aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/surface-hid (follow)
AgeCommit message (Collapse)AuthorFilesLines
2021-06-15HID: surface-hid: Fix get-report requestMaximilian Luz1-1/+1
Getting a report (e.g. feature report) from a device requires us to send a request indicating which report we want to retrieve and then waiting for the corresponding response containing that report. We already provide the response structure to the request call, but the request isn't marked as a request that expects a response. Thus the request returns before we receive the response and the response buffer indicates a zero length response due to that. This essentially means that the get-report calls are broken and will always indicate that a report of length zero has been read. Fix this by appropriately marking the request. Fixes: b05ff1002a5c ("HID: Add support for Surface Aggregator Module HID transport") Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2021-05-05HID: surface-hid: Fix integer endian conversionMaximilian Luz1-3/+3
We want to convert from 16 bit (unsigned) little endian values contained in a packed struct to CPU native endian values here, not the other way around. So replace cpu_to_le16() with get_unaligned_le16(), using the latter instead of le16_to_cpu() to acknowledge that we are reading from a packed struct. Reported-by: kernel test robot <lkp@intel.com> Fixes: b05ff1002a5c ("HID: Add support for Surface Aggregator Module HID transport") Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2021-03-30HID: surface-hid: Add support for legacy keyboard interfaceMaximilian Luz3-0/+315
Add support for the legacy keyboard (KBD/TC=0x08) HID transport layer of the Surface System Aggregator Module (SSAM) to the Surface HID driver. On Surface Laptops 1 and 2, this interface is used to connect the integrated keyboard. Note that this subsystem interface essentially provides a limited HID transport layer. In contrast to the generic HID interface (TC=0x15) used on newer Surface models, this interface only allows (as far as we know) for a single device to be connected and is otherwise severely limited in terms of support for feature- and output-reports. Specifically, only caps-lock-LED output-reports and a single read-only feature-report are supported. Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2021-03-30HID: Add support for Surface Aggregator Module HID transportMaximilian Luz5-0/+636
Add a HID transport driver to support integrated HID devices on newer Microsoft Surface models (specifically 7th-generation, i.e. Surface Laptop 3, Surface Book 3, and later). On those models, the internal keyboard and touchpad (as well as some other HID devices with currently unknown function) are connected via the generic HID subsystem (TC=0x15) of the Surface System Aggregator Module (SSAM). This subsystem provides a generic HID transport layer, support for which is implemented by this driver. Co-developed-by: Blaž Hrastnik <blaz@mxxn.io> Signed-off-by: Blaž Hrastnik <blaz@mxxn.io> Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>