aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorBenson Leung <bleung@chromium.org>2013-03-07 22:43:34 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-03-08 19:03:29 -0500
commit2ef392042debb86003e3e1d756960a2e53930b60 (patch)
treeb2742bb439843176523f4b257c7fbdfa51cfbc58 /drivers/platform
parent22dfab7fd7fd5a8a2c5556ca0a8fd35fc959abc8 (diff)
Platform: x86: chromeos_laptop : Add basic platform data for atmel devices
Add basic platform data to get the current upstream driver working with the 224s touchpad and 1664s touchscreen. We will be using NULL config so we will use the settings from the devices' NVRAMs. Signed-off-by: Benson Leung <bleung@chromium.org> Tested-by: Olof Johansson <olof@lixom.net> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/chromeos_laptop.c41
1 files changed, 39 insertions, 2 deletions
diff --git a/drivers/platform/x86/chromeos_laptop.c b/drivers/platform/x86/chromeos_laptop.c
index 93d66809355a..3e5b4497a1d0 100644
--- a/drivers/platform/x86/chromeos_laptop.c
+++ b/drivers/platform/x86/chromeos_laptop.c
@@ -23,6 +23,9 @@
23 23
24#include <linux/dmi.h> 24#include <linux/dmi.h>
25#include <linux/i2c.h> 25#include <linux/i2c.h>
26#include <linux/i2c/atmel_mxt_ts.h>
27#include <linux/input.h>
28#include <linux/interrupt.h>
26#include <linux/module.h> 29#include <linux/module.h>
27 30
28#define ATMEL_TP_I2C_ADDR 0x4b 31#define ATMEL_TP_I2C_ADDR 0x4b
@@ -67,15 +70,49 @@ static struct i2c_board_info __initdata tsl2563_als_device = {
67 I2C_BOARD_INFO("tsl2563", TAOS_ALS_I2C_ADDR), 70 I2C_BOARD_INFO("tsl2563", TAOS_ALS_I2C_ADDR),
68}; 71};
69 72
73static struct mxt_platform_data atmel_224s_tp_platform_data = {
74 .x_line = 18,
75 .y_line = 12,
76 .x_size = 102*20,
77 .y_size = 68*20,
78 .blen = 0x80, /* Gain setting is in upper 4 bits */
79 .threshold = 0x32,
80 .voltage = 0, /* 3.3V */
81 .orient = MXT_VERTICAL_FLIP,
82 .irqflags = IRQF_TRIGGER_FALLING,
83 .is_tp = true,
84 .key_map = { KEY_RESERVED,
85 KEY_RESERVED,
86 KEY_RESERVED,
87 BTN_LEFT },
88 .config = NULL,
89 .config_length = 0,
90};
91
70static struct i2c_board_info __initdata atmel_224s_tp_device = { 92static struct i2c_board_info __initdata atmel_224s_tp_device = {
71 I2C_BOARD_INFO("atmel_mxt_tp", ATMEL_TP_I2C_ADDR), 93 I2C_BOARD_INFO("atmel_mxt_tp", ATMEL_TP_I2C_ADDR),
72 .platform_data = NULL, 94 .platform_data = &atmel_224s_tp_platform_data,
73 .flags = I2C_CLIENT_WAKE, 95 .flags = I2C_CLIENT_WAKE,
74}; 96};
75 97
98static struct mxt_platform_data atmel_1664s_platform_data = {
99 .x_line = 32,
100 .y_line = 50,
101 .x_size = 1700,
102 .y_size = 2560,
103 .blen = 0x89, /* Gain setting is in upper 4 bits */
104 .threshold = 0x28,
105 .voltage = 0, /* 3.3V */
106 .orient = MXT_ROTATED_90_COUNTER,
107 .irqflags = IRQF_TRIGGER_FALLING,
108 .is_tp = false,
109 .config = NULL,
110 .config_length = 0,
111};
112
76static struct i2c_board_info __initdata atmel_1664s_device = { 113static struct i2c_board_info __initdata atmel_1664s_device = {
77 I2C_BOARD_INFO("atmel_mxt_ts", ATMEL_TS_I2C_ADDR), 114 I2C_BOARD_INFO("atmel_mxt_ts", ATMEL_TS_I2C_ADDR),
78 .platform_data = NULL, 115 .platform_data = &atmel_1664s_platform_data,
79 .flags = I2C_CLIENT_WAKE, 116 .flags = I2C_CLIENT_WAKE,
80}; 117};
81 118