Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[sfrench/cifs-2.6.git] / drivers / input / misc / axp20x-pek.c
index c8f87df93a50e3dae6673921baf4707daf1eb240..04da7916eb70987f96f6873500c105a76d9c8c18 100644 (file)
@@ -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;