[ARM] tegra: updated touch interrupt line for Stingray P2 HW
authormakarand.karvekar <makarand.karvekar@motorola.com>
Mon, 30 Aug 2010 20:48:27 +0000 (15:48 -0500)
committerColin Cross <ccross@android.com>
Wed, 6 Oct 2010 23:50:39 +0000 (16:50 -0700)
touch interrupt has moved from PV2 to PZ2 on P2 HW.

Change-Id: Ic9375e1e081c3ac746f5fa2c21657bd1af1668a3
Signed-off-by: makarand.karvekar <makarand.karvekar@motorola.com>
arch/arm/mach-tegra/board-stingray-touch.c

index 49dec9f033acb8dfe1654da2594fadbeec806ffd..5a60f365168e0d86ee47509acd106b7ae04ee54d 100644 (file)
@@ -36,6 +36,8 @@
 #define STINGRAY_TOUCH_INT_N_GPIO      TEGRA_GPIO_PV2
 #define STINGRAY_TOUCH_WAKE_N_GPIO     TEGRA_GPIO_PJ2
 
+#define STINGRAY_TOUCH_INT_N_GPIO_P2   TEGRA_GPIO_PZ2
+
 static int stingray_touch_reset(void)
 {
        gpio_set_value(STINGRAY_TOUCH_RESET_N_GPIO, 0);
@@ -588,15 +590,21 @@ struct qtouch_ts_platform_data stingray_touch_data_p1p2 = {
 static struct i2c_board_info __initdata stingray_i2c_bus1_touch_info[] = {
        {
                I2C_BOARD_INFO(QTOUCH_TS_NAME, 0x5B),
-               .irq = TEGRA_GPIO_TO_IRQ(STINGRAY_TOUCH_INT_N_GPIO),
        },
 };
 
 int __init stingray_touch_init(void)
 {
-       tegra_gpio_enable(STINGRAY_TOUCH_INT_N_GPIO);
-       gpio_request(STINGRAY_TOUCH_INT_N_GPIO, "touch_irq");
-       gpio_direction_input(STINGRAY_TOUCH_INT_N_GPIO);
+       unsigned touch_int_gpio;
+
+       if (stingray_revision() == STINGRAY_REVISION_P2)
+               touch_int_gpio = STINGRAY_TOUCH_INT_N_GPIO_P2;
+       else
+               touch_int_gpio = STINGRAY_TOUCH_INT_N_GPIO;
+
+       tegra_gpio_enable(touch_int_gpio);
+       gpio_request(touch_int_gpio, "touch_irq");
+       gpio_direction_input(touch_int_gpio);
 
        tegra_gpio_enable(STINGRAY_TOUCH_WAKE_N_GPIO);
        gpio_request(STINGRAY_TOUCH_WAKE_N_GPIO, "touch_wake");
@@ -606,6 +614,9 @@ int __init stingray_touch_init(void)
        gpio_request(STINGRAY_TOUCH_RESET_N_GPIO, "touch_reset");
        gpio_direction_output(STINGRAY_TOUCH_RESET_N_GPIO, 1);
 
+       stingray_i2c_bus1_touch_info[0].irq =
+                TEGRA_GPIO_TO_IRQ(touch_int_gpio);
+
        if ((stingray_revision() == STINGRAY_REVISION_P1) ||
                (stingray_revision() == STINGRAY_REVISION_P2))
                stingray_i2c_bus1_touch_info[0].platform_data = &stingray_touch_data_p1p2;