From patchwork Thu Jun 6 23:35:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Armin Wolf X-Patchwork-Id: 13689062 X-Patchwork-Delegate: hdegoede@redhat.com Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A32A54D9E9; Thu, 6 Jun 2024 23:36:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.15 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717716966; cv=none; b=NvTlCkug39Z1tX1EgPPUO/Z7lWEWSj8uF0sboXT7PSn85S4ZnMZNiAzCs4BQLs8/wIzQ6J4T+7AispY/I2WBmNdJflZlfiJQf2LUQFgPGmom8/dZrrnGkBwFIQ259XZGny9dXRxTje7NA80AI379I4lDlrl99g4uiaCg/SKKC2o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717716966; c=relaxed/simple; bh=CszDyLkit3de2JZWz7Ffnq1hiMqWQuFV3nWNx51JSHk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=P92qvF39rcL8x7m2qriuGBLxm4UZ3tpgvAGuMRyiXt6JubPq6aCKrvGz1npWA8v+qwPCN5Xe4Hgh0ksXCsr6scpFhyUwPNBvUHDuHa3yKc6VCwk/XaWoRBo6FpMh723bguE8YO045YqYQEVsJ3gdRTlEk8twn/ku4M79g9Lx0A8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de; spf=pass smtp.mailfrom=gmx.de; dkim=pass (2048-bit key) header.d=gmx.de header.i=w_armin@gmx.de header.b=gvpX9uyu; arc=none smtp.client-ip=212.227.15.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.de header.i=w_armin@gmx.de header.b="gvpX9uyu" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1717716955; x=1718321755; i=w_armin@gmx.de; bh=ls7bbEgPyWSpw4Yu8LPj3JEysDNJBAPZLyyhcFGu83E=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-Id:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=gvpX9uyu/8A3ND5tnIKz6j95NO40vevlzQFO18WtNqNK92nqh51t1t/HMMBn2SIJ qogdl+R3GgJO8o//Osr9h3QMW04t897fMNYh2N6M0hk8Nfr+MON0aJABHMm6Zs8AA AF5P7zmPJ3Mu7KFuxX+7ANGzEtUkyxs+lV9dynoxBSr4AWR5hiO0PzGBLT45MB8oH UT3SgxEbnJJ9LdKCo11FdwP89U3yTbUhIZaCmv92p5//Zbk4kwqvo+GM06zWwf70l prcxqTvJD2QQOBc/63Rf/+V2ocFXRvTfvzZco93ZXE3hQcaf+sfwdshPX8cFmjBfr FFMFMuQJW5x4JX514Q== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from mx-inspiron.fritz.box ([91.137.126.34]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MEUzA-1sCfku3bJa-00GkmE; Fri, 07 Jun 2024 01:35:55 +0200 From: Armin Wolf To: matan@svgalib.org, agathe@boutmy.com Cc: hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/4] platform/x86: wireless-hotkey: Add support for LG Airplane Button Date: Fri, 7 Jun 2024 01:35:37 +0200 Message-Id: <20240606233540.9774-2-W_Armin@gmx.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240606233540.9774-1-W_Armin@gmx.de> References: <20240606233540.9774-1-W_Armin@gmx.de> Precedence: bulk X-Mailing-List: platform-driver-x86@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:Mj/34HTANbvlRo/35nqfopFGSdz1vprlRwqVKzNwP7eHuxrCn4I WWPx2AEDPtyjcd5LMICltjh9KUTyTVFTqaxwyks55aTYLaLZ56t60n1K1cktj3EApDKs5w3 81XZ62tDg/zT0iFhRAHlW9L8d0Z28uMdE9Yllbwl2Ryi6p6mh4r0LsfA6hAJeizaHkdS+PU Pl0nxIOS8KP0sLF5wKZYg== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:YMOj+HmkksQ=;U+a2OK8ue6btpop0GkP6qB35OoV bniKoh/POHGzcRLLMR2Jz/663KtcpkiGnBwgMjxzOUiorITtIvYr0SzwgAuHxiooVwqh+0WC7 uj2WJs3WldTPD8Qg5HxC5ihZ1QL6YVk37e/NOKd7271cMTIYdMQYqtyctFekDEmnxkryKeQEf e1+PgP+P9K5rfoZLx+Oc8SgBauiBlyE6/e3i82S7J6FV5gaDWR1YObKT2BEmUzCdHvAeQYPpE duhNw+0rVnfSxwD/LCibtT4vFObSzcyTHO8FDMoHTh8PhKG1rQsZBci3WCkg2MqTh8Exx++7h vCw/td6SzCEbjY3XK9H5g452TkRAnd0rcc5unFWwsjfKdQNDyK8xyv5mOllv3kPSlJVqUSNHB /0su+Z12tCo8EBsGNt+jo1K5fcDsB6iBst3aluiKpSPuVyWwbvjNJQPr8wwSnIc+PnWm5EdIz 5zVVSXZ8/RZGHgJ0a74yRl4jB+Edl+56Ti5/0gkuOUsUJOFnvbZcc4ZtVemt6Jnn4GpT8zuLY fsB9nqUjIjOfgJf9KMknMV6CvakIQnLeRKrd9FgmI6KSEa+sDXtiPgdnS06hSQhcVVMFzqYx+ XvMqmzNz89auTuf2IzHoJ5FDRh8qiIG+SCay8tpjTo3QJkKXytFB9ThKeRVS+WZ3uVnT0idOh fVbvwocfwWA293THqYHjaxnEqm8j8p4iTvL2EcIgHi9iYaT05ImcwZRiv+hhcLhpWYwG6A80O U9jMzkzF3bQ8bF/H4VE80UiRf3vg5cvjeovSG+16WQ+BYbDI6vn0Fga035DMzf1xFTsySkbJE O+19QTu8DnJcrByVCzv6Wn2O3dZz4D4Zm6OMJdEneLc70= The LGEX0815 ACPI device is used by the "LG Airplane Mode Button" Windows driver for handling rfkill requests. When the ACPI device receives an 0x80 ACPI notification, an rfkill event is to be send to userspace. Add support for the LGEX0815 ACPI device to the driver. Tested-by: Agathe Boutmy Signed-off-by: Armin Wolf --- drivers/platform/x86/wireless-hotkey.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.39.2 diff --git a/drivers/platform/x86/wireless-hotkey.c b/drivers/platform/x86/wireless-hotkey.c index e95cdbbfb708..ab46164cbe13 100644 --- a/drivers/platform/x86/wireless-hotkey.c +++ b/drivers/platform/x86/wireless-hotkey.c @@ -19,6 +19,7 @@ MODULE_AUTHOR("Alex Hung"); MODULE_ALIAS("acpi*:HPQ6001:*"); MODULE_ALIAS("acpi*:WSTADEF:*"); MODULE_ALIAS("acpi*:AMDI0051:*"); +MODULE_ALIAS("acpi*:LGEX0815:*"); struct wl_button { struct input_dev *input_dev; @@ -29,6 +30,7 @@ static const struct acpi_device_id wl_ids[] = { {"HPQ6001", 0}, {"WSTADEF", 0}, {"AMDI0051", 0}, + {"LGEX0815", 0}, {"", 0}, }; From patchwork Thu Jun 6 23:35:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Armin Wolf X-Patchwork-Id: 13689063 X-Patchwork-Delegate: hdegoede@redhat.com Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1A8AD13BC02; Thu, 6 Jun 2024 23:36:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717716968; cv=none; b=phcR+ie4AtyujEa+NBaMmOkEq90CsfOcjT+R3gDjO3zg9E8voDAtp6ybUistQ9FI73YvxE8O5CBdxqqM2qJQxUrTTg9v3LZyF3MWBjDonTa3jem/4u/ZA+9b9ciBfoOsuVFu4ecEwC9LmyIuuleH/m8VCz8eXHjtWmQhtuaCOg0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717716968; c=relaxed/simple; bh=otV4zp1MoGFcTiETzXfR3TcxXLb4cvvRGl8k3ULZ0sA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=IePemqVJEmqBasGVenCGYIJJ1C4c5f+fzF4BKlaomK8+3dNCK2/fLZ5COenThPc3UolDJIM1Ml8JheHKNm85jP258w4ulWAFuMzBkI7wev41h4okxu/yHoCtIHcF5+FBGJxSyZLJrGdsp8et3Ic2dROrbf/LDDsxG2VfglUs1IY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de; spf=pass smtp.mailfrom=gmx.de; dkim=pass (2048-bit key) header.d=gmx.de header.i=w_armin@gmx.de header.b=EMXEqH0E; arc=none smtp.client-ip=212.227.15.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.de header.i=w_armin@gmx.de header.b="EMXEqH0E" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1717716958; x=1718321758; i=w_armin@gmx.de; bh=ISDNXycXxWS0qiiXv/+/ANk/YpjMLHNtNunSMSoCI94=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-Id:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=EMXEqH0E7UooufD5REalm+XgOuY1ZRzgM7v00fquYiQeY7sCUJ4+wwk5maSIIh7w uaizp24FDwLG85dT2snxzv55EJfM60jmj+/VxGjdHBjWQVIyOQSV0YlmE9aMHyPWQ CU2BUmOAw7R/1qll8lAtMHgWbU3ZFmEry5KFnJgmsYhk4ZSu2cQr31q17rj8ffuAT BgUBxPJkS068JkDiDr87HL+h9PYCgS12/lwSTmYl97kuedDs/92aMEpYTmJQghrB+ 3YTwwHdClSg5ZIoal4nUv28V4SYeS87Fl93F4gcpsoPQYtP4mt802rc5386hvmLTj i+PzVChIe8jDCDsT3g== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from mx-inspiron.fritz.box ([91.137.126.34]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MsHs0-1sYggG02mY-014Dw8; Fri, 07 Jun 2024 01:35:58 +0200 From: Armin Wolf To: matan@svgalib.org, agathe@boutmy.com Cc: hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/4] platform/x86: lg-laptop: Remove LGEX0815 hotkey handling Date: Fri, 7 Jun 2024 01:35:38 +0200 Message-Id: <20240606233540.9774-3-W_Armin@gmx.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240606233540.9774-1-W_Armin@gmx.de> References: <20240606233540.9774-1-W_Armin@gmx.de> Precedence: bulk X-Mailing-List: platform-driver-x86@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:DIdyGUYS8BPW7Q9MzAcW6zeIXzDGwemyHaDEjkBvBDmwF3sTIMx 8wF2cnYmpa+/deSSBjREYMcodtsv7gl4Qkii67si1G+ii/WV4Ab79D8rI0EknkQtGdH6uKE 7htEoZxF5sf5Bv78VCY4Dv/+W6HpgP56Bv3W1VPfoxJP2xp7MFooE8tG//fFcbCdLSkvzlc w9g+pdgBP3Z8Xhu1gmOtQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:YoPEzoASVvk=;FrKHFjjPPLCmrwJdNHNjg3KzhM/ Y1N6w2rL6jNDzUSqfTJu2pFruthpBYZ6NmOgGqHFQIugsKU0X3ZsqSUmE/YQcNVJl+Dd7UBC6 YNfSq999qBdvNuMKH9r3b+94CgdEybT9/JEVAOssVD/tjmK43yG9dGN5mQQmjKZ5lwcw5aEb4 ep6kWHcAaARboq9FazJlep9dlVd2PuDLNoTfZP4C7+gFvCadYz/JqYW/hIQg3+aFKLO09DYQ4 Y+zJkvpRiN/eFf5yzzCcxQKWkPDgigVKRzraI0wJSsbVLpwLW1sjR3DLZwY9KklbM/zOP5HXE DjwX49Cln9C4GIwsBU28LKXNmbYtBtQ3voNa9c2VXYbpsEp2Umk7L6ZfKftu2IX5RWkcvVYey IbJK05CjdygNMgi9/APxb7iyHb7QR1KaJXcRGSdIBhmO+819hczONF9oSy9LFyygQWh78crZU dFzK81Rwi7CsyEREAM0dUnOoIyiVlixOsbzjau6QRJsiyWenbNtNcEK+azeCzjXbRGQGJGNeq L8AHvYraJoCBfdwH5gQJL0gW2ZQ1+HaLIsmI7NlrQdSnx9S6QueWIaner2wAauQZfOGdeLent HkQ7oNQXMo2ED2ntrnQfPi/TuDR545lx8CKOdtFTsrh2GFVAXjt20heHrCmZqzSeF8xd7pkCy 8xD+aJGlPsSHJMHrla8op1VmQZOy1SOwOUVaX/VSz7/yB/5nKHrRlDINN/Fmk2tlplHeLZN0w 3iGLzViDHHY25gvBMOwQfgxZ3VC4qvAK/0BT2iVZQtkBp65YnMjkbEHtid4m3dxsB+fCvAPVS 54eYqvdqrRNUMvEkU8FmGEehf2lYOArhu5WsH0i2wYjdo= The rfkill hotkey handling is already provided by the wireless-hotkey driver. Remove the now unnecessary rfkill hotkey handling to avoid duplicating functionality. The ACPI notify handler still prints debugging information when receiving ACPI notifications to aid in reverse-engineering. Tested-by: Agathe Boutmy Signed-off-by: Armin Wolf --- drivers/platform/x86/lg-laptop.c | 8 -------- 1 file changed, 8 deletions(-) -- 2.39.2 diff --git a/drivers/platform/x86/lg-laptop.c b/drivers/platform/x86/lg-laptop.c index d0fee5d375d7..ea83630106e8 100644 --- a/drivers/platform/x86/lg-laptop.c +++ b/drivers/platform/x86/lg-laptop.c @@ -84,7 +84,6 @@ static const struct key_entry wmi_keymap[] = { * this key both sends an event and * changes backlight level. */ - {KE_KEY, 0x80, {KEY_RFKILL} }, {KE_END, 0} }; @@ -272,14 +271,7 @@ static void wmi_input_setup(void) static void acpi_notify(struct acpi_device *device, u32 event) { - struct key_entry *key; - acpi_handle_debug(device->handle, "notify: %d\n", event); - if (inited & INIT_SPARSE_KEYMAP) { - key = sparse_keymap_entry_from_scancode(wmi_input_dev, 0x80); - if (key && key->type == KE_KEY) - sparse_keymap_report_entry(wmi_input_dev, key, 1, true); - } } static ssize_t fan_mode_store(struct device *dev, From patchwork Thu Jun 6 23:35:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Armin Wolf X-Patchwork-Id: 13689064 X-Patchwork-Delegate: hdegoede@redhat.com Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 53058140E4F; Thu, 6 Jun 2024 23:36:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717716971; cv=none; b=grvLSLpkSi1EokTGKfOuJwfetWnfJpEeEfwH9Bv2zR2HnsvfeVVM54t8QC9gEtyZUxPWV3WQ62krZglrkvoPZRxtlF2qj5QmTrNvotLM3gJYgZES+3+d4vqWoAit57fobJmrvc4M0bw7avmyG0A7eXR3PS0h61cH7rZ+1PH6wXU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717716971; c=relaxed/simple; bh=xmPYtFq3q5IrE/3h9h8aA8hXNZK81eArdkgqdeXQ/1U=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=R6Ug7vwEYm3294wMogbd+Rs8au0iMO5XzIYm0KGvdq9T09glnO4DLD0SuZx4nwHyUHickjC0MQcK3XgTpgxiIG+e+XBWv1Ht/eFCQ9NK7FR9JJ/pdkJERpBMVSbAtJbxnPhila65AporlLFhlxDVnfBx3v64s4IkBBQjmr8xB3o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de; spf=pass smtp.mailfrom=gmx.de; dkim=pass (2048-bit key) header.d=gmx.de header.i=w_armin@gmx.de header.b=gOCcFXGQ; arc=none smtp.client-ip=212.227.15.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.de header.i=w_armin@gmx.de header.b="gOCcFXGQ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1717716962; x=1718321762; i=w_armin@gmx.de; bh=kBzkJHv8vpR5YX8Wf5bPU4jlaFIq5F45CkO0nRM1p1w=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-Id:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=gOCcFXGQlufh8K3ZineuOES+qzEzYR7g6UGr9O7qaHzMvAvA+WKsZToCRvancUdk +MIPcTpXsTS/PVUmntvF4Dq3/FdakW5MOr4/G/0pEZ0wGWP3h8qfR3XwcEKO92E6d sbFfQivWVnzPb7LQn+fKH8imScs20zWhX6Drpuh7i1kZPtxo2Am6Y6ZNi0BCXHAP/ ybmJJ6a6pH7aIkbivcBG1Y/LZRfdoVIr+SG46u0PWodI4QCAZtV3d7fFCDEV9my/B LnDNj6zDsHgx/czXEJflmW79vC9mQ4Dp/aTjKM5arjfoouW0OchwvOXIo35GIJwH+ rIUjEekzBN8t+xqt5Q== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from mx-inspiron.fritz.box ([91.137.126.34]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MYvY2-1rtLeM0RKi-00Wctn; Fri, 07 Jun 2024 01:36:02 +0200 From: Armin Wolf To: matan@svgalib.org, agathe@boutmy.com Cc: hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/4] platform/x86: lg-laptop: Change ACPI device id Date: Fri, 7 Jun 2024 01:35:39 +0200 Message-Id: <20240606233540.9774-4-W_Armin@gmx.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240606233540.9774-1-W_Armin@gmx.de> References: <20240606233540.9774-1-W_Armin@gmx.de> Precedence: bulk X-Mailing-List: platform-driver-x86@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:pG3fLKSVL9iZU0eNC7DQ4bvNRAXZtevo0MmTeE6ibgp4P6Yi93A VuDclF+vdasupvJdWvb6ErNa5WIjWVSnYPq0IfIoa+zwzSZvf53QBNqoO7W7qhrH3qb3bNl cUL8ZhGXQZyRYmIaIaS3hyf+Votr/I20P6U1uTr1e+siMhETFlG8PR6yj1H4OMN7voQK1UM Q60XSBvcU0k9k3lmqaTOA== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:Xsnv9frPWiA=;1gOONwCDNsqZdSL2AmdV3U1845z gEsL4MFMJgBCwGF+U+tGCzh0GnH7coXa13HD3vXTyuBIdRqU3jRfPOQng+miji5ky/D8jy/HK nuh/RVfzekvHQh6+e63qLQnWorFUW0vELDbzP4gNdHgSPAkAQau30jSl/QLA8xGRt3O7IEs7t m4wzhCLW8umKbcxaTsLEq7mmCZM8aE6X/iVeghUehiQGDFOCSsdSoUVWfZY6njKgSGo03/rOL cq21mDrvEPzcL9ssjzSnsMR9CUFekJ+eMIkx18pl25KiiHwzqtCV5Gcd2mDyHLGPWKES/kzEx Y+mkqQ6pD5XVM0QB6jBTqcbehkfEM4pc6ZDUQfuSdAL6Z+zZR77fOl34+JoAXmSdTcriAxUEN +JPox91Ya099OSoHljV5X/fUsVpmQoy/IB/dNdpy57CBdepybna1rg+awVQJOS8Sof4cPU6RL o2UIXXUA49EW+fZoBnpUQKaBNc3wWXKxjJbQWUfawDOD59syyEVIgOQ2YKu/bda0z62rzxEp0 rJjhbpFt9i3WWAXdF669Uz1xZKpA9ajQOcGK+VbKWjrVaHcOJt6Lts43VocuxoMEDzNO/KIap rJVOi0vWCoH+v3WXEwWAbol2235+sbMDKYt+TSzBZHsniiCC9rJMuFNXeVyfogrQ1xTwcRC9i B/IhSeoew5bOd33ngWseJfBN7C6LnpkotwqlAj0WYcpQOdQfDqtt39SvUgWbF8XXKWRx3Gz5n xg8fCXxIOtesQgGUFrBzb/zAiNCfTSRZSb5349poIsWoIB/jj0yDfUEpM9T6NJ8KYIfs9j8zI J2WY8l9NfdJfQjWjla65us9pXLvzk8QNNyMrDyxiCeP1U= The LGEX0815 ACPI device id is used for handling hotkey events, but this functionality is already handled by the wireless-hotkey driver. The LGEX0820 ACPI device id however is used to manage various platform features using the WMAB/WMBB ACPI methods. Use this ACPI device id to avoid blocking the wireless-hotkey driver from probing. Tested-by: Agathe Boutmy Signed-off-by: Armin Wolf --- drivers/platform/x86/lg-laptop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.39.2 diff --git a/drivers/platform/x86/lg-laptop.c b/drivers/platform/x86/lg-laptop.c index ea83630106e8..db8a2f79bf0a 100644 --- a/drivers/platform/x86/lg-laptop.c +++ b/drivers/platform/x86/lg-laptop.c @@ -768,7 +768,7 @@ static void acpi_remove(struct acpi_device *device) } static const struct acpi_device_id device_ids[] = { - {"LGEX0815", 0}, + {"LGEX0820", 0}, {"", 0} }; MODULE_DEVICE_TABLE(acpi, device_ids); From patchwork Thu Jun 6 23:35:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Armin Wolf X-Patchwork-Id: 13689065 X-Patchwork-Delegate: hdegoede@redhat.com Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D66E0145FEF; Thu, 6 Jun 2024 23:36:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717716975; cv=none; b=noNIvYqO+7Hg+dzZ4h6mYg9Mn/IQ5a8y1ex6eOEZ34qfWwDNyD2cqlpMTzhkrT8ZJ915eQOV+Gm36BmQOUiOTvA1+tBoT4rs9QQIhX6TugVAqyHd1cAE60UXcH+cLgLhsF0wQc4PfH9c6PZ520ZN3Lw3PZ96JI9AVMxBySV6hVM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717716975; c=relaxed/simple; bh=O+epwMalW8q1ywVQftnD3kr4enZ/tUns59fgSJivT+I=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=keu/uBDs6LUINore9ANA9zswNH6diyZecHsmuNXZ7aLPo8k81jG/4aNV/VHJh4sAf0MJcrArGSXWL0MINySg4mPse/N5HPUO7oV8ONouGMX9558SO/OKUzMz32PktBuQJ1hfjWRd/orMuncr4zvhCsgRmKlzP9YLenMX+fz5IOI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de; spf=pass smtp.mailfrom=gmx.de; dkim=pass (2048-bit key) header.d=gmx.de header.i=w_armin@gmx.de header.b=EdDXlTeF; arc=none smtp.client-ip=212.227.15.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.de header.i=w_armin@gmx.de header.b="EdDXlTeF" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1717716966; x=1718321766; i=w_armin@gmx.de; bh=/OsDHVNN0gnO8H9MbGHuZBgRREzhWlwQMthhpDzyH7k=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-Id:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=EdDXlTeF1uTugR21JZRATobsXjzfwAe1feN0erAXCtDxnGGgNPb33Fu6fnAuUbpk QT/4uA8wvYbVzPPKVsqd+zBHm6TuVSctCCGxkBL2n2oPAe+v6aWm/QknkJdqLL5dw 6B2CTecfWldIeeCjLsNEni8lYitH7bR6+ojL2+EXiVRDkkwtZ54eR9Pobp2XcP+AJ z30z/6QhON4eAHz9ZwtHkC4XG4Zn9P2O2h/ktDQHTaTiipUz0qZmYT74O15TmiyaT gH5eLiF7CZxLQh/reS20A3FA/HQ/bp0s27ZnnRVtKXXq2VAHBBwTCqd+TgH2Yne1u KBeW67QD8VllTSbk4A== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from mx-inspiron.fritz.box ([91.137.126.34]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MdvqW-1spF6B3kvO-00psKd; Fri, 07 Jun 2024 01:36:06 +0200 From: Armin Wolf To: matan@svgalib.org, agathe@boutmy.com Cc: hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/4] platform/x86: lg-laptop: Use ACPI device handle when evaluating WMAB/WMBB Date: Fri, 7 Jun 2024 01:35:40 +0200 Message-Id: <20240606233540.9774-5-W_Armin@gmx.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240606233540.9774-1-W_Armin@gmx.de> References: <20240606233540.9774-1-W_Armin@gmx.de> Precedence: bulk X-Mailing-List: platform-driver-x86@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:isifIVrCilxhIMRnNU3HGt2G8q3KK3cF7QzUOhPJGYG+J9SkNY8 dc7pQuXtiMaQiG1hapVGSFZJx1bm5y6bFKCt4MTLoWa+7mK6ST3jZUfSOM/3IjRa35KdiVu SijdKukOdoXg2i8XBG/09uNmliz2mCh2QXTkPHAfjymWTiUozifYV+RrjLqfgcpeA1FuqP4 Hrb8RlaKJC1MXIVS3XMFA== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:esqjQDeZD5E=;nRjU9DmUydieYbAg918/syNmZkh d2kWsXw/dQiR6V3WKyzfuo8+zitsHu/Bz4mMlSF5MWFOT0tkfaXZXERWmYrI5VyMxatBqrpw7 idHXbj4L9aRcpiunVsPXG+C6a+ygK0+0pwpPbWUHgSBWi3pJpZRUgVcFaKdXAdoOROx2MAlE7 iuQsH8FRemwFDD7t8dGfFM7I1XRvicvFmgbbEz7MDk6dYmNEX31O3asHKA9J92DowJeq6+hta PjWiTRDRg8nmQpnREUqrFMKdt3iNzaJbjvNSjR7HJGj0nmsMJcDf4uRh6VT8Q0qG9+KZUMWZe EQVz72wP8Cp5xDh7cFDpsC7CE/Vs/ZwjWu2fg37Zfx3bcs1YZUYu+EUUQCdI2MlDycoujaM/W +Jq0TU+AEO4g6jZY4sqyYnjApAle9guV7DtzmxiA10q8/DrAtTK/gm/WYErDy+ZuF5yfT6zt0 lCbYrOZ4Ab3czGbfbcVUgxVpXGI6Bf2u+1PR/SIoOrarTpS/SUQyy7iNlWOjv8ycJT5e1NkhY 0SEgRD7ieU0R251Wv/JfFusLt+ULsjT2MLEp5xBJP/FVy1RMrqarOMHGliHASi/s7B5moFBAD Pwgug8pJzxkIVPGm1OVmwGr7xhUy5pqah3F5NIoiuTNO6/CGgnbj53DV4Fh9cz6oQddccK9K0 ZpLSFHtzCeacybVszmB6lkVGxyJwf66GNLWD4Pg9LdsI6Yw3x/J8DN+Mbr0sUvXcUC8E2xWvz PHW25e8RRu+d+A8/6bDUaAlXeo+0J+BFMDNNkyixranzLBppFcbSwqY/tHnFde/eT/eh9BIzS AXa2X2/xZr1jfV8wkb5L9s1B5i1A2Rx+kWgTGzdm9ohiM= On the LG Gram 16Z90S, the WMAB and WMBB ACPI methods are not mapped under \XINI, but instead are mapped under \_SB.XINI. The reason for this is that the LGEX0820 ACPI device used by this driver is mapped at \_SB.XINI, so the ACPI methods where moved as well to appear below the LGEX0820 ACPI device. Fix this by using the ACPI handle from the ACPI device when evaluating both methods. Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218901 Tested-by: Agathe Boutmy Signed-off-by: Armin Wolf Reviewed-by: Ilpo Järvinen --- drivers/platform/x86/lg-laptop.c | 79 +++++++++++++------------------- 1 file changed, 33 insertions(+), 46 deletions(-) -- 2.39.2 diff --git a/drivers/platform/x86/lg-laptop.c b/drivers/platform/x86/lg-laptop.c index db8a2f79bf0a..9c7857842caf 100644 --- a/drivers/platform/x86/lg-laptop.c +++ b/drivers/platform/x86/lg-laptop.c @@ -39,8 +39,6 @@ MODULE_LICENSE("GPL"); #define WMI_METHOD_WMBB "2B4F501A-BD3C-4394-8DCF-00A7D2BC8210" #define WMI_EVENT_GUID WMI_EVENT_GUID0 -#define WMAB_METHOD "\\XINI.WMAB" -#define WMBB_METHOD "\\XINI.WMBB" #define SB_GGOV_METHOD "\\_SB.GGOV" #define GOV_TLED 0x2020008 #define WM_GET 1 @@ -74,7 +72,7 @@ static u32 inited; static int battery_limit_use_wmbb; static struct led_classdev kbd_backlight; -static enum led_brightness get_kbd_backlight_level(void); +static enum led_brightness get_kbd_backlight_level(struct device *dev); static const struct key_entry wmi_keymap[] = { {KE_KEY, 0x70, {KEY_F15} }, /* LG control panel (F1) */ @@ -127,11 +125,10 @@ static int ggov(u32 arg0) return res; } -static union acpi_object *lg_wmab(u32 method, u32 arg1, u32 arg2) +static union acpi_object *lg_wmab(struct device *dev, u32 method, u32 arg1, u32 arg2) { union acpi_object args[3]; acpi_status status; - acpi_handle handle; struct acpi_object_list arg; struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; @@ -142,29 +139,22 @@ static union acpi_object *lg_wmab(u32 method, u32 arg1, u32 arg2) args[2].type = ACPI_TYPE_INTEGER; args[2].integer.value = arg2; - status = acpi_get_handle(NULL, (acpi_string) WMAB_METHOD, &handle); - if (ACPI_FAILURE(status)) { - pr_err("Cannot get handle"); - return NULL; - } - arg.count = 3; arg.pointer = args; - status = acpi_evaluate_object(handle, NULL, &arg, &buffer); + status = acpi_evaluate_object(ACPI_HANDLE(dev), "WMAB", &arg, &buffer); if (ACPI_FAILURE(status)) { - acpi_handle_err(handle, "WMAB: call failed.\n"); + dev_err(dev, "WMAB: call failed.\n"); return NULL; } return buffer.pointer; } -static union acpi_object *lg_wmbb(u32 method_id, u32 arg1, u32 arg2) +static union acpi_object *lg_wmbb(struct device *dev, u32 method_id, u32 arg1, u32 arg2) { union acpi_object args[3]; acpi_status status; - acpi_handle handle; struct acpi_object_list arg; struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; u8 buf[32]; @@ -180,18 +170,12 @@ static union acpi_object *lg_wmbb(u32 method_id, u32 arg1, u32 arg2) args[2].buffer.length = 32; args[2].buffer.pointer = buf; - status = acpi_get_handle(NULL, (acpi_string)WMBB_METHOD, &handle); - if (ACPI_FAILURE(status)) { - pr_err("Cannot get handle"); - return NULL; - } - arg.count = 3; arg.pointer = args; - status = acpi_evaluate_object(handle, NULL, &arg, &buffer); + status = acpi_evaluate_object(ACPI_HANDLE(dev), "WMBB", &arg, &buffer); if (ACPI_FAILURE(status)) { - acpi_handle_err(handle, "WMAB: call failed.\n"); + dev_err(dev, "WMBB: call failed.\n"); return NULL; } @@ -222,7 +206,7 @@ static void wmi_notify(u32 value, void *context) if (eventcode == 0x10000000) { led_classdev_notify_brightness_hw_changed( - &kbd_backlight, get_kbd_backlight_level()); + &kbd_backlight, get_kbd_backlight_level(kbd_backlight.dev->parent)); } else { key = sparse_keymap_entry_from_scancode( wmi_input_dev, eventcode); @@ -287,7 +271,7 @@ static ssize_t fan_mode_store(struct device *dev, if (ret) return ret; - r = lg_wmab(WM_FAN_MODE, WM_GET, 0); + r = lg_wmab(dev, WM_FAN_MODE, WM_GET, 0); if (!r) return -EIO; @@ -298,9 +282,9 @@ static ssize_t fan_mode_store(struct device *dev, m = r->integer.value; kfree(r); - r = lg_wmab(WM_FAN_MODE, WM_SET, (m & 0xffffff0f) | (value << 4)); + r = lg_wmab(dev, WM_FAN_MODE, WM_SET, (m & 0xffffff0f) | (value << 4)); kfree(r); - r = lg_wmab(WM_FAN_MODE, WM_SET, (m & 0xfffffff0) | value); + r = lg_wmab(dev, WM_FAN_MODE, WM_SET, (m & 0xfffffff0) | value); kfree(r); return count; @@ -312,7 +296,7 @@ static ssize_t fan_mode_show(struct device *dev, unsigned int status; union acpi_object *r; - r = lg_wmab(WM_FAN_MODE, WM_GET, 0); + r = lg_wmab(dev, WM_FAN_MODE, WM_GET, 0); if (!r) return -EIO; @@ -339,7 +323,7 @@ static ssize_t usb_charge_store(struct device *dev, if (ret) return ret; - r = lg_wmbb(WMBB_USB_CHARGE, WM_SET, value); + r = lg_wmbb(dev, WMBB_USB_CHARGE, WM_SET, value); if (!r) return -EIO; @@ -353,7 +337,7 @@ static ssize_t usb_charge_show(struct device *dev, unsigned int status; union acpi_object *r; - r = lg_wmbb(WMBB_USB_CHARGE, WM_GET, 0); + r = lg_wmbb(dev, WMBB_USB_CHARGE, WM_GET, 0); if (!r) return -EIO; @@ -381,7 +365,7 @@ static ssize_t reader_mode_store(struct device *dev, if (ret) return ret; - r = lg_wmab(WM_READER_MODE, WM_SET, value); + r = lg_wmab(dev, WM_READER_MODE, WM_SET, value); if (!r) return -EIO; @@ -395,7 +379,7 @@ static ssize_t reader_mode_show(struct device *dev, unsigned int status; union acpi_object *r; - r = lg_wmab(WM_READER_MODE, WM_GET, 0); + r = lg_wmab(dev, WM_READER_MODE, WM_GET, 0); if (!r) return -EIO; @@ -423,7 +407,7 @@ static ssize_t fn_lock_store(struct device *dev, if (ret) return ret; - r = lg_wmab(WM_FN_LOCK, WM_SET, value); + r = lg_wmab(dev, WM_FN_LOCK, WM_SET, value); if (!r) return -EIO; @@ -437,7 +421,7 @@ static ssize_t fn_lock_show(struct device *dev, unsigned int status; union acpi_object *r; - r = lg_wmab(WM_FN_LOCK, WM_GET, 0); + r = lg_wmab(dev, WM_FN_LOCK, WM_GET, 0); if (!r) return -EIO; @@ -467,9 +451,9 @@ static ssize_t charge_control_end_threshold_store(struct device *dev, union acpi_object *r; if (battery_limit_use_wmbb) - r = lg_wmbb(WMBB_BATT_LIMIT, WM_SET, value); + r = lg_wmbb(&pf_device->dev, WMBB_BATT_LIMIT, WM_SET, value); else - r = lg_wmab(WM_BATT_LIMIT, WM_SET, value); + r = lg_wmab(&pf_device->dev, WM_BATT_LIMIT, WM_SET, value); if (!r) return -EIO; @@ -488,7 +472,7 @@ static ssize_t charge_control_end_threshold_show(struct device *device, union acpi_object *r; if (battery_limit_use_wmbb) { - r = lg_wmbb(WMBB_BATT_LIMIT, WM_GET, 0); + r = lg_wmbb(&pf_device->dev, WMBB_BATT_LIMIT, WM_GET, 0); if (!r) return -EIO; @@ -499,7 +483,7 @@ static ssize_t charge_control_end_threshold_show(struct device *device, status = r->buffer.pointer[0x10]; } else { - r = lg_wmab(WM_BATT_LIMIT, WM_GET, 0); + r = lg_wmab(&pf_device->dev, WM_BATT_LIMIT, WM_GET, 0); if (!r) return -EIO; @@ -578,7 +562,7 @@ static void tpad_led_set(struct led_classdev *cdev, { union acpi_object *r; - r = lg_wmab(WM_TLED, WM_SET, brightness > LED_OFF); + r = lg_wmab(cdev->dev->parent, WM_TLED, WM_SET, brightness > LED_OFF); kfree(r); } @@ -600,16 +584,16 @@ static void kbd_backlight_set(struct led_classdev *cdev, val = 0; if (brightness >= LED_FULL) val = 0x24; - r = lg_wmab(WM_KEY_LIGHT, WM_SET, val); + r = lg_wmab(cdev->dev->parent, WM_KEY_LIGHT, WM_SET, val); kfree(r); } -static enum led_brightness get_kbd_backlight_level(void) +static enum led_brightness get_kbd_backlight_level(struct device *dev) { union acpi_object *r; int val; - r = lg_wmab(WM_KEY_LIGHT, WM_GET, 0); + r = lg_wmab(dev, WM_KEY_LIGHT, WM_GET, 0); if (!r) return LED_OFF; @@ -637,7 +621,7 @@ static enum led_brightness get_kbd_backlight_level(void) static enum led_brightness kbd_backlight_get(struct led_classdev *cdev) { - return get_kbd_backlight_level(); + return get_kbd_backlight_level(cdev->dev->parent); } static LED_DEVICE(kbd_backlight, 255, LED_BRIGHT_HW_CHANGED); @@ -664,6 +648,11 @@ static struct platform_driver pf_driver = { static int acpi_add(struct acpi_device *device) { + struct platform_device_info pdev_info = { + .fwnode = acpi_fwnode_handle(device), + .name = PLATFORM_NAME, + .id = PLATFORM_DEVID_NONE, + }; int ret; const char *product; int year = 2017; @@ -675,9 +664,7 @@ static int acpi_add(struct acpi_device *device) if (ret) return ret; - pf_device = platform_device_register_simple(PLATFORM_NAME, - PLATFORM_DEVID_NONE, - NULL, 0); + pf_device = platform_device_register_full(&pdev_info); if (IS_ERR(pf_device)) { ret = PTR_ERR(pf_device); pf_device = NULL;