Skip to content

Commit 6485cf5

Browse files
committed
Merge tag 'hid-for-linus-2024101301' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid
Pull HID fixes from Jiri Kosina: - fix for memory corruption regression in amd_sfh driver (Basavaraj Natikar) - fix for mis-reporting of BTN_TOOL_PEN and BTN_TOOL_RUBBER for AES sensors tools in Wacom driver (Jason Gerecke) - fix for unitialized variable use in intel-ish-hid driver (SurajSonawane2415) - a few device-specific quirks / device ID additions * tag 'hid-for-linus-2024101301' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: HID: wacom: Hardcode (non-inverted) AES pens as BTN_TOOL_PEN HID: amd_sfh: Switch to device-managed dmam_alloc_coherent() HID: multitouch: Add quirk for HONOR MagicBook Art 14 touchpad HID: multitouch: Add support for B2402FVA track point HID: plantronics: Workaround for an unexcepted opposite volume key hid: intel-ish-hid: Fix uninitialized variable 'rv' in ish_fw_xfer_direct_dma
2 parents 8e929cb + 2934b12 commit 6485cf5

File tree

6 files changed

+40
-12
lines changed

6 files changed

+40
-12
lines changed

drivers/hid/amd-sfh-hid/amd_sfh_client.c

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,9 @@ int amd_sfh_hid_client_init(struct amd_mp2_dev *privdata)
236236
cl_data->in_data = in_data;
237237

