Commit 52d5ac00 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Paul Mundt

ARM: mach-shmobile: ap4evb: modify touchpanel judgment condition

Current touchpanel had below 2 issues

- LCDD2 pin which is needed for WVGA was changed to
  IRQ28_123 pin on ts_get_pendown_state

- GPIO pull up on ts_init was disabled by gpio_request
  on ts_get_pendown_state.
  This mean the return value from gpio_get_value is untrusted.

This patch solve these issues
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent a91a2d06
...@@ -834,11 +834,45 @@ static void __init gpio_no_direction(u32 addr) ...@@ -834,11 +834,45 @@ static void __init gpio_no_direction(u32 addr)
} }
/* TouchScreen */ /* TouchScreen */
#ifdef CONFIG_AP4EVB_QHD
# define GPIO_TSC_IRQ GPIO_FN_IRQ28_123
# define GPIO_TSC_PORT GPIO_PORT123
#else /* WVGA */
# define GPIO_TSC_IRQ GPIO_FN_IRQ7_40
# define GPIO_TSC_PORT GPIO_PORT40
#endif
#define IRQ28 evt2irq(0x3380) /* IRQ28A */ #define IRQ28 evt2irq(0x3380) /* IRQ28A */
#define IRQ7 evt2irq(0x02e0) /* IRQ7A */ #define IRQ7 evt2irq(0x02e0) /* IRQ7A */
static int ts_get_pendown_state(void)
{
int val;
gpio_free(GPIO_TSC_IRQ);
gpio_request(GPIO_TSC_PORT, NULL);
gpio_direction_input(GPIO_TSC_PORT);
val = gpio_get_value(GPIO_TSC_PORT);
gpio_request(GPIO_TSC_IRQ, NULL);
return !val;
}
static int ts_init(void)
{
gpio_request(GPIO_TSC_IRQ, NULL);
return 0;
}
static struct tsc2007_platform_data tsc2007_info = { static struct tsc2007_platform_data tsc2007_info = {
.model = 2007, .model = 2007,
.x_plate_ohms = 1000, .x_plate_ohms = 180,
.get_pendown_state = ts_get_pendown_state,
.init_platform_hw = ts_init,
}; };
static struct i2c_board_info tsc_device = { static struct i2c_board_info tsc_device = {
...@@ -1015,7 +1049,6 @@ static void __init ap4evb_init(void) ...@@ -1015,7 +1049,6 @@ static void __init ap4evb_init(void)
gpio_request(GPIO_FN_KEYIN4, NULL); gpio_request(GPIO_FN_KEYIN4, NULL);
/* enable TouchScreen */ /* enable TouchScreen */
gpio_request(GPIO_FN_IRQ28_123, NULL);
set_irq_type(IRQ28, IRQ_TYPE_LEVEL_LOW); set_irq_type(IRQ28, IRQ_TYPE_LEVEL_LOW);
tsc_device.irq = IRQ28; tsc_device.irq = IRQ28;
...@@ -1072,7 +1105,6 @@ static void __init ap4evb_init(void) ...@@ -1072,7 +1105,6 @@ static void __init ap4evb_init(void)
lcdc_info.ch[0].lcd_size_cfg.height = 91; lcdc_info.ch[0].lcd_size_cfg.height = 91;
/* enable TouchScreen */ /* enable TouchScreen */
gpio_request(GPIO_FN_IRQ7_40, NULL);
set_irq_type(IRQ7, IRQ_TYPE_LEVEL_LOW); set_irq_type(IRQ7, IRQ_TYPE_LEVEL_LOW);
tsc_device.irq = IRQ7; tsc_device.irq = IRQ7;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment