]> Git Repo - linux.git/commitdiff
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
authorLinus Torvalds <[email protected]>
Mon, 17 Jan 2022 06:27:55 +0000 (08:27 +0200)
committerLinus Torvalds <[email protected]>
Mon, 17 Jan 2022 06:27:55 +0000 (08:27 +0200)
Pull input updates from Dmitry Torokhov:
 "Updates to Goodix touchscreen driver (addition of pen support) and
  Silead touchscreen driver (also addition of pen support and parsing of
  embedded firmware to determine screen size), along with assorted fixes
  for other drivers"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: ti_am335x_tsc - fix a typo in a comment
  Input: zinitix - add compatible for bt532
  Input: zinitix - handle proper supply names
  dt-bindings: input/ts/zinitix: Convert to YAML, fix and extend
  Input: axp20x-pek - revert "always register interrupt handlers" change
  Input: gpio-keys - avoid clearing twice some memory
  Input: byd - fix typo in a comment
  Input: ucb1400_ts - remove redundant variable penup
  Input: ti_am335x_tsc - lower the X and Y sampling time
  Input: ti_am335x_tsc - fix STEPCONFIG setup for Z2
  Input: ti_am335x_tsc - set ADCREFM for X configuration
  Input: silead - add pen support
  Input: silead - add support for EFI-embedded fw using different min/max coordinates
  Input: goodix - 2 small fixes for pen support
  Input: goodix - improve gpiod_get() error logging
  Input: goodix - add pen support
  Input: ff-core - correct magnitude setting for rumble compatibility
  Input: palmas-pwrbutton - make a couple of arrays static const
  Input: wacom_i2c - clean up the query device fields
  Input: palmas-pwrbutton - use bitfield helpers

1  2 
drivers/input/misc/axp20x-pek.c

index e09b1fae42e10228dda29594c4bcdd588613a98e,c8f87df93a50e3dae6673921baf4707daf1eb240..04da7916eb70987f96f6873500c105a76d9c8c18
@@@ -22,7 -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>
@@@ -206,11 -205,8 +206,8 @@@ ATTRIBUTE_GROUPS(axp20x)
  
  static irqreturn_t axp20x_pek_irq(int irq, void *pwr)
  {
-       struct axp20x_pek *axp20x_pek = pwr;
-       struct input_dev *idev = axp20x_pek->input;
-       if (!idev)
-               return IRQ_HANDLED;
+       struct input_dev *idev = pwr;
+       struct axp20x_pek *axp20x_pek = input_get_drvdata(idev);
  
        /*
         * The power-button is connected to ground so a falling edge (dbf)
  static int axp20x_pek_probe_input_device(struct axp20x_pek *axp20x_pek,
                                         struct platform_device *pdev)
  {
+       struct axp20x_dev *axp20x = axp20x_pek->axp20x;
        struct input_dev *idev;
        int error;
  
+       axp20x_pek->irq_dbr = platform_get_irq_byname(pdev, "PEK_DBR");
+       if (axp20x_pek->irq_dbr < 0)
+               return axp20x_pek->irq_dbr;
+       axp20x_pek->irq_dbr = regmap_irq_get_virq(axp20x->regmap_irqc,
+                                                 axp20x_pek->irq_dbr);
+       axp20x_pek->irq_dbf = platform_get_irq_byname(pdev, "PEK_DBF");
+       if (axp20x_pek->irq_dbf < 0)
+               return axp20x_pek->irq_dbf;
+       axp20x_pek->irq_dbf = regmap_irq_get_virq(axp20x->regmap_irqc,
+                                                 axp20x_pek->irq_dbf);
        axp20x_pek->input = devm_input_allocate_device(&pdev->dev);
        if (!axp20x_pek->input)
                return -ENOMEM;
  
        input_set_drvdata(idev, axp20x_pek);
  
+       error = devm_request_any_context_irq(&pdev->dev, axp20x_pek->irq_dbr,
+                                            axp20x_pek_irq, 0,
+                                            "axp20x-pek-dbr", idev);
+       if (error < 0) {
+               dev_err(&pdev->dev, "Failed to request dbr IRQ#%d: %d\n",
+                       axp20x_pek->irq_dbr, error);
+               return error;
+       }
+       error = devm_request_any_context_irq(&pdev->dev, axp20x_pek->irq_dbf,
+                                         axp20x_pek_irq, 0,
+                                         "axp20x-pek-dbf", idev);
+       if (error < 0) {
+               dev_err(&pdev->dev, "Failed to request dbf IRQ#%d: %d\n",
+                       axp20x_pek->irq_dbf, error);
+               return error;
+       }
        error = input_register_device(idev);
        if (error) {
                dev_err(&pdev->dev, "Can't register input device: %d\n",
                return error;
        }
  
+       device_init_wakeup(&pdev->dev, true);
        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)
  {
  
        axp20x_pek->axp20x = dev_get_drvdata(pdev->dev.parent);
  
-       axp20x_pek->irq_dbr = platform_get_irq_byname(pdev, "PEK_DBR");
-       if (axp20x_pek->irq_dbr < 0)
-               return axp20x_pek->irq_dbr;
-       axp20x_pek->irq_dbr = regmap_irq_get_virq(
-                       axp20x_pek->axp20x->regmap_irqc, axp20x_pek->irq_dbr);
-       axp20x_pek->irq_dbf = platform_get_irq_byname(pdev, "PEK_DBF");
-       if (axp20x_pek->irq_dbf < 0)
-               return axp20x_pek->irq_dbf;
-       axp20x_pek->irq_dbf = regmap_irq_get_virq(
-                       axp20x_pek->axp20x->regmap_irqc, axp20x_pek->irq_dbf);
 -      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;
  
        axp20x_pek->info = (struct axp20x_info *)match->driver_data;
  
-       error = devm_request_any_context_irq(&pdev->dev, axp20x_pek->irq_dbr,
-                                            axp20x_pek_irq, 0,
-                                            "axp20x-pek-dbr", axp20x_pek);
-       if (error < 0) {
-               dev_err(&pdev->dev, "Failed to request dbr IRQ#%d: %d\n",
-                       axp20x_pek->irq_dbr, error);
-               return error;
-       }
-       error = devm_request_any_context_irq(&pdev->dev, axp20x_pek->irq_dbf,
-                                         axp20x_pek_irq, 0,
-                                         "axp20x-pek-dbf", axp20x_pek);
-       if (error < 0) {
-               dev_err(&pdev->dev, "Failed to request dbf IRQ#%d: %d\n",
-                       axp20x_pek->irq_dbf, error);
-               return error;
-       }
-       device_init_wakeup(&pdev->dev, true);
        platform_set_drvdata(pdev, axp20x_pek);
  
        return 0;
This page took 0.071961 seconds and 4 git commands to generate.