* [PATCH] gpio: eic: sprd: Fix the incorrect EIC offset when toggling
@ 2019-09-16 9:56 Baolin Wang
2019-09-17 8:09 ` Bartosz Golaszewski
0 siblings, 1 reply; 2+ messages in thread
From: Baolin Wang @ 2019-09-16 9:56 UTC (permalink / raw)
To: linus.walleij, bgolaszewski
Cc: orsonzhai, zhang.lyra, baolin.wang, bruce.chen, linux-gpio, linux-kernel
From: Bruce Chen <bruce.chen@unisoc.com>
When toggling the level trigger to emulate the edge trigger, the
EIC offset is incorrect without adding the corresponding bank index,
thus fix it.
Fixes: 7bf0d7f62282 ("gpio: eic: Add edge trigger emulation for EIC")
Signed-off-by: Bruce Chen <bruce.chen@unisoc.com>
Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
---
drivers/gpio/gpio-eic-sprd.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/gpio/gpio-eic-sprd.c b/drivers/gpio/gpio-eic-sprd.c
index 7b9ac4a..090539f 100644
--- a/drivers/gpio/gpio-eic-sprd.c
+++ b/drivers/gpio/gpio-eic-sprd.c
@@ -530,11 +530,12 @@ static void sprd_eic_handle_one_type(struct gpio_chip *chip)
}
for_each_set_bit(n, ®, SPRD_EIC_PER_BANK_NR) {
- girq = irq_find_mapping(chip->irq.domain,
- bank * SPRD_EIC_PER_BANK_NR + n);
+ u32 offset = bank * SPRD_EIC_PER_BANK_NR + n;
+
+ girq = irq_find_mapping(chip->irq.domain, offset);
generic_handle_irq(girq);
- sprd_eic_toggle_trigger(chip, girq, n);
+ sprd_eic_toggle_trigger(chip, girq, offset);
}
}
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] gpio: eic: sprd: Fix the incorrect EIC offset when toggling
2019-09-16 9:56 [PATCH] gpio: eic: sprd: Fix the incorrect EIC offset when toggling Baolin Wang
@ 2019-09-17 8:09 ` Bartosz Golaszewski
0 siblings, 0 replies; 2+ messages in thread
From: Bartosz Golaszewski @ 2019-09-17 8:09 UTC (permalink / raw)
To: Baolin Wang
Cc: Linus Walleij, Orson Zhai, Lyra Zhang, bruce.chen, linux-gpio, LKML
pon., 16 wrz 2019 o 11:57 Baolin Wang <baolin.wang@linaro.org> napisał(a):
>
> From: Bruce Chen <bruce.chen@unisoc.com>
>
> When toggling the level trigger to emulate the edge trigger, the
> EIC offset is incorrect without adding the corresponding bank index,
> thus fix it.
>
> Fixes: 7bf0d7f62282 ("gpio: eic: Add edge trigger emulation for EIC")
> Signed-off-by: Bruce Chen <bruce.chen@unisoc.com>
> Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
> ---
> drivers/gpio/gpio-eic-sprd.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpio/gpio-eic-sprd.c b/drivers/gpio/gpio-eic-sprd.c
> index 7b9ac4a..090539f 100644
> --- a/drivers/gpio/gpio-eic-sprd.c
> +++ b/drivers/gpio/gpio-eic-sprd.c
> @@ -530,11 +530,12 @@ static void sprd_eic_handle_one_type(struct gpio_chip *chip)
> }
>
> for_each_set_bit(n, ®, SPRD_EIC_PER_BANK_NR) {
> - girq = irq_find_mapping(chip->irq.domain,
> - bank * SPRD_EIC_PER_BANK_NR + n);
> + u32 offset = bank * SPRD_EIC_PER_BANK_NR + n;
> +
> + girq = irq_find_mapping(chip->irq.domain, offset);
>
> generic_handle_irq(girq);
> - sprd_eic_toggle_trigger(chip, girq, n);
> + sprd_eic_toggle_trigger(chip, girq, offset);
> }
> }
> }
> --
> 1.7.9.5
>
Queued for fixes.
Bart
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-09-17 8:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-16 9:56 [PATCH] gpio: eic: sprd: Fix the incorrect EIC offset when toggling Baolin Wang
2019-09-17 8:09 ` Bartosz Golaszewski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).