Skip to content

Commit 31d7109

Browse files
committed
Merge tag 'input-for-v6.14-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input updates from Dmitry Torokhov: - several new device IDs added to xpad game controller driver - support for imagis IST3038H variant of chip added to imagis touch controller driver - a fix for GPIO allocation for ads7846 touch controller driver - a fix for iqs7222 driver to properly support status register - a fix for goodix-berlin touch controller driver to use the right name for the regulator - more i8042 quirks to better handle several old Clevo devices. * tag 'input-for-v6.14-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: MAINTAINERS: Remove myself from the goodix touchscreen maintainers Input: iqs7222 - preserve system status register Input: i8042 - swap old quirk combination with new quirk for more devices Input: i8042 - swap old quirk combination with new quirk for several devices Input: i8042 - add required quirks for missing old boardnames Input: i8042 - swap old quirk combination with new quirk for NHxxRZQ Input: xpad - rename QH controller to Legion Go S Input: xpad - add support for TECNO Pocket Go Input: xpad - add support for ZOTAC Gaming Zone Input: goodix-berlin - fix vddio regulator references Input: goodix-berlin - fix comment referencing wrong regulator Input: imagis - add support for imagis IST3038H dt-bindings: input/touchscreen: imagis: add compatible for ist3038h Input: xpad - add multiple supported devices Input: xpad - add 8BitDo SN30 Pro, Hyperkin X91 and Gamesir G7 SE controllers Input: ads7846 - fix gpiod allocation Input: wdt87xx_i2c - fix compiler warning
2 parents cd3a56a + fd10709 commit 31d7109

File tree

9 files changed

+135
-106
lines changed

9 files changed

+135
-106
lines changed

Documentation/devicetree/bindings/input/touchscreen/imagis,ist3038c.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ properties:
1919
- imagis,ist3038
2020
- imagis,ist3038b
2121
- imagis,ist3038c
22+
- imagis,ist3038h
2223

2324
reg:
2425
maxItems: 1

MAINTAINERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9829,7 +9829,6 @@ S: Maintained
98299829
F: drivers/media/usb/go7007/
98309830

98319831
GOODIX TOUCHSCREEN
9832-
M: Bastien Nocera <hadess@hadess.net>
98339832
M: Hans de Goede <hdegoede@redhat.com>
98349833
L: linux-input@vger.kernel.org
98359834
S: Maintained