238238
for (i = 0; i < cl_data->num_hid_devices; i++) {
239-
in_data->sensor_virt_addr[i] = dma_alloc_coherent(dev, sizeof(int) * 8,
240-
&cl_data->sensor_dma_addr[i],
241-
GFP_KERNEL);
239+
in_data->sensor_virt_addr[i] = dmam_alloc_coherent(dev, sizeof(int) * 8,
240+
&cl_data->sensor_dma_addr[i],
241+
GFP_KERNEL);
242242
if (!in_data->sensor_virt_addr[i]) {
243243
rc = -ENOMEM;
244244
goto cleanup;
@@ -331,7 +331,6 @@ int amd_sfh_hid_client_init(struct amd_mp2_dev *privdata)
331331
int amd_sfh_hid_client_deinit(struct amd_mp2_dev *privdata)
332332
{
333333
struct amdtp_cl_data *cl_data = privdata->cl_data;
334-
struct amd_input_data *in_data = cl_data->in_data;
335334
int i, status;
336335

337336
for (i = 0; i < cl_data->num_hid_devices; i++) {
@@ -351,12 +350,5 @@ int amd_sfh_hid_client_deinit(struct amd_mp2_dev *privdata)
351350
cancel_delayed_work_sync(&cl_data->work_buffer);
352351
amdtp_hid_remove(cl_data);
353352

354-
for (i = 0; i < cl_data->num_hid_devices; i++) {
355-
if (in_data->sensor_virt_addr[i]) {
356-
dma_free_coherent(&privdata->pdev->dev, 8 * sizeof(int),
357-
in_data->sensor_virt_addr[i],
358-
cl_data->sensor_dma_addr[i]);
359-
}
360-
}
361353
return 0;
362354
}

drivers/hid/hid-ids.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,6 +1036,8 @@
10361036
#define USB_DEVICE_ID_PLANTRONICS_BLACKWIRE_3220_SERIES 0xc056
10371037
#define USB_DEVICE_ID_PLANTRONICS_BLACKWIRE_3215_SERIES 0xc057
10381038
#define USB_DEVICE_ID_PLANTRONICS_BLACKWIRE_3225_SERIES 0xc058
1039+
#define USB_DEVICE_ID_PLANTRONICS_BLACKWIRE_3325_SERIES 0x430c
1040+
#define USB_DEVICE_ID_PLANTRONICS_ENCOREPRO_500_SERIES 0x431e
10391041

10401042
#define USB_VENDOR_ID_PANASONIC 0x04da
10411043
#define USB_DEVICE_ID_PANABOARD_UBT780 0x1044

drivers/hid/hid-multitouch.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2026,6 +2026,10 @@ static const struct hid_device_id mt_devices[] = {
20262026
HID_DEVICE(BUS_I2C, HID_GROUP_MULTITOUCH_WIN_8,
20272027
USB_VENDOR_ID_ELAN, 0x3148) },
20282028

2029+
{ .driver_data = MT_CLS_WIN_8_FORCE_MULTI_INPUT_NSMU,
2030+
HID_DEVICE(BUS_I2C, HID_GROUP_MULTITOUCH_WIN_8,
2031+
USB_VENDOR_ID_ELAN, 0x32ae) },
2032+
20292033
/* Elitegroup panel */
20302034
{ .driver_data = MT_CLS_SERIAL,
20312035
MT_USB_DEVICE(USB_VENDOR_ID_ELITEGROUP,
@@ -2095,6 +2099,11 @@ static const struct hid_device_id mt_devices[] = {
20952099
HID_DEVICE(BUS_I2C, HID_GROUP_MULTITOUCH_WIN_8,
20962100
0x347d, 0x7853) },
20972101

2102+
/* HONOR MagicBook Art 14 touchpad */
2103+
{ .driver_data = MT_CLS_VTL,
2104+
HID_DEVICE(BUS_I2C, HID_GROUP_MULTITOUCH_WIN_8,
2105+
0x35cc, 0x0104) },
2106+
20982107
/* Ilitek dual touch panel */
20992108
{ .driver_data = MT_CLS_NSMU,
21002109
MT_USB_DEVICE(USB_VENDOR_ID_ILITEK,

drivers/hid/hid-plantronics.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,10 @@
3838
(usage->hid & HID_USAGE_PAGE) == HID_UP_CONSUMER)
3939

4040
#define PLT_QUIRK_DOUBLE_VOLUME_KEYS BIT(0)
41+
#define PLT_QUIRK_FOLLOWED_OPPOSITE_VOLUME_KEYS BIT(1)
4142

4243
#define PLT_DOUBLE_KEY_TIMEOUT 5 /* ms */
44+
#define PLT_FOLLOWED_OPPOSITE_KEY_TIMEOUT 220 /* ms */
4345

4446
struct plt_drv_data {
4547
unsigned long device_type;
@@ -137,6 +139,21 @@ static int plantronics_event(struct hid_device *hdev, struct hid_field *field,
137139

138140
drv_data->last_volume_key_ts = cur_ts;
139141
}
142+
if (drv_data->quirks & PLT_QUIRK_FOLLOWED_OPPOSITE_VOLUME_KEYS) {
143+
unsigned long prev_ts, cur_ts;
144+
145+
/* Usages are filtered in plantronics_usages. */
146+
147+
if (!value) /* Handle key presses only. */
148+
return 0;
149+
150+
prev_ts = drv_data->last_volume_key_ts;
151+
cur_ts = jiffies;
152+
if (jiffies_to_msecs(cur_ts - prev_ts) <= PLT_FOLLOWED_OPPOSITE_KEY_TIMEOUT)
153+
return 1; /* Ignore the followed opposite volume key. */
154+
155+
drv_data->last_volume_key_ts = cur_ts;
156+
}
140157

141158
return 0;
142159
}
@@ -210,6 +227,12 @@ static const struct hid_device_id plantronics_devices[] = {
210227
{ HID_USB_DEVICE(USB_VENDOR_ID_PLANTRONICS,
211228
USB_DEVICE_ID_PLANTRONICS_BLACKWIRE_3225_SERIES),
212229
.driver_data = PLT_QUIRK_DOUBLE_VOLUME_KEYS },
230+
{ HID_USB_DEVICE(USB_VENDOR_ID_PLANTRONICS,
231+
USB_DEVICE_ID_PLANTRONICS_BLACKWIRE_3325_SERIES),
232+
.driver_data = PLT_QUIRK_FOLLOWED_OPPOSITE_VOLUME_KEYS },
233+
{ HID_USB_DEVICE(USB_VENDOR_ID_PLANTRONICS,
234+
USB_DEVICE_ID_PLANTRONICS_ENCOREPRO_500_SERIES),
235+
.driver_data = PLT_QUIRK_FOLLOWED_OPPOSITE_VOLUME_KEYS },
213236
{ HID_USB_DEVICE(USB_VENDOR_ID_PLANTRONICS, HID_ANY_ID) },
214237
{ }
215238
};

drivers/hid/intel-ish-hid/ishtp-fw-loader.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ static int ish_fw_xfer_direct_dma(struct ishtp_cl_data *client_data,
635635
const struct firmware *fw,
636636
const struct shim_fw_info fw_info)
637637
{
638-
int rv;
638+
int rv = 0;
639639
void *dma_buf;
640640
dma_addr_t dma_buf_phy;
641641
u32 fragment_offset, fragment_size, payload_max_size;

drivers/hid/wacom_wac.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2567,6 +2567,8 @@ static void wacom_wac_pen_report(struct hid_device *hdev,
25672567
/* Going into range select tool */
25682568
if (wacom_wac->hid_data.invert_state)
25692569
wacom_wac->tool[0] = BTN_TOOL_RUBBER;
2570+
else if (wacom_wac->features.quirks & WACOM_QUIRK_AESPEN)
2571+
wacom_wac->tool[0] = BTN_TOOL_PEN;
25702572
else if (wacom_wac->id[0])
25712573
wacom_wac->tool[0] = wacom_intuos_get_tool_type(wacom_wac->id[0]);
25722574
else

0 commit comments

Comments
 (0)