Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4a666a78 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Simon Horman
Browse files

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: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: default avatarSimon Horman <horms+renesas@verge.net.au>
parent 5436c2b9
Loading
Loading
Loading
Loading
+2 −11
Original line number Diff line number Diff line
@@ -1037,22 +1037,13 @@ static void __init hdmi_init_pm_clock(void)
#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;
}