]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
ARM: EXYNOS4: Add qt602240 touch screen device on Universal_C210
authorMarek Szyprowski <m.szyprowski@samsung.com>
Wed, 22 Jun 2011 04:43:39 +0000 (13:43 +0900)
committerKukjin Kim <kgene.kim@samsung.com>
Wed, 20 Jul 2011 14:17:39 +0000 (23:17 +0900)
This patch adds definitions to enable support for qt602240 touch screen
driver for Universal C210 board.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
arch/arm/mach-exynos4/Kconfig
arch/arm/mach-exynos4/mach-universal_c210.c

index 08482439acc33dfbd5bbc3be2bf238cebe3ff581..14137782f2896912015f5fd984111332b6e74f91 100644 (file)
@@ -162,9 +162,11 @@ config MACH_UNIVERSAL_C210
        select S3C_DEV_HSMMC2
        select S3C_DEV_HSMMC3
        select S3C_DEV_I2C1
+       select S3C_DEV_I2C3
        select S3C_DEV_I2C5
        select S5P_DEV_ONENAND
        select EXYNOS4_SETUP_I2C1
+       select EXYNOS4_SETUP_I2C3
        select EXYNOS4_SETUP_I2C5
        select EXYNOS4_SETUP_SDHCI
        help
index 83c83cce2478d07b8471140b775216f51cb7a9c2..5d8b097bb697ae4d41115759b17a092250f534bf 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/mmc/host.h>
 #include <linux/i2c-gpio.h>
 #include <linux/i2c/mcs.h>
+#include <linux/i2c/atmel_mxt_ts.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach-types.h>
@@ -29,6 +30,7 @@
 #include <plat/cpu.h>
 #include <plat/devs.h>
 #include <plat/iic.h>
+#include <plat/gpio-cfg.h>
 #include <plat/sdhci.h>
 
 #include <mach/map.h>
@@ -479,6 +481,46 @@ static struct i2c_board_info i2c5_devs[] __initdata = {
        },
 };
 
+/* I2C3 (TSP) */
+static struct mxt_platform_data qt602240_platform_data = {
+       .x_line         = 19,
+       .y_line         = 11,
+       .x_size         = 800,
+       .y_size         = 480,
+       .blen           = 0x11,
+       .threshold      = 0x28,
+       .voltage        = 2800000,              /* 2.8V */
+       .orient         = MXT_DIAGONAL,
+};
+
+static struct i2c_board_info i2c3_devs[] __initdata = {
+       {
+               I2C_BOARD_INFO("qt602240_ts", 0x4a),
+               .platform_data = &qt602240_platform_data,
+       },
+};
+
+static void __init universal_tsp_init(void)
+{
+       int gpio;
+
+       /* TSP_LDO_ON: XMDMADDR_11 */
+       gpio = EXYNOS4_GPE2(3);
+       gpio_request(gpio, "TSP_LDO_ON");
+       gpio_direction_output(gpio, 1);
+       gpio_export(gpio, 0);
+
+       /* TSP_INT: XMDMADDR_7 */
+       gpio = EXYNOS4_GPE1(7);
+       gpio_request(gpio, "TSP_INT");
+
+       s5p_register_gpio_interrupt(gpio);
+       s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf));
+       s3c_gpio_setpull(gpio, S3C_GPIO_PULL_UP);
+       i2c3_devs[0].irq = gpio_to_irq(gpio);
+}
+
+
 /* GPIO I2C 12 (3 Touchkey) */
 static uint32_t touchkey_keymap[] = {
        /* MCS_KEY_MAP(value, keycode) */
@@ -668,6 +710,7 @@ static struct platform_device *universal_devices[] __initdata = {
        &s3c_device_hsmmc0,
        &s3c_device_hsmmc2,
        &s3c_device_hsmmc3,
+       &s3c_device_i2c3,
        &s3c_device_i2c5,
 
        /* Universal Devices */
@@ -690,6 +733,10 @@ static void __init universal_machine_init(void)
        i2c_register_board_info(0, i2c0_devs, ARRAY_SIZE(i2c0_devs));
        i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs));
 
+       universal_tsp_init();
+       s3c_i2c3_set_platdata(NULL);
+       i2c_register_board_info(3, i2c3_devs, ARRAY_SIZE(i2c3_devs));
+
        s3c_i2c5_set_platdata(NULL);
        i2c_register_board_info(5, i2c5_devs, ARRAY_SIZE(i2c5_devs));