Skip to content

Commit bbdb5c2

Browse files
committed
Merge branch 'next' into for-linus
Prepare second round of input updates for 4.3 merge window.
2 parents e60e063 + 5e0baca commit bbdb5c2

File tree

9 files changed

+899
-703
lines changed

9 files changed

+899
-703
lines changed

Documentation/devicetree/bindings/input/touchscreen/tsc2005.txt

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
* Texas Instruments tsc2005 touchscreen controller
1+
* Texas Instruments tsc2004 and tsc2005 touchscreen controllers
22

33
Required properties:
4-
- compatible : "ti,tsc2005"
5-
- reg : SPI device address
6-
- spi-max-frequency : Maximal SPI speed
4+
- compatible : "ti,tsc2004" or "ti,tsc2005"
5+
- reg : Device address
76
- interrupts : IRQ specifier
8-
- reset-gpios : GPIO specifier
9-
- vio-supply : Regulator specifier
7+
- spi-max-frequency : Maximum SPI clocking speed of the device
8+
(for tsc2005)
109

1110
Optional properties:
11+
- vio-supply : Regulator specifier
12+
- reset-gpios : GPIO specifier for the controller reset line
1213
- ti,x-plate-ohms : integer, resistance of the touchscreen's X plates
1314
in ohm (defaults to 280)
1415
- ti,esd-recovery-timeout-ms : integer, if the touchscreen does not respond after
@@ -18,6 +19,27 @@ Optional properties:
1819

1920
Example:
2021

22+
&i2c3 {
23+
tsc2004@48 {
24+
compatible = "ti,tsc2004";
25+
reg = <0x48>;
26+
vio-supply = <&vio>;
27+
28+
reset-gpios = <&gpio4 8 GPIO_ACTIVE_HIGH>;
29+
interrupts-extended = <&gpio1 27 IRQ_TYPE_EDGE_RISING>;
30+
31+
touchscreen-fuzz-x = <4>;
32+
touchscreen-fuzz-y = <7>;
33+
touchscreen-fuzz-pressure = <2>;
34+
touchscreen-size-x = <4096>;
35+
touchscreen-size-y = <4096>;
36+
touchscreen-max-pressure = <2048>;
37+
38+
ti,x-plate-ohms = <280>;
39+
ti,esd-recovery-timeout-ms = <8000>;
40+
};
41+
}
42+
2143
&mcspi1 {
2244
tsc2005@0 {
2345
compatible = "ti,tsc2005";

drivers/input/mouse/elantech.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1520,6 +1520,13 @@ static const struct dmi_system_id elantech_dmi_force_crc_enabled[] = {
15201520
DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E544"),
15211521
},
15221522
},
1523+
{
1524+
/* Fujitsu LIFEBOOK U745 does not work with crc_enabled == 0 */
1525+
.matches = {
1526+
DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
1527+
DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK U745"),
1528+
},
1529+
},
15231530
#endif
15241531
{ }
15251532
};

drivers/input/serio/parkbd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ static int parkbd_getport(struct parport *pp)
164164
return 0;
165165
}
166166

167-
static struct serio * __init parkbd_allocate_serio(void)
167+
static struct serio *parkbd_allocate_serio(void)
168168
{
169169
struct serio *serio;
170170

drivers/input/touchscreen/Kconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -939,10 +939,27 @@ config TOUCHSCREEN_TSC_SERIO
939939
To compile this driver as a module, choose M here: the
940940
module will be called tsc40.
941941

942+
config TOUCHSCREEN_TSC200X_CORE
943+
tristate
944+
945+
config TOUCHSCREEN_TSC2004
946+
tristate "TSC2004 based touchscreens"
947+
depends on I2C
948+
select REGMAP_I2C
949+
select TOUCHSCREEN_TSC200X_CORE
950+
help
951+
Say Y here if you have a TSC2004 based touchscreen.
952+
953+
If unsure, say N.
954+
955+
To compile this driver as a module, choose M here: the
956+
module will be called tsc2004.
957+
942958
config TOUCHSCREEN_TSC2005
943959
tristate "TSC2005 based touchscreens"
944960
depends on SPI_MASTER
945961
select REGMAP_SPI
962+
select TOUCHSCREEN_TSC200X_CORE
946963
help
947964
Say Y here if you have a TSC2005 based touchscreen.
948965

drivers/input/touchscreen/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ obj-$(CONFIG_TOUCHSCREEN_TOUCHIT213) += touchit213.o
6969
obj-$(CONFIG_TOUCHSCREEN_TOUCHRIGHT) += touchright.o
7070
obj-$(CONFIG_TOUCHSCREEN_TOUCHWIN) += touchwin.o
7171
obj-$(CONFIG_TOUCHSCREEN_TSC_SERIO) += tsc40.o
72+
obj-$(CONFIG_TOUCHSCREEN_TSC200X_CORE) += tsc200x-core.o
73+
obj-$(CONFIG_TOUCHSCREEN_TSC2004) += tsc2004.o
7274
obj-$(CONFIG_TOUCHSCREEN_TSC2005) += tsc2005.o
7375
obj-$(CONFIG_TOUCHSCREEN_TSC2007) += tsc2007.o
7476
obj-$(CONFIG_TOUCHSCREEN_UCB1400) += ucb1400_ts.o

drivers/input/touchscreen/tsc2004.c

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
/*
2+
* TSC2004 touchscreen driver
3+
*
4+
* Copyright (C) 2015 QWERTY Embedded Design
5+
* Copyright (C) 2015 EMAC Inc.
6+
*
7+
* This program is free software; you can redistribute it and/or modify
8+
* it under the terms of the GNU General Public License as published by
9+
* the Free Software Foundation; either version 2 of the License, or
10+
* (at your option) any later version.
11+
*
12+
* This program is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU General Public License for more details.
16+
*/
17+
18+
#include <linux/module.h>
19+
#include <linux/input.h>
20+
#include <linux/of.h>
21+
#include <linux/i2c.h>
22+
#include <linux/regmap.h>
23+
#include "tsc200x-core.h"
24+
25+
static int tsc2004_cmd(struct device *dev, u8 cmd)
26+
{
27+
u8 tx = TSC200X_CMD | TSC200X_CMD_12BIT | cmd;
28+
s32 data;
29+
struct i2c_client *i2c = to_i2c_client(dev);
30+
31+
data = i2c_smbus_write_byte(i2c, tx);
32+
if (data < 0) {
33+
dev_err(dev, "%s: failed, command: %x i2c error: %d\n",
34+
__func__, cmd, data);
35+
return data;
36+
}
37+
38+
return 0;
39+
}
40+
41+
static int tsc2004_probe(struct i2c_client *i2c,
42+
const struct i2c_device_id *id)
43+
44+
{
45+
return tsc200x_probe(&i2c->dev, i2c->irq, BUS_I2C,
46+
devm_regmap_init_i2c(i2c, &tsc200x_regmap_config),
47+
tsc2004_cmd);
48+
}
49+
50+
static int tsc2004_remove(struct i2c_client *i2c)
51+
{
52+
return tsc200x_remove(&i2c->dev);
53+
}
54+
55+
static const struct i2c_device_id tsc2004_idtable[] = {
56+
{ "tsc2004", 0 },
57+
{ }
58+
};
59+
MODULE_DEVICE_TABLE(i2c, tsc2004_idtable);
60+
61+
#ifdef CONFIG_OF
62+
static const struct of_device_id tsc2004_of_match[] = {
63+
{ .compatible = "ti,tsc2004" },
64+
{ /* sentinel */ }
65+
};
66+
MODULE_DEVICE_TABLE(of, tsc2004_of_match);
67+
#endif
68+
69+
static struct i2c_driver tsc2004_driver = {
70+
.driver = {
71+
.name = "tsc2004",
72+
.of_match_table = of_match_ptr(tsc2004_of_match),
73+
.pm = &tsc200x_pm_ops,
74+
},
75+
.id_table = tsc2004_idtable,
76+
.probe = tsc2004_probe,
77+
.remove = tsc2004_remove,
78+
};
79+
module_i2c_driver(tsc2004_driver);
80+
81+
MODULE_AUTHOR("Michael Welling <mwelling@ieee.org>");
82+
MODULE_DESCRIPTION("TSC2004 Touchscreen Driver");
83+
MODULE_LICENSE("GPL");

0 commit comments

Comments
 (0)