Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/hid/hid

Pull HID updates from Jiri Kosina:

 - support for "Unified Battery" feature on Logitech devices from Filipe
   Laíns

 - power management improvements for intel-ish driver from Zhang Lixu

 - support for Goodix devices from Douglas Anderson

 - improved handling of generic HID keyboard in order to make it easier
   for userspace to figure out the details of the device, from Dmitry
   Torokhov

 - Playstation DualSense support from Roderick Colenbrander

 - other assorted small fixes and device ID additions.

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: (49 commits)
  HID: playstation: add DualSense player LED support.
  HID: playstation: add microphone mute support for DualSense.
  HID: playstation: add initial DualSense lightbar support.
  HID: wacom: Ignore attempts to overwrite the touch_max value from HID
  HID: playstation: fix array size comparison (off-by-one)
  HID: playstation: fix unused variable in ps_battery_get_property.
  HID: playstation: report DualSense hardware and firmware version.
  HID: playstation: add DualSense classic rumble support.
  HID: playstation: add DualSense Bluetooth support.
  HID: playstation: track devices in list.
  HID: playstation: add DualSense accelerometer and gyroscope support.
  HID: playstation: add DualSense touchpad support.
  HID: playstation: add DualSense battery support.
  HID: playstation: use DualSense MAC address as unique identifier.
  HID: playstation: initial DualSense USB support.
  HID: ite: Enable QUIRK_TOUCHPAD_ON_OFF_REPORT on Acer Aspire Switch 10E
  HID: Ignore battery for Elan touchscreen on HP Spectre X360 15-df0xxx
  HID: logitech-dj: add support for the new lightspeed connection iteration
  HID: intel-ish-hid: ipc: Add Tiger Lake H PCI device ID
  HID: logitech-dj: add support for keyboard events in eQUAD step 4 Gaming
  ...
  • Loading branch information
torvalds committed Feb 23, 2021
2 parents c3476d2 + 00522de commit 69aea9d
Show file tree
Hide file tree
Showing 44 changed files with 2,606 additions and 419 deletions.
65 changes: 65 additions & 0 deletions Documentation/devicetree/bindings/input/goodix,gt7375p.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/input/goodix,gt7375p.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Goodix GT7375P touchscreen

maintainers:
- Douglas Anderson <[email protected]>

description:
Supports the Goodix GT7375P touchscreen.
This touchscreen uses the i2c-hid protocol but has some non-standard
power sequencing required.

properties:
compatible:
items:
- const: goodix,gt7375p

reg:
enum:
- 0x5d
- 0x14

interrupts:
maxItems: 1

reset-gpios:
true

vdd-supply:
description: The 3.3V supply to the touchscreen.

required:
- compatible
- reg
- interrupts
- reset-gpios
- vdd-supply

additionalProperties: false

examples:
- |
#include <dt-bindings/clock/qcom,rpmh.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
ap_ts: touchscreen@5d {
compatible = "goodix,gt7375p";
reg = <0x5d>;
interrupt-parent = <&tlmm>;
interrupts = <9 IRQ_TYPE_LEVEL_LOW>;
reset-gpios = <&tlmm 8 GPIO_ACTIVE_LOW>;
vdd-supply = <&pp3300_ts>;
};
};
22 changes: 11 additions & 11 deletions Documentation/hid/amd-sfh-hid.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
AMD Sensor Fusion Hub
=====================
AMD Sensor Fusion Hub (SFH) is part of an SOC starting from Ryzen based platforms.
AMD Sensor Fusion Hub (SFH) is part of an SOC starting from Ryzen-based platforms.
The solution is working well on several OEM products. AMD SFH uses HID over PCIe bus.
In terms of architecture it resembles ISH, however the major difference is all
the HID reports are generated as part of the kernel driver.

1. Block Diagram
================
Block Diagram
-------------

::

Expand Down Expand Up @@ -45,20 +45,20 @@ the HID reports are generated as part of the kernel driver.
AMD HID Transport Layer
-----------------------
AMD SFH transport is also implemented as a bus. Each client application executing in the AMD MP2 is
registered as a device on this bus. Here: MP2 which is an ARM core connected to x86 for processing
registered as a device on this bus. Here, MP2 is an ARM core connected to x86 for processing
sensor data. The layer, which binds each device (AMD SFH HID driver) identifies the device type and
registers with the hid core. Transport layer attach a constant "struct hid_ll_driver" object with
registers with the HID core. Transport layer attaches a constant "struct hid_ll_driver" object with
each device. Once a device is registered with HID core, the callbacks provided via this struct are
used by HID core to communicate with the device. AMD HID Transport layer implements the synchronous calls.

