diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2019-06-25 16:42:25 +0300 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2019-06-25 16:42:25 +0300 |
commit | d7929c1e13e3788e7cb741d75b5baec5e53eff21 (patch) | |
tree | cf513071edfc4499b4e025e4846244c9d0e4c6bd /drivers/hid/hid-rmi.c | |
parent | 8ac875db0fdc1cfa55c424b38a81cf5282f3df0b (diff) | |
parent | 80d42db02b3a5beb8cffba08207adf5f4c525ee3 (diff) | |
download | linux-d7929c1e13e3788e7cb741d75b5baec5e53eff21.tar.xz |
Merge branch 'drm-next' into drm-next-5.3
Backmerge drm-next and fix up conflicts due to drmP.h removal.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/hid/hid-rmi.c')
-rw-r--r-- | drivers/hid/hid-rmi.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/drivers/hid/hid-rmi.c b/drivers/hid/hid-rmi.c index 9e33165250a3..7c6abd7e0979 100644 --- a/drivers/hid/hid-rmi.c +++ b/drivers/hid/hid-rmi.c @@ -1,13 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (c) 2013 Andrew Duggan <aduggan@synaptics.com> * Copyright (c) 2013 Synaptics Incorporated * Copyright (c) 2014 Benjamin Tissoires <benjamin.tissoires@gmail.com> * Copyright (c) 2014 Red Hat, Inc - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. */ #include <linux/kernel.h> @@ -39,6 +35,7 @@ /* device flags */ #define RMI_DEVICE BIT(0) #define RMI_DEVICE_HAS_PHYS_BUTTONS BIT(1) +#define RMI_DEVICE_OUTPUT_SET_REPORT BIT(2) /* * retrieve the ctrl registers @@ -167,9 +164,19 @@ static int rmi_set_mode(struct hid_device *hdev, u8 mode) static int rmi_write_report(struct hid_device *hdev, u8 *report, int len) { + struct rmi_data *data = hid_get_drvdata(hdev); int ret; - ret = hid_hw_output_report(hdev, (void *)report, len); + if (data->device_flags & RMI_DEVICE_OUTPUT_SET_REPORT) { + /* + * Talk to device by using SET_REPORT requests instead. + */ + ret = hid_hw_raw_request(hdev, report[0], report, + len, HID_OUTPUT_REPORT, HID_REQ_SET_REPORT); + } else { + ret = hid_hw_output_report(hdev, (void *)report, len); + } + if (ret < 0) { dev_err(&hdev->dev, "failed to write hid report (%d)\n", ret); return ret; @@ -751,6 +758,8 @@ static const struct hid_device_id rmi_id[] = { .driver_data = RMI_DEVICE_HAS_PHYS_BUTTONS }, { HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_X1_COVER) }, { HID_USB_DEVICE(USB_VENDOR_ID_PRIMAX, USB_DEVICE_ID_PRIMAX_REZEL) }, + { HID_USB_DEVICE(USB_VENDOR_ID_SYNAPTICS, USB_DEVICE_ID_SYNAPTICS_ACER_SWITCH5), + .driver_data = RMI_DEVICE_OUTPUT_SET_REPORT }, { HID_DEVICE(HID_BUS_ANY, HID_GROUP_RMI, HID_ANY_ID, HID_ANY_ID) }, { } }; |