aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-shmobile/board-ap4evb.c38
1 files changed, 35 insertions, 3 deletions
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index 005337904ad5..3dd76f0106ca 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -834,11 +834,45 @@ static void __init gpio_no_direction(u32 addr)
834} 834}
835 835
836/* TouchScreen */ 836/* TouchScreen */
837#ifdef CONFIG_AP4EVB_QHD
838# define GPIO_TSC_IRQ GPIO_FN_IRQ28_123
839# define GPIO_TSC_PORT GPIO_PORT123
840#else /* WVGA */
841# define GPIO_TSC_IRQ GPIO_FN_IRQ7_40
842# define GPIO_TSC_PORT GPIO_PORT40
843#endif
844
837#define IRQ28 evt2irq(0x3380) /* IRQ28A */ 845#define IRQ28 evt2irq(0x3380) /* IRQ28A */
838#define IRQ7 evt2irq(0x02e0) /* IRQ7A */ 846#define IRQ7 evt2irq(0x02e0) /* IRQ7A */
847static int ts_get_pendown_state(void)
848{
849 int val;
850
851 gpio_free(GPIO_TSC_IRQ);
852
853 gpio_request(GPIO_TSC_PORT, NULL);
854
855 gpio_direction_input(GPIO_TSC_PORT);
856
857 val = gpio_get_value(GPIO_TSC_PORT);
858
859 gpio_request(GPIO_TSC_IRQ, NULL);
860
861 return !val;
862}
863
864static int ts_init(void)
865{
866 gpio_request(GPIO_TSC_IRQ, NULL);
867
868 return 0;
869}
870
839static struct tsc2007_platform_data tsc2007_info = { 871static struct tsc2007_platform_data tsc2007_info = {
840 .model = 2007, 872 .model = 2007,
841 .x_plate_ohms = 1000, 873 .x_plate_ohms = 180,
874 .get_pendown_state = ts_get_pendown_state,
875 .init_platform_hw = ts_init,
842}; 876};
843 877
844static struct i2c_board_info tsc_device = { 878static struct i2c_board_info tsc_device = {
@@ -1015,7 +1049,6 @@ static void __init ap4evb_init(void)
1015 gpio_request(GPIO_FN_KEYIN4, NULL); 1049 gpio_request(GPIO_FN_KEYIN4, NULL);
1016 1050
1017 /* enable TouchScreen */ 1051 /* enable TouchScreen */
1018 gpio_request(GPIO_FN_IRQ28_123, NULL);
1019 set_irq_type(IRQ28, IRQ_TYPE_LEVEL_LOW); 1052 set_irq_type(IRQ28, IRQ_TYPE_LEVEL_LOW);
1020 1053
1021 tsc_device.irq = IRQ28; 1054 tsc_device.irq = IRQ28;
@@ -1072,7 +1105,6 @@ static void __init ap4evb_init(void)
1072 lcdc_info.ch[0].lcd_size_cfg.height = 91; 1105 lcdc_info.ch[0].lcd_size_cfg.height = 91;
1073 1106
1074 /* enable TouchScreen */ 1107 /* enable TouchScreen */
1075 gpio_request(GPIO_FN_IRQ7_40, NULL);
1076 set_irq_type(IRQ7, IRQ_TYPE_LEVEL_LOW); 1108 set_irq_type(IRQ7, IRQ_TYPE_LEVEL_LOW);
1077 1109
1078 tsc_device.irq = IRQ7; 1110 tsc_device.irq = IRQ7;