26 Dec, 2020

1 commit

  • commit c870d50ce387d84b6438211a7044c60afbd5d60a upstream.

    This device uses the SIPODEV SP1064 touchpad, which does not
    supply descriptors, so it has to be added to the override list.

    Cc: stable@vger.kernel.org
    Signed-off-by: Julian Sax
    Reviewed-by: Hans de Goede
    Signed-off-by: Jiri Kosina
    Signed-off-by: Greg Kroah-Hartman

    Julian Sax
     

29 Oct, 2020

1 commit

  • The i2c-hid driver would quietly fail to probe the i2c-hid sensor-hub
    with an ACPI device-id of SMO91D0 every other boot.

    Specifically, the i2c_smbus_read_byte() "Make sure there is something at
    this address" check would fail every other boot.

    It seems that the BIOS does not properly reset/power-cycle the device
    leaving it in a confused state where it refuses to respond to i2c-xfers.
    On boots where probing the device failed, the driver-core puts the device
    in D3 after the probe-failure, which causes the probe to succeed the next
    boot.

    Putting the device in D3 from the shutdown-handler fixes the sensors not
    working every other boot.

    This has been tested on both a Lenovo Miix 2-10 and a Dell Venue 8 Pro 5830
    both of which use an i2c-hid sensor-hub with an ACPI id of SMO91D0.

    Note that it is safe to call acpi_device_set_power() with a NULL pointer
    as first argument, so on none ACPI enumerated devices this change is a
    no-op.

    Cc: Kai-Heng Feng
    Signed-off-by: Hans de Goede
    Acked-by: Kai-Heng Feng
    Signed-off-by: Jiri Kosina

    Hans de Goede
     

16 Oct, 2020

3 commits


23 Sep, 2020

1 commit

  • Fix following warnings caused by mismatch bewteen function parameters
    and comments.
    drivers/hid/i2c-hid/i2c-hid-core.c:331: warning: Function parameter or member 'data_len' not described in 'i2c_hid_set_or_send_report'
    drivers/hid/i2c-hid/i2c-hid-core.c:331: warning: Excess function parameter 'len' description in 'i2c_hid_set_or_send_report'

    Signed-off-by: Xiaofei Tan
    Signed-off-by: Jiri Kosina

    Xiaofei Tan
     

09 Sep, 2020

