|
22 | 22 | #include <linux/kernel.h>
|
23 | 23 | #include <linux/mfd/axp20x.h>
|
24 | 24 | #include <linux/module.h>
|
| 25 | +#include <linux/platform_data/x86/soc.h> |
25 | 26 | #include <linux/platform_device.h>
|
26 | 27 | #include <linux/regmap.h>
|
27 | 28 | #include <linux/slab.h>
|
@@ -255,41 +256,24 @@ static int axp20x_pek_probe_input_device(struct axp20x_pek *axp20x_pek,
|
255 | 256 | return 0;
|
256 | 257 | }
|
257 | 258 |
|
258 |
| -#ifdef CONFIG_ACPI |
259 |
| -static bool axp20x_pek_should_register_input(struct axp20x_pek *axp20x_pek, |
260 |
| - struct platform_device *pdev) |
| 259 | +static bool axp20x_pek_should_register_input(struct axp20x_pek *axp20x_pek) |
261 | 260 | {
|
262 |
| - unsigned long long hrv = 0; |
263 |
| - acpi_status status; |
264 |
| - |
265 | 261 | if (IS_ENABLED(CONFIG_INPUT_SOC_BUTTON_ARRAY) &&
|
266 | 262 | axp20x_pek->axp20x->variant == AXP288_ID) {
|
267 |
| - status = acpi_evaluate_integer(ACPI_HANDLE(pdev->dev.parent), |
268 |
| - "_HRV", NULL, &hrv); |
269 |
| - if (ACPI_FAILURE(status)) |
270 |
| - dev_err(&pdev->dev, "Failed to get PMIC hardware revision\n"); |
271 |
| - |
272 | 263 | /*
|
273 | 264 | * On Cherry Trail platforms (hrv == 3), do not register the
|
274 | 265 | * input device if there is an "INTCFD9" or "ACPI0011" gpio
|
275 | 266 | * button ACPI device, as that handles the power button too,
|
276 | 267 | * and otherwise we end up reporting all presses twice.
|
277 | 268 | */
|
278 |
| - if (hrv == 3 && (acpi_dev_present("INTCFD9", NULL, -1) || |
| 269 | + if (soc_intel_is_cht() && |
| 270 | + (acpi_dev_present("INTCFD9", NULL, -1) || |
279 | 271 | acpi_dev_present("ACPI0011", NULL, -1)))
|
280 | 272 | return false;
|
281 |
| - |
282 | 273 | }
|
283 | 274 |
|
284 | 275 | return true;
|
285 | 276 | }
|
286 |
| -#else |
287 |
| -static bool axp20x_pek_should_register_input(struct axp20x_pek *axp20x_pek, |
288 |
| - struct platform_device *pdev) |
289 |
| -{ |
290 |
| - return true; |
291 |
| -} |
292 |
| -#endif |
293 | 277 |
|
294 | 278 | static int axp20x_pek_probe(struct platform_device *pdev)
|
295 | 279 | {
|
@@ -321,7 +305,7 @@ static int axp20x_pek_probe(struct platform_device *pdev)
|
321 | 305 | axp20x_pek->irq_dbf = regmap_irq_get_virq(
|
322 | 306 | axp20x_pek->axp20x->regmap_irqc, axp20x_pek->irq_dbf);
|
323 | 307 |
|
324 |
| - if (axp20x_pek_should_register_input(axp20x_pek, pdev)) { |
| 308 | + if (axp20x_pek_should_register_input(axp20x_pek)) { |
325 | 309 | error = axp20x_pek_probe_input_device(axp20x_pek, pdev);
|
326 | 310 | if (error)
|
327 | 311 | return error;
|
|
0 commit comments