Skip to content
  1. Oct 14, 2023
    • Matthias Berndt's avatar
      Input: xpad - add PXN V900 support · a65cd7ef
      Matthias Berndt authored
      
      
      Add VID and PID to the xpad_device table to allow driver to use the PXN
      V900 steering wheel, which is XTYPE_XBOX360 compatible in xinput mode.
      
      Signed-off-by: default avatarMatthias Berndt <matthias_berndt@gmx.de>
      Link: https://lore.kernel.org/r/4932699.31r3eYUQgx@fedora
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      a65cd7ef
    • Dmitry Torokhov's avatar
      Input: synaptics-rmi4 - handle reset delay when using SMBus trsnsport · 5030b2fe
      Dmitry Torokhov authored
      Touch controllers need some time after receiving reset command for the
      firmware to finish re-initializing and be ready to respond to commands
      from the host. The driver already had handling for the post-reset delay
      for I2C and SPI transports, this change adds the handling to
      SMBus-connected devices.
      
      SMBus devices are peculiar because they implement legacy PS/2
      compatibility mode, so reset is actually issued by psmouse driver on the
      associated serio port, after which the control is passed to the RMI4
      driver with SMBus companion device.
      
      Note that originally the delay was added to psmouse driver in
      92e24e0e
      
       ("Input: psmouse - add delay when deactivating for SMBus
      mode"), but that resulted in an unwanted delay in "fast" reconnect
      handler for the serio port, so it was decided to revert the patch and
      have the delay being handled in the RMI4 driver, similar to the other
      transports.
      
      Tested-by: default avatarJeffery Miller <jefferymiller@google.com>
      Link: https://lore.kernel.org/r/ZR1yUFJ8a9Zt606N@penguin
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      5030b2fe
    • Jeffery Miller's avatar
      Input: psmouse - fix fast_reconnect function for PS/2 mode · e2cb5cc8
      Jeffery Miller authored
      When the SMBus connection is attempted psmouse_smbus_init() sets
      the fast_reconnect pointer to psmouse_smbus_reconnecti(). If SMBus
      initialization fails, elantech_setup_ps2() and synaptics_init_ps2() will
      fallback to PS/2 mode, replacing the psmouse private data. This can cause
      issues on resume, since psmouse_smbus_reconnect() expects to find an
      instance of struct psmouse_smbus_dev in psmouse->private.
      
      The issue was uncovered when in 92e24e0e
      
       ("Input: psmouse - add
      delay when deactivating for SMBus mode") psmouse_smbus_reconnect()
      started attempting to use more of the data structure. The commit was
      since reverted, not because it was at fault, but because there was found
      a better way of doing what it was attempting to do.
      
      Fix the problem by resetting the fast_reconnect pointer in psmouse
      structure in elantech_setup_ps2() and synaptics_init_ps2() when the PS/2
      mode is used.
      
      Reported-by: default avatarThorsten Leemhuis <linux@leemhuis.info>
      Tested-by: default avatarThorsten Leemhuis <linux@leemhuis.info>
      Signed-off-by: default avatarJeffery Miller <jefferymiller@google.com>
      Fixes: bf232e46
      
       ("Input: psmouse-smbus - allow to control psmouse_deactivate")
      Link: https://lore.kernel.org/r/20231005002249.554877-1-jefferymiller@google.com
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      e2cb5cc8
  2. Oct 13, 2023
    • Dmitry Torokhov's avatar
      Revert "Input: psmouse - add delay when deactivating for SMBus mode" · b3572639
      Dmitry Torokhov authored
      This reverts commit 92e24e0e
      
      .
      
      While the patch itself is correct, it uncovered an issue with fallback
      to PS/2 mode, where we were leaving psmouse->fast_reconnect handler set
      to psmouse_smbus_reconnect(), which caused crashes.
      
      While discussing various approaches to fix the issue it was noted that
      this patch ass undesired delay in the "fast" resume path of PS/2 device,
      and it would be better to actually use "reset_delay" option defined in
      struct rmi_device_platform_data and have RMI code handle it for SMBus
      transport as well. So this patch is being reverted to deal with crashes
      and a better solution will be merged shortly.
      
      Reported-by: default avatarThorsten Leemhuis <linux@leemhuis.info>
      Closes: https://lore.kernel.org/all/ca0109fa-c64b-43c1-a651-75b294d750a1@leemhuis.info/
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      b3572639
  3. Oct 04, 2023
    • Hans de Goede's avatar
      Input: goodix - ensure int GPIO is in input for gpio_count == 1 && gpio_int_idx == 0 case · 423622a9
      Hans de Goede authored
      Add a special case for gpio_count == 1 && gpio_int_idx == 0 to
      goodix_add_acpi_gpio_mappings().
      
      It seems that on newer x86/ACPI devices the reset and irq GPIOs are no
      longer listed as GPIO resources instead there is only 1 GpioInt resource
      and _PS0 does the whole reset sequence for us.
      
      This means that we must call acpi_device_fix_up_power() on these devices
      to ensure that the chip is reset before we try to use it.
      
      This part was already fixed in commit 3de93e6e
      
       ("Input: goodix - call
      acpi_device_fix_up_power() in some cases") by adding a call to
      acpi_device_fix_up_power() to the generic "Unexpected ACPI resources"
      catch all.
      
      But it turns out that this case on some hw needs some more special
      handling. Specifically the firmware may bootup with the IRQ pin in
      output mode. The reset sequence from ACPI _PS0 (executed by
      acpi_device_fix_up_power()) should put the pin in input mode,
      but the GPIO subsystem has cached the direction at bootup, causing
      request_irq() to fail due to gpiochip_lock_as_irq() failure:
      
      [    9.119864] Goodix-TS i2c-GDIX1002:00: Unexpected ACPI resources: gpio_count 1, gpio_int_idx 0
      [    9.317443] Goodix-TS i2c-GDIX1002:00: ID 911, version: 1060
      [    9.321902] input: Goodix Capacitive TouchScreen as /devices/pci0000:00/0000:00:17.0/i2c_designware.4/i2c-5/i2c-GDIX1002:00/input/input8
      [    9.327840] gpio gpiochip0: (INT3453:00): gpiochip_lock_as_irq: tried to flag a GPIO set as output for IRQ
      [    9.327856] gpio gpiochip0: (INT3453:00): unable to lock HW IRQ 26 for IRQ
      [    9.327861] genirq: Failed to request resources for GDIX1002:00 (irq 131) on irqchip intel-gpio
      [    9.327912] Goodix-TS i2c-GDIX1002:00: request IRQ failed: -5
      
      Fix this by adding a special case for gpio_count == 1 && gpio_int_idx == 0
      which adds an ACPI GPIO lookup table for the int GPIO even though we cannot
      use it for reset purposes (as there is no reset GPIO).
      
      Adding the lookup will make the gpiod_int = gpiod_get(..., GPIOD_IN) call
      succeed, which will explicitly set the direction to input fixing the issue.
      
      Note this re-uses the acpi_goodix_int_first_gpios[] lookup table, since
      there is only 1 GPIO in the ACPI resources the reset entry in that
      lookup table will amount to a no-op.
      
      Reported-and-tested-by: default avatarMichael Smith <1973.mjsmith@gmail.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Link: https://lore.kernel.org/r/20231003215144.69527-1-hdegoede@redhat.com
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      423622a9
    • Szilard Fabian's avatar
      Input: i8042 - add Fujitsu Lifebook E5411 to i8042 quirk table · 80f39e1c
      Szilard Fabian authored
      
      
      In the initial boot stage the integrated keyboard of Fujitsu Lifebook E5411
      refuses to work and it's not possible to type for example a dm-crypt
      passphrase without the help of an external keyboard.
      
      i8042.nomux kernel parameter resolves this issue but using that a PS/2
      mouse is detected. This input device is unused even when the i2c-hid-acpi
      kernel module is blacklisted making the integrated ELAN touchpad
      (04F3:308A) not working at all.
      
      Since the integrated touchpad is managed by the i2c_designware input
      driver in the Linux kernel and you can't find a PS/2 mouse port on the
      computer I think it's safe to not use the PS/2 mouse port at all.
      
      Signed-off-by: default avatarSzilard Fabian <szfabian@bluemarch.art>
      Link: https://lore.kernel.org/r/20231004011749.101789-1-szfabian@bluemarch.art
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      80f39e1c
  4. Sep 18, 2023
  5. Aug 31, 2023
  6. Aug 16, 2023
  7. Aug 02, 2023
  8. Jul 29, 2023
  9. Jul 26, 2023
    • Jeffery Miller's avatar
      Input: psmouse - add delay when deactivating for SMBus mode · 92e24e0e
      Jeffery Miller authored
      
      
      There is a period of time between the psmouse deactivate and the
      ability to communicate with the SMBus companion. Insert a
      sleep after the deactivate to account for the delay and ensure
      the SMBus companion is responsive.
      
      Attempting to read from the SMBus companion too quickly was causing
      the touchpad on machines with an i801_smbus companion to stop working
      after a sleep/resume cycle.
      
      On resume the rmi4_smbus would fail with errors reading the SMBus version
      number:
      ```
      [5454] i2c_i801:i801_check_post:414: i801_smbus 0000:00:1f.3: No response
      smbus_result: i2c-0 a=02c f=0000 c=fd BYTE_DATA rd res=-6
      rmi4_smbus 0-002c: failed to get SMBus version number!
      ...
      rmi4_f01 rmi4-00.fn01: Failed to restore normal operation: -6.
      rmi4_f01 rmi4-00.fn01: Resume failed with code -6.
      rmi4_physical rmi4-00: Failed to suspend functions: -6
      rmi4_smbus 0-002c: Failed to resume device: -6
      ```
      In this case the rmi_smb_get_version fails with -ENXIO if it happens too
      soon after the preceding serio_resume -> psmouse_deactivate call.
      
      On boot this issue could cause the touchpad to stay in the limited PS/2
      mode. This only reproduced in 1 in 10 boots on the Lenovo T440p.
      Failures in the log on boot would show up as:
      ```
      psmouse serio1: synaptics: Trying to set up SMBus access
      [122] i2c_i801:i801_check_post:437: i801_smbus 0000:00:1f.3: No response
      psmouse serio1: synaptics: SMbus companion is not ready yet
      ```
      
      Experimentation on the Lenovo T440p showed that a delay of 7-12ms on
      resume allowed the companion to respond.
      
      The 30ms delay in this patch was chosen based on the linux-input message:
      Link: https://lore.kernel.org/all/BYAPR03MB47572F2C65E52ED673238D41B2439@BYAPR03MB4757.namprd03.prod.outlook.com/
      
      Signed-off-by: default avatarJeffery Miller <jefferymiller@google.com>
      Link: https://lore.kernel.org/r/20230726025256.81174-1-jefferymiller@google.com
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      92e24e0e
    • Nathan Chancellor's avatar
      Input: mcs-touchkey - fix uninitialized use of error in mcs_touchkey_probe() · 8362bf82
      Nathan Chancellor authored
      Clang warns (or errors with CONFIG_WERROR=y):
      
        drivers/input/keyboard/mcs_touchkey.c:149:49: error: variable 'error' is uninitialized when used here [-Werror,-Wuninitialized]
          149 |                 dev_err(&client->dev, "i2c read error[%d]\n", error);
              |                                                               ^~~~~
        include/linux/dev_printk.h:144:65: note: expanded from macro 'dev_err'
          144 |         dev_printk_index_wrap(_dev_err, KERN_ERR, dev, dev_fmt(fmt), ##__VA_ARGS__)
              |                                                                        ^~~~~~~~~~~
        include/linux/dev_printk.h:110:23: note: expanded from macro 'dev_printk_index_wrap'
          110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
              |                                     ^~~~~~~~~~~
        drivers/input/keyboard/mcs_touchkey.c:110:11: note: initialize the variable 'error' to silence this warning
          110 |         int error;
              |                  ^
              |                   = 0
        1 error generated.
      
      A refactoring updated the error handling in this block but did not
      update the dev_err() call to use fw_ver instead of error. Do so now to
      fix the warning and avoid printing uninitialized memory.
      
      Closes: https://github.com/ClangBuiltLinux/linux/issues/1893
      Fixes: e175eae1
      
       ("Input: mcs-touchkey - convert to use devm_* api")
      Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
      Link: https://lore.kernel.org/r/20230725-mcs_touchkey-fix-wuninitialized-v1-1-615db39af51c@kernel.org
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      8362bf82
  10. Jul 21, 2023
  11. Jul 19, 2023
    • Artur Weber's avatar
      Input: mms114 - add support for touch keys · bf93349b
      Artur Weber authored
      
      
      MELFAS MMS114 and similar touchscreens have support for touch keys.
      Enable support of them in the driver. The keycodes to emit can be
      controlled by the linux,keycodes DT property.
      
      Sidenote - the MAX_TOUCHKEYS value is set to 15, as that's the
      maximum value that the ID field can contain. I don't have access
      to any datasheets that could confirm or deny whether this is accurate.
      
      Most downstream drivers I've been able to find only use up to 2 keys
      (though I did find a driver that mentioned up to 4, but only 2 were
      used). They don't have any checks for a maximum keycode value, it is
      just extracted from the ID bits (0xf mask).
      
      The drivers I've been able to find also don't use touch ID 0; I assume
      that it is never used, so the keycodes provided in the DT start from
      touch ID 1. I suppose this is in-line with the regular behavior
      for touch IDs in touchscreen events, as there the provided touch ID
      is always lowered by 1, which would cause an overflow if it was 0...
      Just in case, we quietly return if the touch ID is set to 0 here.
      
      The implementation of the linux,keycodes property handling code was
      adapted from the msg2638 driver.
      
      Signed-off-by: default avatarArtur Weber <aweber.kernel@gmail.com>
      Link: https://lore.kernel.org/r/20230714100424.29798-3-aweber.kernel@gmail.com
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      bf93349b
    • Artur Weber's avatar
      dt-bindings: mms114: Add linux,keycodes property for touch keys · 21c133be
      Artur Weber authored
      
      
      MELFAS MMS114 and similar touchscreens have support for touch keys.
      Add the linux,keycodes property which can be used to set up the
      keycodes for the touch keys.
      
      Acked-by: default avatarConor Dooley <conor.dooley@microchip.com>
      Signed-off-by: default avatarArtur Weber <aweber.kernel@gmail.com>
      Link: https://lore.kernel.org/r/20230714100424.29798-2-aweber.kernel@gmail.com
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      21c133be
    • Samuel Holland's avatar
      Input: da9063 - add wakeup support · d7781232
      Samuel Holland authored
      
      
      Mark the IRQ as a wake IRQ so it will be enabled during system suspend.
      
      Signed-off-by: default avatarSamuel Holland <samuel.holland@sifive.com>
      Link: https://lore.kernel.org/r/20230717192004.1304287-1-samuel.holland@sifive.com
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      d7781232
  12. Jul 18, 2023
  13. Jul 14, 2023
  14. Jul 13, 2023
  15. Jul 11, 2023