mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-22 04:03:58 +08:00
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>
This commit is contained in:
parent
5436c2b9b4
commit
4a666a783b
@ -1037,22 +1037,13 @@ out:
|
|||||||
#define IRQ7 evt2irq(0x02e0) /* IRQ7A */
|
#define IRQ7 evt2irq(0x02e0) /* IRQ7A */
|
||||||
static int ts_get_pendown_state(void)
|
static int ts_get_pendown_state(void)
|
||||||
{
|
{
|
||||||
int val;
|
return !gpio_get_value(GPIO_TSC_PORT);
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ts_init(void)
|
static int ts_init(void)
|
||||||
{
|
{
|
||||||
gpio_request(GPIO_TSC_IRQ, NULL);
|
gpio_request(GPIO_TSC_IRQ, NULL);
|
||||||
|
gpio_request_one(GPIO_TSC_PORT, GPIOF_IN, NULL);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user