23 Nov, 2020

1 commit

  • Pull HID fixes from Jiri Kosina:

    - Various functionality / regression fixes for Logitech devices from
    Hans de Goede

    - Fix for (recently added) GPIO support in mcp2221 driver from Lars
    Povlsen

    - Power management handling fix/quirk in i2c-hid driver for certain
    BIOSes that have strange aproach to power-cycle from Hans de Goede

    - a few device ID additions and device-specific quirks

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid:
    HID: logitech-dj: Fix Dinovo Mini when paired with a MX5x00 receiver
    HID: logitech-dj: Fix an error in mse_bluetooth_descriptor
    HID: Add Logitech Dinovo Edge battery quirk
    HID: logitech-hidpp: Add HIDPP_CONSUMER_VENDOR_KEYS quirk for the Dinovo Edge
    HID: logitech-dj: Handle quad/bluetooth keyboards with a builtin trackpad
    HID: add HID_QUIRK_INCREMENT_USAGE_ON_DUPLICATE for Gamevice devices
    HID: mcp2221: Fix GPIO output handling
    HID: hid-sensor-hub: Fix issue with devices with no report ID
    HID: i2c-hid: Put ACPI enumerated devices in D3 on shutdown
    HID: add support for Sega Saturn
    HID: cypress: Support Varmilo Keyboards' media hotkeys
    HID: ite: Replace ABS_MISC 120/121 events with touchpad on/off keypresses
    HID: logitech-hidpp: Add PID for MX Anywhere 2
    HID: uclogic: Add ID for Trust Flex Design Tablet

    Linus Torvalds
     

19 Nov, 2020

2 commits

  • Some users are pairing the Dinovo keyboards with the MX5000 or MX5500
    receivers, instead of with the Dinovo receivers. The receivers are
    mostly the same (and the air protocol obviously is compatible) but
    currently the Dinovo receivers are handled by hid-lg.c while the
    MX5x00 receivers are handled by logitech-dj.c.

    When using a Dinovo keyboard, with its builtin touchpad, through
    logitech-dj.c then the touchpad stops working because when asking the
    receiver for paired devices, we get only 1 paired device with
    a device_type of REPORT_TYPE_KEYBOARD. And since we don't see a paired
    mouse, we have nowhere to send mouse-events to, so we drop them.

    Extend the existing fix for the Dinovo Edge for this to also cover the
    Dinovo Mini keyboard and also add a mapping to logitech-hidpp for the
    Media key on the Dinovo Mini, so that that keeps working too.

    BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1811424
    Fixes: f2113c3020ef ("HID: logitech-dj: add support for Logitech Bluetooth Mini-Receiver")
    Signed-off-by: Hans de Goede
    Signed-off-by: Benjamin Tissoires

    Hans de Goede
     
  • Fix an error in the mouse / INPUT(2) descriptor used for quad/bt2.0 combo
    receivers. Replace INPUT with INPUT (Data,Var,Abs) for the field for the
    4 extra buttons which share their report-byte with the low-res hwheel.

    This is likely a copy and paste error. I've verified that the new
    0x81, 0x02 value matches both the mouse descriptor for the currently
    supported MX5000 / MX5500 receivers, as well as the INPUT(2) mouse
    descriptors for the Dinovo receivers for which support is being
    worked on.

    Cc: stable@vger.kernel.org
    Fixes: f2113c3020ef ("HID: logitech-dj: add support for Logitech Bluetooth Mini-Receiver")
    Signed-off-by: Hans de Goede
    Signed-off-by: Benjamin Tissoires

    Hans de Goede
     

12 Nov, 2020

