From: Laurent Pinchart Date: Sun, 21 Apr 2013 16:56:15 +0000 (+0200) Subject: ARM: shmobile: ap4evb: Simplify tsc2007 pen state read function X-Git-Tag: next-20130527~8^2^13~73 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=62e0f6810d1c3ecd42928dec629f5b65929e8764;p=karo-tx-linux.git 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 Signed-off-by: Simon Horman --- 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; }