From: Bartosz Golaszewski <[email protected]>
While working on my other series related to gpio-backlight[1] I noticed
that we could simplify the driver if we made the only user of platform
data use GPIO lookups and device properties. This series tries to do
that.
The first patch adds all necessary data structures to ecovec24. Patch
2/7 unifies much of the code for both pdata and non-pdata cases. Patches
3-4/7 remove unused platform data fields. Last three patches contain
additional improvements for the GPIO backlight driver while we're already
modifying it.
I don't have access to this HW but hopefully this works. Only compile
tested.
[1] https://lkml.org/lkml/2019/6/25/900
v1 -> v2:
- rebased on top of v5.3-rc1 and adjusted to the recent changes from Andy
- added additional two patches with minor improvements
v2 -> v3:
- in patch 7/7: used initializers to set values for pdata and dev local vars
Bartosz Golaszewski (7):
sh: ecovec24: add additional properties to the backlight device
backlight: gpio: simplify the platform data handling
sh: ecovec24: don't set unused fields in platform data
backlight: gpio: remove unused fields from platform data
backlight: gpio: remove dev from struct gpio_backlight
backlight: gpio: remove def_value from struct gpio_backlight
backlight: gpio: use a helper variable for &pdev->dev
arch/sh/boards/mach-ecovec24/setup.c | 33 ++++++--
drivers/video/backlight/gpio_backlight.c | 82 +++++---------------
include/linux/platform_data/gpio_backlight.h | 3 -
3 files changed, 44 insertions(+), 74 deletions(-)
--
2.21.0
From: Bartosz Golaszewski <[email protected]>
Add a GPIO lookup entry and a device property for GPIO backlight to the
board file. Tie them to the platform device which is now registered using
platform_device_register_full() because of the properties. These changes
are inactive now but will be used once the gpio backlight driver is
modified.
Signed-off-by: Bartosz Golaszewski <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
---
arch/sh/boards/mach-ecovec24/setup.c | 30 +++++++++++++++++++++++-----
1 file changed, 25 insertions(+), 5 deletions(-)
diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
index f402aa741bf3..6926bb3865b9 100644
--- a/arch/sh/boards/mach-ecovec24/setup.c
+++ b/arch/sh/boards/mach-ecovec24/setup.c
@@ -371,6 +371,19 @@ static struct platform_device lcdc_device = {
},
};
+static struct gpiod_lookup_table gpio_backlight_lookup = {
+ .dev_id = "gpio-backlight.0",
+ .table = {
+ GPIO_LOOKUP("sh7724_pfc", GPIO_PTR1, NULL, GPIO_ACTIVE_HIGH),
+ { }
+ },
+};
+
+static struct property_entry gpio_backlight_props[] = {
+ PROPERTY_ENTRY_BOOL("default-on"),
+ { }
+};
+
static struct gpio_backlight_platform_data gpio_backlight_data = {
.fbdev = &lcdc_device.dev,
.gpio = GPIO_PTR1,
@@ -378,13 +391,15 @@ static struct gpio_backlight_platform_data gpio_backlight_data = {
.name = "backlight",
};
-static struct platform_device gpio_backlight_device = {
+static const struct platform_device_info gpio_backlight_device_info = {
.name = "gpio-backlight",
- .dev = {
- .platform_data = &gpio_backlight_data,
- },
+ .data = &gpio_backlight_data,
+ .size_data = sizeof(gpio_backlight_data),
+ .properties = gpio_backlight_props,
};
+static struct platform_device *gpio_backlight_device;
+
/* CEU0 */
static struct ceu_platform_data ceu0_pdata = {
.num_subdevs = 2,
@@ -1006,7 +1021,6 @@ static struct platform_device *ecovec_devices[] __initdata = {
&usb1_common_device,
&usbhs_device,
&lcdc_device,
- &gpio_backlight_device,
&keysc_device,
&cn12_power,
#if defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE)
@@ -1464,6 +1478,12 @@ static int __init arch_setup(void)
#endif
#endif
+ gpiod_add_lookup_table(&gpio_backlight_lookup);
+ gpio_backlight_device = platform_device_register_full(
+ &gpio_backlight_device_info);
+ if (IS_ERR(gpio_backlight_device))
+ return PTR_ERR(gpio_backlight_device);
+
return platform_add_devices(ecovec_devices,
ARRAY_SIZE(ecovec_devices));
}
--
2.21.0
śr., 24 lip 2019 o 10:25 Bartosz Golaszewski <[email protected]> napisał(a):
>
> From: Bartosz Golaszewski <[email protected]>
>
> While working on my other series related to gpio-backlight[1] I noticed
> that we could simplify the driver if we made the only user of platform
> data use GPIO lookups and device properties. This series tries to do
> that.
>
> The first patch adds all necessary data structures to ecovec24. Patch
> 2/7 unifies much of the code for both pdata and non-pdata cases. Patches
> 3-4/7 remove unused platform data fields. Last three patches contain
> additional improvements for the GPIO backlight driver while we're already
> modifying it.
>
> I don't have access to this HW but hopefully this works. Only compile
> tested.
>
> [1] https://lkml.org/lkml/2019/6/25/900
>
> v1 -> v2:
> - rebased on top of v5.3-rc1 and adjusted to the recent changes from Andy
> - added additional two patches with minor improvements
>
> v2 -> v3:
> - in patch 7/7: used initializers to set values for pdata and dev local vars
>
> Bartosz Golaszewski (7):
> sh: ecovec24: add additional properties to the backlight device
> backlight: gpio: simplify the platform data handling
> sh: ecovec24: don't set unused fields in platform data
> backlight: gpio: remove unused fields from platform data
> backlight: gpio: remove dev from struct gpio_backlight
> backlight: gpio: remove def_value from struct gpio_backlight
> backlight: gpio: use a helper variable for &pdev->dev
>
> arch/sh/boards/mach-ecovec24/setup.c | 33 ++++++--
> drivers/video/backlight/gpio_backlight.c | 82 +++++---------------
> include/linux/platform_data/gpio_backlight.h | 3 -
> 3 files changed, 44 insertions(+), 74 deletions(-)
>
> --
> 2.21.0
>
Daniel,
I missed your review tags - could you add them again?
Thanks,
Bart
From: Bartosz Golaszewski <[email protected]>
Remove the platform data fields that nobody uses.
Signed-off-by: Bartosz Golaszewski <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
---
include/linux/platform_data/gpio_backlight.h | 3 ---
1 file changed, 3 deletions(-)
diff --git a/include/linux/platform_data/gpio_backlight.h b/include/linux/platform_data/gpio_backlight.h
index 34179d600360..1a8b5b1946fe 100644
--- a/include/linux/platform_data/gpio_backlight.h
+++ b/include/linux/platform_data/gpio_backlight.h
@@ -9,9 +9,6 @@ struct device;
struct gpio_backlight_platform_data {
struct device *fbdev;
- int gpio;
- int def_value;
- const char *name;
};
#endif
--
2.21.0
On Wed, Jul 24, 2019 at 10:25:05AM +0200, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <[email protected]>
>
> Remove the platform data fields that nobody uses.
>
> Signed-off-by: Bartosz Golaszewski <[email protected]>
> Reviewed-by: Andy Shevchenko <[email protected]>
Reviewed-by: Daniel Thompson <[email protected]>
> ---
> include/linux/platform_data/gpio_backlight.h | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/include/linux/platform_data/gpio_backlight.h b/include/linux/platform_data/gpio_backlight.h
> index 34179d600360..1a8b5b1946fe 100644
> --- a/include/linux/platform_data/gpio_backlight.h
> +++ b/include/linux/platform_data/gpio_backlight.h
> @@ -9,9 +9,6 @@ struct device;
>
> struct gpio_backlight_platform_data {
> struct device *fbdev;
> - int gpio;
> - int def_value;
> - const char *name;
> };
>
> #endif
> --
> 2.21.0
>
On Wed, Jul 24, 2019 at 10:25 AM Bartosz Golaszewski <[email protected]> wrote:
> From: Bartosz Golaszewski <[email protected]>
>
> While working on my other series related to gpio-backlight[1] I noticed
> that we could simplify the driver if we made the only user of platform
> data use GPIO lookups and device properties. This series tries to do
> that.
>
> The first patch adds all necessary data structures to ecovec24. Patch
> 2/7 unifies much of the code for both pdata and non-pdata cases. Patches
> 3-4/7 remove unused platform data fields. Last three patches contain
> additional improvements for the GPIO backlight driver while we're already
> modifying it.
>
> I don't have access to this HW but hopefully this works. Only compile
> tested.
>
> [1] https://lkml.org/lkml/2019/6/25/900
>
> v1 -> v2:
> - rebased on top of v5.3-rc1 and adjusted to the recent changes from Andy
> - added additional two patches with minor improvements
>
> v2 -> v3:
> - in patch 7/7: used initializers to set values for pdata and dev local vars
The series:
Reviewed-by: Linus Walleij <[email protected]>
Yours,
Linus Walleij
śr., 24 lip 2019 o 10:25 Bartosz Golaszewski <[email protected]> napisał(a):
>
> From: Bartosz Golaszewski <[email protected]>
>
> While working on my other series related to gpio-backlight[1] I noticed
> that we could simplify the driver if we made the only user of platform
> data use GPIO lookups and device properties. This series tries to do
> that.
>
> The first patch adds all necessary data structures to ecovec24. Patch
> 2/7 unifies much of the code for both pdata and non-pdata cases. Patches
> 3-4/7 remove unused platform data fields. Last three patches contain
> additional improvements for the GPIO backlight driver while we're already
> modifying it.
>
> I don't have access to this HW but hopefully this works. Only compile
> tested.
>
> [1] https://lkml.org/lkml/2019/6/25/900
>
> v1 -> v2:
> - rebased on top of v5.3-rc1 and adjusted to the recent changes from Andy
> - added additional two patches with minor improvements
>
> v2 -> v3:
> - in patch 7/7: used initializers to set values for pdata and dev local vars
>
> Bartosz Golaszewski (7):
> sh: ecovec24: add additional properties to the backlight device
> backlight: gpio: simplify the platform data handling
> sh: ecovec24: don't set unused fields in platform data
> backlight: gpio: remove unused fields from platform data
> backlight: gpio: remove dev from struct gpio_backlight
> backlight: gpio: remove def_value from struct gpio_backlight
> backlight: gpio: use a helper variable for &pdev->dev
>
> arch/sh/boards/mach-ecovec24/setup.c | 33 ++++++--
> drivers/video/backlight/gpio_backlight.c | 82 +++++---------------
> include/linux/platform_data/gpio_backlight.h | 3 -
> 3 files changed, 44 insertions(+), 74 deletions(-)
>
> --
> 2.21.0
>
Hi Rich, Yoshinori,
can you ack the sh patches in this series?
Bart
czw., 8 sie 2019 o 10:17 Bartosz Golaszewski <[email protected]> napisał(a):
>
> śr., 24 lip 2019 o 10:25 Bartosz Golaszewski <[email protected]> napisał(a):
> >
> > From: Bartosz Golaszewski <[email protected]>
> >
> > While working on my other series related to gpio-backlight[1] I noticed
> > that we could simplify the driver if we made the only user of platform
> > data use GPIO lookups and device properties. This series tries to do
> > that.
> >
> > The first patch adds all necessary data structures to ecovec24. Patch
> > 2/7 unifies much of the code for both pdata and non-pdata cases. Patches
> > 3-4/7 remove unused platform data fields. Last three patches contain
> > additional improvements for the GPIO backlight driver while we're already
> > modifying it.
> >
> > I don't have access to this HW but hopefully this works. Only compile
> > tested.
> >
> > [1] https://lkml.org/lkml/2019/6/25/900
> >
> > v1 -> v2:
> > - rebased on top of v5.3-rc1 and adjusted to the recent changes from Andy
> > - added additional two patches with minor improvements
> >
> > v2 -> v3:
> > - in patch 7/7: used initializers to set values for pdata and dev local vars
> >
> > Bartosz Golaszewski (7):
> > sh: ecovec24: add additional properties to the backlight device
> > backlight: gpio: simplify the platform data handling
> > sh: ecovec24: don't set unused fields in platform data
> > backlight: gpio: remove unused fields from platform data
> > backlight: gpio: remove dev from struct gpio_backlight
> > backlight: gpio: remove def_value from struct gpio_backlight
> > backlight: gpio: use a helper variable for &pdev->dev
> >
> > arch/sh/boards/mach-ecovec24/setup.c | 33 ++++++--
> > drivers/video/backlight/gpio_backlight.c | 82 +++++---------------
> > include/linux/platform_data/gpio_backlight.h | 3 -
> > 3 files changed, 44 insertions(+), 74 deletions(-)
> >
> > --
> > 2.21.0
> >
>
> Hi Rich, Yoshinori,
>
> can you ack the sh patches in this series?
>
> Bart
Ping.
pt., 16 sie 2019 o 17:48 Bartosz Golaszewski <[email protected]> napisał(a):
>
> czw., 8 sie 2019 o 10:17 Bartosz Golaszewski <[email protected]> napisał(a):
> >
> > śr., 24 lip 2019 o 10:25 Bartosz Golaszewski <[email protected]> napisał(a):
> > >
> > > From: Bartosz Golaszewski <[email protected]>
> > >
> > > While working on my other series related to gpio-backlight[1] I noticed
> > > that we could simplify the driver if we made the only user of platform
> > > data use GPIO lookups and device properties. This series tries to do
> > > that.
> > >
> > > The first patch adds all necessary data structures to ecovec24. Patch
> > > 2/7 unifies much of the code for both pdata and non-pdata cases. Patches
> > > 3-4/7 remove unused platform data fields. Last three patches contain
> > > additional improvements for the GPIO backlight driver while we're already
> > > modifying it.
> > >
> > > I don't have access to this HW but hopefully this works. Only compile
> > > tested.
> > >
> > > [1] https://lkml.org/lkml/2019/6/25/900
> > >
> > > v1 -> v2:
> > > - rebased on top of v5.3-rc1 and adjusted to the recent changes from Andy
> > > - added additional two patches with minor improvements
> > >
> > > v2 -> v3:
> > > - in patch 7/7: used initializers to set values for pdata and dev local vars
> > >
> > > Bartosz Golaszewski (7):
> > > sh: ecovec24: add additional properties to the backlight device
> > > backlight: gpio: simplify the platform data handling
> > > sh: ecovec24: don't set unused fields in platform data
> > > backlight: gpio: remove unused fields from platform data
> > > backlight: gpio: remove dev from struct gpio_backlight
> > > backlight: gpio: remove def_value from struct gpio_backlight
> > > backlight: gpio: use a helper variable for &pdev->dev
> > >
> > > arch/sh/boards/mach-ecovec24/setup.c | 33 ++++++--
> > > drivers/video/backlight/gpio_backlight.c | 82 +++++---------------
> > > include/linux/platform_data/gpio_backlight.h | 3 -
> > > 3 files changed, 44 insertions(+), 74 deletions(-)
> > >
> > > --
> > > 2.21.0
> > >
> >
> > Hi Rich, Yoshinori,
> >
> > can you ack the sh patches in this series?
> >
> > Bart
>
> Ping.
Hi,
any chance of getting this reviewed for sh?
Bart
CC the pour soul with the ecovec board.
On Wed, Aug 28, 2019 at 9:33 AM Bartosz Golaszewski <[email protected]> wrote:
> pt., 16 sie 2019 o 17:48 Bartosz Golaszewski <[email protected]> napisał(a):
> > czw., 8 sie 2019 o 10:17 Bartosz Golaszewski <[email protected]> napisał(a):
> > > śr., 24 lip 2019 o 10:25 Bartosz Golaszewski <[email protected]> napisał(a):
> > > > From: Bartosz Golaszewski <[email protected]>
> > > >
> > > > While working on my other series related to gpio-backlight[1] I noticed
> > > > that we could simplify the driver if we made the only user of platform
> > > > data use GPIO lookups and device properties. This series tries to do
> > > > that.
> > > >
> > > > The first patch adds all necessary data structures to ecovec24. Patch
> > > > 2/7 unifies much of the code for both pdata and non-pdata cases. Patches
> > > > 3-4/7 remove unused platform data fields. Last three patches contain
> > > > additional improvements for the GPIO backlight driver while we're already
> > > > modifying it.
> > > >
> > > > I don't have access to this HW but hopefully this works. Only compile
> > > > tested.
> > > >
> > > > [1] https://lkml.org/lkml/2019/6/25/900
> > > >
> > > > v1 -> v2:
> > > > - rebased on top of v5.3-rc1 and adjusted to the recent changes from Andy
> > > > - added additional two patches with minor improvements
> > > >
> > > > v2 -> v3:
> > > > - in patch 7/7: used initializers to set values for pdata and dev local vars
> > > >
> > > > Bartosz Golaszewski (7):
> > > > sh: ecovec24: add additional properties to the backlight device
> > > > backlight: gpio: simplify the platform data handling
> > > > sh: ecovec24: don't set unused fields in platform data
> > > > backlight: gpio: remove unused fields from platform data
> > > > backlight: gpio: remove dev from struct gpio_backlight
> > > > backlight: gpio: remove def_value from struct gpio_backlight
> > > > backlight: gpio: use a helper variable for &pdev->dev
> > > >
> > > > arch/sh/boards/mach-ecovec24/setup.c | 33 ++++++--
> > > > drivers/video/backlight/gpio_backlight.c | 82 +++++---------------
> > > > include/linux/platform_data/gpio_backlight.h | 3 -
> > > > 3 files changed, 44 insertions(+), 74 deletions(-)
> > > >
> > > > --
> > > > 2.21.0
> > > >
> > >
> > > Hi Rich, Yoshinori,
> > >
> > > can you ack the sh patches in this series?
> > >
> > > Bart
> >
> > Ping.
>
> Hi,
>
> any chance of getting this reviewed for sh?
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
On Wed, Aug 28, 2019 at 10:36 AM Geert Uytterhoeven
<[email protected]> wrote:
> CC the pour soul with the ecovec board.
With great power comes great responsibility ;)
Yours,
Linus Walleij
Hi Geert,
On Wed, Aug 28, 2019 at 06:31:19PM +0200, Linus Walleij wrote:
> On Wed, Aug 28, 2019 at 10:36 AM Geert Uytterhoeven
> <[email protected]> wrote:
>
> > CC the pour soul with the ecovec board.
>
I'm sorry, Eco what ? :)
> With great power comes great responsibility ;)
>
Yeah, that's -exactly- a 'great powers' board :)
I'll try to resurect it from the deads again and get back eventually
with a tested-by.
I only briefly looked at the series and I don't have any LCD to test
the backlight with, I hope I can sample the backlight GPIO value from
some test point, if I ever find the schematics...
> Yours,
> Linus Walleij
On Wed, 24 Jul 2019, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <[email protected]>
>
> While working on my other series related to gpio-backlight[1] I noticed
> that we could simplify the driver if we made the only user of platform
> data use GPIO lookups and device properties. This series tries to do
> that.
>
> The first patch adds all necessary data structures to ecovec24. Patch
> 2/7 unifies much of the code for both pdata and non-pdata cases. Patches
> 3-4/7 remove unused platform data fields. Last three patches contain
> additional improvements for the GPIO backlight driver while we're already
> modifying it.
>
> I don't have access to this HW but hopefully this works. Only compile
> tested.
>
> [1] https://lkml.org/lkml/2019/6/25/900
>
> v1 -> v2:
> - rebased on top of v5.3-rc1 and adjusted to the recent changes from Andy
> - added additional two patches with minor improvements
>
> v2 -> v3:
> - in patch 7/7: used initializers to set values for pdata and dev local vars
>
> Bartosz Golaszewski (7):
> sh: ecovec24: add additional properties to the backlight device
> backlight: gpio: simplify the platform data handling
> sh: ecovec24: don't set unused fields in platform data
> backlight: gpio: remove unused fields from platform data
> backlight: gpio: remove dev from struct gpio_backlight
> backlight: gpio: remove def_value from struct gpio_backlight
> backlight: gpio: use a helper variable for &pdev->dev
>
> arch/sh/boards/mach-ecovec24/setup.c | 33 ++++++--
> drivers/video/backlight/gpio_backlight.c | 82 +++++---------------
> include/linux/platform_data/gpio_backlight.h | 3 -
> 3 files changed, 44 insertions(+), 74 deletions(-)
Can you collect all your Acks and re-submit please?
--
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
pon., 2 wrz 2019 o 11:31 Lee Jones <[email protected]> napisał(a):
>
> On Wed, 24 Jul 2019, Bartosz Golaszewski wrote:
>
> > From: Bartosz Golaszewski <[email protected]>
> >
> > While working on my other series related to gpio-backlight[1] I noticed
> > that we could simplify the driver if we made the only user of platform
> > data use GPIO lookups and device properties. This series tries to do
> > that.
> >
> > The first patch adds all necessary data structures to ecovec24. Patch
> > 2/7 unifies much of the code for both pdata and non-pdata cases. Patches
> > 3-4/7 remove unused platform data fields. Last three patches contain
> > additional improvements for the GPIO backlight driver while we're already
> > modifying it.
> >
> > I don't have access to this HW but hopefully this works. Only compile
> > tested.
> >
> > [1] https://lkml.org/lkml/2019/6/25/900
> >
> > v1 -> v2:
> > - rebased on top of v5.3-rc1 and adjusted to the recent changes from Andy
> > - added additional two patches with minor improvements
> >
> > v2 -> v3:
> > - in patch 7/7: used initializers to set values for pdata and dev local vars
> >
> > Bartosz Golaszewski (7):
> > sh: ecovec24: add additional properties to the backlight device
> > backlight: gpio: simplify the platform data handling
> > sh: ecovec24: don't set unused fields in platform data
> > backlight: gpio: remove unused fields from platform data
> > backlight: gpio: remove dev from struct gpio_backlight
> > backlight: gpio: remove def_value from struct gpio_backlight
> > backlight: gpio: use a helper variable for &pdev->dev
> >
> > arch/sh/boards/mach-ecovec24/setup.c | 33 ++++++--
> > drivers/video/backlight/gpio_backlight.c | 82 +++++---------------
> > include/linux/platform_data/gpio_backlight.h | 3 -
> > 3 files changed, 44 insertions(+), 74 deletions(-)
>
> Can you collect all your Acks and re-submit please?
>
Done.
Bart
> --
> Lee Jones [李琼斯]
> Linaro Services Technical Lead
> Linaro.org │ Open source software for ARM SoCs
> Follow Linaro: Facebook | Twitter | Blog