1. 16 Dec, 2020 3 commits
    • Jiri Kosina's avatar
      Merge branch 'for-5.11/core' into for-linus · 105856b3
      Jiri Kosina authored
      - increase of maximum HID report size to 16KB in order to support
        some of the modern devices, from Dean Camera
      
      - control interface support for hidraw, from Dean Camera
      
      - stylus battery reporting improvement, from Dmitry Torokhov
      105856b3
    • Jiri Kosina's avatar
      Merge branch 'for-5.11/asus' into for-linus · 90c5f464
      Jiri Kosina authored
      Support for ASUS N-Key keyboard, from Luke D Jones
      90c5f464
    • Jiri Kosina's avatar
      Merge branch 'for-5.11/amd-sfh-hid' into for-linus · 36ed0958
      Jiri Kosina authored
      From Sandeep Singh.
      
      AMD SFH (Sensor Fusion Hub) is HID based driver.SFH FW is part of MP2 processor
      (MP2 which is an ARM core connected to x86 for processing sensor data) and it
      runs on MP2 where in the driver resides on X86.  The driver functionalities are
      divided into three parts:
      
      1: amd-mp2-pcie:- This part of the module will communicate with MP2
                        firmware. MP2 which is exposed as a PCI device to the
                        X86, uses mailboxes to talk to MP2 firmware to
                        send/receive commands.
      2: Client Layer:- This part of the driver will use DRAM  data and convert
                        the  data into HID format based on HID reports.
      3: Transport layer :- This part of the driver the will communicate with HID
                        core.Communication between devices and HID core is
                        mostly done via HID reports
      
      In terms of architecture, it resembles like ISH (Intel Integrated Sensor Hub).
      However the major difference is all the hid reports are generated as part of
      the kernel driver.
      
      AMD SFH is integrated as a part of SoC, starting from 17h family of processors.
      The solution is working well on several OEM products.  AMD SFH uses HID over
      PCIe bus.
      36ed0958
  2. 27 Nov, 2020 4 commits
    • Julian Sax's avatar
      HID: i2c-hid: add Vero K147 to descriptor override · c870d50c
      Julian Sax authored
      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: default avatarJulian Sax <jsbc@gmx.de>
      Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      c870d50c
    • Hans de Goede's avatar
      HID: ite: Add support for Acer S1002 keyboard-dock · c961facb
      Hans de Goede authored
      Make the hid-ite driver handle the Acer S1002 keyboard-dock, this
      leads to 2 improvements:
      
      1. The non working wifi-toggle hotkey now works.
      2. Toggling the touchpad on of with the hotkey will no show OSD
      notifications in e.g. GNOME3. The actual toggling is handled inside
      the keyboard, this adds support for notifying evdev listeners about this.
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      c961facb
    • Dean Camera's avatar
      HID: hidraw: Add additional hidraw input/output report ioctls. · f43d3870
      Dean Camera authored
      Currently the hidraw module can only read and write feature HID reports on
      demand, via dedicated ioctls. Input reports are read from the device through
      the read() interface, while output reports are written through the write
      interface().
      
      This is insufficient; it is desirable in many situations to be able to read and
      write input and output reports through the control interface to cover
      additional scenarios:
      
        - Reading an input report by its report ID, to get initial state
        - Writing an input report, to set initial input state in the device
        - Reading an output report by its report ID, to obtain current state
        - Writing an output report by its report ID, out of band
      
      This patch adds these missing ioctl requests to read and write the remaining
      HID report types. Note that not all HID backends will neccesarily support this
      (e.g. while the USB link layer supports setting Input reports, others may not).
      
      Also included are documentation and example updates. The current hidraw
      documentation states that feature reports read from the device does *not*
      include the report ID, however this is not the case and the returned report
      will have its report ID prepended by conforming HID devices, as the report data
      sent from the device over the control endpoint must be indentical in format to
      those sent over the regular transport.
      Signed-off-by: default avatarDean Camera <dean@fourwalledcubicle.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      f43d3870
    • Dean Camera's avatar
      HID: Increase HID maximum report size to 16KB · 6a0eaf51
      Dean Camera authored
      Currently the maximum HID report size which can be buffered by the kernel is
      8KB. This is sufficient for the vast majority of HID devices on the market, as
      most HID reports are fairly small.
      
      However, some unusual devices such as the Elgate Stream Deck exist which use a
      report size slightly over 8KB for the image data that is sent to the device.
      Reports these large cannot be buffered by the regular HID subsystem currently,
      thus the only way to use such device is to bypass the HID subsystem entirely.
      
      This increases the maximum HID report size to 16KB, which should cover all
      sanely designed HID devices.
      Signed-off-by: default avatarDean Camera <dean@fourwalledcubicle.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      6a0eaf51
  3. 25 Nov, 2020 5 commits
  4. 19 Nov, 2020 2 commits
    • Hans de Goede's avatar
      HID: logitech-dj: Fix Dinovo Mini when paired with a MX5x00 receiver · b4c00e79
      Hans de Goede authored
      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: f2113c30 ("HID: logitech-dj: add support for Logitech Bluetooth Mini-Receiver")
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
      b4c00e79
    • Hans de Goede's avatar
      HID: logitech-dj: Fix an error in mse_bluetooth_descriptor · eec231e0
      Hans de Goede authored
      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: f2113c30 ("HID: logitech-dj: add support for Logitech Bluetooth Mini-Receiver")
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
      eec231e0
  5. 12 Nov, 2020 4 commits
    • Colin Ian King's avatar
      SFH: fix error return check for -ERESTARTSYS · 6e6eae04
      Colin Ian King authored
      Currently the check for the error return code -ERESTARTSYS is dead code
      and never executed because a previous check for ret < 0 is catching this
      and returning -ETIMEDOUT instead.  Fix this by checking for -ERESTARTSYS
      before the more generic negative error code.
      
      Addresses-Coverity: ("Logically dead code")
      Fixes: 4b2c53d9 ("SFH:Transport Driver to add support of AMD Sensor Fusion Hub (SFH)")
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Reviewed-by: default avatarSandeep Singh <sandeep.singh@amd.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      6e6eae04
    • Hans de Goede's avatar
      HID: Add Logitech Dinovo Edge battery quirk · 7940fb03
      Hans de Goede authored
      The battery status is also being reported by the logitech-hidpp driver,
      so ignore the standard HID battery status to avoid reporting the same
      info twice.
      
      Note the logitech-hidpp battery driver provides more info, such as properly
      differentiating between charging and discharging. Also the standard HID
      battery info seems to be wrong, reporting a capacity of just 26% after
      fully charging the device.
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
      7940fb03
    • Hans de Goede's avatar
      HID: logitech-hidpp: Add HIDPP_CONSUMER_VENDOR_KEYS quirk for the Dinovo Edge · c27168a0
      Hans de Goede authored
      Like the MX5000 and MX5500 quad/bluetooth keyboards the Dinovo Edge also
      needs the HIDPP_CONSUMER_VENDOR_KEYS quirk for some special keys to work.
      Specifically without this the "Phone" and the 'A' - 'D' Smart Keys do not
      send any events.
      
      In addition to fixing these keys not sending any events, adding the
      Bluetooth match, so that hid-logitech-hidpp is used instead of the
      generic HID driver, also adds battery monitoring support when the
      keyboard is connected over Bluetooth.
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
      c27168a0
    • Hans de Goede's avatar
      HID: logitech-dj: Handle quad/bluetooth keyboards with a builtin trackpad · ee5e5841
      Hans de Goede authored
      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: f2113c30 ("HID: logitech-dj: add support for Logitech Bluetooth Mini-Receiver")
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
      ee5e5841
  6. 09 Nov, 2020 1 commit
  7. 05 Nov, 2020 2 commits
  8. 03 Nov, 2020 1 commit
  9. 29 Oct, 2020 4 commits
    • dmitry.torokhov@gmail.com's avatar
      HID: hid-input: occasionally report stylus battery even if not changed · c6838eee
      dmitry.torokhov@gmail.com authored
      There are styluses that only report their battery status when they are
      touching the touchscreen; additionally we currently suppress battery
      reports if capacity has not changed. To help userspace recognize how long
      ago the device reported battery status, let's send the change event through
      if either capacity has changed, or at least 30 seconds have passed since
      last report we've let through.
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      c6838eee
    • Sandeep Singh's avatar
      AMD_SFH: Fix for incorrect Sensor index · 4b393f0f
      Sandeep Singh authored
      It appears like the accelerometer/magnetometer and gyroscope indices were
      interchanged in the patch series which got into for-5.11/amd-sfh-hid until
      Mandoli/Richard reported to us.  Ideally sensor indices should be 0,1,2 for the
      accelerometer, Gyroscope, Magnetometer respectively, but this interchanged
      possibly could be because i was using a test MP2 firmware on my machine.
      
      This patch fixes the earlier commit with the right sensor indices and also
      removing unused structures _hid_report_descriptor, _hid_device_descriptor as
      reported by Richard.
      
      Fixes: 4f567b9f ("SFH: PCIe driver to add support of AMD sensor fusion hub 4f567b9f")
      Reported-by: default avatarMandoli <lipheng@hanmail.net>
      Reported-by: default avatarRichard Neumann <mail@richard-neumann.de>
      Signed-off-by: default avatarSandeep Singh <sandeep.singh@amd.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      4b393f0f
    • Luke D Jones's avatar
      HID: asus: Add support for ASUS N-Key keyboard · b92b8024
      Luke D Jones authored
      The ASUS N-Key keyboard uses the productId of 0x1866 and is used in
      almost all modern ASUS gaming laptops with slight changes to the
      firmware. This patch enables: Fn+key hotkeys, keyboard backlight
      brightness control.
      
      Additionally this keyboard requires the LED interface to be
      initialized before such things as keyboard backlight control work.
      Signed-off-by: default avatarLuke D Jones <luke@ljones.dev>
      Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      b92b8024
    • Hans de Goede's avatar
      HID: i2c-hid: Put ACPI enumerated devices in D3 on shutdown · 5c7e02a8
      Hans de Goede authored
      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 <kai.heng.feng@canonical.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Acked-by: default avatarKai-Heng Feng <kai.heng.feng@canonical.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      5c7e02a8
  10. 23 Oct, 2020 2 commits
    • Jiri Kosina's avatar
      HID: add support for Sega Saturn · 1811977c
      Jiri Kosina authored
      This device needs HID_QUIRK_MULTI_INPUT in order to be presented to userspace
      in a consistent way.
      Reported-and-tested-by: default avatarDavid Gámiz Jiménez <david.gamiz@gmail.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      1811977c
    • Frank Yang's avatar
      HID: cypress: Support Varmilo Keyboards' media hotkeys · 652f3d00
      Frank Yang authored
      The Varmilo VA104M Keyboard (04b4:07b1, reported as Varmilo Z104M)
      exposes media control hotkeys as a USB HID consumer control device, but
      these keys do not work in the current (5.8-rc1) kernel due to the
      incorrect HID report descriptor. Fix the problem by modifying the
      internal HID report descriptor.
      
      More specifically, the keyboard report descriptor specifies the
      logical boundary as 572~10754 (0x023c ~ 0x2a02) while the usage
      boundary is specified as 0~10754 (0x00 ~ 0x2a02). This results in an
      incorrect interpretation of input reports, causing inputs to be ignored.
      By setting the Logical Minimum to zero, we align the logical boundary
      with the Usage ID boundary.
      
      Some notes:
      
      * There seem to be multiple variants of the VA104M keyboard. This
        patch specifically targets 04b4:07b1 variant.
      
      * The device works out-of-the-box on Windows platform with the generic
        consumer control device driver (hidserv.inf). This suggests that
        Windows either ignores the Logical Minimum/Logical Maximum or
        interprets the Usage ID assignment differently from the linux
        implementation; Maybe there are other devices out there that only
        works on Windows due to this problem?
      Signed-off-by: default avatarFrank Yang <puilp0502@gmail.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      652f3d00
  11. 22 Oct, 2020 7 commits
  12. 15 Oct, 2020 5 commits
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid · bf36c6b9
      Linus Torvalds authored
      Pull HID updates from Jiri Kosina:
      
       - Lenovo X1 Tablet support improvements from Mikael Wikström
      
       - "heartbeat" report fix for several Wacom devices from Jason Gerecke
      
       - bounds checking fix in hid-roccat from Dan Carpenter
      
       - stylus battery reporting fix from Dmitry Torokhov
      
       - i2c-hid support for wakeup from suspend-to-idle from Kai-Heng Feng
      
       - new driver for Vivaldi devices from Sean O'Brien
      
       - other assorted small fixes and device ID additions
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid:
        HID: i2c-hid: Enable wakeup capability from Suspend-to-Idle
        HID: add vivaldi HID driver
        HID: hid-input: fix stylus battery reporting
        HID: wacom: Avoid entering wacom_wac_pen_report for pad / battery
        HID: i2c-hid: fix kerneldoc warnings in i2c-hid-core.c
        HID: core: fix kerneldoc warnings in hid-core.c
        HID: multitouch: Lenovo X1 Tablet Gen2 trackpoint and buttons
        HID: multitouch: Lenovo X1 Tablet Gen3 trackpoint and buttons
        HID: alps: clean up indentation issue
        HID: intel-ish-hid: simplify the return expression of ishtp_bus_remove_device()
        HID: hid-debug: fix nonblocking read semantics wrt EIO/ERESTARTSYS
        HID: i2c-hid: Prefer asynchronous probe
        HID: ite: Add USB id match for Acer One S1003 keyboard dock
        HID: roccat: add bounds checking in kone_sysfs_write_settings()
        HID: wiimote: narrow spinlock range in wiimote_hid_event()
        HID: wiimote: make handlers[] const
        HID: apple: Add support for Matias wireless keyboard
        HID: cp2112: Use irqchip template
      bf36c6b9
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching · 0cd7d979
      Linus Torvalds authored
      Pull livepatching update from Jiri Kosina:
       "livepatching kselftest output fix from Miroslav Benes"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching:
        selftests/livepatch: Do not check order when using "comm" for dmesg checking
      0cd7d979
    • Linus Torvalds's avatar
      Merge tag 'dio_for_v5.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs · 4a165feb
      Linus Torvalds authored
      Pull direct-io fix from Jan Kara:
       "Fix for unaligned direct IO read past EOF in legacy DIO code"
      
      * tag 'dio_for_v5.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
        direct-io: defer alignment check until after the EOF check
        direct-io: don't force writeback for reads beyond EOF
        direct-io: clean up error paths of do_blockdev_direct_IO
      4a165feb
    • Linus Torvalds's avatar
      Merge tag 'fs_for_v5.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs · b77a69b8
      Linus Torvalds authored
      Pull UDF, reiserfs, ext2, quota fixes from Jan Kara:
      
       - a couple of UDF fixes for issues found by syzbot fuzzing
      
       - a couple of reiserfs fixes for issues found by syzbot fuzzing
      
       - some minor ext2 cleanups
      
       - quota patches to support grace times beyond year 2038 for XFS quota
         APIs
      
      * tag 'fs_for_v5.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
        reiserfs: Fix oops during mount
        udf: Limit sparing table size
        udf: Remove pointless union in udf_inode_info
        udf: Avoid accessing uninitialized data on failed inode read
        quota: clear padding in v2r1_mem2diskdqb()
        reiserfs: Initialize inode keys properly
        udf: Fix memory leak when mounting
        udf: Remove redundant initialization of variable ret
        reiserfs: only call unlock_new_inode() if I_NEW
        ext2: Fix some kernel-doc warnings in balloc.c
        quota: Expand comment describing d_itimer
        quota: widen timestamps for the fs_disk_quota structure
        reiserfs: Fix memory leak in reiserfs_parse_options()
        udf: Use kvzalloc() in udf_sb_alloc_bitmap()
        ext2: remove duplicate include
      b77a69b8
    • Linus Torvalds's avatar
      Merge tag 'configfs-5.10' of git://git.infradead.org/users/hch/configfs · ca5387e4
      Linus Torvalds authored
      Pull configfs updates from Christoph Hellwig:
       "Various cleanups for the configfs samples (Bartosz Golaszewski)"
      
      * tag 'configfs-5.10' of git://git.infradead.org/users/hch/configfs:
        samples: configfs: prefer pr_err() over bare printk(KERN_ERR
        samples: configfs: don't use spaces before tabs
        samples: configfs: consolidate local variables of the same type
        samples: configfs: don't reinitialize variables which are already zeroed
        samples: configfs: replace simple_strtoul() with kstrtoint()
        samples: configfs: fix alignment in item struct
        samples: configfs: drop unnecessary ternary operators
        samples: configfs: remove redundant newlines
        MAINTAINERS: add the sample directory to the configfs entry
      ca5387e4