Skip to content

Commit 0b51733

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input fixes from Dmitry Torokhov: "Switching a few devices with Synaptics over to SMbus and disabling SMbus on a couple devices with Elan touchpads as they need more plumbing on PS/2 side" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: synaptics - enable SMBus for HP EliteBook 840 G4 Input: elantech - disable elan-i2c for P52 and P72 Input: synaptics - enable RMI on ThinkPad T560 Input: omap-keypad - fix idle configuration to not block SoC idle states
2 parents bc38073 + 7a71712 commit 0b51733

File tree

3 files changed

+22
-14
lines changed

3 files changed

+22
-14
lines changed

drivers/input/keyboard/omap4-keypad.c

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,8 @@ static irqreturn_t omap4_keypad_irq_handler(int irq, void *dev_id)
126126
{
127127
struct omap4_keypad *keypad_data = dev_id;
128128

129-
if (kbd_read_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS)) {
130-
/* Disable interrupts */
131-
kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQENABLE,
132-
OMAP4_VAL_IRQDISABLE);
129+
if (kbd_read_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS))
133130
return IRQ_WAKE_THREAD;
134-
}
135131

136132
return IRQ_NONE;
137133
}
@@ -173,11 +169,6 @@ static irqreturn_t omap4_keypad_irq_thread_fn(int irq, void *dev_id)
173169
kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS,
174170
kbd_read_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS));
175171

176-
/* enable interrupts */
177-
kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQENABLE,
178-
OMAP4_DEF_IRQENABLE_EVENTEN |
179-
OMAP4_DEF_IRQENABLE_LONGKEY);
180-
181172
return IRQ_HANDLED;
182173
}
183174

@@ -214,9 +205,10 @@ static void omap4_keypad_close(struct input_dev *input)
214205

215206
disable_irq(keypad_data->irq);
216207

217-
/* Disable interrupts */
208+
/* Disable interrupts and wake-up events */
218209
kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQENABLE,
219210
OMAP4_VAL_IRQDISABLE);
211+
kbd_writel(keypad_data, OMAP4_KBD_WAKEUPENABLE, 0);
220212

221213
/* clear pending interrupts */
222214
kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS,
@@ -365,7 +357,7 @@ static int omap4_keypad_probe(struct platform_device *pdev)
365357
}
366358

367359
error = request_threaded_irq(keypad_data->irq, omap4_keypad_irq_handler,
368-
omap4_keypad_irq_thread_fn, 0,
360+
omap4_keypad_irq_thread_fn, IRQF_ONESHOT,
369361
"omap4-keypad", keypad_data);
370362
if (error) {
371363
dev_err(&pdev->dev, "failed to register interrupt\n");

drivers/input/mouse/elantech.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1767,6 +1767,18 @@ static int elantech_smbus = IS_ENABLED(CONFIG_MOUSE_ELAN_I2C_SMBUS) ?
17671767
module_param_named(elantech_smbus, elantech_smbus, int, 0644);
17681768
MODULE_PARM_DESC(elantech_smbus, "Use a secondary bus for the Elantech device.");
17691769

1770+
static const char * const i2c_blacklist_pnp_ids[] = {
1771+
/*
1772+
* These are known to not be working properly as bits are missing
1773+
* in elan_i2c.
1774+
*/
1775+
"LEN2131", /* ThinkPad P52 w/ NFC */
1776+
"LEN2132", /* ThinkPad P52 */
1777+
"LEN2133", /* ThinkPad P72 w/ NFC */
1778+
"LEN2134", /* ThinkPad P72 */
1779+
NULL
1780+
};
1781+
17701782
static int elantech_create_smbus(struct psmouse *psmouse,
17711783
struct elantech_device_info *info,
17721784
bool leave_breadcrumbs)
@@ -1802,10 +1814,12 @@ static int elantech_setup_smbus(struct psmouse *psmouse,
18021814

18031815
if (elantech_smbus == ELANTECH_SMBUS_NOT_SET) {
18041816
/*
1805-
* New ICs are enabled by default.
1817+
* New ICs are enabled by default, unless mentioned in
1818+
* i2c_blacklist_pnp_ids.
18061819
* Old ICs are up to the user to decide.
18071820
*/
1808-
if (!ETP_NEW_IC_SMBUS_HOST_NOTIFY(info->fw_version))
1821+
if (!ETP_NEW_IC_SMBUS_HOST_NOTIFY(info->fw_version) ||
1822+
psmouse_matches_pnp_id(psmouse, i2c_blacklist_pnp_ids))
18091823
return -ENXIO;
18101824
}
18111825

drivers/input/mouse/synaptics.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,15 @@ static const char * const smbus_pnp_ids[] = {
171171
"LEN0046", /* X250 */
172172
"LEN004a", /* W541 */
173173
"LEN005b", /* P50 */
174+
"LEN005e", /* T560 */
174175
"LEN0071", /* T480 */
175176
"LEN0072", /* X1 Carbon Gen 5 (2017) - Elan/ALPS trackpoint */
176177
"LEN0073", /* X1 Carbon G5 (Elantech) */
177178
"LEN0092", /* X1 Carbon 6 */
178179
"LEN0096", /* X280 */
179180
"LEN0097", /* X280 -> ALPS trackpoint */
180181
"LEN200f", /* T450s */
182+
"SYN3052", /* HP EliteBook 840 G4 */
181183
"SYN3221", /* HP 15-ay000 */
182184
NULL
183185
};

0 commit comments

Comments
 (0)