1 commit

  • Some quad/bluetooth keyboards, such as the Dinovo Edge (Y-RAY81) have a
    builtin touchpad. In this case when asking the receiver for paired devices,
    we get only 1 paired device with a device_type of REPORT_TYPE_KEYBOARD.

    This means that we do not instantiate a second dj_hiddev for the mouse
    (as we normally would) and thus there is no place for us to forward the
    mouse input reports to, causing the touchpad part of the keyboard to not
    work.

    There is no way for us to detect these keyboards, so this commit adds
    an array with device-ids for such keyboards and when a keyboard is on
    this list it adds STD_MOUSE to the reports_supported bitmap for the
    dj_hiddev created for the keyboard fixing the touchpad not working.

    Using a list of device-ids for this is not ideal, but there are only
    very few such keyboards so this should be fine. Besides the Dinovo Edge,
    other known wireless Logitech keyboards with a builtin touchpad are:

    * Dinovo Mini (TODO add its device-id to the list)
    * K400 (uses a unifying receiver so is not affected)
    * K600 (uses a unifying receiver so is not affected)

    Cc: stable@vger.kernel.org
    BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1811424
    Fixes: f2113c3020ef ("HID: logitech-dj: add support for Logitech Bluetooth Mini-Receiver")
    Signed-off-by: Hans de Goede
    Signed-off-by: Benjamin Tissoires

    Hans de Goede
     

01 Sep, 2020

1 commit


24 Aug, 2020

1 commit

  • Replace the existing /* fall through */ comments and its variants with
    the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
    fall-through markings when it is the case.

    [1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

    Signed-off-by: Gustavo A. R. Silva

    Gustavo A. R. Silva
     

07 Jul, 2020

1 commit


06 Apr, 2020

1 commit


10 Mar, 2020

1 commit


12 Feb, 2020

1 commit


23 Sep, 2019

1 commit


26 Aug, 2019

1 commit

  • Before this commit dj_probe would exit with an error if the initial
    logi_dj_recv_query_paired_devices fails. The initial call may fail
    when the receiver is connected through a kvm and the focus is away.

    When the call fails this causes 2 problems:

    1) dj_probe calls logi_dj_recv_query_paired_devices after calling
    hid_device_io_start() so a HID report may have been received in between
    and our delayedwork_callback may be running. It seems that the initial
    logi_dj_recv_query_paired_devices failure happening with some KVMs triggers
    this exact scenario, causing the work-queue to run on free-ed memory,
    leading to:

    BUG: unable to handle page fault for address: 0000000000001e88
    #PF: supervisor read access in kernel mode
    #PF: error_code(0x0000) - not-present page
    PGD 0 P4D 0
    Oops: 0000 [#1] SMP PTI
    CPU: 3 PID: 257 Comm: kworker/3:3 Tainted: G OE 5.3.0-rc5+ #100
    Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./B150M Pro4S/D3, BIOS P7.10 12/06/2016
    Workqueue: events 0xffffffffc02ba200
    RIP: 0010:0xffffffffc02ba1bd
    Code: e8 e8 13 00 d8 48 89 c5 48 85 c0 74 4c 48 8b 7b 10 48 89 ea b9 07 00 00 00 41 b9 09 00 00 00 41 b8 01 00 00 00 be 10 00 00 00 8b 87 88 1e 00 00 48 8b 40 40 e8 b3 6b b4 d8 48 89 ef 41 89 c4
    RSP: 0018:ffffb760c046bdb8 EFLAGS: 00010286
    RAX: ffff935038ea4550 RBX: ffff935046778000 RCX: 0000000000000007
    RDX: ffff935038ea4550 RSI: 0000000000000010 RDI: 0000000000000000
    RBP: ffff935038ea4550 R08: 0000000000000001 R09: 0000000000000009
    R10: 000000000000e011 R11: 0000000000000001 R12: ffff9350467780e8
    R13: ffff935046778000 R14: 0000000000000000 R15: ffff935046778070
    FS: 0000000000000000(0000) GS:ffff935054e00000(0000) knlGS:0000000000000000
    CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 0000000000001e88 CR3: 000000075a612002 CR4: 00000000003606e0
    DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
    Call Trace:
    0xffffffffc02ba2f7
    ? process_one_work+0x1b1/0x560
    process_one_work+0x234/0x560
    worker_thread+0x50/0x3b0
    kthread+0x10a/0x140
    ? process_one_work+0x560/0x560
    ? kthread_park+0x80/0x80
    ret_from_fork+0x3a/0x50
    Modules linked in: vboxpci(O) vboxnetadp(O) vboxnetflt(O) vboxdrv(O) bnep vfat fat btusb btrtl btbcm btintel bluetooth intel_rapl_msr ecdh_generic rfkill ecc snd_usb_audio snd_usbmidi_lib intel_rapl_common snd_rawmidi mc x86_pkg_temp_thermal intel_powerclamp coretemp iTCO_wdt iTCO_vendor_support mei_wdt mei_hdcp ppdev kvm_intel kvm irqbypass crct10dif_pclmul crc32_generic crc32_pclmul snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic ledtrig_audio ghash_clmulni_intel intel_cstate snd_hda_intel snd_hda_codec intel_uncore snd_hda_core snd_hwdep intel_rapl_perf snd_seq snd_seq_device snd_pcm snd_timer intel_wmi_thunderbolt snd e1000e soundcore mxm_wmi i2c_i801 bfq mei_me mei intel_pch_thermal parport_pc parport acpi_pad binfmt_misc hid_lg_g15(E) hid_logitech_dj(E) i915 crc32c_intel i2c_algo_bit drm_kms_helper nvme nvme_core drm wmi video uas usb_storage i2c_dev
    CR2: 0000000000001e88
    ---[ end trace 1d3f8afdcfcbd842 ]---

    2) Even if we were to fix 1. by making sure the work is stopped before
    failing probe, failing probe is the wrong thing to do, we have
    logi_dj_recv_queue_unknown_work to deal with the initial
    logi_dj_recv_query_paired_devices failure.

    Rather then error-ing out of the probe, causing the receiver to not work at
    all we should rely on this, so that the attached devices will get properly
    enumerated once the KVM focus is switched back.

    Cc: stable@vger.kernel.org
    Fixes: 74808f9115ce ("HID: logitech-dj: add support for non unifying receivers")
    Signed-off-by: Hans de Goede
    Signed-off-by: Benjamin Tissoires

    Hans de Goede
     