drivers/input/joystick/xpad.c

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ static const struct xpad_device {
140140
{ 0x044f, 0x0f00, "Thrustmaster Wheel", 0, XTYPE_XBOX },
141141
{ 0x044f, 0x0f03, "Thrustmaster Wheel", 0, XTYPE_XBOX },
142142
{ 0x044f, 0x0f07, "Thrustmaster, Inc. Controller", 0, XTYPE_XBOX },
143+
{ 0x044f, 0xd01e, "ThrustMaster, Inc. ESWAP X 2 ELDEN RING EDITION", 0, XTYPE_XBOXONE },
143144
{ 0x044f, 0x0f10, "Thrustmaster Modena GT Wheel", 0, XTYPE_XBOX },
144145
{ 0x044f, 0xb326, "Thrustmaster Gamepad GP XID", 0, XTYPE_XBOX360 },
145146
{ 0x045e, 0x0202, "Microsoft X-Box pad v1 (US)", 0, XTYPE_XBOX },
@@ -177,6 +178,7 @@ static const struct xpad_device {
177178
{ 0x06a3, 0x0200, "Saitek Racing Wheel", 0, XTYPE_XBOX },
178179
{ 0x06a3, 0x0201, "Saitek Adrenalin", 0, XTYPE_XBOX },
179180
{ 0x06a3, 0xf51a, "Saitek P3600", 0, XTYPE_XBOX360 },
181+
{ 0x0738, 0x4503, "Mad Catz Racing Wheel", 0, XTYPE_XBOXONE },
180182
{ 0x0738, 0x4506, "Mad Catz 4506 Wireless Controller", 0, XTYPE_XBOX },
181183
{ 0x0738, 0x4516, "Mad Catz Control Pad", 0, XTYPE_XBOX },
182184
{ 0x0738, 0x4520, "Mad Catz Control Pad Pro", 0, XTYPE_XBOX },
@@ -238,6 +240,7 @@ static const struct xpad_device {
238240
{ 0x0e6f, 0x0146, "Rock Candy Wired Controller for Xbox One", 0, XTYPE_XBOXONE },
239241
{ 0x0e6f, 0x0147, "PDP Marvel Xbox One Controller", 0, XTYPE_XBOXONE },
240242
{ 0x0e6f, 0x015c, "PDP Xbox One Arcade Stick", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOXONE },
243+
{ 0x0e6f, 0x015d, "PDP Mirror's Edge Official Wired Controller for Xbox One", XTYPE_XBOXONE },
241244
{ 0x0e6f, 0x0161, "PDP Xbox One Controller", 0, XTYPE_XBOXONE },
242245
{ 0x0e6f, 0x0162, "PDP Xbox One Controller", 0, XTYPE_XBOXONE },
243246
{ 0x0e6f, 0x0163, "PDP Xbox One Controller", 0, XTYPE_XBOXONE },
@@ -276,12 +279,15 @@ static const struct xpad_device {
276279
{ 0x0f0d, 0x0078, "Hori Real Arcade Pro V Kai Xbox One", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOXONE },
277280
{ 0x0f0d, 0x00c5, "Hori Fighting Commander ONE", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOXONE },
278281
{ 0x0f0d, 0x00dc, "HORIPAD FPS for Nintendo Switch", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 },
282+
{ 0x0f0d, 0x0151, "Hori Racing Wheel Overdrive for Xbox Series X", 0, XTYPE_XBOXONE },
283+
{ 0x0f0d, 0x0152, "Hori Racing Wheel Overdrive for Xbox Series X", 0, XTYPE_XBOXONE },
279284
{ 0x0f30, 0x010b, "Philips Recoil", 0, XTYPE_XBOX },
280285
{ 0x0f30, 0x0202, "Joytech Advanced Controller", 0, XTYPE_XBOX },
281286
{ 0x0f30, 0x8888, "BigBen XBMiniPad Controller", 0, XTYPE_XBOX },
282287
{ 0x102c, 0xff0c, "Joytech Wireless Advanced Controller", 0, XTYPE_XBOX },
283288
{ 0x1038, 0x1430, "SteelSeries Stratus Duo", 0, XTYPE_XBOX360 },
284289
{ 0x1038, 0x1431, "SteelSeries Stratus Duo", 0, XTYPE_XBOX360 },
290+
{ 0x10f5, 0x7005, "Turtle Beach Recon Controller", 0, XTYPE_XBOXONE },
285291
{ 0x11c9, 0x55f0, "Nacon GC-100XF", 0, XTYPE_XBOX360 },
286292
{ 0x11ff, 0x0511, "PXN V900", 0, XTYPE_XBOX360 },
287293
{ 0x1209, 0x2882, "Ardwiino Controller", 0, XTYPE_XBOX360 },
@@ -306,7 +312,7 @@ static const struct xpad_device {
306312
{ 0x1689, 0xfe00, "Razer Sabertooth", 0, XTYPE_XBOX360 },
307313
{ 0x17ef, 0x6182, "Lenovo Legion Controller for Windows", 0, XTYPE_XBOX360 },
308314
{ 0x1949, 0x041a, "Amazon Game Controller", 0, XTYPE_XBOX360 },
309-
{ 0x1a86, 0xe310, "QH Electronics Controller", 0, XTYPE_XBOX360 },
315+
{ 0x1a86, 0xe310, "Legion Go S", 0, XTYPE_XBOX360 },
310316
{ 0x1bad, 0x0002, "Harmonix Rock Band Guitar", 0, XTYPE_XBOX360 },
311317
{ 0x1bad, 0x0003, "Harmonix Rock Band Drumkit", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 },
312318
{ 0x1bad, 0x0130, "Ion Drum Rocker", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 },
@@ -343,6 +349,7 @@ static const struct xpad_device {
343349
{ 0x1bad, 0xfa01, "MadCatz GamePad", 0, XTYPE_XBOX360 },
344350
{ 0x1bad, 0xfd00, "Razer Onza TE", 0, XTYPE_XBOX360 },
345351
{ 0x1bad, 0xfd01, "Razer Onza", 0, XTYPE_XBOX360 },
352+
{ 0x1ee9, 0x1590, "ZOTAC Gaming Zone", 0, XTYPE_XBOX360 },
346353
{ 0x20d6, 0x2001, "BDA Xbox Series X Wired Controller", 0, XTYPE_XBOXONE },
347354
{ 0x20d6, 0x2009, "PowerA Enhanced Wired Controller for Xbox Series X|S", 0, XTYPE_XBOXONE },
348355
{ 0x20d6, 0x281f, "PowerA Wired Controller For Xbox 360", 0, XTYPE_XBOX360 },
@@ -366,6 +373,7 @@ static const struct xpad_device {
366373
{ 0x24c6, 0x5510, "Hori Fighting Commander ONE (Xbox 360/PC Mode)", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 },
367374
{ 0x24c6, 0x551a, "PowerA FUSION Pro Controller", 0, XTYPE_XBOXONE },
368375
{ 0x24c6, 0x561a, "PowerA FUSION Controller", 0, XTYPE_XBOXONE },
376+
{ 0x24c6, 0x581a, "ThrustMaster XB1 Classic Controller", 0, XTYPE_XBOXONE },
369377
{ 0x24c6, 0x5b00, "ThrustMaster Ferrari 458 Racing Wheel", 0, XTYPE_XBOX360 },
370378
{ 0x24c6, 0x5b02, "Thrustmaster, Inc. GPX Controller", 0, XTYPE_XBOX360 },
371379
{ 0x24c6, 0x5b03, "Thrustmaster Ferrari 458 Racing Wheel", 0, XTYPE_XBOX360 },
@@ -374,22 +382,32 @@ static const struct xpad_device {
374382
{ 0x2563, 0x058d, "OneXPlayer Gamepad", 0, XTYPE_XBOX360 },
375383
{ 0x294b, 0x3303, "Snakebyte GAMEPAD BASE X", 0, XTYPE_XBOXONE },
376384
{ 0x294b, 0x3404, "Snakebyte GAMEPAD RGB X", 0, XTYPE_XBOXONE },
385+
{ 0x2993, 0x2001, "TECNO Pocket Go", 0, XTYPE_XBOX360 },
377386
{ 0x2dc8, 0x2000, "8BitDo Pro 2 Wired Controller fox Xbox", 0, XTYPE_XBOXONE },
378387
{ 0x2dc8, 0x3106, "8BitDo Ultimate Wireless / Pro 2 Wired Controller", 0, XTYPE_XBOX360 },
388+
{ 0x2dc8, 0x3109, "8BitDo Ultimate Wireless Bluetooth", 0, XTYPE_XBOX360 },
379389
{ 0x2dc8, 0x310a, "8BitDo Ultimate 2C Wireless Controller", 0, XTYPE_XBOX360 },
390+
{ 0x2dc8, 0x6001, "8BitDo SN30 Pro", 0, XTYPE_XBOX360 },
380391
{ 0x2e24, 0x0652, "Hyperkin Duke X-Box One pad", 0, XTYPE_XBOXONE },
392+
{ 0x2e24, 0x1688, "Hyperkin X91 X-Box One pad", 0, XTYPE_XBOXONE },
393+
{ 0x2e95, 0x0504, "SCUF Gaming Controller", MAP_SELECT_BUTTON, XTYPE_XBOXONE },
381394
{ 0x31e3, 0x1100, "Wooting One", 0, XTYPE_XBOX360 },
382395
{ 0x31e3, 0x1200, "Wooting Two", 0, XTYPE_XBOX360 },
383396
{ 0x31e3, 0x1210, "Wooting Lekker", 0, XTYPE_XBOX360 },
384397
{ 0x31e3, 0x1220, "Wooting Two HE", 0, XTYPE_XBOX360 },
385398
{ 0x31e3, 0x1230, "Wooting Two HE (ARM)", 0, XTYPE_XBOX360 },
386399
{ 0x31e3, 0x1300, "Wooting 60HE (AVR)", 0, XTYPE_XBOX360 },
387400
{ 0x31e3, 0x1310, "Wooting 60HE (ARM)", 0, XTYPE_XBOX360 },
401+
{ 0x3285, 0x0603, "Nacon Pro Compact controller for Xbox", 0, XTYPE_XBOXONE },
388402
{ 0x3285, 0x0607, "Nacon GC-100", 0, XTYPE_XBOX360 },
403+
{ 0x3285, 0x0614, "Nacon Pro Compact", 0, XTYPE_XBOXONE },
389404
{ 0x3285, 0x0646, "Nacon Pro Compact", 0, XTYPE_XBOXONE },
405+
{ 0x3285, 0x0662, "Nacon Revolution5 Pro", 0, XTYPE_XBOX360 },
390406
{ 0x3285, 0x0663, "Nacon Evol-X", 0, XTYPE_XBOXONE },
391407
{ 0x3537, 0x1004, "GameSir T4 Kaleid", 0, XTYPE_XBOX360 },
408+
{ 0x3537, 0x1010, "GameSir G7 SE", 0, XTYPE_XBOXONE },
392409
{ 0x3767, 0x0101, "Fanatec Speedster 3 Forceshock Wheel", 0, XTYPE_XBOX },
410+
{ 0x413d, 0x2104, "Black Shark Green Ghost Gamepad", 0, XTYPE_XBOX360 },
393411
{ 0xffff, 0xffff, "Chinese-made Xbox Controller", 0, XTYPE_XBOX },
394412
{ 0x0000, 0x0000, "Generic X-Box pad", 0, XTYPE_UNKNOWN }
395413
};
@@ -488,6 +506,7 @@ static const struct usb_device_id xpad_table[] = {
488506
XPAD_XBOX360_VENDOR(0x03f0), /* HP HyperX Xbox 360 controllers */
489507
XPAD_XBOXONE_VENDOR(0x03f0), /* HP HyperX Xbox One controllers */
490508
XPAD_XBOX360_VENDOR(0x044f), /* Thrustmaster Xbox 360 controllers */
509+
XPAD_XBOXONE_VENDOR(0x044f), /* Thrustmaster Xbox One controllers */
491510
XPAD_XBOX360_VENDOR(0x045e), /* Microsoft Xbox 360 controllers */
492511
XPAD_XBOXONE_VENDOR(0x045e), /* Microsoft Xbox One controllers */
493512
XPAD_XBOX360_VENDOR(0x046d), /* Logitech Xbox 360-style controllers */
@@ -519,26 +538,30 @@ static const struct usb_device_id xpad_table[] = {
519538
XPAD_XBOX360_VENDOR(0x1689), /* Razer Onza */
520539
XPAD_XBOX360_VENDOR(0x17ef), /* Lenovo */
521540
XPAD_XBOX360_VENDOR(0x1949), /* Amazon controllers */
522-
XPAD_XBOX360_VENDOR(0x1a86), /* QH Electronics */
541+
XPAD_XBOX360_VENDOR(0x1a86), /* Nanjing Qinheng Microelectronics (WCH) */
523542
XPAD_XBOX360_VENDOR(0x1bad), /* Harmonix Rock Band guitar and drums */
543+
XPAD_XBOX360_VENDOR(0x1ee9), /* ZOTAC Technology Limited */
524544
XPAD_XBOX360_VENDOR(0x20d6), /* PowerA controllers */
525545
XPAD_XBOXONE_VENDOR(0x20d6), /* PowerA controllers */
526546
XPAD_XBOX360_VENDOR(0x2345), /* Machenike Controllers */
527547
XPAD_XBOX360_VENDOR(0x24c6), /* PowerA controllers */
528548
XPAD_XBOXONE_VENDOR(0x24c6), /* PowerA controllers */
529549
XPAD_XBOX360_VENDOR(0x2563), /* OneXPlayer Gamepad */
530550
XPAD_XBOX360_VENDOR(0x260d), /* Dareu H101 */
531-
XPAD_XBOXONE_VENDOR(0x294b), /* Snakebyte */
551+
XPAD_XBOXONE_VENDOR(0x294b), /* Snakebyte */
552+
XPAD_XBOX360_VENDOR(0x2993), /* TECNO Mobile */
532553
XPAD_XBOX360_VENDOR(0x2c22), /* Qanba Controllers */
533-
XPAD_XBOX360_VENDOR(0x2dc8), /* 8BitDo Pro 2 Wired Controller */
534-
XPAD_XBOXONE_VENDOR(0x2dc8), /* 8BitDo Pro 2 Wired Controller for Xbox */
535-
XPAD_XBOXONE_VENDOR(0x2e24), /* Hyperkin Duke Xbox One pad */
536-
XPAD_XBOX360_VENDOR(0x2f24), /* GameSir controllers */
554+
XPAD_XBOX360_VENDOR(0x2dc8), /* 8BitDo Controllers */
555+
XPAD_XBOXONE_VENDOR(0x2dc8), /* 8BitDo Controllers */
556+
XPAD_XBOXONE_VENDOR(0x2e24), /* Hyperkin Controllers */
557+
XPAD_XBOX360_VENDOR(0x2f24), /* GameSir Controllers */
558+
XPAD_XBOXONE_VENDOR(0x2e95), /* SCUF Gaming Controller */
537559
XPAD_XBOX360_VENDOR(0x31e3), /* Wooting Keyboards */
538560
XPAD_XBOX360_VENDOR(0x3285), /* Nacon GC-100 */
539561
XPAD_XBOXONE_VENDOR(0x3285), /* Nacon Evol-X */
540562
XPAD_XBOX360_VENDOR(0x3537), /* GameSir Controllers */
541563
XPAD_XBOXONE_VENDOR(0x3537), /* GameSir Controllers */
564+
XPAD_XBOX360_VENDOR(0x413d), /* Black Shark Green Ghost Controller */
542565
{ }
543566
};
544567

@@ -691,7 +714,9 @@ static const struct xboxone_init_packet xboxone_init_packets[] = {
691714
XBOXONE_INIT_PKT(0x045e, 0x0b00, xboxone_s_init),
692715
XBOXONE_INIT_PKT(0x045e, 0x0b00, extra_input_packet_init),
693716
XBOXONE_INIT_PKT(0x0e6f, 0x0000, xboxone_pdp_led_on),
717+
XBOXONE_INIT_PKT(0x20d6, 0xa01a, xboxone_pdp_led_on),
694718
XBOXONE_INIT_PKT(0x0e6f, 0x0000, xboxone_pdp_auth),
719+
XBOXONE_INIT_PKT(0x20d6, 0xa01a, xboxone_pdp_auth),
695720
XBOXONE_INIT_PKT(0x24c6, 0x541a, xboxone_rumblebegin_init),
696721
XBOXONE_INIT_PKT(0x24c6, 0x542a, xboxone_rumblebegin_init),
697722
XBOXONE_INIT_PKT(0x24c6, 0x543a, xboxone_rumblebegin_init),

drivers/input/misc/iqs7222.c

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,11 @@ enum iqs7222_reg_key_id {
100100

101101
enum iqs7222_reg_grp_id {
102102
IQS7222_REG_GRP_STAT,
103-
IQS7222_REG_GRP_FILT,
104103
IQS7222_REG_GRP_CYCLE,
105104
IQS7222_REG_GRP_GLBL,
106105
IQS7222_REG_GRP_BTN,
107106
IQS7222_REG_GRP_CHAN,
107+
IQS7222_REG_GRP_FILT,
108108
IQS7222_REG_GRP_SLDR,
109109
IQS7222_REG_GRP_TPAD,
110110
IQS7222_REG_GRP_GPIO,
@@ -286,6 +286,7 @@ static const struct iqs7222_event_desc iqs7222_tp_events[] = {
286286

287287
struct iqs7222_reg_grp_desc {
288288
u16 base;
289+
u16 val_len;
289290
int num_row;
290291
int num_col;
291292
};
@@ -342,6 +343,7 @@ static const struct iqs7222_dev_desc iqs7222_devs[] = {
342343
},
343344
[IQS7222_REG_GRP_FILT] = {
344345
.base = 0xAC00,
346+
.val_len = 3,
345347
.num_row = 1,
346348
.num_col = 2,
347349
},
@@ -400,6 +402,7 @@ static const struct iqs7222_dev_desc iqs7222_devs[] = {
400402
},
401403
[IQS7222_REG_GRP_FILT] = {
402404
.base = 0xAC00,
405+
.val_len = 3,
403406
.num_row = 1,
404407
.num_col = 2,
405408
},
@@ -454,6 +457,7 @@ static const struct iqs7222_dev_desc iqs7222_devs[] = {
454457
},
455458
[IQS7222_REG_GRP_FILT] = {
456459
.base = 0xC400,
460+
.val_len = 3,
457461
.num_row = 1,
458462
.num_col = 2,
459463
},
@@ -496,6 +500,7 @@ static const struct iqs7222_dev_desc iqs7222_devs[] = {
496500
},
497501
[IQS7222_REG_GRP_FILT] = {
498502
.base = 0xC400,
503+
.val_len = 3,
499504
.num_row = 1,
500505
.num_col = 2,
501506
},
@@ -543,6 +548,7 @@ static const struct iqs7222_dev_desc iqs7222_devs[] = {
543548
},
544549
[IQS7222_REG_GRP_FILT] = {
545550
.base = 0xAA00,
551+
.val_len = 3,
546552
.num_row = 1,
547553
.num_col = 2,
548554
},
@@ -600,6 +606,7 @@ static const struct iqs7222_dev_desc iqs7222_devs[] = {
600606
},
601607
[IQS7222_REG_GRP_FILT] = {
602608
.base = 0xAA00,
609+
.val_len = 3,
603610
.num_row = 1,
604611
.num_col = 2,
605612
},
@@ -656,6 +663,7 @@ static const struct iqs7222_dev_desc iqs7222_devs[] = {
656663
},
657664
[IQS7222_REG_GRP_FILT] = {
658665
.base = 0xAE00,
666+
.val_len = 3,
659667
.num_row = 1,
660668
.num_col = 2,
661669
},
@@ -712,6 +720,7 @@ static const struct iqs7222_dev_desc iqs7222_devs[] = {
712720
},
713721
[IQS7222_REG_GRP_FILT] = {
714722
.base = 0xAE00,
723+
.val_len = 3,
715724
.num_row = 1,
716725
.num_col = 2,
717726
},
@@ -768,6 +777,7 @@ static const struct iqs7222_dev_desc iqs7222_devs[] = {
768777
},
769778
[IQS7222_REG_GRP_FILT] = {
770779
.base = 0xAE00,
780+
.val_len = 3,
771781
.num_row = 1,
772782
.num_col = 2,
773783
},
@@ -1604,7 +1614,7 @@ static int iqs7222_force_comms(struct iqs7222_private *iqs7222)
16041614
}
16051615

16061616
static int iqs7222_read_burst(struct iqs7222_private *iqs7222,
1607-
u16 reg, void *val, u16 num_val)
1617+
u16 reg, void *val, u16 val_len)
16081618
{
16091619
u8 reg_buf[sizeof(__be16)];
16101620
int ret, i;
@@ -1619,7 +1629,7 @@ static int iqs7222_read_burst(struct iqs7222_private *iqs7222,
16191629
{
16201630
.addr = client->addr,
16211631
.flags = I2C_M_RD,
1622-
.len = num_val * sizeof(__le16),
1632+
.len = val_len,
16231633
.buf = (u8 *)val,
16241634
},
16251635
};
@@ -1675,7 +1685,7 @@ static int iqs7222_read_word(struct iqs7222_private *iqs7222, u16 reg, u16 *val)
16751685
__le16 val_buf;
16761686
int error;
16771687

1678-
error = iqs7222_read_burst(iqs7222, reg, &val_buf, 1);
1688+
error = iqs7222_read_burst(iqs7222, reg, &val_buf, sizeof(val_buf));
16791689
if (error)
16801690
return error;
16811691

@@ -1685,10 +1695,9 @@ static int iqs7222_read_word(struct iqs7222_private *iqs7222, u16 reg, u16 *val)
16851695
}
16861696

16871697
static int iqs7222_write_burst(struct iqs7222_private *iqs7222,
1688-
u16 reg, const void *val, u16 num_val)
1698+
u16 reg, const void *val, u16 val_len)
16891699
{
16901700
int reg_len = reg > U8_MAX ? sizeof(reg) : sizeof(u8);
1691-
int val_len = num_val * sizeof(__le16);
16921701
int msg_len = reg_len + val_len;
16931702
int ret, i;
16941703
struct i2c_client *client = iqs7222->client;
@@ -1747,7 +1756,7 @@ static int iqs7222_write_word(struct iqs7222_private *iqs7222, u16 reg, u16 val)
17471756
{
17481757
__le16 val_buf = cpu_to_le16(val);
17491758

1750-
return iqs7222_write_burst(iqs7222, reg, &val_buf, 1);
1759+
return iqs7222_write_burst(iqs7222, reg, &val_buf, sizeof(val_buf));
17511760
}
17521761

17531762
static int iqs7222_ati_trigger(struct iqs7222_private *iqs7222)
@@ -1831,30 +1840,14 @@ static int iqs7222_dev_init(struct iqs7222_private *iqs7222, int dir)
18311840

18321841
/*
18331842
* Acknowledge reset before writing any registers in case the device
1834-
* suffers a spurious reset during initialization. Because this step
1835-
* may change the reserved fields of the second filter beta register,
1836-
* its cache must be updated.
1837-
*
1838-
* Writing the second filter beta register, in turn, may clobber the
1839-
* system status register. As such, the filter beta register pair is
1840-
* written first to protect against this hazard.
1843+
* suffers a spurious reset during initialization.
18411844
*/
18421845
if (dir == WRITE) {
1843-
u16 reg = dev_desc->reg_grps[IQS7222_REG_GRP_FILT].base + 1;
1844-
u16 filt_setup;
1845-
18461846
error = iqs7222_write_word(iqs7222, IQS7222_SYS_SETUP,
18471847
iqs7222->sys_setup[0] |
18481848
IQS7222_SYS_SETUP_ACK_RESET);
18491849
if (error)
18501850
return error;
1851-
1852-
error = iqs7222_read_word(iqs7222, reg, &filt_setup);
1853-
if (error)
1854-
return error;
1855-
1856-
iqs7222->filt_setup[1] &= GENMASK(7, 0);
1857-
iqs7222->filt_setup[1] |= (filt_setup & ~GENMASK(7, 0));
18581851
}
18591852

18601853
/*
@@ -1883,6 +1876,7 @@ static int iqs7222_dev_init(struct iqs7222_private *iqs7222, int dir)
18831876
int num_col = dev_desc->reg_grps[i].num_col;
18841877
u16 reg = dev_desc->reg_grps[i].base;
18851878
__le16 *val_buf;
1879+
u16 val_len = dev_desc->reg_grps[i].val_len ? : num_col * sizeof(*val_buf);
18861880
u16 *val;
18871881

18881882
if (!num_col)
@@ -1900,7 +1894,7 @@ static int iqs7222_dev_init(struct iqs7222_private *iqs7222, int dir)
19001894
switch (dir) {
19011895
case READ:
19021896
error = iqs7222_read_burst(iqs7222, reg,
1903-
val_buf, num_col);
1897+
val_buf, val_len);
19041898
for (k = 0; k < num_col; k++)
19051899
val[k] = le16_to_cpu(val_buf[k]);
19061900
break;
@@ -1909,7 +1903,7 @@ static int iqs7222_dev_init(struct iqs7222_private *iqs7222, int dir)
19091903
for (k = 0; k < num_col; k++)
19101904
val_buf[k] = cpu_to_le16(val[k]);
19111905
error = iqs7222_write_burst(iqs7222, reg,
1912-
val_buf, num_col);
1906+
val_buf, val_len);
19131907
break;
19141908

19151909
default:
@@ -1962,7 +1956,7 @@ static int iqs7222_dev_info(struct iqs7222_private *iqs7222)
19621956
int error, i;
19631957

19641958
error = iqs7222_read_burst(iqs7222, IQS7222_PROD_NUM, dev_id,
1965-
ARRAY_SIZE(dev_id));
1959+
sizeof(dev_id));
19661960
if (error)
19671961
return error;
19681962

@@ -2915,7 +2909,7 @@ static int iqs7222_report(struct iqs7222_private *iqs7222)
29152909
__le16 status[IQS7222_MAX_COLS_STAT];
29162910

29172911
error = iqs7222_read_burst(iqs7222, IQS7222_SYS_STATUS, status,
2918-
num_stat);
2912+
num_stat * sizeof(*status));
29192913
if (error)
29202914
return error;
29212915

0 commit comments

Comments
 (0)