Merge tag 'input-for-v5.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 17 Jul 2022 14:52:46 +0000 (07:52 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 17 Jul 2022 14:52:46 +0000 (07:52 -0700)
Pull input fixes from Dmitry Torokhov:

 - fix Goodix driver to properly behave on the Aya Neo Next

 - some more sanity checks in usbtouchscreen driver

 - a tweak in wm97xx driver in preparation for remove() to return void

 - a clarification in input core regarding units of measurement for
   resolution on touch events.

* tag 'input-for-v5.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: document the units for resolution of size axes
  Input: goodix - call acpi_device_fix_up_power() in some cases
  Input: wm97xx - make .remove() obviously always return 0
  Input: usbtouchscreen - add driver_info sanity check

1  2 
drivers/input/touchscreen/wm97xx-core.c
include/uapi/linux/input.h

index 2757c7768ffe95456757d35eaa2f7dc41fddf589,a466e8c56462f10fa151c33cb872cf99d6ba46e2..f51ab561453200b8432ebdc8c2cf144c7a28e9f4
@@@ -285,12 -285,11 +285,12 @@@ void wm97xx_set_suspend_mode(struct wm9
  EXPORT_SYMBOL_GPL(wm97xx_set_suspend_mode);
  
  /*
 - * Handle a pen down interrupt.
 + * Codec PENDOWN irq handler
 + *
   */
 -static void wm97xx_pen_irq_worker(struct work_struct *work)
 +static irqreturn_t wm97xx_pen_interrupt(int irq, void *dev_id)
  {
 -      struct wm97xx *wm = container_of(work, struct wm97xx, pen_event_work);
 +      struct wm97xx *wm = dev_id;
        int pen_was_down = wm->pen_is_down;
  
        /* do we need to enable the touch panel reader */
        if (!wm->pen_is_down && wm->mach_ops->acc_enabled)
                wm->mach_ops->acc_pen_up(wm);
  
 -      wm->mach_ops->irq_enable(wm, 1);
 -}
 -
 -/*
 - * Codec PENDOWN irq handler
 - *
 - * We have to disable the codec interrupt in the handler because it
 - * can take up to 1ms to clear the interrupt source. We schedule a task
 - * in a work queue to do the actual interaction with the chip.  The
 - * interrupt is then enabled again in the slow handler when the source
 - * has been cleared.
 - */
 -static irqreturn_t wm97xx_pen_interrupt(int irq, void *dev_id)
 -{
 -      struct wm97xx *wm = dev_id;
 -
 -      if (!work_pending(&wm->pen_event_work)) {
 -              wm->mach_ops->irq_enable(wm, 0);
 -              queue_work(wm->ts_workq, &wm->pen_event_work);
 -      }
 -
        return IRQ_HANDLED;
  }
  
@@@ -354,9 -374,12 +354,9 @@@ static int wm97xx_init_pen_irq(struct w
  {
        u16 reg;
  
 -      /* If an interrupt is supplied an IRQ enable operation must also be
 -       * provided. */
 -      BUG_ON(!wm->mach_ops->irq_enable);
 -
 -      if (request_irq(wm->pen_irq, wm97xx_pen_interrupt, IRQF_SHARED,
 -                      "wm97xx-pen", wm)) {
 +      if (request_threaded_irq(wm->pen_irq, NULL, wm97xx_pen_interrupt,
 +                               IRQF_SHARED | IRQF_ONESHOT,
 +                               "wm97xx-pen", wm)) {
                dev_err(wm->dev,
                        "Failed to register pen down interrupt, polling");
                wm->pen_irq = 0;
@@@ -486,6 -509,7 +486,6 @@@ static int wm97xx_ts_input_open(struct 
        wm->codec->dig_enable(wm, 1);
  
        INIT_DELAYED_WORK(&wm->ts_reader, wm97xx_ts_reader);
 -      INIT_WORK(&wm->pen_event_work, wm97xx_pen_irq_worker);
  
        wm->ts_reader_min_interval = HZ >= 100 ? HZ / 100 : 1;
        if (wm->ts_reader_min_interval < 1)
@@@ -536,6 -560,10 +536,6 @@@ static void wm97xx_ts_input_close(struc
  
        wm->pen_is_down = 0;
  
 -      /* Balance out interrupt disables/enables */
 -      if (cancel_work_sync(&wm->pen_event_work))
 -              wm->mach_ops->irq_enable(wm, 1);
 -
        /* ts_reader rearms itself so we need to explicitly stop it
         * before we destroy the workqueue.
         */
@@@ -758,7 -786,9 +758,9 @@@ batt_err
  
  static int wm97xx_mfd_remove(struct platform_device *pdev)
  {
-       return wm97xx_remove(&pdev->dev);
+       wm97xx_remove(&pdev->dev);
+       return 0;
  }
  
  static int __maybe_unused wm97xx_suspend(struct device *dev)
index ef4257ab30265c67940b2d7a06fc237d776dee80,328cf545c029921bd9544dbd4ac7cf51a9510445..2557eb7b056178b2b8be98d9cea855eba1bd5aaf
@@@ -78,10 -78,13 +78,13 @@@ struct input_id 
   * Note that input core does not clamp reported values to the
   * [minimum, maximum] limits, such task is left to userspace.
   *
-  * The default resolution for main axes (ABS_X, ABS_Y, ABS_Z)
-  * is reported in units per millimeter (units/mm), resolution
-  * for rotational axes (ABS_RX, ABS_RY, ABS_RZ) is reported
-  * in units per radian.
+  * The default resolution for main axes (ABS_X, ABS_Y, ABS_Z,
+  * ABS_MT_POSITION_X, ABS_MT_POSITION_Y) is reported in units
+  * per millimeter (units/mm), resolution for rotational axes
+  * (ABS_RX, ABS_RY, ABS_RZ) is reported in units per radian.
+  * The resolution for the size axes (ABS_MT_TOUCH_MAJOR,
+  * ABS_MT_TOUCH_MINOR, ABS_MT_WIDTH_MAJOR, ABS_MT_WIDTH_MINOR)
+  * is reported in units per millimeter (units/mm).
   * When INPUT_PROP_ACCELEROMETER is set the resolution changes.
   * The main axes (ABS_X, ABS_Y, ABS_Z) are then reported in
   * units per g (units/g) and in units per degree per second
@@@ -271,7 -274,6 +274,7 @@@ struct input_mask 
  #define BUS_RMI                       0x1D
  #define BUS_CEC                       0x1E
  #define BUS_INTEL_ISHTP               0x1F
 +#define BUS_AMD_SFH           0x20
  
  /*
   * MT_TOOL types