From 83a0e6153673e0eba3adb7143a7682825c93b60c Mon Sep 17 00:00:00 2001 From: Rebecca Schultz Zavin Date: Wed, 26 May 2010 14:46:49 -0700 Subject: [PATCH] [ARM] tegra: Stingray: Add touch board file. Touch board has platform data with config parameters for mxt1386. i2c board file touch contents moved to touch board file. Change-Id: I3f8df54f5a7c32de2d63a3d4b0c796c2a8e4ca3c Signed-off-by: Makarand Karvekar --- arch/arm/mach-tegra/Makefile | 2 +- ...-stingray-i2c.c => board-stingray-touch.c} | 27 +++++++++---------- arch/arm/mach-tegra/board-stingray.c | 2 +- arch/arm/mach-tegra/board-stingray.h | 1 + 4 files changed, 16 insertions(+), 16 deletions(-) rename arch/arm/mach-tegra/{board-stingray-i2c.c => board-stingray-touch.c} (93%) diff --git a/arch/arm/mach-tegra/Makefile b/arch/arm/mach-tegra/Makefile index 231bc9456185..30bdad11f216 100644 --- a/arch/arm/mach-tegra/Makefile +++ b/arch/arm/mach-tegra/Makefile @@ -54,8 +54,8 @@ obj-${CONFIG_MACH_OLYMPUS} += board-olympus-wifi.o obj-${CONFIG_MACH_STINGRAY} += board-stingray.o obj-${CONFIG_MACH_STINGRAY} += board-stingray-pinmux.o obj-${CONFIG_MACH_STINGRAY} += board-stingray-panel.o -obj-${CONFIG_MACH_STINGRAY} += board-stingray-i2c.o obj-${CONFIG_MACH_STINGRAY} += board-stingray-keypad.o obj-${CONFIG_MACH_STINGRAY} += board-stingray-wifi.o obj-${CONFIG_MACH_STINGRAY} += board-stingray-sensors.o obj-${CONFIG_MACH_STINGRAY} += board-stingray-wlan_nvs.o +obj-${CONFIG_MACH_STINGRAY} += board-stingray-touch.o diff --git a/arch/arm/mach-tegra/board-stingray-i2c.c b/arch/arm/mach-tegra/board-stingray-touch.c similarity index 93% rename from arch/arm/mach-tegra/board-stingray-i2c.c rename to arch/arm/mach-tegra/board-stingray-touch.c index 4caa46bff4d7..88cc463be14f 100644 --- a/arch/arm/mach-tegra/board-stingray-i2c.c +++ b/arch/arm/mach-tegra/board-stingray-touch.c @@ -1,6 +1,7 @@ /* - * arch/arm/mach-tegra/board-stingray-i2c.c + * arch/arm/mach-tegra/board-stingray-touch.c * + * Copyright (C) 2010 Motorola, Inc. * Copyright (C) 2010 Google, Inc. * * This software is licensed under the terms of the GNU General Public @@ -44,8 +45,7 @@ static int stingray_touch_reset(void) return 0; } - -/*struct qtouch_ts_platform_data stingray_touch_data = { +struct qtouch_ts_platform_data stingray_touch_data = { .flags = (QTOUCH_FLIP_X | QTOUCH_FLIP_Y | @@ -292,15 +292,16 @@ static int stingray_touch_reset(void) }, }; -static struct i2c_board_info __initdata stingray_i2c_bus1_board_info[] = { +static struct i2c_board_info __initdata stingray_i2c_bus1_touch_info[] = { { - I2C_BOARD_INFO(QTOUCH_TS_NAME, 0x5B), - .platform_data = &stingray_touch_data, - .irq = TEGRA_GPIO_TO_IRQ(STINGRAY_TOUCH_INT_N_GPIO), - }, -};*/ + I2C_BOARD_INFO(QTOUCH_TS_NAME, 0x5B), + .platform_data = &stingray_touch_data, + .irq = TEGRA_GPIO_TO_IRQ(STINGRAY_TOUCH_INT_N_GPIO), + }, +}; -int __init stingray_i2c_init(void) + +int __init stingray_touch_init(void) { tegra_gpio_enable(STINGRAY_TOUCH_INT_N_GPIO); gpio_request(STINGRAY_TOUCH_INT_N_GPIO, "touch_irq"); @@ -308,15 +309,13 @@ int __init stingray_i2c_init(void) tegra_gpio_enable(STINGRAY_TOUCH_WAKE_N_GPIO); gpio_request(STINGRAY_TOUCH_WAKE_N_GPIO, "touch_wake"); - gpio_direction_input(STINGRAY_TOUCH_WAKE_N_GPIO); + gpio_direction_output(STINGRAY_TOUCH_WAKE_N_GPIO, 0); tegra_gpio_enable(STINGRAY_TOUCH_RESET_N_GPIO); gpio_request(STINGRAY_TOUCH_RESET_N_GPIO, "touch_reset"); gpio_direction_output(STINGRAY_TOUCH_RESET_N_GPIO, 1); -// i2c_register_board_info(0, stingray_i2c_bus1_board_info, 1); - -// i2c_register_board_info(3, stingray_i2c_bus4_board_info, 1); + i2c_register_board_info(0, stingray_i2c_bus1_touch_info, 1); return 0; } diff --git a/arch/arm/mach-tegra/board-stingray.c b/arch/arm/mach-tegra/board-stingray.c index 705294d5312e..61a8757aaae9 100644 --- a/arch/arm/mach-tegra/board-stingray.c +++ b/arch/arm/mach-tegra/board-stingray.c @@ -301,7 +301,7 @@ static void __init tegra_stingray_init(void) platform_add_devices(stingray_devices, ARRAY_SIZE(stingray_devices)); stingray_keypad_init(); - stingray_i2c_init(); + stingray_touch_init(); stingray_panel_init(); stingray_sdhci_init(); stingray_sensors_init(); diff --git a/arch/arm/mach-tegra/board-stingray.h b/arch/arm/mach-tegra/board-stingray.h index ff27feb6298d..50979eb70195 100644 --- a/arch/arm/mach-tegra/board-stingray.h +++ b/arch/arm/mach-tegra/board-stingray.h @@ -23,5 +23,6 @@ int stingray_keypad_init(void); int stingray_i2c_init(void); int stingray_wlan_init(void); int stingray_sensors_init(void); +int stingray_touch_init(void); #endif -- 2.34.1