Skip to content

Commit d86561b

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: "Just a few fixups to various drivers" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: elantech - fix touchpad initialization on Gigabyte U2442 Input: tca8418 - fix loading this driver as a module from a device tree Input: bma150 - extend chip detection for bma180 Input: atkbd - fix keyboard not working on some LG laptops Input: synaptics - add min/max quirk for ThinkPad Edge E431
2 parents c6c96d7 + 36189cc commit d86561b

File tree

7 files changed

+76
-4
lines changed

7 files changed

+76
-4
lines changed

Documentation/input/elantech.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,9 +504,12 @@ byte 5:
504504
* reg_10
505505

506506
bit 7 6 5 4 3 2 1 0
507-
0 0 0 0 0 0 0 A
507+
0 0 0 0 R F T A
508508

509509
A: 1 = enable absolute tracking
510+
T: 1 = enable two finger mode auto correct
511+
F: 1 = disable ABS Position Filter
512+
R: 1 = enable real hardware resolution
510513

511514
6.2 Native absolute mode 6 byte packet format
512515
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

drivers/input/keyboard/atkbd.c

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,12 @@ static void (*atkbd_platform_fixup)(struct atkbd *, const void *data);
243243
static void *atkbd_platform_fixup_data;
244244
static unsigned int (*atkbd_platform_scancode_fixup)(struct atkbd *, unsigned int);
245245

246+
/*
247+
* Certain keyboards to not like ATKBD_CMD_RESET_DIS and stop responding
248+
* to many commands until full reset (ATKBD_CMD_RESET_BAT) is performed.
249+
*/
250+
static bool atkbd_skip_deactivate;
251+
246252
static ssize_t atkbd_attr_show_helper(struct device *dev, char *buf,
247253
ssize_t (*handler)(struct atkbd *, char *));
248254
static ssize_t atkbd_attr_set_helper(struct device *dev, const char *buf, size_t count,
@@ -768,7 +774,8 @@ static int atkbd_probe(struct atkbd *atkbd)
768774
* Make sure nothing is coming from the keyboard and disturbs our
769775
* internal state.
770776
*/
771-
atkbd_deactivate(atkbd);
777+
if (!atkbd_skip_deactivate)
778+
atkbd_deactivate(atkbd);
772779

773780
return 0;
774781
}
@@ -1638,6 +1645,12 @@ static int __init atkbd_setup_scancode_fixup(const struct dmi_system_id *id)
16381645
return 1;
16391646
}
16401647

1648+
static int __init atkbd_deactivate_fixup(const struct dmi_system_id *id)
1649+
{
1650+
atkbd_skip_deactivate = true;
1651+
return 1;
1652+
}
1653+
16411654
static const struct dmi_system_id atkbd_dmi_quirk_table[] __initconst = {
16421655
{
16431656
.matches = {
@@ -1775,6 +1788,20 @@ static const struct dmi_system_id atkbd_dmi_quirk_table[] __initconst = {
17751788
.callback = atkbd_setup_scancode_fixup,
17761789
.driver_data = atkbd_oqo_01plus_scancode_fixup,
17771790
},
1791+
{
1792+
.matches = {
1793+
DMI_MATCH(DMI_SYS_VENDOR, "LG Electronics"),
1794+
DMI_MATCH(DMI_PRODUCT_NAME, "LW25-B7HV"),
1795+
},
1796+
.callback = atkbd_deactivate_fixup,
1797+
},
1798+
{
1799+
.matches = {
1800+
DMI_MATCH(DMI_SYS_VENDOR, "LG Electronics"),
1801+
DMI_MATCH(DMI_PRODUCT_NAME, "P1-J273B"),
1802+
},
1803+
.callback = atkbd_deactivate_fixup,
1804+
},
17781805
{ }
17791806
};
17801807

drivers/input/keyboard/tca8418_keypad.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,13 @@ static const struct of_device_id tca8418_dt_ids[] = {
392392
{ }
393393
};
394394
MODULE_DEVICE_TABLE(of, tca8418_dt_ids);
395+
396+
/*
397+
* The device tree based i2c loader looks for
398+
* "i2c:" + second_component_of(property("compatible"))
399+
* and therefore we need an alias to be found.
400+
*/
401+
MODULE_ALIAS("i2c:tca8418");
395402
#endif
396403

397404
static struct i2c_driver tca8418_keypad_driver = {

drivers/input/misc/bma150.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
#define BMA150_CFG_5_REG 0x11
7171

7272
#define BMA150_CHIP_ID 2
73+
#define BMA180_CHIP_ID 3
7374
#define BMA150_CHIP_ID_REG BMA150_DATA_0_REG
7475

7576
#define BMA150_ACC_X_LSB_REG BMA150_DATA_2_REG
@@ -539,7 +540,7 @@ static int bma150_probe(struct i2c_client *client,
539540
}
540541

541542
chip_id = i2c_smbus_read_byte_data(client, BMA150_CHIP_ID_REG);
542-
if (chip_id != BMA150_CHIP_ID) {
543+
if (chip_id != BMA150_CHIP_ID && chip_id != BMA180_CHIP_ID) {
543544
dev_err(&client->dev, "BMA150 chip id error: %d\n", chip_id);
544545
return -EINVAL;
545546
}
@@ -643,6 +644,7 @@ static UNIVERSAL_DEV_PM_OPS(bma150_pm, bma150_suspend, bma150_resume, NULL);
643644

644645
static const struct i2c_device_id bma150_id[] = {
645646
{ "bma150", 0 },
647+
{ "bma180", 0 },
646648
{ "smb380", 0 },
647649
{ "bma023", 0 },
648650
{ }

drivers/input/mouse/elantech.c

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
*/
1212

1313
#include <linux/delay.h>
14+
#include <linux/dmi.h>
1415
#include <linux/slab.h>
1516
#include <linux/module.h>
1617
#include <linux/input.h>
@@ -831,7 +832,11 @@ static int elantech_set_absolute_mode(struct psmouse *psmouse)
831832
break;
832833

833834
case 3:
834-
etd->reg_10 = 0x0b;
835+
if (etd->set_hw_resolution)
836+
etd->reg_10 = 0x0b;
837+
else
838+
etd->reg_10 = 0x03;
839+
835840
if (elantech_write_reg(psmouse, 0x10, etd->reg_10))
836841
rc = -1;
837842

@@ -1330,6 +1335,22 @@ static int elantech_reconnect(struct psmouse *psmouse)
13301335
return 0;
13311336
}
13321337

1338+
/*
1339+
* Some hw_version 3 models go into error state when we try to set bit 3 of r10
1340+
*/
1341+
static const struct dmi_system_id no_hw_res_dmi_table[] = {
1342+
#if defined(CONFIG_DMI) && defined(CONFIG_X86)
1343+
{
1344+
/* Gigabyte U2442 */
1345+
.matches = {
1346+
DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
1347+
DMI_MATCH(DMI_PRODUCT_NAME, "U2442"),
1348+
},
1349+
},
1350+
#endif
1351+
{ }
1352+
};
1353+
13331354
/*
13341355
* determine hardware version and set some properties according to it.
13351356
*/
@@ -1390,6 +1411,9 @@ static int elantech_set_properties(struct elantech_data *etd)
13901411
*/
13911412
etd->crc_enabled = ((etd->fw_version & 0x4000) == 0x4000);
13921413

1414+
/* Enable real hardware resolution on hw_version 3 ? */
1415+
etd->set_hw_resolution = !dmi_check_system(no_hw_res_dmi_table);
1416+
13931417
return 0;
13941418
}
13951419

drivers/input/mouse/elantech.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ struct elantech_data {
130130
bool jumpy_cursor;
131131
bool reports_pressure;
132132
bool crc_enabled;
133+
bool set_hw_resolution;
133134
unsigned char hw_version;
134135
unsigned int fw_version;
135136
unsigned int single_finger_reports;

drivers/input/mouse/synaptics.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1565,6 +1565,14 @@ static const struct dmi_system_id min_max_dmi_table[] __initconst = {
15651565
},
15661566
.driver_data = (int []){1232, 5710, 1156, 4696},
15671567
},
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+
},
15681576
{
15691577
/* Lenovo ThinkPad T431s */
15701578
.matches = {

0 commit comments

Comments
 (0)