This makes cyttsp controller work on Medfield platform.

Signed-off-by: Hong Liu <[email protected]>
---
 arch/x86/kernel/mrst.c |   52 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 52 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/mrst.c b/arch/x86/kernel/mrst.c
index f2ee138..1a708dc 100644
--- a/arch/x86/kernel/mrst.c
+++ b/arch/x86/kernel/mrst.c
@@ -28,6 +28,7 @@
 #include <linux/spi/dw_spi.h>
 #include <linux/i2c/cp_tm1217.h>
 #include <linux/cy8ctmg110_pdata.h>
+#include <linux/cyttsp.h>
 #include <linux/i2c.h>
 #include <linux/i2c/pca953x.h>
 #include <linux/lis3lv02d.h>
@@ -631,6 +632,56 @@ static struct dw_spi_chip max3111_uart = {
        .type = SPI_FRF_SPI,
 };
 
+#define CYTTSP_GPIO_PIN                0x3E
+static int cyttsp_init(int on)
+{
+       int ret;
+
+       if (on) {
+               ret = gpio_request(CYTTSP_GPIO_PIN, "cyttsp_irq");
+               if (ret < 0) {
+                       pr_err("%s: gpio request failed\n", __func__);
+                       return ret;
+               }
+
+               ret = gpio_direction_input(CYTTSP_GPIO_PIN);
+               if (ret < 0) {
+                       pr_err("%s: gpio direction config failed\n", __func__);
+                       gpio_free(CYTTSP_GPIO_PIN);
+                       return ret;
+               }
+       } else {
+               gpio_free(CYTTSP_GPIO_PIN);
+       }
+       return 0;
+}
+
+static void *cyttsp_platform_data(void *info)
+{
+       static struct cyttsp_platform_data cyttsp_pdata = {
+               .init = cyttsp_init,
+               .mt_sync = input_mt_sync,
+               .maxx = 479,
+               .maxy = 799,
+               .flags = 0,
+               .gen = CY_GEN3,
+               .use_st = 1,
+               .use_mt = 0,
+               .use_trk_id = 0,
+               .use_hndshk = 1,
+               .use_timer = 0,
+               .use_sleep = 1,
+               .use_gestures = 0,
+               .act_intrvl = CY_ACT_INTRVL_DFLT,
+               .tch_tmout = CY_TCH_TMOUT_DFLT,
+               .lp_intrvl = CY_LP_INTRVL_DFLT,
+               .name = CY_I2C_NAME,
+               .irq_gpio = CYTTSP_GPIO_PIN,
+       };
+
+       return &cyttsp_pdata;
+}
+
 static void *max3111_platform_data(void *info)
 {
        static int dummy;
@@ -1128,6 +1179,7 @@ static const struct devs_id device_ids[] = {
        {"spi_6260_modem", SFI_DEV_TYPE_SPI, 0, &ifx_mdm_platform_data},
        {"spi_ifx_gps", SFI_DEV_TYPE_SPI, 0, &ifx_gps_platform_data},
        {"cptm1217", SFI_DEV_TYPE_I2C, 0, &cp_tm1217_platform_data},
+       {"cy8ctma340", SFI_DEV_TYPE_I2C, 0, &cyttsp_platform_data},
        {"spi_max3111", SFI_DEV_TYPE_SPI, 0, &max3111_platform_data},
        {"i2c_max7315", SFI_DEV_TYPE_I2C, 1, &max7315_platform_data},
        {"i2c_max7315_2", SFI_DEV_TYPE_I2C, 1, &max7315_platform_data},
-- 
1.7.2.3

_______________________________________________
MeeGo-kernel mailing list
[email protected]
http://lists.meego.com/listinfo/meego-kernel

Reply via email to