public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/3] gpio: sprd: In the sleep state, the eic dbnc clk must be forced open
@ 2023-08-08  3:31 Wenhua Lin
  2023-08-08  9:36 ` Chunyan Zhang
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Wenhua Lin @ 2023-08-08  3:31 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko, Orson Zhai,
	Baolin Wang, Chunyan Zhang
  Cc: linux-serial, linux-kernel, wenhua lin, Wenhua Lin, Xiongpeng Wu

In the sleep state, Eic dbnc has no clock and the clk enable
of dbnc needs to be forced open, so that eic can wake up normally.

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 0d85d9e80848..c506cfd6df8e 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
@@ -213,6 +214,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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/3] gpio: sprd: In the sleep state, the eic dbnc clk must be forced open
  2023-08-08  3:31 [PATCH 2/3] gpio: sprd: In the sleep state, the eic dbnc clk must be forced open Wenhua Lin
@ 2023-08-08  9:36 ` Chunyan Zhang
  2023-08-08 13:23   ` Andy Shevchenko
  2023-08-10  6:53   ` wenhua lin
  2023-08-08 13:22 ` Andy Shevchenko
  2023-08-09  1:29 ` Baolin Wang
  2 siblings, 2 replies; 8+ messages in thread
From: Chunyan Zhang @ 2023-08-08  9:36 UTC (permalink / raw)
  To: Wenhua Lin
  Cc: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko, Orson Zhai,
	Baolin Wang, linux-serial, linux-kernel, wenhua lin, Xiongpeng Wu

On Tue, 8 Aug 2023 at 11:32, Wenhua Lin <Wenhua.Lin@unisoc.com> wrote:
>
> In the sleep state, Eic dbnc has no clock and the clk enable

Does "dbnc" mean "debounce"? I suggest not using abbreviation here.

> of dbnc needs to be forced open, so that eic can wake up normally.
>
> 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 0d85d9e80848..c506cfd6df8e 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
> @@ -213,6 +214,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
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/3] gpio: sprd: In the sleep state, the eic dbnc clk must be forced open
  2023-08-08  3:31 [PATCH 2/3] gpio: sprd: In the sleep state, the eic dbnc clk must be forced open Wenhua Lin
  2023-08-08  9:36 ` Chunyan Zhang
@ 2023-08-08 13:22 ` Andy Shevchenko
  2023-08-10  7:03   ` wenhua lin
  2023-08-09  1:29 ` Baolin Wang
  2 siblings, 1 reply; 8+ messages in thread
From: Andy Shevchenko @ 2023-08-08 13:22 UTC (permalink / raw)
  To: Wenhua Lin
  Cc: Linus Walleij, Bartosz Golaszewski, Orson Zhai, Baolin Wang,
	Chunyan Zhang, linux-serial, linux-kernel, wenhua lin,
	Xiongpeng Wu

On Tue, Aug 08, 2023 at 11:31:30AM +0800, Wenhua Lin wrote:
> In the sleep state, Eic dbnc has no clock and the clk enable

Comma is not needed here.

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

...

> +#define SPRD_EIC_DBNC_FORCE_CLK		0x8000

BIT(15) ?

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/3] gpio: sprd: In the sleep state, the eic dbnc clk must be forced open
  2023-08-08  9:36 ` Chunyan Zhang
@ 2023-08-08 13:23   ` Andy Shevchenko
  2023-08-10  6:53   ` wenhua lin
  1 sibling, 0 replies; 8+ messages in thread
From: Andy Shevchenko @ 2023-08-08 13:23 UTC (permalink / raw)
  To: Chunyan Zhang
  Cc: Wenhua Lin, Linus Walleij, Bartosz Golaszewski, Orson Zhai,
	Baolin Wang, linux-serial, linux-kernel, wenhua lin, Xiongpeng Wu

On Tue, Aug 08, 2023 at 05:36:05PM +0800, Chunyan Zhang wrote:
> On Tue, 8 Aug 2023 at 11:32, Wenhua Lin <Wenhua.Lin@unisoc.com> wrote:
> >
> > In the sleep state, Eic dbnc has no clock and the clk enable
> 
> Does "dbnc" mean "debounce"? I suggest not using abbreviation here.

Also +1 here.

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


-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/3] gpio: sprd: In the sleep state, the eic dbnc clk must be forced open
  2023-08-08  3:31 [PATCH 2/3] gpio: sprd: In the sleep state, the eic dbnc clk must be forced open Wenhua Lin
  2023-08-08  9:36 ` Chunyan Zhang
  2023-08-08 13:22 ` Andy Shevchenko
@ 2023-08-09  1:29 ` Baolin Wang
  2023-08-10  7:04   ` wenhua lin
  2 siblings, 1 reply; 8+ messages in thread
From: Baolin Wang @ 2023-08-09  1:29 UTC (permalink / raw)
  To: Wenhua Lin, Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Orson Zhai, Chunyan Zhang
  Cc: linux-serial, linux-kernel, wenhua lin, Xiongpeng Wu



On 8/8/2023 11:31 AM, Wenhua Lin wrote:
> In the sleep state, Eic dbnc has no clock and the clk enable
> of dbnc needs to be forced open, so that eic can wake up normally.

Sounds reasonable to me. Should add a Fixes tag if need to backport for 
stable kernel?

> 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 0d85d9e80848..c506cfd6df8e 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
> @@ -213,6 +214,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;

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/3] gpio: sprd: In the sleep state, the eic dbnc clk must be forced open
  2023-08-08  9:36 ` Chunyan Zhang
  2023-08-08 13:23   ` Andy Shevchenko
@ 2023-08-10  6:53   ` wenhua lin
  1 sibling, 0 replies; 8+ messages in thread
