ARM: pxa: hx4700: Add Synaptics NavPoint touchpad
authorPaul Parsons <lost.distance@yahoo.com>
Sat, 12 May 2012 11:31:02 +0000 (12:31 +0100)
committerHaojian Zhuang <haojian.zhuang@gmail.com>
Mon, 14 May 2012 01:38:17 +0000 (09:38 +0800)
This patch adds the Synaptics NavPoint touchpad to the hx4700 platform:
1. Change GPIO23_SSP1_SCLK value in hx4700_pin_config[] from an output
to an input, since the NavPoint is connected to SSP in SPI slave mode.
2. Add GPIO102_GPIO (NavPoint power) to hx4700_pin_config[].
3. Add navpoint platform_device to devices[].

Signed-off-by: Paul Parsons <lost.distance@yahoo.com>
Cc: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com>
arch/arm/mach-pxa/hx4700.c
arch/arm/mach-pxa/include/mach/mfp-pxa27x.h

index 88f0f51ad6d5c2a6723289cf2cb8af600a695d71..865f6d37372e32e24681a132482eb50235387455 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/gpio.h>
 #include <linux/gpio_keys.h>
 #include <linux/input.h>
+#include <linux/input/navpoint.h>
 #include <linux/lcd.h>
 #include <linux/mfd/htc-egpio.h>
 #include <linux/mfd/asic3.h>
@@ -113,7 +114,7 @@ static unsigned long hx4700_pin_config[] __initdata = {
        GPIO113_I2S_SYSCLK,
 
        /* SSP 1 (NavPoint) */
-       GPIO23_SSP1_SCLK,
+       GPIO23_SSP1_SCLK_IN,
        GPIO24_SSP1_SFRM,
        GPIO25_SSP1_TXD,
        GPIO26_SSP1_RXD,
@@ -129,6 +130,9 @@ static unsigned long hx4700_pin_config[] __initdata = {
        GPIO13_GPIO,    /* W3220_IRQ */
        GPIO14_GPIO,    /* nWLAN_IRQ */
 
+       /* HX4700 specific output GPIOs */
+       GPIO102_GPIO | MFP_LPM_DRIVE_LOW,       /* SYNAPTICS_POWER_ON */
+
        GPIO10_GPIO,    /* GSM_IRQ */
        GPIO13_GPIO,    /* CPLD_IRQ */
        GPIO107_GPIO,   /* DS1WM_IRQ */
@@ -182,6 +186,23 @@ static struct platform_device gpio_keys = {
        .id   = -1,
 };
 
+/*
+ * Synaptics NavPoint connected to SSP1
+ */
+
+static struct navpoint_platform_data navpoint_platform_data = {
+       .port   = 1,
+       .gpio   = GPIO102_HX4700_SYNAPTICS_POWER_ON,
+};
+
+static struct platform_device navpoint = {
+       .name   = "navpoint",
+       .id     = -1,
+       .dev = {
+               .platform_data = &navpoint_platform_data,
+       },
+};
+
 /*
  * ASIC3
  */
@@ -823,6 +844,7 @@ static struct platform_device audio = {
 static struct platform_device *devices[] __initdata = {
        &asic3,
        &gpio_keys,
+       &navpoint,
        &backlight,
        &w3220,
        &hx4700_lcd,
index a65867209aa0da3e251b3791377e4f8966b37d72..a611ad3153c7b2e7e9a7e78803df0f9876bc677e 100644 (file)
 #define GPIO113_I2S_SYSCLK     MFP_CFG_OUT(GPIO113, AF1, DRIVE_LOW)
 
 /* SSP 1 */
+#define GPIO23_SSP1_SCLK_IN    MFP_CFG_IN(GPIO23, AF2)
 #define GPIO23_SSP1_SCLK       MFP_CFG_OUT(GPIO23, AF2, DRIVE_LOW)
 #define GPIO29_SSP1_SCLK       MFP_CFG_IN(GPIO29, AF3)
 #define GPIO27_SSP1_SYSCLK     MFP_CFG_OUT(GPIO27, AF1, DRIVE_LOW)