@@ -117,6 +117,31 @@ void synaptics_reset(struct psmouse *psmouse)
117
117
}
118
118
119
119
#ifdef CONFIG_MOUSE_PS2_SYNAPTICS
120
+ struct min_max_quirk {
121
+ const char * const * pnp_ids ;
122
+ int x_min , x_max , y_min , y_max ;
123
+ };
124
+
125
+ static const struct min_max_quirk min_max_pnpid_table [] = {
126
+ {
127
+ (const char * const []){"LEN0033" , NULL },
128
+ 1024 , 5052 , 2258 , 4832
129
+ },
130
+ {
131
+ (const char * const []){"LEN0035" , "LEN0042" , NULL },
132
+ 1232 , 5710 , 1156 , 4696
133
+ },
134
+ {
135
+ (const char * const []){"LEN0034" , "LEN0036" , "LEN2004" , NULL },
136
+ 1024 , 5112 , 2024 , 4832
137
+ },
138
+ {
139
+ (const char * const []){"LEN2001" , NULL },
140
+ 1024 , 5022 , 2508 , 4832
141
+ },
142
+ { }
143
+ };
144
+
120
145
/* This list has been kindly provided by Synaptics. */
121
146
static const char * const topbuttonpad_pnp_ids [] = {
122
147
"LEN0017" ,
@@ -129,7 +154,7 @@ static const char * const topbuttonpad_pnp_ids[] = {
129
154
"LEN002D" ,
130
155
"LEN002E" ,
131
156
"LEN0033" , /* Helix */
132
- "LEN0034" , /* T431s, T540, X1 Carbon 2nd */
157
+ "LEN0034" , /* T431s, L440, L540, T540, W540 , X1 Carbon 2nd */
133
158
"LEN0035" , /* X240 */
134
159
"LEN0036" , /* T440 */
135
160
"LEN0037" ,
@@ -142,7 +167,7 @@ static const char * const topbuttonpad_pnp_ids[] = {
142
167
"LEN0048" ,
143
168
"LEN0049" ,
144
169
"LEN2000" ,
145
- "LEN2001" ,
170
+ "LEN2001" , /* Edge E431 */
146
171
"LEN2002" ,
147
172
"LEN2003" ,
148
173
"LEN2004" , /* L440 */
@@ -156,6 +181,18 @@ static const char * const topbuttonpad_pnp_ids[] = {
156
181
NULL
157
182
};
158
183
184
+ static bool matches_pnp_id (struct psmouse * psmouse , const char * const ids [])
185
+ {
186
+ int i ;
187
+
188
+ if (!strncmp (psmouse -> ps2dev .serio -> firmware_id , "PNP:" , 4 ))
189
+ for (i = 0 ; ids [i ]; i ++ )
190
+ if (strstr (psmouse -> ps2dev .serio -> firmware_id , ids [i ]))
191
+ return true;
192
+
193
+ return false;
194
+ }
195
+
159
196
/*****************************************************************************
160
197
* Synaptics communications functions
161
198
****************************************************************************/
@@ -304,20 +341,20 @@ static int synaptics_identify(struct psmouse *psmouse)
304
341
* Resolution is left zero if touchpad does not support the query
305
342
*/
306
343
307
- static const int * quirk_min_max ;
308
-
309
344
static int synaptics_resolution (struct psmouse * psmouse )
310
345
{
311
346
struct synaptics_data * priv = psmouse -> private ;
312
347
unsigned char resp [3 ];
348
+ int i ;
313
349
314
- if (quirk_min_max ) {
315
- priv -> x_min = quirk_min_max [0 ];
316
- priv -> x_max = quirk_min_max [1 ];
317
- priv -> y_min = quirk_min_max [2 ];
318
- priv -> y_max = quirk_min_max [3 ];
319
- return 0 ;
320
- }
350
+ for (i = 0 ; min_max_pnpid_table [i ].pnp_ids ; i ++ )
351
+ if (matches_pnp_id (psmouse , min_max_pnpid_table [i ].pnp_ids )) {
352
+ priv -> x_min = min_max_pnpid_table [i ].x_min ;
353
+ priv -> x_max = min_max_pnpid_table [i ].x_max ;
354
+ priv -> y_min = min_max_pnpid_table [i ].y_min ;
355
+ priv -> y_max = min_max_pnpid_table [i ].y_max ;
356
+ return 0 ;
357
+ }
321
358
322
359
if (SYN_ID_MAJOR (priv -> identity ) < 4 )
323
360
return 0 ;
@@ -1365,17 +1402,8 @@ static void set_input_params(struct psmouse *psmouse,
1365
1402
1366
1403
if (SYN_CAP_CLICKPAD (priv -> ext_cap_0c )) {
1367
1404
__set_bit (INPUT_PROP_BUTTONPAD , dev -> propbit );
1368
- /* See if this buttonpad has a top button area */
1369
- if (!strncmp (psmouse -> ps2dev .serio -> firmware_id , "PNP:" , 4 )) {
1370
- for (i = 0 ; topbuttonpad_pnp_ids [i ]; i ++ ) {
1371
- if (strstr (psmouse -> ps2dev .serio -> firmware_id ,
1372
- topbuttonpad_pnp_ids [i ])) {
1373
- __set_bit (INPUT_PROP_TOPBUTTONPAD ,
1374
- dev -> propbit );
1375
- break ;
1376
- }
1377
- }
1378
- }
1405
+ if (matches_pnp_id (psmouse , topbuttonpad_pnp_ids ))
1406
+ __set_bit (INPUT_PROP_TOPBUTTONPAD , dev -> propbit );
1379
1407
/* Clickpads report only left button */
1380
1408
__clear_bit (BTN_RIGHT , dev -> keybit );
1381
1409
__clear_bit (BTN_MIDDLE , dev -> keybit );
@@ -1547,104 +1575,10 @@ static const struct dmi_system_id olpc_dmi_table[] __initconst = {
1547
1575
{ }
1548
1576
};
1549
1577
1550
- static const struct dmi_system_id min_max_dmi_table [] __initconst = {
1551
- #if defined(CONFIG_DMI )
1552
- {
1553
- /* Lenovo ThinkPad Helix */
1554
- .matches = {
1555
- DMI_MATCH (DMI_SYS_VENDOR , "LENOVO" ),
1556
- DMI_MATCH (DMI_PRODUCT_VERSION , "ThinkPad Helix" ),
1557
- },
1558
- .driver_data = (int []){1024 , 5052 , 2258 , 4832 },
1559
- },
1560
- {
1561
- /* Lenovo ThinkPad X240 */
1562
- .matches = {
1563
- DMI_MATCH (DMI_SYS_VENDOR , "LENOVO" ),
1564
- DMI_MATCH (DMI_PRODUCT_VERSION , "ThinkPad X240" ),
1565
- },
1566
- .driver_data = (int []){1232 , 5710 , 1156 , 4696 },
1567
- },
1568
- {
1569
- /* Lenovo ThinkPad Edge E431 */
1570
- .matches = {
1571
- DMI_MATCH (DMI_SYS_VENDOR , "LENOVO" ),
1572
- DMI_MATCH (DMI_PRODUCT_VERSION , "ThinkPad Edge E431" ),
1573
- },
1574
- .driver_data = (int []){1024 , 5022 , 2508 , 4832 },
1575
- },
1576
- {
1577
- /* Lenovo ThinkPad T431s */
1578
- .matches = {
1579
- DMI_MATCH (DMI_SYS_VENDOR , "LENOVO" ),
1580
- DMI_MATCH (DMI_PRODUCT_VERSION , "ThinkPad T431" ),
1581
- },
1582
- .driver_data = (int []){1024 , 5112 , 2024 , 4832 },
1583
- },
1584
- {
1585
- /* Lenovo ThinkPad T440s */
1586
- .matches = {
1587
- DMI_MATCH (DMI_SYS_VENDOR , "LENOVO" ),
1588
- DMI_MATCH (DMI_PRODUCT_VERSION , "ThinkPad T440" ),
1589
- },
1590
- .driver_data = (int []){1024 , 5112 , 2024 , 4832 },
1591
- },
1592
- {
1593
- /* Lenovo ThinkPad L440 */
1594
- .matches = {
1595
- DMI_MATCH (DMI_SYS_VENDOR , "LENOVO" ),
1596
- DMI_MATCH (DMI_PRODUCT_VERSION , "ThinkPad L440" ),
1597
- },
1598
- .driver_data = (int []){1024 , 5112 , 2024 , 4832 },
1599
- },
1600
- {
1601
- /* Lenovo ThinkPad T540p */
1602
- .matches = {
1603
- DMI_MATCH (DMI_SYS_VENDOR , "LENOVO" ),
1604
- DMI_MATCH (DMI_PRODUCT_VERSION , "ThinkPad T540" ),
1605
- },
1606
- .driver_data = (int []){1024 , 5056 , 2058 , 4832 },
1607
- },
1608
- {
1609
- /* Lenovo ThinkPad L540 */
1610
- .matches = {
1611
- DMI_MATCH (DMI_SYS_VENDOR , "LENOVO" ),
1612
- DMI_MATCH (DMI_PRODUCT_VERSION , "ThinkPad L540" ),
1613
- },
1614
- .driver_data = (int []){1024 , 5112 , 2024 , 4832 },
1615
- },
1616
- {
1617
- /* Lenovo Yoga S1 */
1618
- .matches = {
1619
- DMI_MATCH (DMI_SYS_VENDOR , "LENOVO" ),
1620
- DMI_EXACT_MATCH (DMI_PRODUCT_VERSION ,
1621
- "ThinkPad S1 Yoga" ),
1622
- },
1623
- .driver_data = (int []){1232 , 5710 , 1156 , 4696 },
1624
- },
1625
- {
1626
- /* Lenovo ThinkPad X1 Carbon Haswell (3rd generation) */
1627
- .matches = {
1628
- DMI_MATCH (DMI_SYS_VENDOR , "LENOVO" ),
1629
- DMI_MATCH (DMI_PRODUCT_VERSION ,
1630
- "ThinkPad X1 Carbon 2nd" ),
1631
- },
1632
- .driver_data = (int []){1024 , 5112 , 2024 , 4832 },
1633
- },
1634
- #endif
1635
- { }
1636
- };
1637
-
1638
1578
void __init synaptics_module_init (void )
1639
1579
{
1640
- const struct dmi_system_id * min_max_dmi ;
1641
-
1642
1580
impaired_toshiba_kbc = dmi_check_system (toshiba_dmi_table );
1643
1581
broken_olpc_ec = dmi_check_system (olpc_dmi_table );
1644
-
1645
- min_max_dmi = dmi_first_match (min_max_dmi_table );
1646
- if (min_max_dmi )
1647
- quirk_min_max = min_max_dmi -> driver_data ;
1648
1582
}
1649
1583
1650
1584
static int __synaptics_init (struct psmouse * psmouse , bool absolute_mode )
0 commit comments