aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorBenson Leung <bleung@chromium.org>2016-05-01 20:57:16 -0400
committerOlof Johansson <olof@lixom.net>2016-05-11 14:55:48 -0400
commit9bd9a90b013c647ed88ed4fa69b664b770924cf0 (patch)
tree70e6a0bd06efd1e290605ebcf898efd1878a0dbe /drivers/platform
parent2521ea3e0d1b285cea371a38772d3eefa0490c71 (diff)
platform/chrome: chromeos_laptop - Add elan trackpad option for C720
Add the elan trackpad to the Acer C720 (peppy) list, as it is an alternate trackpad option. It may exist at i2c address 0x15. Based on this change from the chromeos kernel : https://chromium-review.googlesource.com/186253 Signed-off-by: Benson Leung <bleung@chromium.org> Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/chrome/chromeos_laptop.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/drivers/platform/chrome/chromeos_laptop.c b/drivers/platform/chrome/chromeos_laptop.c
index f5aa0a361412..6ea4f1ad382a 100644
--- a/drivers/platform/chrome/chromeos_laptop.c
+++ b/drivers/platform/chrome/chromeos_laptop.c
@@ -34,6 +34,7 @@
34#define ATMEL_TS_I2C_ADDR 0x4a 34#define ATMEL_TS_I2C_ADDR 0x4a
35#define ATMEL_TS_I2C_BL_ADDR 0x26 35#define ATMEL_TS_I2C_BL_ADDR 0x26
36#define CYAPA_TP_I2C_ADDR 0x67 36#define CYAPA_TP_I2C_ADDR 0x67
37#define ELAN_TP_I2C_ADDR 0x15
37#define ISL_ALS_I2C_ADDR 0x44 38#define ISL_ALS_I2C_ADDR 0x44
38#define TAOS_ALS_I2C_ADDR 0x29 39#define TAOS_ALS_I2C_ADDR 0x29
39 40
@@ -73,7 +74,7 @@ struct i2c_peripheral {
73 int tries; 74 int tries;
74}; 75};
75 76
76#define MAX_I2C_PERIPHERALS 3 77#define MAX_I2C_PERIPHERALS 4
77 78
78struct chromeos_laptop { 79struct chromeos_laptop {
79 struct i2c_peripheral i2c_peripherals[MAX_I2C_PERIPHERALS]; 80 struct i2c_peripheral i2c_peripherals[MAX_I2C_PERIPHERALS];
@@ -86,6 +87,11 @@ static struct i2c_board_info cyapa_device = {
86 .flags = I2C_CLIENT_WAKE, 87 .flags = I2C_CLIENT_WAKE,
87}; 88};
88 89
90static struct i2c_board_info elantech_device = {
91 I2C_BOARD_INFO("elan_i2c", ELAN_TP_I2C_ADDR),
92 .flags = I2C_CLIENT_WAKE,
93};
94
89static struct i2c_board_info isl_als_device = { 95static struct i2c_board_info isl_als_device = {
90 I2C_BOARD_INFO("isl29018", ISL_ALS_I2C_ADDR), 96 I2C_BOARD_INFO("isl29018", ISL_ALS_I2C_ADDR),
91}; 97};
@@ -306,6 +312,16 @@ static int setup_atmel_224s_tp(enum i2c_adapter_type type)
306 return (!tp) ? -EAGAIN : 0; 312 return (!tp) ? -EAGAIN : 0;
307} 313}
308 314
315static int setup_elantech_tp(enum i2c_adapter_type type)
316{
317 if (tp)
318 return 0;
319
320 /* add elantech touchpad */
321 tp = add_i2c_device("trackpad", type, &elantech_device);
322 return (!tp) ? -EAGAIN : 0;
323}
324
309static int setup_atmel_1664s_ts(enum i2c_adapter_type type) 325static int setup_atmel_1664s_ts(enum i2c_adapter_type type)
310{ 326{
311 const unsigned short addr_list[] = { ATMEL_TS_I2C_BL_ADDR, 327 const unsigned short addr_list[] = { ATMEL_TS_I2C_BL_ADDR,
@@ -475,6 +491,8 @@ static struct chromeos_laptop acer_c720 = {
475 { .add = setup_atmel_1664s_ts, I2C_ADAPTER_DESIGNWARE_1 }, 491 { .add = setup_atmel_1664s_ts, I2C_ADAPTER_DESIGNWARE_1 },
476 /* Touchpad. */ 492 /* Touchpad. */
477 { .add = setup_cyapa_tp, I2C_ADAPTER_DESIGNWARE_0 }, 493 { .add = setup_cyapa_tp, I2C_ADAPTER_DESIGNWARE_0 },
494 /* Elan Touchpad option. */
495 { .add = setup_elantech_tp, I2C_ADAPTER_DESIGNWARE_0 },
478 /* Light Sensor. */ 496 /* Light Sensor. */
479 { .add = setup_isl29018_als, I2C_ADAPTER_DESIGNWARE_1 }, 497 { .add = setup_isl29018_als, I2C_ADAPTER_DESIGNWARE_1 },
480 }, 498 },