diff options
author | Joonyoung Shim <jy0922.shim@samsung.com> | 2011-03-23 02:25:14 -0400 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2011-05-05 20:36:47 -0400 |
commit | 3260ecd859ba842c709f205cbc01408b826bb387 (patch) | |
tree | 41230aad8dc8aa4250ba9f4f4686e8ca4bb012c9 /arch/arm | |
parent | 3d73998558beac1e56efaaf7c5bf3469ee4c6ba2 (diff) |
ARM: EXYNOS4: Add Atmel mXT touchscreen device to the NURI board
This patch is to support Atmel mXT touchscreen device to the NURI board.
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-exynos4/Kconfig | 2 | ||||
-rw-r--r-- | arch/arm/mach-exynos4/mach-nuri.c | 89 |
2 files changed, 91 insertions, 0 deletions
diff --git a/arch/arm/mach-exynos4/Kconfig b/arch/arm/mach-exynos4/Kconfig index e849f67be47d..11b57a4d53fa 100644 --- a/arch/arm/mach-exynos4/Kconfig +++ b/arch/arm/mach-exynos4/Kconfig | |||
@@ -169,8 +169,10 @@ config MACH_NURI | |||
169 | select S3C_DEV_HSMMC2 | 169 | select S3C_DEV_HSMMC2 |
170 | select S3C_DEV_HSMMC3 | 170 | select S3C_DEV_HSMMC3 |
171 | select S3C_DEV_I2C1 | 171 | select S3C_DEV_I2C1 |
172 | select S3C_DEV_I2C3 | ||
172 | select S3C_DEV_I2C5 | 173 | select S3C_DEV_I2C5 |
173 | select EXYNOS4_SETUP_I2C1 | 174 | select EXYNOS4_SETUP_I2C1 |
175 | select EXYNOS4_SETUP_I2C3 | ||
174 | select EXYNOS4_SETUP_I2C5 | 176 | select EXYNOS4_SETUP_I2C5 |
175 | select EXYNOS4_SETUP_SDHCI | 177 | select EXYNOS4_SETUP_SDHCI |
176 | select SAMSUNG_DEV_PWM | 178 | select SAMSUNG_DEV_PWM |
diff --git a/arch/arm/mach-exynos4/mach-nuri.c b/arch/arm/mach-exynos4/mach-nuri.c index b79ad010d194..d13c5e81c6a4 100644 --- a/arch/arm/mach-exynos4/mach-nuri.c +++ b/arch/arm/mach-exynos4/mach-nuri.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/serial_core.h> | 12 | #include <linux/serial_core.h> |
13 | #include <linux/input.h> | 13 | #include <linux/input.h> |
14 | #include <linux/i2c.h> | 14 | #include <linux/i2c.h> |
15 | #include <linux/i2c/atmel_mxt_ts.h> | ||
15 | #include <linux/gpio_keys.h> | 16 | #include <linux/gpio_keys.h> |
16 | #include <linux/gpio.h> | 17 | #include <linux/gpio.h> |
17 | #include <linux/regulator/machine.h> | 18 | #include <linux/regulator/machine.h> |
@@ -30,6 +31,8 @@ | |||
30 | #include <plat/cpu.h> | 31 | #include <plat/cpu.h> |
31 | #include <plat/devs.h> | 32 | #include <plat/devs.h> |
32 | #include <plat/sdhci.h> | 33 | #include <plat/sdhci.h> |
34 | #include <plat/gpio-cfg.h> | ||
35 | #include <plat/iic.h> | ||
33 | 36 | ||
34 | #include <mach/map.h> | 37 | #include <mach/map.h> |
35 | 38 | ||
@@ -257,6 +260,88 @@ static struct i2c_board_info i2c1_devs[] __initdata = { | |||
257 | /* Gyro, To be updated */ | 260 | /* Gyro, To be updated */ |
258 | }; | 261 | }; |
259 | 262 | ||
263 | /* TSP */ | ||
264 | static u8 mxt_init_vals[] = { | ||
265 | /* MXT_GEN_COMMAND(6) */ | ||
266 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
267 | /* MXT_GEN_POWER(7) */ | ||
268 | 0x20, 0xff, 0x32, | ||
269 | /* MXT_GEN_ACQUIRE(8) */ | ||
270 | 0x0a, 0x00, 0x05, 0x00, 0x00, 0x00, 0x09, 0x23, | ||
271 | /* MXT_TOUCH_MULTI(9) */ | ||
272 | 0x00, 0x00, 0x00, 0x13, 0x0b, 0x00, 0x00, 0x00, 0x02, 0x00, | ||
273 | 0x00, 0x01, 0x01, 0x0e, 0x0a, 0x0a, 0x0a, 0x0a, 0x00, 0x00, | ||
274 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
275 | 0x00, | ||
276 | /* MXT_TOUCH_KEYARRAY(15) */ | ||
277 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, | ||
278 | 0x00, | ||
279 | /* MXT_SPT_GPIOPWM(19) */ | ||
280 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
281 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
282 | /* MXT_PROCI_GRIPFACE(20) */ | ||
283 | 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x28, 0x04, | ||
284 | 0x0f, 0x0a, | ||
285 | /* MXT_PROCG_NOISE(22) */ | ||
286 | 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x23, 0x00, | ||
287 | 0x00, 0x05, 0x0f, 0x19, 0x23, 0x2d, 0x03, | ||
288 | /* MXT_TOUCH_PROXIMITY(23) */ | ||
289 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
290 | 0x00, 0x00, 0x00, 0x00, 0x00, | ||
291 | /* MXT_PROCI_ONETOUCH(24) */ | ||
292 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
293 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
294 | /* MXT_SPT_SELFTEST(25) */ | ||
295 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
296 | 0x00, 0x00, 0x00, 0x00, | ||
297 | /* MXT_PROCI_TWOTOUCH(27) */ | ||
298 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
299 | /* MXT_SPT_CTECONFIG(28) */ | ||
300 | 0x00, 0x00, 0x02, 0x08, 0x10, 0x00, | ||
301 | }; | ||
302 | |||
303 | static struct mxt_platform_data mxt_platform_data = { | ||
304 | .config = mxt_init_vals, | ||
305 | .config_length = ARRAY_SIZE(mxt_init_vals), | ||
306 | |||
307 | .x_line = 18, | ||
308 | .y_line = 11, | ||
309 | .x_size = 1024, | ||
310 | .y_size = 600, | ||
311 | .blen = 0x1, | ||
312 | .threshold = 0x28, | ||
313 | .voltage = 2800000, /* 2.8V */ | ||
314 | .orient = MXT_DIAGONAL_COUNTER, | ||
315 | .irqflags = IRQF_TRIGGER_FALLING, | ||
316 | }; | ||
317 | |||
318 | static struct s3c2410_platform_i2c i2c3_data __initdata = { | ||
319 | .flags = 0, | ||
320 | .bus_num = 3, | ||
321 | .slave_addr = 0x10, | ||
322 | .frequency = 400 * 1000, | ||
323 | .sda_delay = 100, | ||
324 | }; | ||
325 | |||
326 | static struct i2c_board_info i2c3_devs[] __initdata = { | ||
327 | { | ||
328 | I2C_BOARD_INFO("atmel_mxt_ts", 0x4a), | ||
329 | .platform_data = &mxt_platform_data, | ||
330 | .irq = IRQ_EINT(4), | ||
331 | }, | ||
332 | }; | ||
333 | |||
334 | static void __init nuri_tsp_init(void) | ||
335 | { | ||
336 | int gpio; | ||
337 | |||
338 | /* TOUCH_INT: XEINT_4 */ | ||
339 | gpio = EXYNOS4_GPX0(4); | ||
340 | gpio_request(gpio, "TOUCH_INT"); | ||
341 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf)); | ||
342 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_UP); | ||
343 | } | ||
344 | |||
260 | /* GPIO I2C 5 (PMIC) */ | 345 | /* GPIO I2C 5 (PMIC) */ |
261 | static struct i2c_board_info i2c5_devs[] __initdata = { | 346 | static struct i2c_board_info i2c5_devs[] __initdata = { |
262 | /* max8997, To be updated */ | 347 | /* max8997, To be updated */ |
@@ -270,6 +355,7 @@ static struct platform_device *nuri_devices[] __initdata = { | |||
270 | &s3c_device_hsmmc3, | 355 | &s3c_device_hsmmc3, |
271 | &s3c_device_wdt, | 356 | &s3c_device_wdt, |
272 | &s3c_device_timer[0], | 357 | &s3c_device_timer[0], |
358 | &s3c_device_i2c3, | ||
273 | 359 | ||
274 | /* NURI Devices */ | 360 | /* NURI Devices */ |
275 | &nuri_gpio_keys, | 361 | &nuri_gpio_keys, |
@@ -287,8 +373,11 @@ static void __init nuri_map_io(void) | |||
287 | static void __init nuri_machine_init(void) | 373 | static void __init nuri_machine_init(void) |
288 | { | 374 | { |
289 | nuri_sdhci_init(); | 375 | nuri_sdhci_init(); |
376 | nuri_tsp_init(); | ||
290 | 377 | ||
291 | i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs)); | 378 | i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs)); |
379 | s3c_i2c3_set_platdata(&i2c3_data); | ||
380 | i2c_register_board_info(3, i2c3_devs, ARRAY_SIZE(i2c3_devs)); | ||
292 | i2c_register_board_info(5, i2c5_devs, ARRAY_SIZE(i2c5_devs)); | 381 | i2c_register_board_info(5, i2c5_devs, ARRAY_SIZE(i2c5_devs)); |
293 | 382 | ||
294 | /* Last */ | 383 | /* Last */ |