aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86
diff options
context:
space:
mode:
authorYufeng Shen <miletus@chromium.org>2013-02-21 15:15:00 -0500
committerMatthew Garrett <matthew.garrett@nebula.com>2013-02-27 08:30:45 -0500
commit33a84f8a7694e442a624556ef3ae40e91e31bd11 (patch)
treef91023b8d091a2d063004b068b900de715bb1f88 /drivers/platform/x86
parentbcaf089c5160639d6c43091f717faa3d0dc8f3d8 (diff)
Platform: x86: chromeos_laptop - Add Pixel Touchscreen
Instantiate the atmel mxt1664s touchscreen on this system. The touchscreen may appear at two possible addresses: 0x4a in operational mode. 0x26 in bootloader mode. Signed-off-by: Yufeng Shen <miletus@chromium.org> Signed-off-by: Benson Leung <bleung@chromium.org> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Diffstat (limited to 'drivers/platform/x86')
-rw-r--r--drivers/platform/x86/chromeos_laptop.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/drivers/platform/x86/chromeos_laptop.c b/drivers/platform/x86/chromeos_laptop.c
index c13f0c5e282a..e5380e772b26 100644
--- a/drivers/platform/x86/chromeos_laptop.c
+++ b/drivers/platform/x86/chromeos_laptop.c
@@ -27,12 +27,15 @@
27 27
28#define ATMEL_TP_I2C_ADDR 0x4b 28#define ATMEL_TP_I2C_ADDR 0x4b
29#define ATMEL_TP_I2C_BL_ADDR 0x25 29#define ATMEL_TP_I2C_BL_ADDR 0x25
30#define ATMEL_TS_I2C_ADDR 0x4a
31#define ATMEL_TS_I2C_BL_ADDR 0x26
30#define CYAPA_TP_I2C_ADDR 0x67 32#define CYAPA_TP_I2C_ADDR 0x67
31#define ISL_ALS_I2C_ADDR 0x44 33#define ISL_ALS_I2C_ADDR 0x44
32#define TAOS_ALS_I2C_ADDR 0x29 34#define TAOS_ALS_I2C_ADDR 0x29
33 35
34static struct i2c_client *als; 36static struct i2c_client *als;
35static struct i2c_client *tp; 37static struct i2c_client *tp;
38static struct i2c_client *ts;
36 39
37const char *i2c_adapter_names[] = { 40const char *i2c_adapter_names[] = {
38 "SMBus I801 adapter", 41 "SMBus I801 adapter",
@@ -66,6 +69,12 @@ static struct i2c_board_info __initdata atmel_224s_tp_device = {
66 .flags = I2C_CLIENT_WAKE, 69 .flags = I2C_CLIENT_WAKE,
67}; 70};
68 71
72static struct i2c_board_info __initdata atmel_1664s_device = {
73 I2C_BOARD_INFO("atmel_mxt_ts", ATMEL_TS_I2C_ADDR),
74 .platform_data = NULL,
75 .flags = I2C_CLIENT_WAKE,
76};
77
69static struct i2c_client __init *__add_probed_i2c_device( 78static struct i2c_client __init *__add_probed_i2c_device(
70 const char *name, 79 const char *name,
71 int bus, 80 int bus,
@@ -201,6 +210,18 @@ static int __init setup_atmel_224s_tp(const struct dmi_system_id *id)
201 return 0; 210 return 0;
202} 211}
203 212
213static int __init setup_atmel_1664s_ts(const struct dmi_system_id *id)
214{
215 const unsigned short addr_list[] = { ATMEL_TS_I2C_BL_ADDR,
216 ATMEL_TS_I2C_ADDR,
217 I2C_CLIENT_END };
218
219 /* add atmel mxt touch device on PANEL GMBus */
220 ts = add_probed_i2c_device("touchscreen", I2C_ADAPTER_PANEL,
221 &atmel_1664s_device, addr_list);
222 return 0;
223}
224
204 225
205static int __init setup_isl29018_als(const struct dmi_system_id *id) 226static int __init setup_isl29018_als(const struct dmi_system_id *id)
206{ 227{
@@ -233,6 +254,14 @@ static struct dmi_system_id __initdata chromeos_laptop_dmi_table[] = {
233 .callback = setup_cyapa_smbus_tp, 254 .callback = setup_cyapa_smbus_tp,
234 }, 255 },
235 { 256 {
257 .ident = "Chromebook Pixel - Touchscreen",
258 .matches = {
259 DMI_MATCH(DMI_SYS_VENDOR, "GOOGLE"),
260 DMI_MATCH(DMI_PRODUCT_NAME, "Link"),
261 },
262 .callback = setup_atmel_1664s_ts,
263 },
264 {
236 .ident = "Chromebook Pixel - Touchpad", 265 .ident = "Chromebook Pixel - Touchpad",
237 .matches = { 266 .matches = {
238 DMI_MATCH(DMI_SYS_VENDOR, "GOOGLE"), 267 DMI_MATCH(DMI_SYS_VENDOR, "GOOGLE"),
@@ -302,6 +331,8 @@ static void __exit chromeos_laptop_exit(void)
302 i2c_unregister_device(als); 331 i2c_unregister_device(als);
303 if (tp) 332 if (tp)
304 i2c_unregister_device(tp); 333 i2c_unregister_device(tp);
334 if (ts)
335 i2c_unregister_device(ts);
305} 336}
306 337
307module_init(chromeos_laptop_init); 338module_init(chromeos_laptop_init);