23 Aug, 2019

3 commits


05 Aug, 2019

2 commits

  • Extend the range of usage codes in the consumer page descriptor of
    the driver. Some Logitech HID devices send usages in that upper range.

    Signed-off-by: Olivier Gay
    Tested-by: Benson Leung
    Signed-off-by: Jiri Kosina

    Olivier Gay
     
  • Commit dbcbabf7da92 ("HID: logitech-dj: fix return value of
    logi_dj_recv_query_hidpp_devices") made logi_dj_recv_query_hidpp_devices
    return the return value of hid_hw_raw_request instead of unconditionally
    returning 0.

    But hid_hw_raw_request returns the report-size on a successful request
    (and a negative error-code on failure) where as the callers of
    logi_dj_recv_query_hidpp_devices expect a 0 return on success.

    This commit fixes things so that either the negative error gets returned
    or 0 on success, fixing HID++ receivers such as the Logitech nano receivers
    no longer working.

    Cc: YueHaibing
    Cc: Rafael J. Wysocki
    Cc: Lionel Landwerlin
    Fixes: dbcbabf7da92 ("HID: logitech-dj: fix return value of logi_dj_recv_query_hidpp_devices")
    Reported-by: Lionel Landwerlin
    Reported-by: Rafael J. Wysocki
    Signed-off-by: Hans de Goede
    Tested-by: Rafael J. Wysocki
    Reviewed-by: Petr Vorel
    Tested-by: Petr Vorel
    Reviewed-by: YueHaibing
    Signed-off-by: Jiri Kosina

    Hans de Goede
     

17 Jul, 2019

2 commits


10 Jul, 2019

1 commit


28 Jun, 2019

1 commit

  • Pull HID fixes from Jiri Kosina:

    - fix for one corner case in HID++ protocol with respect to handling
    very long reports, from Hans de Goede

    - power management fix in Intel-ISH driver, from Hyungwoo Yang

    - use-after-free fix in Intel-ISH driver, from Dan Carpenter

    - a couple of new device IDs/quirks from Kai-Heng Feng, Kyle Godbey and
    Oleksandr Natalenko

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid:
    HID: intel-ish-hid: fix wrong driver_data usage
    HID: multitouch: Add pointstick support for ALPS Touchpad
    HID: logitech-dj: Fix forwarding of very long HID++ reports
    HID: uclogic: Add support for Huion HS64 tablet
    HID: chicony: add another quirk for PixArt mouse
    HID: intel-ish-hid: Fix a use after free in load_fw_from_host()

    Linus Torvalds
     

26 Jun, 2019

1 commit

  • The HID++ spec also defines very long HID++ reports, with a reportid of
    0x12. The MX5000 and MX5500 keyboards use 0x12 output reports for sending
    messages to display on their buildin LCD.

    Userspace (libmx5000) supports this, in order for this to work when talking
    to the HID devices instantiated for the keyboard by hid-logitech-dj,
    we need to properly forward these reports to the device.

    This commit fixes logi_dj_ll_raw_request not forwarding these reports.

    Fixes: f2113c3020ef ("HID: logitech-dj: add support for Logitech Bluetooth Mini-Receiver")
    Signed-off-by: Hans de Goede
    Signed-off-by: Jiri Kosina

    Hans de Goede
     

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
     

11 Jun, 2019

1 commit


05 Jun, 2019

2 commits

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation this program is
    distributed in the hope that it will be useful but without any
    warranty without even the implied warranty of merchantability or
    fitness for a particular purpose see the gnu general public license
    for more details you should have received a copy of the gnu general
    public license along with this program if not write to the free
    software foundation inc 59 temple place suite 330 boston ma 02111
    1307 usa

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 136 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Alexios Zavras
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190530000436.384967451@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • The c52f nano receiver is a mouse only receiver. This means that it needs
    some special handling compared to the c534 nano receiver:

    1) It sends unnumbered mouse reports with a size of 8 bytes, so we need
    to extend the unnumbered mouse report handling to support reports upto
    8 bytes large

    2) It mouse reports have the same high-resolution format as those from the
    gaming mouse receivers

    3) It can report consumer/multimedia buttons on its second interface, since
    this is a mouse-only receiver these must be forwarded to the mouse child
    device and not to the keyboard child-device (which will not exist)

    Link: https://bugzilla.kernel.org/show_bug.cgi?id=203619
    Signed-off-by: Hans de Goede
    Acked-by: Jiri Kosina
    Signed-off-by: Benjamin Tissoires

    Hans de Goede
     

