From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C773AC001DB for ; Sun, 13 Aug 2023 16:10:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232877AbjHMQKK (ORCPT ); Sun, 13 Aug 2023 12:10:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232743AbjHMQJn (ORCPT ); Sun, 13 Aug 2023 12:09:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9729F2D50; Sun, 13 Aug 2023 09:09:26 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 05F7463918; Sun, 13 Aug 2023 16:08:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 25E48C433C8; Sun, 13 Aug 2023 16:08:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691942915; bh=0CxcTLzn26xCsqttZBazf/V93k/U/Pl8qEN1IuAe/ks=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cMbk76yX0j2ihyP/NSYJsyJG7FB0CQkSp0SuYD0WE0QDH8aMh3XVgeZTx6H27zfZn yvLyP/fUK4VFrbEFYX04t5DJsS2SUJsCgc8S7x92b25h45/BUJpq8Ye40vfHf5NEiE o8tJ1VZsVk94MoUM+YSA+GHYCK4aDr7I9Md3UAzhHcxdbu4B6YkbPLj5N/qtj1YHAy rgMmmTs/z1hYmg+4dtAu3kvGWQu9EFd3GaYLeWC4VJOwJAyy5RsNWpX9+i7u2JAvC3 yrlaBSmBSMg/TPg5gHHllhLplzVZbnwc38xfToo0tN7/2oi+uq2wPqFjDBDPubdBDl GRY0vh+9eLaFw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Hans de Goede , Maxim Mikityanskiy , Sasha Levin , alexhung@gmail.com, markgross@kernel.org, platform-driver-x86@vger.kernel.org Subject: [PATCH AUTOSEL 5.15 22/31] platform/x86: intel: hid: Always call BTNL ACPI method Date: Sun, 13 Aug 2023 12:05:55 -0400 Message-Id: <20230813160605.1080385-22-sashal@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230813160605.1080385-1-sashal@kernel.org> References: <20230813160605.1080385-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 5.15.126 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hans de Goede [ Upstream commit e3ab18de2b09361d6f0e4aafb9cfd6d002ce43a1 ] On a HP Elite Dragonfly G2 the 0xcc and 0xcd events for SW_TABLET_MODE are only send after the BTNL ACPI method has been called. Likely more devices need this, so make the BTNL ACPI method unconditional instead of only doing it on devices with a 5 button array. Note this also makes the intel_button_array_enable() call in probe() unconditional, that function does its own priv->array check. This makes the intel_button_array_enable() call in probe() consistent with the calls done on suspend/resume which also rely on the priv->array check inside the function. Reported-by: Maxim Mikityanskiy Closes: https://lore.kernel.org/platform-driver-x86/20230712175023.31651-1-maxtram95@gmail.com/ Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20230715181516.5173-1-hdegoede@redhat.com Signed-off-by: Sasha Levin --- drivers/platform/x86/intel/hid.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/drivers/platform/x86/intel/hid.c b/drivers/platform/x86/intel/hid.c index 4d1c78635114e..73ecbdfcfb7c0 100644 --- a/drivers/platform/x86/intel/hid.c +++ b/drivers/platform/x86/intel/hid.c @@ -608,7 +608,7 @@ static bool button_array_present(struct platform_device *device) static int intel_hid_probe(struct platform_device *device) { acpi_handle handle = ACPI_HANDLE(&device->dev); - unsigned long long mode; + unsigned long long mode, dummy; struct intel_hid_priv *priv; acpi_status status; int err; @@ -673,18 +673,15 @@ static int intel_hid_probe(struct platform_device *device) if (err) goto err_remove_notify; - if (priv->array) { - unsigned long long dummy; + intel_button_array_enable(&device->dev, true); - intel_button_array_enable(&device->dev, true); - - /* Call button load method to enable HID power button */ - if (!intel_hid_evaluate_method(handle, INTEL_HID_DSM_BTNL_FN, - &dummy)) { - dev_warn(&device->dev, - "failed to enable HID power button\n"); - } - } + /* + * Call button load method to enable HID power button + * Always do this since it activates events on some devices without + * a button array too. + */ + if (!intel_hid_evaluate_method(handle, INTEL_HID_DSM_BTNL_FN, &dummy)) + dev_warn(&device->dev, "failed to enable HID power button\n"); device_init_wakeup(&device->dev, true); /* -- 2.40.1