1 commit

  • Adding printouts to the i2c_hid_probe() function shows that it takes
    quite some time. It used to take about 70 ms, but after commit
    eef4016243e9 ("HID: i2c-hid: Always sleep 60ms after I2C_HID_PWR_ON
    commands") it takes about 190 ms. This is not tons of time but it's
    not trivial. Because we haven't yet specified that we'd prefer
    asynchronous probe for this driver then, if the driver is builtin to
    the kernel, we'll wait for this driver to finish before we start
    probes for more drivers. Let's set the flag to enable asynchronous
    for this driver so that other drivers aren't blocked from probing
    until we finish.

    Since this driver can be configured as a module and modules are
    always asynchronously probed this is quite a safe change and will
    benefit anyone who has a reason to build this driver into the kernel
    instead of using it as a module.

    [jkosina@suse.cz: drop spurious whitespace addition]
    Signed-off-by: Douglas Anderson
    Signed-off-by: Jiri Kosina

    Douglas Anderson
     

17 Aug, 2020

1 commit

  • Before this commit i2c_hid_parse() consists of the following steps:

    1. Send power on cmd
    2. usleep_range(1000, 5000)
    3. Send reset cmd
    4. Wait for reset to complete (device interrupt, or msleep(100))
    5. Send power on cmd
    6. Try to read HID descriptor

    Notice how there is an usleep_range(1000, 5000) after the first power-on
    command, but not after the second power-on command.

    Testing has shown that at least on the BMAX Y13 laptop's i2c-hid touchpad,
    not having a delay after the second power-on command causes the HID
    descriptor to read as all zeros.

    In case we hit this on other devices too, the descriptor being all zeros
    can be recognized by the following message being logged many, many times:

    hid-generic 0018:0911:5288.0002: unknown main item tag 0x0

    At the same time as the BMAX Y13's touchpad issue was debugged,
    Kai-Heng was working on debugging some issues with Goodix i2c-hid
    touchpads. It turns out that these need a delay after a PWR_ON command
    too, otherwise they stop working after a suspend/resume cycle.
    According to Goodix a delay of minimal 60ms is needed.

    Having multiple cases where we need a delay after sending the power-on
    command, seems to indicate that we should always sleep after the power-on
    command.

    This commit fixes the mentioned issues by moving the existing 1ms sleep to
    the i2c_hid_set_power() function and changing it to a 60ms sleep.

    Cc: stable@vger.kernel.org
    BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=208247
    Reported-by: Kai-Heng Feng
    Reported-and-tested-by: Andrea Borgia
    Signed-off-by: Hans de Goede
    Signed-off-by: Jiri Kosina

    Hans de Goede
     

18 Jul, 2020

1 commit

  • Pull HID fixes from Jiri Kosina:

    - linked list race condition fix in hid-steam driver from Rodrigo Rivas
    Costa

    - assorted deviceID-specific quirks and other small cosmetic cleanups

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid:
    HID: logitech-hidpp: avoid repeated "multiplier = " log messages
    HID: logitech: Use HIDPP_RECEIVER_INDEX instead of 0xff
    HID: quirks: Ignore Simply Automated UPB PIM
    HID: apple: Disable Fn-key key-re-mapping on clone keyboards
    MAINTAINERS: update uhid and hid-wiimote entry
    HID: steam: fixes race in handling device list.
    HID: magicmouse: do not set up autorepeat
    HID: alps: support devices with report id 2
    HID: quirks: Always poll Obins Anne Pro 2 keyboard
    HID: i2c-hid: add Mediacom FlexBook edge13 to descriptor override

    Linus Torvalds
     

16 Jun, 2020

1 commit


14 Jun, 2020

1 commit

  • Since commit 84af7a6194e4 ("checkpatch: kconfig: prefer 'help' over
    '---help---'"), the number of '---help---' has been gradually
    decreasing, but there are still more than 2400 instances.

    This commit finishes the conversion. While I touched the lines,
    I also fixed the indentation.

    There are a variety of indentation styles found.

    a) 4 spaces + '---help---'
    b) 7 spaces + '---help---'
    c) 8 spaces + '---help---'
    d) 1 space + 1 tab + '---help---'
    e) 1 tab + '---help---' (correct indentation)
    f) 1 tab + 1 space + '---help---'
    g) 1 tab + 2 spaces + '---help---'

    In order to convert all of them to 1 tab + 'help', I ran the
    following commend:

    $ find . -name 'Kconfig*' | xargs sed -i 's/^[[:space:]]*---help---/\thelp/'

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

05 May, 2020

1 commit


30 Apr, 2020

1 commit

  • On the Dell XPS 9570, the Synaptics SYNA2393 touchpad generates spurious
    interrupts after resuming from suspend until it receives some input or
    is reset. Add it to the quirk I2C_HID_QUIRK_RESET_ON_RESUME so that it
    is reset when resuming from suspend.

    More information about the bug can be found in this mailing list
    discussion: https://www.spinics.net/lists/linux-input/msg59530.html

    Signed-off-by: Daniel Playfair Cal
    Signed-off-by: Jiri Kosina

    Daniel Playfair Cal
     

14 Feb, 2020

1 commit


13 Dec, 2019

1 commit

  • Apply it to the Lenovo Y720 gaming laptop I2C peripheral then.

    This fixes dmesg being flooded with errors visible on un-suspend
    in Linux Mint 19 Cinnamon.

    Example of error log:

    [ 4.326588] i2c_hid i2c-ITE33D1:00: i2c_hid_get_input: incomplete report (2/4)
    [ 4.326845] i2c_hid i2c-ITE33D1:00: i2c_hid_get_input: incomplete report (2/4)
    [ 4.327095] i2c_hid i2c-ITE33D1:00: i2c_hid_get_input: incomplete report (2/4)
    [ 4.327341] i2c_hid i2c-ITE33D1:00: i2c_hid_get_input: incomplete report (2/4)
    [ 4.327609] i2c_hid i2c-ITE33D1:00: i2c_hid_get_input: incomplete report (2/4)

    Example of fixed log (debug on)

    [ 3731.333183] i2c_hid i2c-ITE33D1:00: input: 02 00
    [ 3731.333581] i2c_hid i2c-ITE33D1:00: input: 02 00
    [ 3731.333842] i2c_hid i2c-ITE33D1:00: input: 02 00
    [ 3731.334107] i2c_hid i2c-ITE33D1:00: input: 02 00
    [ 3731.334367] i2c_hid i2c-ITE33D1:00: input: 02 00

    [jkosina@suse.cz: rebase onto more recent codebase]
    Signed-off-by: Pavel Balan
    Signed-off-by: Jiri Kosina

    Pavel Balan
     

