From 2d3884998945cf3f995e9c2e0f157b59f4ec3e86 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Sun, 19 Feb 2017 17:14:33 -0800 Subject: Input: eeti_ts - respect interrupt set in client structure Instead of expecting that GPIO is always interrupt source, let's use interrupt specified in I2C client. Reviewed-by: Daniel Mack Signed-off-by: Dmitry Torokhov --- arch/arm/mach-pxa/raumfeld.c | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/arm') diff --git a/arch/arm/mach-pxa/raumfeld.c b/arch/arm/mach-pxa/raumfeld.c index e216433b56ed..1ed524ef9fff 100644 --- a/arch/arm/mach-pxa/raumfeld.c +++ b/arch/arm/mach-pxa/raumfeld.c @@ -973,6 +973,7 @@ static struct eeti_ts_platform_data eeti_ts_pdata = { static struct i2c_board_info raumfeld_controller_i2c_board_info __initdata = { .type = "eeti_ts", .addr = 0x0a, + .irq = PXA_GPIO_TO_IRQ(GPIO_TOUCH_IRQ), .platform_data = &eeti_ts_pdata, }; -- cgit v1.2.3 From d422be5f62ef7986d00afa4cd31eda5534ab7991 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Sun, 19 Feb 2017 16:22:13 -0800 Subject: Input: eeti_ts - expect platform code to set interrupt trigger Instead of keying interrupt trigger off GPIO polarity, let's rely on platform code to set it up properly for us. Reviewed-by: Daniel Mack Signed-off-by: Dmitry Torokhov --- arch/arm/mach-pxa/raumfeld.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-pxa/raumfeld.c b/arch/arm/mach-pxa/raumfeld.c index 1ed524ef9fff..e13f42a180cc 100644 --- a/arch/arm/mach-pxa/raumfeld.c +++ b/arch/arm/mach-pxa/raumfeld.c @@ -970,10 +970,19 @@ static struct eeti_ts_platform_data eeti_ts_pdata = { .irq_gpio = GPIO_TOUCH_IRQ, }; +static const struct resource raumfeld_controller_resources[] = __initconst { + { + .start = PXA_GPIO_TO_IRQ(GPIO_TOUCH_IRQ), + .end = PXA_GPIO_TO_IRQ(GPIO_TOUCH_IRQ), + .flags = IORESOURCE_IRQ | IRQF_TRIGGER_HIGH, + }, +}; + static struct i2c_board_info raumfeld_controller_i2c_board_info __initdata = { .type = "eeti_ts", .addr = 0x0a, - .irq = PXA_GPIO_TO_IRQ(GPIO_TOUCH_IRQ), + .resources = raumfeld_controller_resources, + .num_resources = ARRAY_SIZE(raumfeld_controller_resources), .platform_data = &eeti_ts_pdata, }; -- cgit v1.2.3 From d99caa472c0a28dc95dd9b98c30ee46f9755181f Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Sun, 19 Feb 2017 17:21:56 -0800 Subject: Input: eeti_ts - switch to gpiod API gpiod API allows standard way of specifying GPIO polarity and takes it into account when reading or setting GPIO state. It also allows us to switch to common way of obtaining GPIO descriptor and away form legacy platform data. Reviewed-by: Daniel Mack Signed-off-by: Dmitry Torokhov --- arch/arm/mach-pxa/raumfeld.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-pxa/raumfeld.c b/arch/arm/mach-pxa/raumfeld.c index e13f42a180cc..b55965ee43fb 100644 --- a/arch/arm/mach-pxa/raumfeld.c +++ b/arch/arm/mach-pxa/raumfeld.c @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include @@ -965,9 +964,13 @@ static struct i2c_board_info raumfeld_connector_i2c_board_info __initdata = { .addr = 0x48, }; -static struct eeti_ts_platform_data eeti_ts_pdata = { - .irq_active_high = 1, - .irq_gpio = GPIO_TOUCH_IRQ, +static struct gpiod_lookup_table raumfeld_controller_gpios_table = { + .dev_id = "0-000a", + .table = { + GPIO_LOOKUP("gpio-pxa", + GPIO_TOUCH_IRQ, "attn", GPIO_ACTIVE_HIGH), + { }, + }, }; static const struct resource raumfeld_controller_resources[] = __initconst { @@ -983,7 +986,6 @@ static struct i2c_board_info raumfeld_controller_i2c_board_info __initdata = { .addr = 0x0a, .resources = raumfeld_controller_resources, .num_resources = ARRAY_SIZE(raumfeld_controller_resources), - .platform_data = &eeti_ts_pdata, }; static struct platform_device *raumfeld_common_devices[] = { @@ -1074,6 +1076,8 @@ static void __init __maybe_unused raumfeld_controller_init(void) platform_device_register(&rotary_encoder_device); spi_register_board_info(ARRAY_AND_SIZE(controller_spi_devices)); + + gpiod_add_lookup_table(&raumfeld_controller_gpios_table); i2c_register_board_info(0, &raumfeld_controller_i2c_board_info, 1); ret = gpio_request(GPIO_SHUTDOWN_BATT, "battery shutdown"); -- cgit v1.2.3 From 312ec92daee499f4f1be86aaf07d6d9bfdaed795 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Tue, 18 Apr 2017 11:08:33 -0700 Subject: ARM: pxa/raumfeld: fix compile error in rotary controller resources When switching rotary controlelr from plain IRQ number to IRQ resource, I messed up the syntax. Fixes: d422be5f62ef ("Input: eeti_ts - expect platform code to set ... ") Reported-by: kbuild test robot Signed-off-by: Dmitry Torokhov --- arch/arm/mach-pxa/raumfeld.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-pxa/raumfeld.c b/arch/arm/mach-pxa/raumfeld.c index b55965ee43fb..e2c97728b3c6 100644 --- a/arch/arm/mach-pxa/raumfeld.c +++ b/arch/arm/mach-pxa/raumfeld.c @@ -973,7 +973,7 @@ static struct gpiod_lookup_table raumfeld_controller_gpios_table = { }, }; -static const struct resource raumfeld_controller_resources[] = __initconst { +static const struct resource raumfeld_controller_resources[] __initconst = { { .start = PXA_GPIO_TO_IRQ(GPIO_TOUCH_IRQ), .end = PXA_GPIO_TO_IRQ(GPIO_TOUCH_IRQ), -- cgit v1.2.3