[PATCH V2 1/4] gpio: sprd: In the sleep state, the eic debounce clk must be forced open

Wenhua Lin posted 4 patches 2 years, 4 months ago
There is a newer version of this series
[PATCH V2 1/4] gpio: sprd: In the sleep state, the eic debounce clk must be forced open
Posted by Wenhua Lin 2 years, 4 months ago
In the sleep state, Eic debounce has no clock and the clk of
debounce needs to be forced open, so that eic can wake up normally.

Fixes: 2788938b7946 ("gpio: eic-sprd: Make the irqchip immutable")

Signed-off-by: Wenhua Lin <Wenhua.Lin@unisoc.com>
---
 drivers/gpio/gpio-eic-sprd.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpio/gpio-eic-sprd.c b/drivers/gpio/gpio-eic-sprd.c
index 84352a6f4973..bfa8a4c7515a 100644
--- a/drivers/gpio/gpio-eic-sprd.c
+++ b/drivers/gpio/gpio-eic-sprd.c
@@ -23,6 +23,7 @@
 #define SPRD_EIC_DBNC_IC		0x24
 #define SPRD_EIC_DBNC_TRIG		0x28
 #define SPRD_EIC_DBNC_CTRL0		0x40
+#define SPRD_EIC_DBNC_FORCE_CLK		0x8000
 
 #define SPRD_EIC_LATCH_INTEN		0x0
 #define SPRD_EIC_LATCH_INTRAW		0x4
