aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-exynos4/mach-nuri.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-exynos4/mach-nuri.c')
-rw-r--r--arch/arm/mach-exynos4/mach-nuri.c89
1 files changed, 89 insertions, 0 deletions
diff --git a/arch/arm/mach-exynos4/mach-nuri.c b/arch/arm/mach-exynos4/mach-nuri.c
index bb5d12f43af8..642702bb5b12 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>
@@ -32,6 +33,8 @@
32#include <plat/sdhci.h> 33#include <plat/sdhci.h>
33#include <plat/ehci.h> 34#include <plat/ehci.h>
34#include <plat/clock.h> 35#include <plat/clock.h>
36#include <plat/gpio-cfg.h>
37#include <plat/iic.h>
35 38
36#include <mach/map.h> 39#include <mach/map.h>
37 40
@@ -259,6 +262,88 @@ static struct i2c_board_info i2c1_devs[] __initdata = {
259 /* Gyro, To be updated */ 262 /* Gyro, To be updated */
260}; 263};
261 264
265/* TSP */
266static u8 mxt_init_vals[] = {
267 /* MXT_GEN_COMMAND(6) */
268 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
269 /* MXT_GEN_POWER(7) */
270 0x20, 0xff, 0x32,
271 /* MXT_GEN_ACQUIRE(8) */
272 0x0a, 0x00, 0x05, 0x00, 0x00, 0x00, 0x09, 0x23,
273 /* MXT_TOUCH_MULTI(9) */
274 0x00, 0x00, 0x00, 0x13, 0x0b, 0x00, 0x00, 0x00, 0x02, 0x00,
275 0x00, 0x01, 0x01, 0x0e, 0x0a, 0x0a, 0x0a, 0x0a, 0x00, 0x00,
276 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
277 0x00,
278 /* MXT_TOUCH_KEYARRAY(15) */
279 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00,
280 0x00,
281 /* MXT_SPT_GPIOPWM(19) */
282 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
283 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
284 /* MXT_PROCI_GRIPFACE(20) */
285 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x28, 0x04,
286 0x0f, 0x0a,
287 /* MXT_PROCG_NOISE(22) */
288 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x23, 0x00,
289 0x00, 0x05, 0x0f, 0x19, 0x23, 0x2d, 0x03,
290 /* MXT_TOUCH_PROXIMITY(23) */
291 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
292 0x00, 0x00, 0x00, 0x00, 0x00,
293 /* MXT_PROCI_ONETOUCH(24) */
294 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
295 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
296 /* MXT_SPT_SELFTEST(25) */
297 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
298 0x00, 0x00, 0x00, 0x00,
299 /* MXT_PROCI_TWOTOUCH(27) */
300 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
301 /* MXT_SPT_CTECONFIG(28) */
302 0x00, 0x00, 0x02, 0x08, 0x10, 0x00,
303};
304
305static struct mxt_platform_data mxt_platform_data = {
306 .config = mxt_init_vals,
307 .config_length = ARRAY_SIZE(mxt_init_vals),
308
309 .x_line = 18,
310 .y_line = 11,
311 .x_size = 1024,
312 .y_size = 600,
313 .blen = 0x1,
314 .threshold = 0x28,
315 .voltage = 2800000, /* 2.8V */
316 .orient = MXT_DIAGONAL_COUNTER,
317 .irqflags = IRQF_TRIGGER_FALLING,
318};
319
320static struct s3c2410_platform_i2c i2c3_data __initdata = {
321 .flags = 0,
322 .bus_num = 3,
323 .slave_addr = 0x10,
324 .frequency = 400 * 1000,
325 .sda_delay = 100,
326};
327
328static struct i2c_board_info i2c3_devs[] __initdata = {
329 {
330 I2C_BOARD_INFO("atmel_mxt_ts", 0x4a),
331 .platform_data = &mxt_platform_data,
332 .irq = IRQ_EINT(4),
333 },
334};
335
336static void __init nuri_tsp_init(void)
337{
338 int gpio;
339
340 /* TOUCH_INT: XEINT_4 */
341 gpio = EXYNOS4_GPX0(4);
342 gpio_request(gpio, "TOUCH_INT");
343 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf));
344 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_UP);
345}
346
262/* GPIO I2C 5 (PMIC) */ 347/* GPIO I2C 5 (PMIC) */
263static struct i2c_board_info i2c5_devs[] __initdata = { 348static struct i2c_board_info i2c5_devs[] __initdata = {
264 /* max8997, To be updated */ 349 /* max8997, To be updated */
@@ -283,6 +368,7 @@ static struct platform_device *nuri_devices[] __initdata = {
283 &s3c_device_wdt, 368 &s3c_device_wdt,
284 &s3c_device_timer[0], 369 &s3c_device_timer[0],
285 &s5p_device_ehci, 370 &s5p_device_ehci,
371 &s3c_device_i2c3,
286 372
287 /* NURI Devices */ 373 /* NURI Devices */
288 &nuri_gpio_keys, 374 &nuri_gpio_keys,
@@ -300,8 +386,11 @@ static void __init nuri_map_io(void)
300static void __init nuri_machine_init(void) 386static void __init nuri_machine_init(void)
301{ 387{
302 nuri_sdhci_init(); 388 nuri_sdhci_init();
389 nuri_tsp_init();
303 390
304 i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs)); 391 i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs));
392 s3c_i2c3_set_platdata(&i2c3_data);
393 i2c_register_board_info(3, i2c3_devs, ARRAY_SIZE(i2c3_devs));
305 i2c_register_board_info(5, i2c5_devs, ARRAY_SIZE(i2c5_devs)); 394 i2c_register_board_info(5, i2c5_devs, ARRAY_SIZE(i2c5_devs));
306 395
307 nuri_ehci_init(); 396 nuri_ehci_init();