Commit 29aa98d0 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'for-linus-2023083101' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid

Pull HID updates from Benjamin Tissoires:

 - devm fixes for problems that caused use-after-free reports (Rahul
   Rameshbabu)

 - Some extensive HID docs (Marco Morandini)

 - Constification of struct class (Ivan Orlov and Greg Kroah-Hartman)

 - Google Stadia Force Feedback support (Fabio Baltieri)

 - Various fixes and new device ID support

* tag 'for-linus-2023083101' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: (42 commits)
  HID: logitech-hidpp: rework one more time the retries attempts
  HID: nvidia-shield: Reference hid_device devm allocation of input_dev name
  HID: multitouch: Correct devm device reference for hidinput input_dev name
  HID: uclogic: Correct devm device reference for hidinput input_dev name
  HID: logitech-dj: Fix error handling in logi_dj_recv_switch_to_dj_mode()
  HID: i2c-hid: elan: Add ili9882t timing
  dt-bindings: input: i2c-hid: Introduce Ilitek ili9882t
  HID: apple: Add "Hailuck" to the list of non-apple keyboards
  HID: steelseries: arctis_1_battery_request[] should be static
  MAINTAINERS: update my email address
  HID: logitech-hidpp: Add support for Logitech MX Anywhere 3 mouse
  HID: wacom: struct name cleanup
  HID: wacom: remove unnecessary 'connected' variable from EKR
  HID: wacom: remove the battery when the EKR is off
  HID: nvidia-shield: Update Thunderstrike LED instance name to use id
  HID: nvidia-shield: Add battery support for Thunderstrike
  HID: nvidia-shield: Remove led_classdev_unregister in thunderstrike_create
  HID: hid-google-stadiaff: add support for Stadia force feedback
  HID: logitech-dj: Add support for a new lightspeed receiver iteration
  HID: logitech-hidpp: Add support for the Pro X Superlight
  ...
parents 307d5903 9fe5167a
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -139,6 +139,9 @@ Daniel Borkmann <daniel@iogearbox.net> <dborkman@redhat.com>
Daniel Borkmann <daniel@iogearbox.net> <dxchgb@gmail.com>
David Brownell <david-b@pacbell.net>
David Collins <quic_collinsd@quicinc.com> <collinsd@codeaurora.org>
David Rheinsberg <david@readahead.eu> <dh.herrmann@gmail.com>
David Rheinsberg <david@readahead.eu> <dh.herrmann@googlemail.com>
David Rheinsberg <david@readahead.eu> <david.rheinsberg@gmail.com>
David Woodhouse <dwmw2@shinybook.infradead.org>
Dedy Lansky <quic_dlansky@quicinc.com> <dlansky@codeaurora.org>
Deepak Kumar Singh <quic_deesin@quicinc.com> <deesin@codeaurora.org>
+67 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/input/ilitek,ili9882t.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Ilitek ili9882t touchscreen controller

maintainers:
  - Cong Yang <yangcong5@huaqin.corp-partner.google.com>

description:
  Supports the Ilitek ili9882t touchscreen controller.
  This touchscreen controller uses the i2c-hid protocol with a reset GPIO.

allOf:
  - $ref: /schemas/input/touchscreen/touchscreen.yaml#

properties:
  compatible:
    const: ilitek,ili9882t

  reg:
    const: 0x41

  interrupts:
    maxItems: 1

  panel: true

  reset-gpios:
    maxItems: 1
    description: Reset GPIO.

  vccio-supply:
    description: The 1.8V supply to the touchscreen.

required:
  - compatible
  - reg
  - interrupts
  - panel
  - vccio-supply

additionalProperties: false

examples:
  - |
    #include <dt-bindings/gpio/gpio.h>
    #include <dt-bindings/interrupt-controller/irq.h>

    i2c {
      #address-cells = <1>;
      #size-cells = <0>;

      touchscreen: touchscreen@41 {
        compatible = "ilitek,ili9882t";
        reg = <0x41>;

        interrupt-parent = <&pio>;
        interrupts = <12 IRQ_TYPE_LEVEL_LOW>;

        panel = <&panel>;
        reset-gpios = <&pio 60 GPIO_ACTIVE_LOW>;
        vccio-supply = <&mt6366_vio18_reg>;
      };
    };
+524 −0

File added.

Preview size limit exceeded, changes collapsed.

+49 −0
Original line number Diff line number Diff line
.. SPDX-License-Identifier: GPL-2.0

========================================
Manual parsing of HID report descriptors
========================================

Consider again the mouse HID report descriptor
introduced in Documentation/hid/hidintro.rst::

  $ hexdump -C /sys/bus/hid/devices/0003\:093A\:2510.0002/report_descriptor
  00000000  05 01 09 02 a1 01 09 01  a1 00 05 09 19 01 29 03  |..............).|
  00000010  15 00 25 01 75 01 95 03  81 02 75 05 95 01 81 01  |..%.u.....u.....|
  00000020  05 01 09 30 09 31 09 38  15 81 25 7f 75 08 95 03  |...0.1.8..%.u...|
  00000030  81 06 c0 c0                                       |....|
  00000034

and try to parse it by hand.

Start with the first number, 0x05: it carries 2 bits for the
length of the item, 2 bits for the type of the item and 4 bits for the
function::

  +----------+
  | 00000101 |
  +----------+
          ^^
          ---- Length of data (see HID spec 6.2.2.2)
        ^^
        ------ Type of the item (see HID spec 6.2.2.2, then jump to 6.2.2.7)
    ^^^^
    --------- Function of the item (see HID spec 6.2.2.7, then HUT Sec 3)

In our case, the length is 1 byte, the type is ``Global`` and the
function is ``Usage Page``, thus for parsing the value 0x01 in the second byte
we need to refer to HUT Sec 3.

The second number is the actual data, and its meaning can be found in
the HUT. We have a ``Usage Page``, thus we need to refer to HUT
Sec. 3, "Usage Pages"; from there, one sees that ``0x01`` stands for
``Generic Desktop Page``.

Moving now to the second two bytes, and following the same scheme,
``0x09`` (i.e. ``00001001``) will be followed by one byte (``01``)
and is a ``Local`` item (``10``). Thus, the meaning of the remaining four bits
(``0000``) is given in the HID spec Sec. 6.2.2.8 "Local Items", so that
we have a ``Usage``. From HUT, Sec. 4, "Generic Desktop Page",  we see that
0x02 stands for ``Mouse``.

The following numbers can be parsed in the same way.
+1 −0
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@ Human Interface Devices (HID)
.. toctree::
   :maxdepth: 1

   hidintro
   hiddev
   hidraw
   hid-sensor
Loading