@@ -214,6 +215,7 @@ static int sprd_eic_set_debounce(struct gpio_chip *chip, unsigned int offset,
 	u32 value = readl_relaxed(base + reg) & ~SPRD_EIC_DBNC_MASK;
 
 	value |= (debounce / 1000) & SPRD_EIC_DBNC_MASK;
+	value |= SPRD_EIC_DBNC_FORCE_CLK;
 	writel_relaxed(value, base + reg);
 
 	return 0;
-- 
2.17.1
Re: [PATCH V2 1/4] gpio: sprd: In the sleep state, the eic debounce clk must be forced open
Posted by Baolin Wang 2 years, 4 months ago

On 9/21/2023 5:00 PM, Wenhua Lin wrote:
> In the sleep state, Eic debounce has no clock and the clk of
> debounce needs to be forced open, so that eic can wake up normally.
> 
> Fixes: 2788938b7946 ("gpio: eic-sprd: Make the irqchip immutable")

Are you sure this is the right Fixes tag? This commit did not change EIC 
debounce logics.

The changes look good to me.

> Signed-off-by: Wenhua Lin <Wenhua.Lin@unisoc.com>
> ---
>   drivers/gpio/gpio-eic-sprd.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/gpio/gpio-eic-sprd.c b/drivers/gpio/gpio-eic-sprd.c
> index 84352a6f4973..bfa8a4c7515a 100644
> --- a/drivers/gpio/gpio-eic-sprd.c
> +++ b/drivers/gpio/gpio-eic-sprd.c
> @@ -23,6 +23,7 @@
>   #define SPRD_EIC_DBNC_IC		0x24
>   #define SPRD_EIC_DBNC_TRIG		0x28
>   #define SPRD_EIC_DBNC_CTRL0		0x40
> +#define SPRD_EIC_DBNC_FORCE_CLK		0x8000
>   
>   #define SPRD_EIC_LATCH_INTEN		0x0
>   #define SPRD_EIC_LATCH_INTRAW		0x4
> @@ -214,6 +215,7 @@ static int sprd_eic_set_debounce(struct gpio_chip *chip, unsigned int offset,
>   	u32 value = readl_relaxed(base + reg) & ~SPRD_EIC_DBNC_MASK;
>   
>   	value |= (debounce / 1000) & SPRD_EIC_DBNC_MASK;
> +	value |= SPRD_EIC_DBNC_FORCE_CLK;
>   	writel_relaxed(value, base + reg);
>   
>   	return 0;
Re: [PATCH V2 1/4] gpio: sprd: In the sleep state, the eic debounce clk must be forced open
Posted by wenhua lin 2 years, 1 month ago
On Wed, Sep 27, 2023 at 5:08 PM Baolin Wang
<baolin.wang@linux.alibaba.com> wrote:
>
>
>
> On 9/21/2023 5:00 PM, Wenhua Lin wrote:
> > In the sleep state, Eic debounce has no clock and the clk of
> > debounce needs to be forced open, so that eic can wake up normally.
> >
> > Fixes: 2788938b7946 ("gpio: eic-sprd: Make the irqchip immutable")
>
> Are you sure this is the right Fixes tag? This commit did not change EIC
> debounce logics.
>
> The changes look good to me.

This modification turns on the debounce clock, and we will modify the
submission
description on patch v3. Thank you for your review.

>
> > Signed-off-by: Wenhua Lin <Wenhua.Lin@unisoc.com>
> > ---
> >   drivers/gpio/gpio-eic-sprd.c | 2 ++
> >   1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/gpio/gpio-eic-sprd.c b/drivers/gpio/gpio-eic-sprd.c
> > index 84352a6f4973..bfa8a4c7515a 100644
> > --- a/drivers/gpio/gpio-eic-sprd.c
> > +++ b/drivers/gpio/gpio-eic-sprd.c
> > @@ -23,6 +23,7 @@
> >   #define SPRD_EIC_DBNC_IC            0x24
> >   #define SPRD_EIC_DBNC_TRIG          0x28
> >   #define SPRD_EIC_DBNC_CTRL0         0x40
> > +#define SPRD_EIC_DBNC_FORCE_CLK              0x8000
> >
> >   #define SPRD_EIC_LATCH_INTEN                0x0
> >   #define SPRD_EIC_LATCH_INTRAW               0x4
> > @@ -214,6 +215,7 @@ static int sprd_eic_set_debounce(struct gpio_chip *chip, unsigned int offset,
> >       u32 value = readl_relaxed(base + reg) & ~SPRD_EIC_DBNC_MASK;
> >
> >       value |= (debounce / 1000) & SPRD_EIC_DBNC_MASK;
> > +     value |= SPRD_EIC_DBNC_FORCE_CLK;
> >       writel_relaxed(value, base + reg);
> >
> >       return 0;
Re: [PATCH V2 1/4] gpio: sprd: In the sleep state, the eic debounce clk must be forced open
Posted by Andy Shevchenko 2 years, 4 months ago
On Thu, Sep 21, 2023 at 05:00:24PM +0800, Wenhua Lin wrote:
> In the sleep state, Eic debounce has no clock and the clk of

Eic --> The eic

clk --> clock

> debounce needs to be forced open, so that eic can wake up normally.

> Fixes: 2788938b7946 ("gpio: eic-sprd: Make the irqchip immutable")
> 
> Signed-off-by: Wenhua Lin <Wenhua.Lin@unisoc.com>

The tag block mustn't have blank lines.

-- 
With Best Regards,
Andy Shevchenko
Re: [PATCH V2 1/4] gpio: sprd: In the sleep state, the eic debounce clk must be forced open
Posted by wenhua lin 2 years, 1 month ago
On Thu, Sep 21, 2023 at 7:25 PM Andy Shevchenko <andy@kernel.org> wrote:
>
> On Thu, Sep 21, 2023 at 05:00:24PM +0800, Wenhua Lin wrote:
> > In the sleep state, Eic debounce has no clock and the clk of
>
> Eic --> The eic
>
> clk --> clock
>
> > debounce needs to be forced open, so that eic can wake up normally.
>
> > Fixes: 2788938b7946 ("gpio: eic-sprd: Make the irqchip immutable")
> >
> > Signed-off-by: Wenhua Lin <Wenhua.Lin@unisoc.com>
>
> The tag block mustn't have blank lines.
>

Thank you very much for your review.
I will fix this issue in patch v3.

> --
> With Best Regards,
> Andy Shevchenko
>
>