22 May, 2019

1 commit

  • Don't populate the array template on the stack but instead make it
    static. Makes the object code smaller by 10 bytes. Also reformat
    the declaration.

    Before:
    text data bss dec hex filename
    29376 9360 128 38864 97d0 drivers/hid/hid-logitech-dj.o

    After:
    text data bss dec hex filename
    29270 9456 128 38854 97c6 drivers/hid/hid-logitech-dj.o

    (gcc version 8.3.0, amd64)

    Signed-off-by: Colin Ian King
    Signed-off-by: Jiri Kosina

    Colin Ian King
     

10 May, 2019

2 commits

  • Testing has shown that, as expected, the MX3000 receiver is fully
    compatible with the existing 27MHz receiver support in hid-logitech-dj.c.

    After this the only, presumably also compatible, receiver id left in
    hid-lg.c is the USB_DEVICE_ID_S510_RECEIVER / 0xc50c id. If we can get
    someone to confirm that this receiver works with the dj 27Mhz support too,
    then the handling of the LG_RDESC and LG_WIRELESS quirks can be removed
    from hid-lg.c.

    Signed-off-by: Hans de Goede
    Signed-off-by: Jiri Kosina

    Hans de Goede
     
  • Add support for the HID proxy mode of the Logitech Bluetooth Mini-Receiver
    which comes with the Logitech MX5500 keyboard. This receiver works the same
    as the Bluetooth Mini-Receiver coming with the MX5000 keyboard and also
    presents itself as an USB-hub with 2 separate USB devices for the keyboard
    (boot sub-class) interface and for the (boot sub-class) mouse interface.

    Signed-off-by: Hans de Goede
    Signed-off-by: Jiri Kosina

    Hans de Goede
     

30 Apr, 2019

1 commit


24 Apr, 2019

