Skip to content

Commit 2ef3920

Browse files
bleungatchromiumtorvalds
authored andcommitted
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>
1 parent 22dfab7 commit 2ef3920

1 file changed

Lines changed: 39 additions & 2 deletions

File tree

‎drivers/platform/x86/chromeos_laptop.c‎

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323

2424
#include <linux/dmi.h>
2525
#include <linux/i2c.h>
26+
#include <linux/i2c/atmel_mxt_ts.h>
27+
#include <linux/input.h>
28+
#include <linux/interrupt.h>
2629
#include <linux/module.h>
2730

2831
#define ATMEL_TP_I2C_ADDR 0x4b
@@ -67,15 +70,49 @@ static struct i2c_board_info __initdata tsl2563_als_device = {
6770
I2C_BOARD_INFO("tsl2563", TAOS_ALS_I2C_ADDR),
6871
};
6972

73+
static 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+
7092
static struct i2c_board_info __initdata atmel_224s_tp_device = {
7193
I2C_BOARD_INFO("atmel_mxt_tp", ATMEL_TP_I2C_ADDR),
72-
.platform_data = NULL,
94+
.platform_data = &atmel_224s_tp_platform_data,
7395
.flags = I2C_CLIENT_WAKE,
7496
};
7597

98+
static 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+
76113
static struct i2c_board_info __initdata atmel_1664s_device = {
77114
I2C_BOARD_INFO("atmel_mxt_ts", ATMEL_TS_I2C_ADDR),
78-
.platform_data = NULL,
115+
.platform_data = &atmel_1664s_platform_data,
79116
.flags = I2C_CLIENT_WAKE,
80117
};
81118

0 commit comments

Comments
 (0)