2021-04-16 14:32:20

by Andy Shevchenko

[permalink] [raw]
Subject: [PATCH v2 1/4] fbtft: Replace custom ->reset() with generic one

The custom ->reset() repeats the generic one, replace it.

Note, in newer kernels the context of the function is a sleeping one,
it's fine to switch over to the sleeping functions. Keeping the reset
line asserted longer than 20 microseconds is also okay, it's an idling
state of the hardware.

Fixes: b2ebd4be6fa1 ("staging: fbtft: add fb_agm1264k-fl driver")
Signed-off-by: Andy Shevchenko <[email protected]>
---
v2: new patch split from the bigger fix (Greg)
drivers/staging/fbtft/fb_agm1264k-fl.c | 14 --------------
1 file changed, 14 deletions(-)

diff --git a/drivers/staging/fbtft/fb_agm1264k-fl.c b/drivers/staging/fbtft/fb_agm1264k-fl.c
index eeeeec97ad27..4dfc22d05a40 100644
--- a/drivers/staging/fbtft/fb_agm1264k-fl.c
+++ b/drivers/staging/fbtft/fb_agm1264k-fl.c
@@ -77,19 +77,6 @@ static int init_display(struct fbtft_par *par)
return 0;
}

-static void reset(struct fbtft_par *par)
-{
- if (!par->gpio.reset)
- return;
-
- dev_dbg(par->info->device, "%s()\n", __func__);
-
- gpiod_set_value(par->gpio.reset, 0);
- udelay(20);
- gpiod_set_value(par->gpio.reset, 1);
- mdelay(120);
-}
-
/* Check if all necessary GPIOS defined */
static int verify_gpios(struct fbtft_par *par)
{
@@ -439,7 +426,6 @@ static struct fbtft_display display = {
.set_addr_win = set_addr_win,
.verify_gpios = verify_gpios,
.request_gpios_match = request_gpios_match,
- .reset = reset,
.write = write,
.write_register = write_reg8_bus8,
.write_vmem = write_vmem,
--
2.30.2


2021-04-16 14:33:05

by Andy Shevchenko

[permalink] [raw]
Subject: [PATCH v2 4/4] fbtft: Update TODO

Now, after a few fixes we may consider the conversion to
the GPIO descriptor API is done.

Signed-off-by: Andy Shevchenko <[email protected]>
---
v2: new patch split from the bigger fix (Greg)
drivers/staging/fbtft/TODO | 5 -----
1 file changed, 5 deletions(-)

diff --git a/drivers/staging/fbtft/TODO b/drivers/staging/fbtft/TODO
index a9f4802bb6be..e72a08bf221c 100644
--- a/drivers/staging/fbtft/TODO
+++ b/drivers/staging/fbtft/TODO
@@ -1,8 +1,3 @@
-* convert all uses of the old GPIO API from <linux/gpio.h> to the
- GPIO descriptor API in <linux/gpio/consumer.h> and look up GPIO
- lines from device tree, ACPI or board files, board files should
- use <linux/gpio/machine.h>
-
* convert all these over to drm_simple_display_pipe and submit for inclusion
into the DRM subsystem under drivers/gpu/drm - fbdev doesn't take any new
drivers anymore.
--
2.30.2

2021-04-17 07:20:33

by Fabio Aiuto

[permalink] [raw]
Subject: Re: [PATCH v2 1/4] fbtft: Replace custom ->reset() with generic one

Hi,

'staging:' in mail subject is missing...

On Fri, Apr 16, 2021 at 05:20:41PM +0300, Andy Shevchenko wrote:
> The custom ->reset() repeats the generic one, replace it.
>
> Note, in newer kernels the context of the function is a sleeping one,
> it's fine to switch over to the sleeping functions. Keeping the reset
> line asserted longer than 20 microseconds is also okay, it's an idling
> state of the hardware.
>
> Fixes: b2ebd4be6fa1 ("staging: fbtft: add fb_agm1264k-fl driver")
> Signed-off-by: Andy Shevchenko <[email protected]>
> ---
> v2: new patch split from the bigger fix (Greg)
> drivers/staging/fbtft/fb_agm1264k-fl.c | 14 --------------
> 1 file changed, 14 deletions(-)
>
> diff --git a/drivers/staging/fbtft/fb_agm1264k-fl.c b/drivers/staging/fbtft/fb_agm1264k-fl.c
> index eeeeec97ad27..4dfc22d05a40 100644
> --- a/drivers/staging/fbtft/fb_agm1264k-fl.c
> +++ b/drivers/staging/fbtft/fb_agm1264k-fl.c
> @@ -77,19 +77,6 @@ static int init_display(struct fbtft_par *par)
> return 0;
> }
>
> -static void reset(struct fbtft_par *par)
> -{
> - if (!par->gpio.reset)
> - return;
> -
> - dev_dbg(par->info->device, "%s()\n", __func__);
> -
> - gpiod_set_value(par->gpio.reset, 0);
> - udelay(20);
> - gpiod_set_value(par->gpio.reset, 1);
> - mdelay(120);
> -}
> -
> /* Check if all necessary GPIOS defined */
> static int verify_gpios(struct fbtft_par *par)
> {
> @@ -439,7 +426,6 @@ static struct fbtft_display display = {
> .set_addr_win = set_addr_win,
> .verify_gpios = verify_gpios,
> .request_gpios_match = request_gpios_match,
> - .reset = reset,
> .write = write,
> .write_register = write_reg8_bus8,
> .write_vmem = write_vmem,
> --
> 2.30.2
>
>

thank you,

fabio

2021-04-27 11:08:41

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH v2 1/4] fbtft: Replace custom ->reset() with generic one

On Fri, Apr 16, 2021 at 05:20:41PM +0300, Andy Shevchenko wrote:
> The custom ->reset() repeats the generic one, replace it.
>
> Note, in newer kernels the context of the function is a sleeping one,
> it's fine to switch over to the sleeping functions. Keeping the reset
> line asserted longer than 20 microseconds is also okay, it's an idling
> state of the hardware.
>
> Fixes: b2ebd4be6fa1 ("staging: fbtft: add fb_agm1264k-fl driver")

What does this "fix"? A bug or just a "it shouldn't have been done this
way"?

And as others pointed out, if you could put "staging: fbtft:" as a
prefix here, that would be much better.

thanks,

greg k-h

2021-04-27 12:11:18

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH v2 1/4] fbtft: Replace custom ->reset() with generic one

On Tue, Apr 27, 2021 at 2:09 PM Greg Kroah-Hartman
<[email protected]> wrote:
> On Fri, Apr 16, 2021 at 05:20:41PM +0300, Andy Shevchenko wrote:
> > The custom ->reset() repeats the generic one, replace it.
> >
> > Note, in newer kernels the context of the function is a sleeping one,
> > it's fine to switch over to the sleeping functions. Keeping the reset
> > line asserted longer than 20 microseconds is also okay, it's an idling
> > state of the hardware.
> >
> > Fixes: b2ebd4be6fa1 ("staging: fbtft: add fb_agm1264k-fl driver")
>
> What does this "fix"? A bug or just a "it shouldn't have been done this
> way"?

There is nothing to fix actually, it's rather a pointer where this
change has been missed for some reason. I'll remove the tag.

> And as others pointed out, if you could put "staging: fbtft:" as a
> prefix here, that would be much better.

Got it, thanks!

--
With Best Regards,
Andy Shevchenko