diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2022-01-18 03:03:39 +0100 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2022-01-18 03:03:39 +0100 |
commit | 87a0b2fafc09766d8c55461a18345a1cfb10a7fe (patch) | |
tree | f2ecd87b34a4709e49b51470056f6b6e528fefca /drivers/input/misc/axp20x-pek.c | |
parent | Input: ti_am335x_tsc - fix a typo in a comment (diff) | |
parent | Linux 5.16 (diff) | |
download | linux-87a0b2fafc09766d8c55461a18345a1cfb10a7fe.tar.xz linux-87a0b2fafc09766d8c55461a18345a1cfb10a7fe.zip |
Merge tag 'v5.16' into next
Sync up with mainline to bring in the latest API changes.
Diffstat (limited to 'drivers/input/misc/axp20x-pek.c')
-rw-r--r-- | drivers/input/misc/axp20x-pek.c | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/drivers/input/misc/axp20x-pek.c b/drivers/input/misc/axp20x-pek.c index c8f87df93a50..04da7916eb70 100644 --- a/drivers/input/misc/axp20x-pek.c +++ b/drivers/input/misc/axp20x-pek.c @@ -22,6 +22,7 @@ #include <linux/kernel.h> #include <linux/mfd/axp20x.h> #include <linux/module.h> +#include <linux/platform_data/x86/soc.h> #include <linux/platform_device.h> #include <linux/regmap.h> #include <linux/slab.h> @@ -285,41 +286,24 @@ static int axp20x_pek_probe_input_device(struct axp20x_pek *axp20x_pek, return 0; } -#ifdef CONFIG_ACPI -static bool axp20x_pek_should_register_input(struct axp20x_pek *axp20x_pek, - struct platform_device *pdev) +static bool axp20x_pek_should_register_input(struct axp20x_pek *axp20x_pek) { - unsigned long long hrv = 0; - acpi_status status; - if (IS_ENABLED(CONFIG_INPUT_SOC_BUTTON_ARRAY) && axp20x_pek->axp20x->variant == AXP288_ID) { - status = acpi_evaluate_integer(ACPI_HANDLE(pdev->dev.parent), - "_HRV", NULL, &hrv); - if (ACPI_FAILURE(status)) - dev_err(&pdev->dev, "Failed to get PMIC hardware revision\n"); - /* * On Cherry Trail platforms (hrv == 3), do not register the * input device if there is an "INTCFD9" or "ACPI0011" gpio * button ACPI device, as that handles the power button too, * and otherwise we end up reporting all presses twice. */ - if (hrv == 3 && (acpi_dev_present("INTCFD9", NULL, -1) || + if (soc_intel_is_cht() && + (acpi_dev_present("INTCFD9", NULL, -1) || acpi_dev_present("ACPI0011", NULL, -1))) return false; - } return true; } -#else -static bool axp20x_pek_should_register_input(struct axp20x_pek *axp20x_pek, - struct platform_device *pdev) -{ - return true; -} -#endif static int axp20x_pek_probe(struct platform_device *pdev) { @@ -339,7 +323,7 @@ static int axp20x_pek_probe(struct platform_device *pdev) axp20x_pek->axp20x = dev_get_drvdata(pdev->dev.parent); - if (axp20x_pek_should_register_input(axp20x_pek, pdev)) { + if (axp20x_pek_should_register_input(axp20x_pek)) { error = axp20x_pek_probe_input_device(axp20x_pek, pdev); if (error) return error; |