Skip to content

Commit 5f63595

Browse files
committed
Merge tag 'input-for-v6.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input fixes from Dmitry Torokhov: - a fix for unbalanced open count for inhibited input devices - fixups in Elantech PS/2 and Cyppress TTSP v5 drivers - a quirk to soc_button_array driver to make it work with Lenovo Yoga Book X90F / X90L - a removal of erroneous entry from xpad driver * tag 'input-for-v6.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: xpad - delete a Razer DeathAdder mouse VID/PID entry Input: psmouse - fix OOB access in Elantech protocol Input: soc_button_array - add invalid acpi_index DMI quirk handling Input: fix open count when closing inhibited device Input: cyttsp5 - fix array length
2 parents 25bda38 + feee70f commit 5f63595

File tree

5 files changed

+37
-7
lines changed

5 files changed

+37
-7
lines changed

drivers/input/input.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ void input_close_device(struct input_handle *handle)
703703

704704
__input_release_device(handle);
705705

706-
if (!dev->inhibited && !--dev->users) {
706+
if (!--dev->users && !dev->inhibited) {
707707
if (dev->poller)
708708
input_dev_poller_stop(dev->poller);
709709
if (dev->close)

drivers/input/joystick/xpad.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,6 @@ static const struct xpad_device {
281281
{ 0x1430, 0xf801, "RedOctane Controller", 0, XTYPE_XBOX360 },
282282
{ 0x146b, 0x0601, "BigBen Interactive XBOX 360 Controller", 0, XTYPE_XBOX360 },
283283
{ 0x146b, 0x0604, "Bigben Interactive DAIJA Arcade Stick", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 },
284-
{ 0x1532, 0x0037, "Razer Sabertooth", 0, XTYPE_XBOX360 },
285284
{ 0x1532, 0x0a00, "Razer Atrox Arcade Stick", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOXONE },
286285
{ 0x1532, 0x0a03, "Razer Wildcat", 0, XTYPE_XBOXONE },
287286
{ 0x15e4, 0x3f00, "Power A Mini Pro Elite", 0, XTYPE_XBOX360 },

drivers/input/misc/soc_button_array.c

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,27 @@ static const struct dmi_system_id dmi_use_low_level_irq[] = {
108108
{} /* Terminating entry */
109109
};
110110

111+
/*
112+
* Some devices have a wrong entry which points to a GPIO which is
113+
* required in another driver, so this driver must not claim it.
114+
*/
115+
static const struct dmi_system_id dmi_invalid_acpi_index[] = {
116+
{
117+
/*
118+
* Lenovo Yoga Book X90F / X90L, the PNP0C40 home button entry
119+
* points to a GPIO which is not a home button and which is
120+
* required by the lenovo-yogabook driver.
121+
*/
122+
.matches = {
123+
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Intel Corporation"),
124+
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "CHERRYVIEW D1 PLATFORM"),
125+
DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "YETI-11"),
126+
},
127+
.driver_data = (void *)1l,
128+
},
129+
{} /* Terminating entry */
130+
};
131+
111132
/*
112133
* Get the Nth GPIO number from the ACPI object.
113134
*/
@@ -137,6 +158,8 @@ soc_button_device_create(struct platform_device *pdev,
137158
struct platform_device *pd;
138159
struct gpio_keys_button *gpio_keys;
139160
struct gpio_keys_platform_data *gpio_keys_pdata;
161+
const struct dmi_system_id *dmi_id;
162+
int invalid_acpi_index = -1;
140163
int error, gpio, irq;
141164
int n_buttons = 0;
142165

@@ -154,10 +177,17 @@ soc_button_device_create(struct platform_device *pdev,
154177
gpio_keys = (void *)(gpio_keys_pdata + 1);
155178
n_buttons = 0;
156179

180+
dmi_id = dmi_first_match(dmi_invalid_acpi_index);
181+
if (dmi_id)
182+
invalid_acpi_index = (long)dmi_id->driver_data;
183+
157184
for (info = button_info; info->name; info++) {
158185
if (info->autorepeat != autorepeat)
159186
continue;
160187

188+
if (info->acpi_index == invalid_acpi_index)
189+
continue;
190+
161191
error = soc_button_lookup_gpio(&pdev->dev, info->acpi_index, &gpio, &irq);
162192
if (error || irq < 0) {
163193
/*

drivers/input/mouse/elantech.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -674,10 +674,11 @@ static void process_packet_head_v4(struct psmouse *psmouse)
674674
struct input_dev *dev = psmouse->dev;
675675
struct elantech_data *etd = psmouse->private;
676676
unsigned char *packet = psmouse->packet;
677-
int id = ((packet[3] & 0xe0) >> 5) - 1;
677+
int id;
678678
int pres, traces;
679679

680-
if (id < 0)
680+
id = ((packet[3] & 0xe0) >> 5) - 1;
681+
if (id < 0 || id >= ETP_MAX_FINGERS)
681682
return;
682683

683684
etd->mt[id].x = ((packet[1] & 0x0f) << 8) | packet[2];
@@ -707,7 +708,7 @@ static void process_packet_motion_v4(struct psmouse *psmouse)
707708
int id, sid;
708709

709710
id = ((packet[0] & 0xe0) >> 5) - 1;
710-
if (id < 0)
711+
if (id < 0 || id >= ETP_MAX_FINGERS)
711712
return;
712713

713714
sid = ((packet[3] & 0xe0) >> 5) - 1;
@@ -728,7 +729,7 @@ static void process_packet_motion_v4(struct psmouse *psmouse)
728729
input_report_abs(dev, ABS_MT_POSITION_X, etd->mt[id].x);
729730
input_report_abs(dev, ABS_MT_POSITION_Y, etd->mt[id].y);
730731

731-
if (sid >= 0) {
732+
if (sid >= 0 && sid < ETP_MAX_FINGERS) {
732733
etd->mt[sid].x += delta_x2 * weight;
733734
etd->mt[sid].y -= delta_y2 * weight;
734735
input_mt_slot(dev, sid);

drivers/input/touchscreen/cyttsp5.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ static int cyttsp5_hid_output_get_sysinfo(struct cyttsp5 *ts)
560560
static int cyttsp5_hid_output_bl_launch_app(struct cyttsp5 *ts)
561561
{
562562
int rc;
563-
u8 cmd[HID_OUTPUT_BL_LAUNCH_APP];
563+
u8 cmd[HID_OUTPUT_BL_LAUNCH_APP_SIZE];
564564
u16 crc;
565565

566566
put_unaligned_le16(HID_OUTPUT_BL_LAUNCH_APP_SIZE, cmd);

0 commit comments

Comments
 (0)