AMD HID Client Layer
--------------------
This layer is responsible to implement HID request and descriptors. As firmware is OS agnostic, HID
This layer is responsible to implement HID requests and descriptors. As firmware is OS agnostic, HID
client layer fills the HID request structure and descriptors. HID client layer is complex as it is
interface between MP2 PCIe layer and HID. HID client layer initialized the MP2 PCIe layer and holds
the instance of MP2 layer. It identifies the number of sensors connected using MP2-PCIe layer. Base
on that allocates the DRAM address for each and every sensor and pass it to MP2-PCIe driver.On
enumeration of each the sensor, client layer fills the HID Descriptor structure and HID input repor
interface between MP2 PCIe layer and HID. HID client layer initializes the MP2 PCIe layer and holds
the instance of MP2 layer. It identifies the number of sensors connected using MP2-PCIe layer. Based
on that allocates the DRAM address for each and every sensor and passes it to MP2-PCIe driver. On
enumeration of each sensor, client layer fills the HID Descriptor structure and HID input report
structure. HID Feature report structure is optional. The report descriptor structure varies from
sensor to sensor.

Expand All @@ -72,7 +72,7 @@ The communication between X86 and MP2 is split into three parts.
2. Data transfer via DRAM.
3. Supported sensor info via P2C registers.

Commands are sent to MP2 using C2P Mailbox registers. Writing into C2P Message registers generate
Commands are sent to MP2 using C2P Mailbox registers. Writing into C2P Message registers generates
interrupt to MP2. The client layer allocates the physical memory and the same is sent to MP2 via
the PCI layer. MP2 firmware writes the command output to the access DRAM memory which the client
layer has allocated. Firmware always writes minimum of 32 bytes into DRAM. So as a protocol driver
Expand Down
4 changes: 2 additions & 2 deletions Documentation/hid/hid-alps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Case2 ReportID_3 TP Absolute

Command Read/Write
------------------
To read/write to RAM, need to send a commands to the device.
To read/write to RAM, need to send a command to the device.

The command format is as below.

Expand All @@ -80,7 +80,7 @@ Byte6 Value Byte
Byte7 Checksum
===== ======================

Command Byte is read=0xD1/write=0xD2 .
Command Byte is read=0xD1/write=0xD2.

Address is read/write RAM address.

Expand Down
18 changes: 9 additions & 9 deletions Documentation/hid/hid-sensor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ for different sensors. For example an accelerometer can send X,Y and Z data, whe
an ambient light sensor can send illumination data.
So the implementation has two parts:

- Core hid driver
- Core HID driver
- Individual sensor processing part (sensor drivers)

Core driver
-----------
The core driver registers (hid-sensor-hub) registers as a HID driver. It parses
The core driver (hid-sensor-hub) registers as a HID driver. It parses
report descriptors and identifies all the sensors present. It adds an MFD device
with name HID-SENSOR-xxxx (where xxxx is usage id from the specification).

Expand Down Expand Up @@ -95,14 +95,14 @@ Registration functions::
u32 usage_id,
struct hid_sensor_hub_callbacks *usage_callback):

Registers callbacks for an usage id. The callback functions are not allowed
Registers callbacks for a usage id. The callback functions are not allowed
to sleep::


int sensor_hub_remove_callback(struct hid_sensor_hub_device *hsdev,
u32 usage_id):

Removes callbacks for an usage id.
Removes callbacks for a usage id.


Parsing function::
Expand Down Expand Up @@ -166,7 +166,7 @@ This allows some differentiating use cases, where vendor can provide application
Some common use cases are debug other sensors or to provide some events like
keyboard attached/detached or lid open/close.

To allow application to utilize these sensors, here they are exported uses sysfs
To allow application to utilize these sensors, here they are exported using sysfs
attribute groups, attributes and misc device interface.

An example of this representation on sysfs::
Expand Down Expand Up @@ -207,9 +207,9 @@ An example of this representation on sysfs::
│   │   │   ├── input-1-200202-units
│   │   │   ├── input-1-200202-value

Here there is a custom sensors with four fields, two feature and two inputs.
Here there is a custom sensor with four fields: two feature and two inputs.
Each field is represented by a set of attributes. All fields except the "value"
are read only. The value field is a RW field.
are read only. The value field is a read-write field.

Example::

Expand Down Expand Up @@ -237,6 +237,6 @@ These reports are pushed using misc device interface in a FIFO order::
│   │   │   ├── 10:53 -> ../HID-SENSOR-2000e1.6.auto
│   ├── HID-SENSOR-2000e1.6.auto

Each reports can be of variable length preceded by a header. This header
consist of a 32 bit usage id, 64 bit time stamp and 32 bit length field of raw
Each report can be of variable length preceded by a header. This header
consists of a 32-bit usage id, 64-bit time stamp and 32-bit length field of raw
data.
12 changes: 6 additions & 6 deletions Documentation/hid/hid-transport.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Bluetooth, I2C and user-space I/O drivers.

The HID subsystem is designed as a bus. Any I/O subsystem may provide HID
devices and register them with the HID bus. HID core then loads generic device
drivers on top of it. The transport drivers are responsible of raw data
transport and device setup/management. HID core is responsible of
drivers on top of it. The transport drivers are responsible for raw data
transport and device setup/management. HID core is responsible for
report-parsing, report interpretation and the user-space API. Device specifics
and quirks are handled by all layers depending on the quirk.

