summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpio-eic-sprd.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2019-02-17 21:59:33 +0100
committerLinus Walleij <linus.walleij@linaro.org>2019-02-17 21:59:33 +0100
commit8fab3d713ca36bf4ad4dadec0bf38f5e70b8999d (patch)
tree18cdadced0870584ceffa02eed47f4c86da8263c /drivers/gpio/gpio-eic-sprd.c
parent760a160e8b899f5ebcab99da17feebbe40ec42f1 (diff)
parent68b7587baabfa42ca5625b709691358fee51b9d8 (diff)
Merge tag 'gpio-v5.1-updates-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux into devel
gpio updates for v5.1 - support for a new variant of pca953x - documentation fix from Wolfram - some tegra186 name changes - two minor fixes for madera and altera-a10sr
Diffstat (limited to 'drivers/gpio/gpio-eic-sprd.c')
-rw-r--r--drivers/gpio/gpio-eic-sprd.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-eic-sprd.c b/drivers/gpio/gpio-eic-sprd.c
index 64cc87d91790..f0223cee9774 100644
--- a/drivers/gpio/gpio-eic-sprd.c
+++ b/drivers/gpio/gpio-eic-sprd.c
@@ -180,7 +180,18 @@ static void sprd_eic_free(struct gpio_chip *chip, unsigned int offset)
static int sprd_eic_get(struct gpio_chip *chip, unsigned int offset)
{
- return sprd_eic_read(chip, offset, SPRD_EIC_DBNC_DATA);
+ struct sprd_eic *sprd_eic = gpiochip_get_data(chip);
+
+ switch (sprd_eic->type) {
+ case SPRD_EIC_DEBOUNCE:
+ return sprd_eic_read(chip, offset, SPRD_EIC_DBNC_DATA);
+ case SPRD_EIC_ASYNC:
+ return sprd_eic_read(chip, offset, SPRD_EIC_ASYNC_DATA);
+ case SPRD_EIC_SYNC:
+ return sprd_eic_read(chip, offset, SPRD_EIC_SYNC_DATA);
+ default:
+ return -ENOTSUPP;
+ }
}
static int sprd_eic_direction_input(struct gpio_chip *chip, unsigned int offset)
@@ -368,6 +379,7 @@ static int sprd_eic_irq_set_type(struct irq_data *data, unsigned int flow_type)
irq_set_handler_locked(data, handle_edge_irq);
break;
case IRQ_TYPE_EDGE_BOTH:
+ sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTMODE, 0);
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTBOTH, 1);
irq_set_handler_locked(data, handle_edge_irq);
break;