30 Nov, 2019

1 commit


15 Nov, 2019

3 commits

  • Commit 52cf93e63ee6 ("HID: i2c-hid: Don't reset device upon system
    resume") fixes many touchpads and touchscreens, however ALPS touchpads
    start to trigger IRQ storm after system resume.

    Since it's total silence from ALPS, let's bring the old behavior back
    to ALPS touchpads.

    Fixes: 52cf93e63ee6 ("HID: i2c-hid: Don't reset device upon system resume")
    Signed-off-by: Kai-Heng Feng
    Signed-off-by: Jiri Kosina

    Kai-Heng Feng
     
  • On some ThinkPad L390 some raydium 3118 touchscreen devices
    doesn't response any data after reset, but some does.

    Add this ID to no irq quirk,
    then don't wait for any response alike on these touchscreens.
    All kinds of raydium 3118 devices work fine.

    BugLink: https://bugs.launchpad.net/bugs/1849721

    Signed-off-by: Aaron Ma
    Signed-off-by: Jiri Kosina

    Aaron Ma
     
  • This was introduced in commit 00b790ea545b ("HID: i2c-hid: Add a small
    delay after sleep command for Raydium touchpanel") which has been
    effectively reverted by commit 67b18dfb8cfc ("HID: i2c-hid: Remove
    runtime power management").

    Signed-off-by: You-Sheng Yang
    Signed-off-by: Jiri Kosina

    You-Sheng Yang
     

03 Nov, 2019

1 commit

  • Before commit 67b18dfb8cfc ("HID: i2c-hid: Remove runtime power
    management"), any i2c-hid touchscreens would typically be runtime-suspended
    between the driver loading and Xorg or a Wayland compositor opening it,
    causing it to be resumed again. This means that before this change,
    we would call i2c_hid_set_power(OFF), i2c_hid_set_power(ON) before the
    graphical session would start listening to the touchscreen.

    It turns out that at least some SIS touchscreens, such as the one found
    on the Asus T100HA, need a power-on command after reset, otherwise they
    will not send any events.

    Fixes: 67b18dfb8cfc ("HID: i2c-hid: Remove runtime power management")
    Cc: Kai-Heng Feng
    Signed-off-by: Hans de Goede
    Signed-off-by: Jiri Kosina

    Hans de Goede
     

18 Oct, 2019

2 commits

  • The Primebook C11B uses the SIPODEV SP1064 touchpad. There are 2 versions
    of this 2-in-1 and the touchpad in the older version does not supply
    descriptors, so it has to be added to the override list.

    Cc: stable@vger.kernel.org
    Signed-off-by: Hans de Goede
    Signed-off-by: Benjamin Tissoires

    Hans de Goede
     
  • Runtime power management in i2c-hid brings lots of issues, such as:
    - When transitioning from display manager to desktop session, i2c-hid
    was closed and opened, so the device was set to SLEEP and ON in a short
    period. Vendors confirmed that their devices can't handle fast ON/SLEEP
    command because Windows doesn't have this behavior.

    - When rebooting, i2c-hid was closed, and the driver core put the device
    back to full power before shutdown. This behavior also triggers a quick
    SLEEP and ON commands that some devices can't handle, renders an
    unusable touchpad after reboot.

    - Most importantly, my power meter reports little to none energy saving
    when i2c-hid is runtime suspended.

    So let's remove runtime power management since there is no actual
    benefit.

    Signed-off-by: Kai-Heng Feng
    Acked-by: Hans de Goede
    Signed-off-by: Benjamin Tissoires

    Kai-Heng Feng
     

04 Sep, 2019

1 commit

  • This 'SET_PWR_WAKEUP_DEV' quirk only works for weida's devices with pid
    0xC300 & 0xC301. Some weida's devices with other pids also need this quirk
    now. Use 'HID_ANY_ID' instead of 0xC300 to make all of weida's devices can be
    fixed on the power on issue. This modification should be safe since devices
    without power on issue will send the power on command only once.

    Signed-off-by: HungNien Chen
    Signed-off-by: Jiri Kosina

    HungNien Chen
     

13 Jun, 2019

1 commit

  • Pull HID fixes from Jiri Kosina:

    - regression fixes (reverts) for module loading changes that turned out
    to be incompatible with some userspace, from Benjamin Tissoires

    - regression fix for special Logitech unifiying receiver 0xc52f, from
    Hans de Goede

    - a few device ID additions to logitech driver, from Hans de Goede

    - fix for Bluetooth support on 2nd-gen Wacom Intuos Pro, from Jason
    Gerecke

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid:
    HID: logitech-dj: Fix 064d:c52f receiver support
    Revert "HID: core: Call request_module before doing device_add"
    Revert "HID: core: Do not call request_module() in async context"
    Revert "HID: Increase maximum report size allowed by hid_field_extract()"
    HID: a4tech: fix horizontal scrolling
    HID: hyperv: Add a module description line
    HID: logitech-hidpp: Add support for the S510 remote control
    HID: multitouch: handle faulty Elo touch device
    HID: wacom: Sync INTUOSP2_BT touch state after each frame if necessary
    HID: wacom: Correct button numbering 2nd-gen Intuos Pro over Bluetooth
    HID: wacom: Send BTN_TOUCH in response to INTUOSP2_BT eraser contact
    HID: wacom: Don't report anything prior to the tool entering range
    HID: wacom: Don't set tool type until we're in range
    HID: rmi: Use SET_REPORT request on control endpoint for Acer Switch 3 and 5
    HID: logitech-hidpp: add support for the MX5500 keyboard
    HID: logitech-dj: add support for the Logitech MX5500's Bluetooth Mini-Receiver
    HID: i2c-hid: add iBall Aer3 to descriptor override

    Linus Torvalds
     

21 May, 2019

1 commit


10 May, 2019

1 commit


11 Apr, 2019

1 commit


01 Apr, 2019

1 commit

  • We have a new Dell laptop which has the synaptics I2C touchpad
    (06cb:7e7e) on it. After booting up the Linux, the touchpad doesn't
    work, there is no interrupt when touching the touchpad, after
    disable the runtime PM, everything works well.

    I also tried the quirk of I2C_HID_QUIRK_DELAY_AFTER_SLEEP, it is
    better after applied this quirk, there are interrupts but data it
    reports is invalid.

    Signed-off-by: Hui Wang
    Signed-off-by: Jiri Kosina

    Hui Wang
     

05 Mar, 2019

1 commit


21 Jan, 2019

1 commit

  • While using Elan touchpads, the message floods:
    [ 136.138487] i2c_hid i2c-DELL08D6:00: i2c_hid_get_input: incomplete report (14/65535)

    Though the message flood is annoying, the device it self works without
    any issue. I suspect that the device in question takes too much time to
    pull the IRQ back to high after I2C host has done reading its data.

    Since the host receives all useful data, let's ignore the input report
    when there's no data.

    Signed-off-by: Kai-Heng Feng
    Signed-off-by: Benjamin Tissoires

    Kai-Heng Feng
     

14 Jan, 2019

1 commit

  • A Goodix touchpad doesn't work. Touching the touchpad can trigger IRQ
    but there's no input event from HID subsystem.

    Turns out it reports some invalid data:
    [ 22.136630] i2c_hid i2c-DELL091F:00: input: 0b 00 01 00 00 00 00 00 00 00 00

    After some trial and error, it's another device that doesn't work well
    with ON/SLEEP commands. Disable runtime PM to fix the issue.

    Signed-off-by: Kai-Heng Feng
    Signed-off-by: Jiri Kosina

    Kai-Heng Feng
     

03 Jan, 2019

1 commit


19 Nov, 2018

1 commit

  • LG touchscreen (1fd2:8001) stops working after reboot:
    [ 4.859153] i2c_hid i2c-SAPS2101:00: i2c_hid_get_input: incomplete report (64/66)
    [ 4.936070] i2c_hid i2c-SAPS2101:00: i2c_hid_get_input: incomplete report (64/66)
    [ 9.948224] i2c_hid i2c-SAPS2101:00: failed to reset device.

    The device in question stops working after receives SLEEP, ON, SLEEP
    commands in a short period. The scenario is like this:
    - Once the desktop session closes, it also closed the hid device, so the
    device gets runtime suspended and receives a SLEEP command.
    - Before calling shutdown callback, it gets runtime resumed and received
    an ON command.
    - In the shutdown callback, it receives another SLEEP command.

    I failed to find a reliable interval between ON/SLEEP commands that can
    make it work, so let's simply disable runtime PM for the device.

    Signed-off-by: Kai-Heng Feng
    Signed-off-by: Jiri Kosina

    Kai-Heng Feng
     

06 Nov, 2018

1 commit


31 Oct, 2018

1 commit


28 Oct, 2018

1 commit

  • Commit 9ee3e06610fd ("HID: i2c-hid: override HID descriptors for certain
    devices") added a new dmi_system_id quirk table to override certain HID
    report descriptors for some systems that lack them.

    But the table wasn't properly terminated, causing the dmi matching to
    walk off into la-la-land, and starting to treat random data as dmi
    descriptor pointers, causing boot-time oopses if you were at all
    unlucky.

    Terminate the array.

    We really should have some way to just statically check that arrays that
    should be terminated by an empty entry actually are so. But the HID
    people really should have caught this themselves, rather than have me
    deal with an oops during the merge window. Tssk, tssk.

    Cc: Julian Sax
    Cc: Benjamin Tissoires
    Cc: Jiri Kosina
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

26 Oct, 2018

1 commit

  • Raydium touchpanel (2386:4B33) sometimes does not work in desktop session
    although it works in display manager.

    During user logging, the display manager exits, close the HID device,
    then the device gets runtime suspended and powered off. The desktop
    session begins shortly after, opens the HID device, then the device gets
    runtime resumed and powered on.

    If the trasition from display manager to desktop sesesion is fast, the
    touchpanel cannot switch from powered off to powered on in short
    timeframe. So add a small delay to workaround the issue.

    Signed-off-by: Kai-Heng Feng
    Reviewed-by: Benjamin Tissoires
    Signed-off-by: Jiri Kosina

    Kai-Heng Feng
     

23 Oct, 2018

1 commit


30 Sep, 2018

1 commit

  • A particular touchpad (SIPODEV SP1064) refuses to supply the HID
    descriptors. This patch provides the framework for overriding these
    descriptors based on DMI data. It also includes the descriptors for
    said touchpad, which were extracted by listening to the traffic of the
    windows filter driver, as well as the DMI data for the laptops known
    to use this device.

    Relevant Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1526312

    Cc: Hans de Goede
    Reported-and-tested-by: ahormann@gmx.net
    Reported-and-tested-by: Bruno Jesus
    Reported-and-tested-by: Dietrich
    Reported-and-tested-by: kloxdami@yahoo.com
    Signed-off-by: Julian Sax
    Reviewed-by: Benjamin Tissoires
    Signed-off-by: Jiri Kosina

    Julian Sax
     

24 Sep, 2018

1 commit

  • Commit 52cf93e63ee6 ("HID: i2c-hid: Don't reset device upon system resume")
    removes the need for the RESEND_REPORT_DESCR quirk for Raydium devices, but
    kept it for the SIS device id 10FB touchscreens, as the author of that
    commit could not determine if the quirk is still necessary there.

    I've tested suspend/resume on a Toshiba Click Mini L9W-B which is the
    device for which this quirk was added in the first place and with the
    "Don't reset device upon system resume" fix the quirk is no longer
    necessary, so this commit removes it.

    Note even better I also had some other devices with SIS touchscreens which
    suspend/resume issues, where the RESEND_REPORT_DESCR quirk did not help.

    I've also tested these devices with the "Don't reset device upon system
    resume" fix and I'm happy to report that that fix also fixes touchscreen
    resume on the following devices:

    Asus T100HA
    Asus T200TA
    Peaq C1010

    Cc: Kai-Heng Feng
    Acked-by: Benjamin Tissoires
    Signed-off-by: Hans de Goede
    Signed-off-by: Jiri Kosina

    Hans de Goede