Expand Down Expand Up @@ -67,7 +67,7 @@ Transport drivers attach a constant "struct hid_ll_driver" object with each
device. Once a device is registered with HID core, the callbacks provided via
this struct are used by HID core to communicate with the device.

Transport drivers are responsible of detecting device failures and unplugging.
Transport drivers are responsible for detecting device failures and unplugging.
HID core will operate a device as long as it is registered regardless of any
device failures. Once transport drivers detect unplug or failure events, they
must unregister the device from HID core and HID core will stop using the
Expand Down Expand Up @@ -101,7 +101,7 @@ properties in common.
channel. Any unrequested incoming or outgoing data report must be sent on
this channel and is never acknowledged by the remote side. Devices usually
send their input events on this channel. Outgoing events are normally
not send via intr, except if high throughput is required.
not sent via intr, except if high throughput is required.
- Control Channel (ctrl): The ctrl channel is used for synchronous requests and
device management. Unrequested data input events must not be sent on this
channel and are normally ignored. Instead, devices only send management
Expand Down Expand Up @@ -161,7 +161,7 @@ allowed on the intr channel and are the only means of data there.
payload may be blocked by the underlying transport driver if the
specification does not allow them.
- SET_REPORT: A SET_REPORT request has a report ID plus data as payload. It is
sent from host to device and a device must update it's current report state
sent from host to device and a device must update its current report state
according to the given data. Any of the 3 report types can be used. However,
INPUT reports as payload might be blocked by the underlying transport driver
if the specification does not allow them.
Expand Down Expand Up @@ -294,7 +294,7 @@ The available HID callbacks are:
void (*request) (struct hid_device *hdev, struct hid_report *report,
int reqtype)

Send an HID request on the ctrl channel. "report" contains the report that
Send a HID request on the ctrl channel. "report" contains the report that
should be sent and "reqtype" the request type. Request-type can be
HID_REQ_SET_REPORT or HID_REQ_GET_REPORT.

Expand Down
10 changes: 5 additions & 5 deletions Documentation/hid/hiddev.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ the following::
--> hiddev.c ----> POWER / MONITOR CONTROL

In addition, other subsystems (apart from USB) can potentially feed
events into the input subsystem, but these have no effect on the hid
events into the input subsystem, but these have no effect on the HID
device interface.

Using the HID Device Interface
Expand Down Expand Up @@ -73,7 +73,7 @@ The hiddev API uses a read() interface, and a set of ioctl() calls.
HID devices exchange data with the host computer using data
bundles called "reports". Each report is divided into "fields",
each of which can have one or more "usages". In the hid-core,
each one of these usages has a single signed 32 bit value.
each one of these usages has a single signed 32-bit value.

read():
-------
Expand Down Expand Up @@ -113,7 +113,7 @@ HIDIOCAPPLICATION
- (none)

This ioctl call returns the HID application usage associated with the
hid device. The third argument to ioctl() specifies which application
HID device. The third argument to ioctl() specifies which application
index to get. This is useful when the device has more than one
application collection. If the index is invalid (greater or equal to
the number of application collections this device has) the ioctl
Expand Down Expand Up @@ -181,7 +181,7 @@ looked up by type (input, output or feature) and id, so these fields
must be filled in by the user. The ID can be absolute -- the actual
report id as reported by the device -- or relative --
HID_REPORT_ID_FIRST for the first report, and (HID_REPORT_ID_NEXT |
report_id) for the next report after report_id. Without a-priori
report_id) for the next report after report_id. Without a priori
information about report ids, the right way to use this ioctl is to
use the relative IDs above to enumerate the valid IDs. The ioctl
returns non-zero when there is no more next ID. The real report ID is
Expand All @@ -200,7 +200,7 @@ HIDIOCGUCODE
- struct hiddev_usage_ref (read/write)

Returns the usage_code in a hiddev_usage_ref structure, given that
given its report type, report id, field index, and index within the
its report type, report id, field index, and index within the
field have already been filled into the structure.

HIDIOCGUSAGE
Expand Down
5 changes: 3 additions & 2 deletions Documentation/hid/hidraw.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Hidraw is the only alternative, short of writing a custom kernel driver, for
these non-conformant devices.

A benefit of hidraw is that its use by userspace applications is independent
of the underlying hardware type. Currently, Hidraw is implemented for USB
of the underlying hardware type. Currently, hidraw is implemented for USB
and Bluetooth. In the future, as new hardware bus types are developed which
use the HID specification, hidraw will be expanded to add support for these
new bus types.
Expand All @@ -31,9 +31,10 @@ create hidraw device nodes. Udev will typically create the device nodes
directly under /dev (eg: /dev/hidraw0). As this location is distribution-
and udev rule-dependent, applications should use libudev to locate hidraw
devices attached to the system. There is a tutorial on libudev with a
working example at:
working example at::

http://www.signal11.us/oss/udev/
https://web.archive.org/web/2019*/www.signal11.us

The HIDRAW API
---------------
Expand Down
Loading

0 comments on commit 69aea9d

Please sign in to comment.