aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2017-06-02 20:50:22 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2017-06-02 20:53:20 -0400
commit0fd5f221093870d93edb696f6903b058c4d75411 (patch)
treed218c8e4afd5ab878b63e3fa956153ae129ffbc0
parent8d4b31376974855cd4fb176e5d63ba8e0407928e (diff)
Input: axp20x-pek - switch to acpi_dev_present and check for ACPI0011 too
acpi_dev_found checks that there is a matching ACPI node, but it may be disabled (_STA method returns 0) in which case the soc_button_array driver will not bind to it and axp20x-pek should handle the power-button. This commit switches from acpi_dev_found to acpi_dev_present to avoid not registering an input-dev for the powerbutton when there is a disabled PNP0C40 device. The ACPI-6.0 standard defines a standard gpio button device using the ACPI0011 HID replacing the custom PNP0C40 gpio device, many newer devices define both PNP0C40 and ACPI0011 devices enabling one or the other depending on whether the BIOS thinks it is going to boot Android or Windows. This commit adds a check for the ACPI0011 device, so that if either device is present *and* enabled we don't register an input-dev for the powerbutton. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-rw-r--r--drivers/input/misc/axp20x-pek.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/input/misc/axp20x-pek.c b/drivers/input/misc/axp20x-pek.c
index c0a763a70a00..400869e61a06 100644
--- a/drivers/input/misc/axp20x-pek.c
+++ b/drivers/input/misc/axp20x-pek.c
@@ -272,11 +272,12 @@ static bool axp20x_pek_should_register_input(struct axp20x_pek *axp20x_pek,
272 272
273 /* 273 /*
274 * On Cherry Trail platforms (hrv == 3), do not register the 274 * On Cherry Trail platforms (hrv == 3), do not register the
275 * input device if there is an "INTCFD9" gpio 275 * input device if there is an "INTCFD9" or "ACPI0011" gpio
276 * button ACPI device, as that handles the power button too, 276 * button ACPI device, as that handles the power button too,
277 * and otherwise we end up reporting all presses twice. 277 * and otherwise we end up reporting all presses twice.
278 */ 278 */
279 if (hrv == 3 && acpi_dev_found("INTCFD9")) 279 if (hrv == 3 && (acpi_dev_present("INTCFD9", NULL, -1) ||
280 acpi_dev_present("ACPI0011", NULL, -1)))
280 return false; 281 return false;
281 282
282 } 283 }