From: wenhua lin @ 2023-08-10  6:53 UTC (permalink / raw)
  To: Chunyan Zhang
  Cc: Wenhua Lin, Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Orson Zhai, Baolin Wang, linux-serial, linux-kernel, Xiongpeng Wu

On Tue, Aug 8, 2023 at 5:36 PM Chunyan Zhang <zhang.lyra@gmail.com> wrote:
>
> On Tue, 8 Aug 2023 at 11:32, Wenhua Lin <Wenhua.Lin@unisoc.com> wrote:
> >
> > In the sleep state, Eic dbnc has no clock and the clk enable
>
> Does "dbnc" mean "debounce"? I suggest not using abbreviation here.

Hi chunyan:
    dbnc is debounce, We will make changes in patch v2.

Thanks

>
> > of dbnc needs to be forced open, so that eic can wake up normally.
> >
> > 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 0d85d9e80848..c506cfd6df8e 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
> > @@ -213,6 +214,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
> >

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/3] gpio: sprd: In the sleep state, the eic dbnc clk must be forced open
  2023-08-08 13:22 ` Andy Shevchenko
@ 2023-08-10  7:03   ` wenhua lin
  0 siblings, 0 replies; 8+ messages in thread
From: wenhua lin @ 2023-08-10  7:03 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Wenhua Lin, Linus Walleij, Bartosz Golaszewski, Orson Zhai,
	Baolin Wang, Chunyan Zhang, linux-serial, linux-kernel,
	Xiongpeng Wu

On Tue, Aug 8, 2023 at 9:23 PM Andy Shevchenko <andy@kernel.org> wrote:
>
> On Tue, Aug 08, 2023 at 11:31:30AM +0800, Wenhua Lin wrote:
> > In the sleep state, Eic dbnc has no clock and the clk enable
>
> Comma is not needed here.

Hi Andy:
We will make changes in patch v2.

Thanks
Wernhua.Lin

>
> > of dbnc needs to be forced open, so that eic can wake up normally.
>
> ...
>
> > +#define SPRD_EIC_DBNC_FORCE_CLK              0x8000
>
> BIT(15) ?

Hi Andy:
Yes, The bit15 is clock of dbnc forced open

Thanks
Wernhua.Lin

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/3] gpio: sprd: In the sleep state, the eic dbnc clk must be forced open
  2023-08-09  1:29 ` Baolin Wang
@ 2023-08-10  7:04   ` wenhua lin
  0 siblings, 0 replies; 8+ messages in thread
From: wenhua lin @ 2023-08-10  7:04 UTC (permalink / raw)
  To: Baolin Wang
  Cc: Wenhua Lin, Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Orson Zhai, Chunyan Zhang, linux-serial, linux-kernel,
	Xiongpeng Wu

On Wed, Aug 9, 2023 at 9:29 AM Baolin Wang
<baolin.wang@linux.alibaba.com> wrote:
>
>
>
> On 8/8/2023 11:31 AM, Wenhua Lin wrote:
> > In the sleep state, Eic dbnc has no clock and the clk enable
> > of dbnc needs to be forced open, so that eic can wake up normally.
>
> Sounds reasonable to me. Should add a Fixes tag if need to backport for
> stable kernel?

Hi baolin:
We will make changes in patch v2.

Thanks
Wernhua.Lin

>
> > 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 0d85d9e80848..c506cfd6df8e 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
> > @@ -213,6 +214,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;

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-08-10  7:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-08  3:31 [PATCH 2/3] gpio: sprd: In the sleep state, the eic dbnc clk must be forced open Wenhua Lin
2023-08-08  9:36 ` Chunyan Zhang
2023-08-08 13:23   ` Andy Shevchenko
2023-08-10  6:53   ` wenhua lin
2023-08-08 13:22 ` Andy Shevchenko
2023-08-10  7:03   ` wenhua lin
2023-08-09  1:29 ` Baolin Wang
2023-08-10  7:04   ` wenhua lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox