Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1487385

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input subsystem fixes from Dmitry Torokhov: "A couple of driver/build fixups and also redone quirk for Synaptics touchpads on Lenovo boxes (now using PNP IDs instead of DMI data to limit number of quirks)" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: synaptics - change min/max quirk table to pnp-id matching Input: synaptics - add a matches_pnp_id helper function Input: synaptics - T540p - unify with other LEN0034 models Input: synaptics - add min/max quirk for the ThinkPad W540 Input: ambakmi - request a shared interrupt for AMBA KMI devices Input: pxa27x-keypad - fix generating scancode Input: atmel-wm97xx - only build for AVR32 Input: fix ps2/serio module dependency
2 parents 1326af2 + 0f68f39 commit 1487385

File tree

6 files changed

+61
-121
lines changed

6 files changed

+61
-121
lines changed

drivers/input/keyboard/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ config KEYBOARD_ATKBD
7171
default y
7272
select SERIO
7373
select SERIO_LIBPS2
74-
select SERIO_I8042 if X86
74+
select SERIO_I8042 if ARCH_MIGHT_HAVE_PC_SERIO
7575
select SERIO_GSCPS2 if GSC
7676
help
7777
Say Y here if you want to use a standard AT or PS/2 keyboard. Usually

drivers/input/keyboard/pxa27x_keypad.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ struct pxa27x_keypad {
111111
unsigned short keycodes[MAX_KEYPAD_KEYS];
112112
int rotary_rel_code[2];
113113

114+
unsigned int row_shift;
115+
114116
/* state row bits of each column scan */
115117
uint32_t matrix_key_state[MAX_MATRIX_KEY_COLS];
116118
uint32_t direct_key_state;
@@ -467,7 +469,8 @@ static void pxa27x_keypad_scan_matrix(struct pxa27x_keypad *keypad)
467469
if ((bits_changed & (1 << row)) == 0)
468470
continue;
469471

470-
code = MATRIX_SCAN_CODE(row, col, MATRIX_ROW_SHIFT);
472+
code = MATRIX_SCAN_CODE(row, col, keypad->row_shift);
473+
471474
input_event(input_dev, EV_MSC, MSC_SCAN, code);
472475
input_report_key(input_dev, keypad->keycodes[code],
473476
new_state[col] & (1 << row));
@@ -802,6 +805,8 @@ static int pxa27x_keypad_probe(struct platform_device *pdev)
802805
goto failed_put_clk;
803806
}
804807

808+
keypad->row_shift = get_count_order(pdata->matrix_key_cols);
809+
805810
if ((pdata->enable_rotary0 && keypad->rotary_rel_code[0] != -1) ||
806811
(pdata->enable_rotary1 && keypad->rotary_rel_code[1] != -1)) {
807812
input_dev->evbit[0] |= BIT_MASK(EV_REL);

drivers/input/mouse/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ config MOUSE_PS2
1717
default y
1818
select SERIO
1919
select SERIO_LIBPS2
20-
select SERIO_I8042 if X86
20+
select SERIO_I8042 if ARCH_MIGHT_HAVE_PC_SERIO
2121
select SERIO_GSCPS2 if GSC
2222
help
2323
Say Y here if you have a PS/2 mouse connected to your system. This

drivers/input/mouse/synaptics.c

Lines changed: 50 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,31 @@ void synaptics_reset(struct psmouse *psmouse)
117117
}
118118

119119
#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+
120145
/* This list has been kindly provided by Synaptics. */
121146
static const char * const topbuttonpad_pnp_ids[] = {
122147
"LEN0017",
@@ -129,7 +154,7 @@ static const char * const topbuttonpad_pnp_ids[] = {
129154
"LEN002D",
130155
"LEN002E",
131156
"LEN0033", /* Helix */
132-
"LEN0034", /* T431s, T540, X1 Carbon 2nd */
157+
"LEN0034", /* T431s, L440, L540, T540, W540, X1 Carbon 2nd */
133158
"LEN0035", /* X240 */
134159
"LEN0036", /* T440 */
135160
"LEN0037",
@@ -142,7 +167,7 @@ static const char * const topbuttonpad_pnp_ids[] = {
142167
"LEN0048",
143168
"LEN0049",
144169
"LEN2000",
145-
"LEN2001",
170+
"LEN2001", /* Edge E431 */
146171
"LEN2002",
147172
"LEN2003",
148173
"LEN2004", /* L440 */
@@ -156,6 +181,18 @@ static const char * const topbuttonpad_pnp_ids[] = {
156181
NULL
157182
};
158183

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+
159196
/*****************************************************************************
160197
* Synaptics communications functions
161198
****************************************************************************/
@@ -304,20 +341,20 @@ static int synaptics_identify(struct psmouse *psmouse)
304341
* Resolution is left zero if touchpad does not support the query
305342
*/
306343

307-
static const int *quirk_min_max;
308-
309344
static int synaptics_resolution(struct psmouse *psmouse)
310345
{
311346
struct synaptics_data *priv = psmouse->private;
312347
unsigned char resp[3];
348+
int i;
313349

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+
}
321358

322359
if (SYN_ID_MAJOR(priv->identity) < 4)
323360
return 0;
@@ -1365,17 +1402,8 @@ static void set_input_params(struct psmouse *psmouse,
13651402

13661403
if (SYN_CAP_CLICKPAD(priv->ext_cap_0c)) {
13671404
__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);
13791407
/* Clickpads report only left button */
13801408
__clear_bit(BTN_RIGHT, dev->keybit);
13811409
__clear_bit(BTN_MIDDLE, dev->keybit);
@@ -1547,104 +1575,10 @@ static const struct dmi_system_id olpc_dmi_table[] __initconst = {
15471575
{ }
15481576
};
15491577

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-
16381578
void __init synaptics_module_init(void)
16391579
{
1640-
const struct dmi_system_id *min_max_dmi;
1641-
16421580
impaired_toshiba_kbc = dmi_check_system(toshiba_dmi_table);
16431581
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;
16481582
}
16491583

16501584
static int __synaptics_init(struct psmouse *psmouse, bool absolute_mode)

drivers/input/serio/ambakmi.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ static int amba_kmi_open(struct serio *io)
7979
writeb(divisor, KMICLKDIV);
8080
writeb(KMICR_EN, KMICR);
8181

82-
ret = request_irq(kmi->irq, amba_kmi_int, 0, "kmi-pl050", kmi);
82+
ret = request_irq(kmi->irq, amba_kmi_int, IRQF_SHARED, "kmi-pl050",
83+
kmi);
8384
if (ret) {
8485
printk(KERN_ERR "kmi: failed to claim IRQ%d\n", kmi->irq);
8586
writeb(0, KMICR);

drivers/input/touchscreen/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ config TOUCHSCREEN_WM9713
640640

641641
config TOUCHSCREEN_WM97XX_ATMEL
642642
tristate "WM97xx Atmel accelerated touch"
643-
depends on TOUCHSCREEN_WM97XX && (AVR32 || ARCH_AT91)
643+
depends on TOUCHSCREEN_WM97XX && AVR32
644644
help
645645
Say Y here for support for streaming mode with WM97xx touchscreens
646646
on Atmel AT91 or AVR32 systems with an AC97C module.

0 commit comments

Comments
 (0)