aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-s5pv210
diff options
context:
space:
mode:
authorMarek Szyprowski <m.szyprowski@samsung.com>2010-10-04 05:38:12 -0400
committerKukjin Kim <kgene.kim@samsung.com>2010-10-20 18:54:58 -0400
commitb4a0dca771350b4eb0b262b5bbcf2aab5b47d1ea (patch)
treec2ea55d766e0613fd35ecf6c6a60900ed75da4e8 /arch/arm/mach-s5pv210
parent528ef1b5f3998cd3199926526b4c188d52e4ba7c (diff)
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 'arch/arm/mach-s5pv210')
-rw-r--r--arch/arm/mach-s5pv210/Kconfig3
-rw-r--r--arch/arm/mach-s5pv210/mach-goni.c54
2 files changed, 57 insertions, 0 deletions
diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig
index 634844693cdb..862f239a0fdb 100644
--- a/arch/arm/mach-s5pv210/Kconfig
+++ b/arch/arm/mach-s5pv210/Kconfig
@@ -74,6 +74,7 @@ config MACH_AQUILA
74config MACH_GONI 74config MACH_GONI
75 bool "GONI" 75 bool "GONI"
76 select CPU_S5PV210 76 select CPU_S5PV210
77 select S5P_GPIO_INT
77 select S3C_DEV_FB 78 select S3C_DEV_FB
78 select S5P_DEV_FIMC0 79 select S5P_DEV_FIMC0
79 select S5P_DEV_FIMC1 80 select S5P_DEV_FIMC1
@@ -82,11 +83,13 @@ config MACH_GONI
82 select S3C_DEV_HSMMC1 83 select S3C_DEV_HSMMC1
83 select S3C_DEV_HSMMC2 84 select S3C_DEV_HSMMC2
84 select S3C_DEV_I2C1 85 select S3C_DEV_I2C1
86 select S3C_DEV_I2C2
85 select S3C_DEV_USB_HSOTG 87 select S3C_DEV_USB_HSOTG
86 select S5P_DEV_ONENAND 88 select S5P_DEV_ONENAND
87 select SAMSUNG_DEV_KEYPAD 89 select SAMSUNG_DEV_KEYPAD
88 select S5PV210_SETUP_FB_24BPP 90 select S5PV210_SETUP_FB_24BPP
89 select S5PV210_SETUP_I2C1 91 select S5PV210_SETUP_I2C1
92 select S5PV210_SETUP_I2C2
90 select S5PV210_SETUP_KEYPAD 93 select S5PV210_SETUP_KEYPAD
91 select S5PV210_SETUP_SDHCI 94 select S5PV210_SETUP_SDHCI
92 help 95 help
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 @@
15#include <linux/fb.h> 15#include <linux/fb.h>
16#include <linux/i2c.h> 16#include <linux/i2c.h>
17#include <linux/i2c-gpio.h> 17#include <linux/i2c-gpio.h>
18#include <linux/i2c/qt602240_ts.h>
18#include <linux/mfd/max8998.h> 19#include <linux/mfd/max8998.h>
19#include <linux/regulator/fixed.h> 20#include <linux/regulator/fixed.h>
20#include <linux/spi/spi.h> 21#include <linux/spi/spi.h>
@@ -219,6 +220,51 @@ static void __init goni_radio_init(void)
219 gpio_direction_output(gpio, 1); 220 gpio_direction_output(gpio, 1);
220} 221}
221 222
223/* TSP */
224static struct qt602240_platform_data qt602240_platform_data = {
225 .x_line = 17,
226 .y_line = 11,
227 .x_size = 800,
228 .y_size = 480,
229 .blen = 0x21,
230 .threshold = 0x28,
231 .voltage = 2800000, /* 2.8V */
232 .orient = QT602240_DIAGONAL,
233};
234
235static struct s3c2410_platform_i2c i2c2_data __initdata = {
236 .flags = 0,
237 .bus_num = 2,
238 .slave_addr = 0x10,
239 .frequency = 400 * 1000,
240 .sda_delay = 100,
241};
242
243static struct i2c_board_info i2c2_devs[] __initdata = {
244 {
245 I2C_BOARD_INFO("qt602240_ts", 0x4a),
246 .platform_data = &qt602240_platform_data,
247 },
248};
249
250static void __init goni_tsp_init(void)
251{
252 int gpio;
253
254 gpio = S5PV210_GPJ1(3); /* XMSMADDR_11 */
255 gpio_request(gpio, "TSP_LDO_ON");
256 gpio_direction_output(gpio, 1);
257 gpio_export(gpio, 0);
258
259 gpio = S5PV210_GPJ0(5); /* XMSMADDR_5 */
260 gpio_request(gpio, "TSP_INT");
261
262 s5p_register_gpio_interrupt(gpio);
263 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf));
264 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_UP);
265 i2c2_devs[0].irq = gpio_to_irq(gpio);
266}
267
222/* MAX8998 regulators */ 268/* MAX8998 regulators */
223#if defined(CONFIG_REGULATOR_MAX8998) || defined(CONFIG_REGULATOR_MAX8998_MODULE) 269#if defined(CONFIG_REGULATOR_MAX8998) || defined(CONFIG_REGULATOR_MAX8998_MODULE)
224 270
@@ -610,6 +656,7 @@ static struct platform_device *goni_devices[] __initdata = {
610 &s3c_device_usb_hsotg, 656 &s3c_device_usb_hsotg,
611 &samsung_device_keypad, 657 &samsung_device_keypad,
612 &s3c_device_i2c1, 658 &s3c_device_i2c1,
659 &s3c_device_i2c2,
613}; 660};
614 661
615static void __init goni_map_io(void) 662static void __init goni_map_io(void)
@@ -628,6 +675,13 @@ static void __init goni_machine_init(void)
628 s3c_i2c1_set_platdata(NULL); 675 s3c_i2c1_set_platdata(NULL);
629 i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs)); 676 i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs));
630 677
678 /* TSP: call before I2C 2 registeration */
679 goni_tsp_init();
680
681 /* I2C2 */
682 s3c_i2c2_set_platdata(&i2c2_data);
683 i2c_register_board_info(2, i2c2_devs, ARRAY_SIZE(i2c2_devs));
684
631 /* PMIC */ 685 /* PMIC */
632 goni_pmic_init(); 686 goni_pmic_init();
633 i2c_register_board_info(AP_I2C_GPIO_PMIC_BUS_4, i2c_gpio_pmic_devs, 687 i2c_register_board_info(AP_I2C_GPIO_PMIC_BUS_4, i2c_gpio_pmic_devs,