summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-s5pv210/mach-goni.c
diff options
context:
space:
mode:
authorMarek Szyprowski <m.szyprowski@samsung.com>2010-10-04 11:38:12 +0200
committerKukjin Kim <kgene.kim@samsung.com>2010-10-21 00:54:58 +0200
commitb4a0dca771350b4eb0b262b5bbcf2aab5b47d1ea (patch)
treec2ea55d766e0613fd35ecf6c6a60900ed75da4e8 /arch/arm/mach-s5pv210/mach-goni.c
parentARM: S5PV210: Add si470x radio device to the GONI board (diff)
downloadlinux-b4a0dca771350b4eb0b262b5bbcf2aab5b47d1ea.tar.xz
linux-b4a0dca771350b4eb0b262b5bbcf2aab5b47d1ea.zip
ARM: S5PV210: GONI: Add support for QT602240 TS driver
Add required platform definitions for QT602240 touchscreen on I2C2 bus. Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to '')
-rw-r--r--arch/arm/mach-s5pv210/mach-goni.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/arch/arm/mach-s5pv210/mach-goni.c b/arch/arm/mach-s5pv210/mach-goni.c
index f1fe024144eb..1bae3f13f0a0 100644
--- a/arch/arm/mach-s5pv210/mach-goni.c
+++ b/arch/arm/mach-s5pv210/mach-goni.c
@@ -15,6 +15,7 @@
#include <linux/fb.h>
#include <linux/i2c.h>
#include <linux/i2c-gpio.h>
+#include <linux/i2c/qt602240_ts.h>
#include <linux/mfd/max8998.h>
#include <linux/regulator/fixed.h>
#include <linux/spi/spi.h>
@@ -219,6 +220,51 @@ static void __init goni_radio_init(void)
gpio_direction_output(gpio, 1);
}
+/* TSP */
+static struct qt602240_platform_data qt602240_platform_data = {
+ .x_line = 17,
+ .y_line = 11,
+ .x_size = 800,
+ .y_size = 480,
+ .blen = 0x21,
+ .threshold = 0x28,
+ .voltage = 2800000, /* 2.8V */
+ .orient = QT602240_DIAGONAL,
+};
+
+static struct s3c2410_platform_i2c i2c2_data __initdata = {
+ .flags = 0,
+ .bus_num = 2,
+ .slave_addr = 0x10,
+ .frequency = 400 * 1000,
+ .sda_delay = 100,
+};
+
+static struct i2c_board_info i2c2_devs[] __initdata = {
+ {
+ I2C_BOARD_INFO("qt602240_ts", 0x4a),
+ .platform_data = &qt602240_platform_data,
+ },
+};
+
+static void __init goni_tsp_init(void)
+{
+ int gpio;
+
+ gpio = S5PV210_GPJ1(3); /* XMSMADDR_11 */
+ gpio_request(gpio, "TSP_LDO_ON");
+ gpio_direction_output(gpio, 1);
+ gpio_export(gpio, 0);
+
+ gpio = S5PV210_GPJ0(5); /* XMSMADDR_5 */
+ 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);
+ i2c2_devs[0].irq = gpio_to_irq(gpio);
+}
+
/* MAX8998 regulators */
#if defined(CONFIG_REGULATOR_MAX8998) || defined(CONFIG_REGULATOR_MAX8998_MODULE)
@@ -610,6 +656,7 @@ static struct platform_device *goni_devices[] __initdata = {
&s3c_device_usb_hsotg,
&samsung_device_keypad,
&s3c_device_i2c1,
+ &s3c_device_i2c2,
};
static void __init goni_map_io(void)
@@ -628,6 +675,13 @@ static void __init goni_machine_init(void)
s3c_i2c1_set_platdata(NULL);
i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs));
+ /* TSP: call before I2C 2 registeration */
+ goni_tsp_init();
+
+ /* I2C2 */
+ s3c_i2c2_set_platdata(&i2c2_data);
+ i2c_register_board_info(2, i2c2_devs, ARRAY_SIZE(i2c2_devs));
+
/* PMIC */
goni_pmic_init();
i2c_register_board_info(AP_I2C_GPIO_PMIC_BUS_4, i2c_gpio_pmic_devs,