Re: [PATCH] backlight: pwm_bl: Switch to full GPIO descriptor

2019-12-14 Thread Robert Jarzmik
Daniel Thompson  writes:

>
> ... I worry that palmtc.c is no longer compilable for some configs.
I you're right, there is a very simple way to test it :
make pxa_defconfig && make -j

It should scream if the compilation is broken, and the kernel CI should
certainly protect us.

Cheers.

-- 
Robert
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] backlight: pwm_bl: Switch to full GPIO descriptor

2019-12-13 Thread Linus Walleij
On Fri, Dec 13, 2019 at 6:30 PM Robert Jarzmik  wrote:
> Daniel Thompson  writes:
> >
> > ... I worry that palmtc.c is no longer compilable for some configs.
> I you're right, there is a very simple way to test it :
> make pxa_defconfig && make -j
>
> It should scream if the compilation is broken, and the kernel CI should
> certainly protect us.

I actually push my patches to the zeroday but it has reliability issues...

Yours,
Linus Walleij
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] backlight: pwm_bl: Switch to full GPIO descriptor

2019-12-06 Thread Bartosz Golaszewski
czw., 5 gru 2019 o 09:11 Linus Walleij  napisał(a):
>
> The PWM backlight still supports passing a enable GPIO line as
> platform data using the legacy  API.
>
> It turns out that ever board using this mechanism except one
> is pass .enable_gpio = -1. So we drop all these cargo-culted -1's
> from all instances of this platform data in the kernel.
>
> The remaning board, Palm TC, is converted to pass a machine
> descriptior table with the "enable" GPIO instead, and delete the
> platform data entry for enable_gpio and the code handling it
> and things should work smoothly with the new API.
>
> Cc: Krzysztof Kozlowski 
> Cc: Robert Jarzmik 
> Cc: Guan Xuetao 
> Cc: Bartosz Golaszewski 
> Signed-off-by: Linus Walleij 
> ---
>  arch/arm/mach-pxa/cm-x300.c   |  1 -
>  arch/arm/mach-pxa/colibri-pxa270-income.c |  1 -
>  arch/arm/mach-pxa/ezx.c   |  1 -
>  arch/arm/mach-pxa/hx4700.c|  1 -
>  arch/arm/mach-pxa/lpd270.c|  1 -
>  arch/arm/mach-pxa/magician.c  |  1 -
>  arch/arm/mach-pxa/mainstone.c |  1 -
>  arch/arm/mach-pxa/mioa701.c   |  1 -
>  arch/arm/mach-pxa/palm27x.c   |  1 -
>  arch/arm/mach-pxa/palmtc.c| 10 ++
>  arch/arm/mach-pxa/palmte2.c   |  1 -
>  arch/arm/mach-pxa/pcm990-baseboard.c  |  1 -
>  arch/arm/mach-pxa/tavorevb.c  |  2 --
>  arch/arm/mach-pxa/viper.c |  1 -
>  arch/arm/mach-pxa/z2.c|  2 --
>  arch/arm/mach-pxa/zylonite.c  |  1 -
>  arch/arm/mach-s3c24xx/mach-h1940.c|  1 -
>  arch/arm/mach-s3c24xx/mach-rx1950.c   |  1 -
>  arch/arm/mach-s3c64xx/dev-backlight.c |  3 ---
>  arch/arm/mach-s3c64xx/mach-crag6410.c |  1 -
>  arch/arm/mach-s3c64xx/mach-hmt.c  |  1 -
>  arch/arm/mach-s3c64xx/mach-smartq.c   |  1 -
>  arch/arm/mach-s3c64xx/mach-smdk6410.c |  2 +-
>  arch/unicore32/kernel/puv3-nb0916.c   |  1 -
>  drivers/video/backlight/pwm_bl.c  | 19 ---
>  include/linux/pwm_backlight.h |  2 --
>  26 files changed, 11 insertions(+), 48 deletions(-)
>
> diff --git a/arch/arm/mach-pxa/cm-x300.c b/arch/arm/mach-pxa/cm-x300.c
> index 425855f456f2..2e35354b61f5 100644
> --- a/arch/arm/mach-pxa/cm-x300.c
> +++ b/arch/arm/mach-pxa/cm-x300.c
> @@ -312,7 +312,6 @@ static struct pwm_lookup cm_x300_pwm_lookup[] = {
>  static struct platform_pwm_backlight_data cm_x300_backlight_data = {
> .max_brightness = 100,
> .dft_brightness = 100,
> -   .enable_gpio= -1,
>  };
>
>  static struct platform_device cm_x300_backlight_device = {
> diff --git a/arch/arm/mach-pxa/colibri-pxa270-income.c 
> b/arch/arm/mach-pxa/colibri-pxa270-income.c
> index dbad2f13706c..e5879e8b0682 100644
> --- a/arch/arm/mach-pxa/colibri-pxa270-income.c
> +++ b/arch/arm/mach-pxa/colibri-pxa270-income.c
> @@ -202,7 +202,6 @@ static struct pwm_lookup income_pwm_lookup[] = {
>  static struct platform_pwm_backlight_data income_backlight_data = {
> .max_brightness = 0x3ff,
> .dft_brightness = 0x1ff,
> -   .enable_gpio= -1,
>  };
>
>  static struct platform_device income_backlight = {
> diff --git a/arch/arm/mach-pxa/ezx.c b/arch/arm/mach-pxa/ezx.c
> index ec10851b63cf..eb85950e7c0e 100644
> --- a/arch/arm/mach-pxa/ezx.c
> +++ b/arch/arm/mach-pxa/ezx.c
> @@ -55,7 +55,6 @@ static struct pwm_lookup ezx_pwm_lookup[] __maybe_unused = {
>  static struct platform_pwm_backlight_data ezx_backlight_data = {
> .max_brightness = 1023,
> .dft_brightness = 1023,
> -   .enable_gpio= -1,
>  };
>
>  static struct platform_device ezx_backlight_device = {
> diff --git a/arch/arm/mach-pxa/hx4700.c b/arch/arm/mach-pxa/hx4700.c
> index 311268d186ab..60186224df49 100644
> --- a/arch/arm/mach-pxa/hx4700.c
> +++ b/arch/arm/mach-pxa/hx4700.c
> @@ -557,7 +557,6 @@ static struct platform_device hx4700_lcd = {
>  static struct platform_pwm_backlight_data backlight_data = {
> .max_brightness = 200,
> .dft_brightness = 100,
> -   .enable_gpio= -1,
>  };
>
>  static struct platform_device backlight = {
> diff --git a/arch/arm/mach-pxa/lpd270.c b/arch/arm/mach-pxa/lpd270.c
> index 20e00e970385..6fc40bc06910 100644
> --- a/arch/arm/mach-pxa/lpd270.c
> +++ b/arch/arm/mach-pxa/lpd270.c
> @@ -277,7 +277,6 @@ static struct pwm_lookup lpd270_pwm_lookup[] = {
>  static struct platform_pwm_backlight_data lpd270_backlight_data = {
> .max_brightness = 1,
> .dft_brightness = 1,
> -   .enable_gpio= -1,
>  };
>
>  static struct platform_device lpd270_backlight_device = {
> diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c
> index e1a394ac3eea..9b5b17b8b8b7 100644
> --- a/arch/arm/mach-pxa/magician.c
> +++ b/arch/arm/mach-pxa/magician.c
> @@ -402,7 +402,6 @@ static void magician_backlight_exit(struct device *dev)
>  static struct platform_pwm_backlight_data backlight_data = {
> 

Re: [PATCH] backlight: pwm_bl: Switch to full GPIO descriptor

2019-12-05 Thread Lee Jones
On Thu, 05 Dec 2019, Bartosz Golaszewski wrote:

> czw., 5 gru 2019 o 09:11 Linus Walleij  napisał(a):
> >
> > The PWM backlight still supports passing a enable GPIO line as
> > platform data using the legacy  API.
> >
> > It turns out that ever board using this mechanism except one
> > is pass .enable_gpio = -1. So we drop all these cargo-culted -1's
> > from all instances of this platform data in the kernel.
> >
> > The remaning board, Palm TC, is converted to pass a machine
> > descriptior table with the "enable" GPIO instead, and delete the
> > platform data entry for enable_gpio and the code handling it
> > and things should work smoothly with the new API.
> >
> > Cc: Krzysztof Kozlowski 
> > Cc: Robert Jarzmik 
> > Cc: Guan Xuetao 
> > Cc: Bartosz Golaszewski 
> > Signed-off-by: Linus Walleij 
> > ---
> >  arch/arm/mach-pxa/cm-x300.c   |  1 -
> >  arch/arm/mach-pxa/colibri-pxa270-income.c |  1 -
> >  arch/arm/mach-pxa/ezx.c   |  1 -
> >  arch/arm/mach-pxa/hx4700.c|  1 -
> >  arch/arm/mach-pxa/lpd270.c|  1 -
> >  arch/arm/mach-pxa/magician.c  |  1 -
> >  arch/arm/mach-pxa/mainstone.c |  1 -
> >  arch/arm/mach-pxa/mioa701.c   |  1 -
> >  arch/arm/mach-pxa/palm27x.c   |  1 -
> >  arch/arm/mach-pxa/palmtc.c| 10 ++
> >  arch/arm/mach-pxa/palmte2.c   |  1 -
> >  arch/arm/mach-pxa/pcm990-baseboard.c  |  1 -
> >  arch/arm/mach-pxa/tavorevb.c  |  2 --
> >  arch/arm/mach-pxa/viper.c |  1 -
> >  arch/arm/mach-pxa/z2.c|  2 --
> >  arch/arm/mach-pxa/zylonite.c  |  1 -
> >  arch/arm/mach-s3c24xx/mach-h1940.c|  1 -
> >  arch/arm/mach-s3c24xx/mach-rx1950.c   |  1 -
> >  arch/arm/mach-s3c64xx/dev-backlight.c |  3 ---
> >  arch/arm/mach-s3c64xx/mach-crag6410.c |  1 -
> >  arch/arm/mach-s3c64xx/mach-hmt.c  |  1 -
> >  arch/arm/mach-s3c64xx/mach-smartq.c   |  1 -
> >  arch/arm/mach-s3c64xx/mach-smdk6410.c |  2 +-
> >  arch/unicore32/kernel/puv3-nb0916.c   |  1 -
> >  drivers/video/backlight/pwm_bl.c  | 19 ---
> >  include/linux/pwm_backlight.h |  2 --
> >  26 files changed, 11 insertions(+), 48 deletions(-)
> 
> Reviewed-by: Bartosz Golaszewski 

Please could you snip your responses.

There is a lot of cruft to get through before we find your reply.

-- 
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH] backlight: pwm_bl: Switch to full GPIO descriptor

2019-12-05 Thread Daniel Thompson
On Thu, Dec 05, 2019 at 09:11:16AM +0100, Linus Walleij wrote:
> The PWM backlight still supports passing a enable GPIO line as
> platform data using the legacy  API.
> 
> It turns out that ever board using this mechanism except one
> is pass .enable_gpio = -1. So we drop all these cargo-culted -1's
> from all instances of this platform data in the kernel.
> 
> The remaning board, Palm TC, is converted to pass a machine
> descriptior table with the "enable" GPIO instead, and delete the
> platform data entry for enable_gpio and the code handling it
> and things should work smoothly with the new API.
> 
> Cc: Krzysztof Kozlowski 
> Cc: Robert Jarzmik 
> Cc: Guan Xuetao 
> Cc: Bartosz Golaszewski 
> Signed-off-by: Linus Walleij 

Looks good but...

> diff --git a/arch/arm/mach-pxa/palmtc.c b/arch/arm/mach-pxa/palmtc.c
> index f52bd155e825..3813118435bf 100644
> --- a/arch/arm/mach-pxa/palmtc.c
> +++ b/arch/arm/mach-pxa/palmtc.c
> @@ -175,6 +175,15 @@ static inline void palmtc_keys_init(void) {}
>   * Backlight
>   
> **/
>  #if defined(CONFIG_BACKLIGHT_PWM) || defined(CONFIG_BACKLIGHT_PWM_MODULE)
> +
> +static struct gpiod_lookup_table palmtc_pwm_bl_gpio_table = {
> + .dev_id = "pwm-backlight.0",
> + .table = {
> + GPIO_LOOKUP("gpio-pxa", GPIO_NR_PALMTC_BL_POWER,
> + "enable", GPIO_ACTIVE_HIGH),
> + },
> +};
> +

... I cannot find the corresponding removal of the 
`.enable_gpio = GPIO_NR_PALMTC_BL_POWER` meaning that ...

> diff --git a/include/linux/pwm_backlight.h b/include/linux/pwm_backlight.h
> index 8ea265a022fd..06086cb93b6f 100644
> --- a/include/linux/pwm_backlight.h
> +++ b/include/linux/pwm_backlight.h
> @@ -16,8 +16,6 @@ struct platform_pwm_backlight_data {
>   unsigned int *levels;
>   unsigned int post_pwm_on_delay;
>   unsigned int pwm_off_delay;
> - /* TODO remove once all users are switched to gpiod_* API */
> - int enable_gpio;

... I worry that palmtc.c is no longer compilable for some configs.


Daniel.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH] backlight: pwm_bl: Switch to full GPIO descriptor

2019-12-05 Thread Linus Walleij
The PWM backlight still supports passing a enable GPIO line as
platform data using the legacy  API.

It turns out that ever board using this mechanism except one
is pass .enable_gpio = -1. So we drop all these cargo-culted -1's
from all instances of this platform data in the kernel.

The remaning board, Palm TC, is converted to pass a machine
descriptior table with the "enable" GPIO instead, and delete the
platform data entry for enable_gpio and the code handling it
and things should work smoothly with the new API.

Cc: Krzysztof Kozlowski 
Cc: Robert Jarzmik 
Cc: Guan Xuetao 
Cc: Bartosz Golaszewski 
Signed-off-by: Linus Walleij 
---
 arch/arm/mach-pxa/cm-x300.c   |  1 -
 arch/arm/mach-pxa/colibri-pxa270-income.c |  1 -
 arch/arm/mach-pxa/ezx.c   |  1 -
 arch/arm/mach-pxa/hx4700.c|  1 -
 arch/arm/mach-pxa/lpd270.c|  1 -
 arch/arm/mach-pxa/magician.c  |  1 -
 arch/arm/mach-pxa/mainstone.c |  1 -
 arch/arm/mach-pxa/mioa701.c   |  1 -
 arch/arm/mach-pxa/palm27x.c   |  1 -
 arch/arm/mach-pxa/palmtc.c| 10 ++
 arch/arm/mach-pxa/palmte2.c   |  1 -
 arch/arm/mach-pxa/pcm990-baseboard.c  |  1 -
 arch/arm/mach-pxa/tavorevb.c  |  2 --
 arch/arm/mach-pxa/viper.c |  1 -
 arch/arm/mach-pxa/z2.c|  2 --
 arch/arm/mach-pxa/zylonite.c  |  1 -
 arch/arm/mach-s3c24xx/mach-h1940.c|  1 -
 arch/arm/mach-s3c24xx/mach-rx1950.c   |  1 -
 arch/arm/mach-s3c64xx/dev-backlight.c |  3 ---
 arch/arm/mach-s3c64xx/mach-crag6410.c |  1 -
 arch/arm/mach-s3c64xx/mach-hmt.c  |  1 -
 arch/arm/mach-s3c64xx/mach-smartq.c   |  1 -
 arch/arm/mach-s3c64xx/mach-smdk6410.c |  2 +-
 arch/unicore32/kernel/puv3-nb0916.c   |  1 -
 drivers/video/backlight/pwm_bl.c  | 19 ---
 include/linux/pwm_backlight.h |  2 --
 26 files changed, 11 insertions(+), 48 deletions(-)

diff --git a/arch/arm/mach-pxa/cm-x300.c b/arch/arm/mach-pxa/cm-x300.c
index 425855f456f2..2e35354b61f5 100644
--- a/arch/arm/mach-pxa/cm-x300.c
+++ b/arch/arm/mach-pxa/cm-x300.c
@@ -312,7 +312,6 @@ static struct pwm_lookup cm_x300_pwm_lookup[] = {
 static struct platform_pwm_backlight_data cm_x300_backlight_data = {
.max_brightness = 100,
.dft_brightness = 100,
-   .enable_gpio= -1,
 };
 
 static struct platform_device cm_x300_backlight_device = {
diff --git a/arch/arm/mach-pxa/colibri-pxa270-income.c 
b/arch/arm/mach-pxa/colibri-pxa270-income.c
index dbad2f13706c..e5879e8b0682 100644
--- a/arch/arm/mach-pxa/colibri-pxa270-income.c
+++ b/arch/arm/mach-pxa/colibri-pxa270-income.c
@@ -202,7 +202,6 @@ static struct pwm_lookup income_pwm_lookup[] = {
 static struct platform_pwm_backlight_data income_backlight_data = {
.max_brightness = 0x3ff,
.dft_brightness = 0x1ff,
-   .enable_gpio= -1,
 };
 
 static struct platform_device income_backlight = {
diff --git a/arch/arm/mach-pxa/ezx.c b/arch/arm/mach-pxa/ezx.c
index ec10851b63cf..eb85950e7c0e 100644
--- a/arch/arm/mach-pxa/ezx.c
+++ b/arch/arm/mach-pxa/ezx.c
@@ -55,7 +55,6 @@ static struct pwm_lookup ezx_pwm_lookup[] __maybe_unused = {
 static struct platform_pwm_backlight_data ezx_backlight_data = {
.max_brightness = 1023,
.dft_brightness = 1023,
-   .enable_gpio= -1,
 };
 
 static struct platform_device ezx_backlight_device = {
diff --git a/arch/arm/mach-pxa/hx4700.c b/arch/arm/mach-pxa/hx4700.c
index 311268d186ab..60186224df49 100644
--- a/arch/arm/mach-pxa/hx4700.c
+++ b/arch/arm/mach-pxa/hx4700.c
@@ -557,7 +557,6 @@ static struct platform_device hx4700_lcd = {
 static struct platform_pwm_backlight_data backlight_data = {
.max_brightness = 200,
.dft_brightness = 100,
-   .enable_gpio= -1,
 };
 
 static struct platform_device backlight = {
diff --git a/arch/arm/mach-pxa/lpd270.c b/arch/arm/mach-pxa/lpd270.c
index 20e00e970385..6fc40bc06910 100644
--- a/arch/arm/mach-pxa/lpd270.c
+++ b/arch/arm/mach-pxa/lpd270.c
@@ -277,7 +277,6 @@ static struct pwm_lookup lpd270_pwm_lookup[] = {
 static struct platform_pwm_backlight_data lpd270_backlight_data = {
.max_brightness = 1,
.dft_brightness = 1,
-   .enable_gpio= -1,
 };
 
 static struct platform_device lpd270_backlight_device = {
diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c
index e1a394ac3eea..9b5b17b8b8b7 100644
--- a/arch/arm/mach-pxa/magician.c
+++ b/arch/arm/mach-pxa/magician.c
@@ -402,7 +402,6 @@ static void magician_backlight_exit(struct device *dev)
 static struct platform_pwm_backlight_data backlight_data = {
.max_brightness = 272,
.dft_brightness = 100,
-   .enable_gpio= -1,
.init   = magician_backlight_init,
.notify = magician_backlight_notify,
.exit   = magician_backlight_exit,
diff --git a/arch/arm