aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile/board-ap4evb.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2013-04-21 18:56:15 +0200
committerSimon Horman <horms+renesas@verge.net.au>2013-06-04 21:04:19 +0900
commit4a666a783b0bb989afe87686f80c94d6ac1897a8 (patch)
treea5df97fd1f9b55bacc99d21f34fd2c75b3b434d8 /arch/arm/mach-shmobile/board-ap4evb.c
parentARM: shmobile: ap4evb: Register pinctrl mapping for SMSC911x (diff)
downloadlinux-dev-4a666a783b0bb989afe87686f80c94d6ac1897a8.tar.xz
linux-dev-4a666a783b0bb989afe87686f80c94d6ac1897a8.zip
ARM: shmobile: ap4evb: Simplify tsc2007 pen state read function
The pen state is retrieved by reading the state of a pin used as an IRQ. There's no need to reconfigure the pin as a pure GPIO, as the IRQ pin state can be read. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Diffstat (limited to 'arch/arm/mach-shmobile/board-ap4evb.c')
-rw-r--r--arch/arm/mach-shmobile/board-ap4evb.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index 9ee8bcd0d7d6..0109bb3c15b6 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -1037,22 +1037,13 @@ out:
#define IRQ7 evt2irq(0x02e0) /* IRQ7A */
static int ts_get_pendown_state(void)
{
- int val;
-
- gpio_free(GPIO_TSC_IRQ);
-
- gpio_request_one(GPIO_TSC_PORT, GPIOF_IN, NULL);
-
- val = gpio_get_value(GPIO_TSC_PORT);
-
- gpio_request(GPIO_TSC_IRQ, NULL);
-
- return !val;
+ return !gpio_get_value(GPIO_TSC_PORT);
}
static int ts_init(void)
{
gpio_request(GPIO_TSC_IRQ, NULL);
+ gpio_request_one(GPIO_TSC_PORT, GPIOF_IN, NULL);
return 0;
}