10 commits

  • Add support for the Logitech Bluetooth Mini-Receiver in HID proxy mode

    This requires some special handing in dj_find_receiver_dev because the
    BT Mini-Receiver contains a built-in hub and has separate USB-devices
    for the keyboard and mouse interfaces, rather then using 2 interfaces on
    a single USB device. Otherwise this receiver works identical to the
    standard non-unifying nano receivers.

    Signed-off-by: Hans de Goede
    Signed-off-by: Benjamin Tissoires

    Hans de Goede
     
  • Make the appending of the HID++ descriptors in logi_dj_ll_parse
    conditional. This is a preparation patch for adding support for the
    Logitech mini Bluetooth receiver in HID proxy mode (its default mode),
    where some of the paired devices may not be Logitech devices and thus may
    not be HID++ capable.

    This uses a fake bit 63 in reports_supported, which is changed from an
    u32 to an u64 for this. Bits
    Signed-off-by: Benjamin Tissoires

    Hans de Goede
     
  • The various functions queueing work-items do not check there already is a
    work-item queued before calling schedule_work(), as such they may race
    with each-other and with the re-queuing done by the delayedwork_callback
    itself.

    This is fine as the delayedwork_callback simply is a nop if scheduled once
    too much. I've actually seen the false-positive hid_err for this trigger
    in practice, so lets remove it.

    While at it also remove the somewhat overzealous debugging around the
    schedule_work() calls.

    Signed-off-by: Hans de Goede
    Signed-off-by: Benjamin Tissoires

    Hans de Goede
     
  • hidpp_unifying_get_name() does not work for devices attached to
    non-unifying receivers. Since we do get a device-type in the device-
    connection report, we can pick a better name for these devices in
    hid-logitech-dj.c .

    Signed-off-by: Hans de Goede
    Signed-off-by: Benjamin Tissoires

    Hans de Goede
     
  • My Aten cs1764a KVM adds an extra interface to the receiver through which
    it forwards mouse events, if a separate mouse is plugged in next to the
    receiver dongle. This interface is present even if no extra mouse is
    plugged in.

    logitech-dj trying to handle this extra interface causes mouse events send
    through the extra interface to not be properly handled.

    This commit fixes this by treating any extra interfaces as hid-generic
    interfaces.

    Signed-off-by: Hans de Goede
    Signed-off-by: Benjamin Tissoires

    Hans de Goede
     
  • Use hid_err consistently everywhere.

    While at it also tweak some of the messages for clarity, to
    consistently have a space after a ':' and in some cases to fit
    within 80 chars.

    Signed-off-by: Hans de Goede
    Signed-off-by: Benjamin Tissoires

    Hans de Goede
     
  • 27 MHz mouse-only receivers send an unnumbered input report with the mouse
    data, add special handling for this and add the c51b product-id to the
    logi_dj_receivers table.

    Signed-off-by: Hans de Goede
    Signed-off-by: Benjamin Tissoires

    Hans de Goede
     
  • Most Logitech wireless keyboard and mice using the 27 MHz are hidpp10
    devices, add support to logitech-dj for their receivers.

    Doing so leads to 2 improvements:

    1) All these devices share the same USB product-id for their receiver,
    making it impossible to properly map some special keys / buttons
    which differ from device to device. Adding support to logitech-dj to
    see these as hidpp10 devices allows us to get the actual device-id
    from the keyboard / mouse.

    2) It enables battery-monitoring of these devices

    This patch uses a new HID group for 27Mhz devices, since the logitech-hidpp
    code needs to be able to differentiate them from other devices instantiated
    by the logitech-dj code.

    Signed-off-by: Hans de Goede
    Signed-off-by: Benjamin Tissoires

    Hans de Goede
     
  • This receiver is almost identical to the normal unifying ones except:
    - it is supposed to be paired to only one device (for performance reasons)
    - the mice reports have a greater ranges in their values, so they are
    using a different report ID.

    Tested on a G403 and a G900.

    Co-authored-by: Hans de Goede
    Signed-off-by: Hans de Goede
    Signed-off-by: Benjamin Tissoires

    Benjamin Tissoires
     
  • We emulate the DJ functionality through the driver.

    The receiver supports "fake device arrival" which behaves
    like the probing of DJ devices.

    A non-unifying receiver has 2 USB interfaces, the first one generates
    standard keypresses and is compatible with the USB Keyboard Boot Subclass.
    The second interface sends events for the mouse and special keys such as
    the consumer-page keys. Events are split this way for BIOS / Windows /
    generic-hid driver compatibility. This split does not actually match with
    which device the event originate from, e.g. the consumer-page key events
    originate from the keyboard but are delivered on the mouse interface.

    To make sure the events are actually delivered to the dj_device
    representing the originating device, we pick which dj_dev to forward
    a "regular" input-report to based on the report-number, rather
    then based on the originating interface.

    Co-authored-by: Benjamin Tissoires
    Signed-off-by: Hans de Goede
    Signed-off-by: Benjamin Tissoires

    Hans de Goede