mbox series

[00/15] backlight: Drop use of deprecated fb_blank property

Message ID 20230107-sam-video-backlight-drop-fb_blank-v1-0-1bd9bafb351f@ravnborg.org
Headers show
Series backlight: Drop use of deprecated fb_blank property | expand

Message

Sam Ravnborg via B4 Relay Jan. 7, 2023, 6:26 p.m. UTC
This series refactor backlight users to avoid use of the
deprecated backlight_properties.fb_blank member.

Stephen Kitt <steve@sk2.org> and others already did a lot of
work and this is the final touches.

Patches 1-13 are independent and can be applied individually.
Patch 14 was already sent by Stephen and included here to make
the series complete.

The last patch may have to wait to avoid breaking the build
as it depends on all the other patches.

The series touches several sub-systems, so with acks I could
take them all in drm-misc. Or we can let the subsystems take
them and wait until next merge window with the final removal.
As new users of fb_blank do not pop up that often, waiting
one merge cycle is fine.

Sam

To: Nicolas Ferre <nicolas.ferre@microchip.com>
To: Helge Deller <deller@gmx.de>
To: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Claudiu Beznea <claudiu.beznea@microchip.com>
To: Antonino Daplas <adaplas@gmail.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Paul Mackerras <paulus@samba.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Robin van der Gracht <robin@protonic.nl>
To: Miguel Ojeda <ojeda@kernel.org>
To: Lee Jones <lee@kernel.org>
To: Daniel Thompson <daniel.thompson@linaro.org>
To: Jingoo Han <jingoohan1@gmail.com>
Cc: linux-fbdev@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-omap@vger.kernel.org
Cc: linux-staging@lists.linux.dev
Cc: linuxppc-dev@lists.ozlabs.org
Cc: Stephen Kitt <steve@sk2.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>

---
Sam Ravnborg (14):
      video: fbdev: atmel_lcdfb: Rework backlight handling
      video: fbdev: atyfb: Introduce backlight_get_brightness()
      video: fbdev: nvidia: Introduce backlight_get_brightness()
      video: fbdev: radeon: Introduce backlight_get_brightness()
      video: fbdev: riva: Introduce backlight_get_brightness()
      video: fbdev: aty128fb: Introduce backlight_get_brightness()
      video: fbdev: mx3fb: Introduce backlight_get_brightness()
      video: fbdev: omap2: Introduce backlight_get_brightness()
      staging: fbtft: fb_ssd1351.c: Introduce backlight_is_blank()
      staging: fbtft: core: Introduce backlight_is_blank()
      powerpc: via-pmu-backlight: Introduce backlight_get_brightness()
      auxdisplay: ht16k33: Introduce backlight_get_brightness()
      backlight: omap1: Use backlight helpers
      backlight: backlight: Drop the deprecated fb_blank property

Stephen Kitt (1):
      backlight: tosa: Use backlight helper

 drivers/auxdisplay/ht16k33.c                       |  7 +--
 drivers/macintosh/via-pmu-backlight.c              |  7 +--
 drivers/staging/fbtft/fb_ssd1351.c                 |  9 +--
 drivers/staging/fbtft/fbtft-core.c                 | 12 ++--
 drivers/video/backlight/backlight.c                |  2 -
 drivers/video/backlight/omap1_bl.c                 | 67 +++-------------------
 drivers/video/backlight/tosa_bl.c                  |  7 +--
 drivers/video/fbdev/atmel_lcdfb.c                  | 24 +-------
 drivers/video/fbdev/aty/aty128fb.c                 | 11 +---
 drivers/video/fbdev/aty/atyfb_base.c               |  8 +--
 drivers/video/fbdev/aty/radeon_backlight.c         | 10 +---
 drivers/video/fbdev/mx3fb.c                        |  8 +--
 drivers/video/fbdev/nvidia/nv_backlight.c          |  8 +--
 .../fbdev/omap2/omapfb/displays/panel-dsi-cm.c     | 19 +-----
 .../omap2/omapfb/displays/panel-sony-acx565akm.c   | 23 +++-----
 drivers/video/fbdev/riva/fbdev.c                   |  8 +--
 include/linux/backlight.h                          | 22 -------
 17 files changed, 41 insertions(+), 211 deletions(-)
---
base-commit: a53be8dae86fe5d3567db245177e814e58210632
change-id: 20230107-sam-video-backlight-drop-fb_blank-d6feb73572ff

Best regards,

Comments

Stephen Kitt Jan. 8, 2023, 7:45 a.m. UTC | #1
On 7 January 2023 21:53:46 CET, Sam Ravnborg <sam@ravnborg.org> wrote:
>Hi Stephen.
>
>On Sat, Jan 07, 2023 at 09:36:47PM +0100, Stephen Kitt wrote:
>> On 7 January 2023 19:26:15 CET, Sam Ravnborg via B4 Submission Endpoint <devnull+sam.ravnborg.org@kernel.org> wrote:
>> >From: Sam Ravnborg <sam@ravnborg.org>
>> >
>> >The atmel_lcdfb had code to save/restore power state.
>> >This is not needed so drop it.
>> >
>> >Introduce backlight_is_brightness() to make logic simpler.
>> >
>> >Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
>> >Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
>> >Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
>> >Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
>> >Cc: linux-fbdev@vger.kernel.org
>> >Cc: linux-arm-kernel@lists.infradead.org
>> >---
>> > drivers/video/fbdev/atmel_lcdfb.c | 24 +++---------------------
>> > 1 file changed, 3 insertions(+), 21 deletions(-)
>...
>> 
>> Hi Sam,
>> 
>> I’d submitted quite a few more of these previously (and you’d reviewed them), see e.g. the thread starting at https://lkml.org/lkml/2022/6/7/4365, and yesterday, https://lkml.org/lkml/2023/1/6/520, https://lkml.org/lkml/2023/1/6/656, https://lkml.org/lkml/2023/1/6/970, https://lkml.org/lkml/2023/1/6/643, and https://lkml.org/lkml/2023/1/6/680. There are a few more, I can find them if it’s any use.
>
>The patches from yesterday was what triggered me to resurrect an old
>branch of mine where I had done something similar. I had lost all
>memory of reviewing similar patches from you.
>
>
>Helge - could you pick the reviewed patches from:
>https://lore.kernel.org/all/20220607192335.1137249-1-steve@sk2.org/
>[This is the same mail as Stephen refer to above - looked up via lore].
>
>Stephen - I expect Daniel/Lee to take care of the patches from yesterday.
>If you can look up other pending patches from you please do so, so we
>can have them applied.
>Preferably with links to lore - as this makes it easier to apply them.
>
>Review of what is unique in this set would be appreciated.
>
>	Sam

Hi Sam,

Here are my pending patches from last June on lore:

* https://lore.kernel.org/lkml/20220607190925.1134737-1-steve@sk2.org/
* https://lore.kernel.org/lkml/20220608205623.2106113-1-steve@sk2.org/
* https://lore.kernel.org/lkml/20220607192335.1137249-1-steve@sk2.org/
* https://lore.kernel.org/lkml/20220616170425.1346081-1-steve@sk2.org/

I’ll send reviews of your other patches later today or tomorrow.

Regards,

Stephen
Stephen Kitt Jan. 8, 2023, 7:47 a.m. UTC | #2
On 8 January 2023 08:45:46 CET, Stephen Kitt <steve@sk2.org> wrote:
>On 7 January 2023 21:53:46 CET, Sam Ravnborg <sam@ravnborg.org> wrote:
>>Hi Stephen.
>>
>>On Sat, Jan 07, 2023 at 09:36:47PM +0100, Stephen Kitt wrote:
>>> On 7 January 2023 19:26:15 CET, Sam Ravnborg via B4 Submission Endpoint <devnull+sam.ravnborg.org@kernel.org> wrote:
>>> >From: Sam Ravnborg <sam@ravnborg.org>
>>> >
>>> >The atmel_lcdfb had code to save/restore power state.
>>> >This is not needed so drop it.
>>> >
>>> >Introduce backlight_is_brightness() to make logic simpler.
>>> >
>>> >Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
>>> >Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
>>> >Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
>>> >Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
>>> >Cc: linux-fbdev@vger.kernel.org
>>> >Cc: linux-arm-kernel@lists.infradead.org
>>> >---
>>> > drivers/video/fbdev/atmel_lcdfb.c | 24 +++---------------------
>>> > 1 file changed, 3 insertions(+), 21 deletions(-)
>>...
>>> 
>>> Hi Sam,
>>> 
>>> I’d submitted quite a few more of these previously (and you’d reviewed them), see e.g. the thread starting at https://lkml.org/lkml/2022/6/7/4365, and yesterday, https://lkml.org/lkml/2023/1/6/520, https://lkml.org/lkml/2023/1/6/656, https://lkml.org/lkml/2023/1/6/970, https://lkml.org/lkml/2023/1/6/643, and https://lkml.org/lkml/2023/1/6/680. There are a few more, I can find them if it’s any use.
>>
>>The patches from yesterday was what triggered me to resurrect an old
>>branch of mine where I had done something similar. I had lost all
>>memory of reviewing similar patches from you.
>>
>>
>>Helge - could you pick the reviewed patches from:
>>https://lore.kernel.org/all/20220607192335.1137249-1-steve@sk2.org/
>>[This is the same mail as Stephen refer to above - looked up via lore].
>>
>>Stephen - I expect Daniel/Lee to take care of the patches from yesterday.
>>If you can look up other pending patches from you please do so, so we
>>can have them applied.
>>Preferably with links to lore - as this makes it easier to apply them.
>>
>>Review of what is unique in this set would be appreciated.
>>
>>	Sam
>
>Hi Sam,
>
>Here are my pending patches from last June on lore:
>
>* https://lore.kernel.org/lkml/20220607190925.1134737-1-steve@sk2.org/
>* https://lore.kernel.org/lkml/20220608205623.2106113-1-steve@sk2.org/
>* https://lore.kernel.org/lkml/20220607192335.1137249-1-steve@sk2.org/
>* https://lore.kernel.org/lkml/20220616170425.1346081-1-steve@sk2.org/
>
>I’ll send reviews of your other patches later today or tomorrow.
>
>Regards,
>
>Stephen

And the auxdisplay patch, v1:

https://lore.kernel.org/lkml/20220607180406.1116277-1-steve@sk2.org/

and v2:

https://lore.kernel.org/lkml/20230106143002.1434266-1-steve@sk2.org/

Regards,

Stephen
Helge Deller Jan. 8, 2023, 5:26 p.m. UTC | #3
On 1/7/23 21:53, Sam Ravnborg wrote:
> Hi Stephen.
>
> On Sat, Jan 07, 2023 at 09:36:47PM +0100, Stephen Kitt wrote:
>> On 7 January 2023 19:26:15 CET, Sam Ravnborg via B4 Submission Endpoint <devnull+sam.ravnborg.org@kernel.org> wrote:
>>> From: Sam Ravnborg <sam@ravnborg.org>
>>>
>>> The atmel_lcdfb had code to save/restore power state.
>>> This is not needed so drop it.
>>>
>>> Introduce backlight_is_brightness() to make logic simpler.
>>>
>>> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
>>> Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
>>> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
>>> Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
>>> Cc: linux-fbdev@vger.kernel.org
>>> Cc: linux-arm-kernel@lists.infradead.org
>>> ---
>>> drivers/video/fbdev/atmel_lcdfb.c | 24 +++---------------------
>>> 1 file changed, 3 insertions(+), 21 deletions(-)
> ...
>>
>> Hi Sam,
>>
>> I’d submitted quite a few more of these previously (and you’d reviewed them), see e.g. the thread starting at https://lkml.org/lkml/2022/6/7/4365, and yesterday, https://lkml.org/lkml/2023/1/6/520, https://lkml.org/lkml/2023/1/6/656, https://lkml.org/lkml/2023/1/6/970, https://lkml.org/lkml/2023/1/6/643, and https://lkml.org/lkml/2023/1/6/680. There are a few more, I can find them if it’s any use.
>
> The patches from yesterday was what triggered me to resurrect an old
> branch of mine where I had done something similar. I had lost all
> memory of reviewing similar patches from you.
>
>
> Helge - could you pick the reviewed patches from:
> https://lore.kernel.org/all/20220607192335.1137249-1-steve@sk2.org/
> [This is the same mail as Stephen refer to above - looked up via lore].

I just pulled those 7 patches into fbdev/for-next.
If you need more, please let me know,

Thanks!
Helge


>
> Stephen - I expect Daniel/Lee to take care of the patches from yesterday.
> If you can look up other pending patches from you please do so, so we
> can have them applied.
> Preferably with links to lore - as this makes it easier to apply them.
>
> Review of what is unique in this set would be appreciated.
>
> 	Sam
Stephen Kitt Jan. 8, 2023, 7:32 p.m. UTC | #4
On Sat, 07 Jan 2023 19:26:27 +0100, Sam Ravnborg via B4 Submission Endpoint
<devnull+sam.ravnborg.org@kernel.org> wrote:

> From: Sam Ravnborg <sam@ravnborg.org>
> 
> Rework backlight handling to avoid access to the deprecated
> backlight_properties.fb_blank member.
> 
> The rework includes removal of get_brightness() operation,
> because there was no read back from HW so no use for it.
> 
> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> Cc: Lee Jones <lee@kernel.org>
> Cc: Daniel Thompson <daniel.thompson@linaro.org>
> Cc: Jingoo Han <jingoohan1@gmail.com>
> ---
>  drivers/video/backlight/omap1_bl.c | 67
> +++++--------------------------------- 1 file changed, 9 insertions(+), 58
> deletions(-)
> 
> diff --git a/drivers/video/backlight/omap1_bl.c
> b/drivers/video/backlight/omap1_bl.c index 69a49384b3de..49f37da857e7 100644
> --- a/drivers/video/backlight/omap1_bl.c
> +++ b/drivers/video/backlight/omap1_bl.c
> @@ -20,9 +20,6 @@
>  #define OMAPBL_MAX_INTENSITY		0xff
>  
>  struct omap_backlight {
> -	int powermode;
> -	int current_intensity;
> -
>  	struct device *dev;
>  	struct omap_backlight_config *pdata;
>  };
> @@ -37,82 +34,40 @@ static inline void omapbl_send_enable(int enable)
>  	omap_writeb(enable, OMAP_PWL_CLK_ENABLE);
>  }
>  
> -static void omapbl_blank(struct omap_backlight *bl, int mode)
> -{
> -	if (bl->pdata->set_power)
> -		bl->pdata->set_power(bl->dev, mode);
> -
> -	switch (mode) {
> -	case FB_BLANK_NORMAL:
> -	case FB_BLANK_VSYNC_SUSPEND:
> -	case FB_BLANK_HSYNC_SUSPEND:
> -	case FB_BLANK_POWERDOWN:
> -		omapbl_send_intensity(0);
> -		omapbl_send_enable(0);
> -		break;
> -
> -	case FB_BLANK_UNBLANK:
> -		omapbl_send_intensity(bl->current_intensity);
> -		omapbl_send_enable(1);
> -		break;
> -	}
> -}
> -
>  #ifdef CONFIG_PM_SLEEP
>  static int omapbl_suspend(struct device *dev)
>  {
>  	struct backlight_device *bl_dev = dev_get_drvdata(dev);
> -	struct omap_backlight *bl = bl_get_data(bl_dev);
>  
> -	omapbl_blank(bl, FB_BLANK_POWERDOWN);
> +	backlight_disable(bl_dev);
>  	return 0;
>  }
>  
>  static int omapbl_resume(struct device *dev)
>  {
>  	struct backlight_device *bl_dev = dev_get_drvdata(dev);
> -	struct omap_backlight *bl = bl_get_data(bl_dev);
>  
> -	omapbl_blank(bl, bl->powermode);
> +	backlight_enable(bl_dev);
>  	return 0;
>  }
>  #endif
>  
> -static int omapbl_set_power(struct backlight_device *dev, int state)
> -{
> -	struct omap_backlight *bl = bl_get_data(dev);
> -
> -	omapbl_blank(bl, state);
> -	bl->powermode = state;
> -
> -	return 0;
> -}
> -
>  static int omapbl_update_status(struct backlight_device *dev)
>  {
> -	struct omap_backlight *bl = bl_get_data(dev);
> +	int brightness = backlight_get_brightness(dev);
>  
> -	if (bl->current_intensity != dev->props.brightness) {
> -		if (bl->powermode == FB_BLANK_UNBLANK)
> -			omapbl_send_intensity(dev->props.brightness);
> -		bl->current_intensity = dev->props.brightness;
> +	if (brightness > 0) {
> +		omapbl_send_intensity(dev->props.brightness);
> +		omapbl_send_enable(1);
> +	} else {
> +		omapbl_send_intensity(0);
> +		omapbl_send_enable(0);
>  	}
>  
> -	if (dev->props.fb_blank != bl->powermode)
> -		omapbl_set_power(dev, dev->props.fb_blank);
> -
>  	return 0;
>  }
>  
> -static int omapbl_get_intensity(struct backlight_device *dev)
> -{
> -	struct omap_backlight *bl = bl_get_data(dev);
> -
> -	return bl->current_intensity;
> -}
> -
>  static const struct backlight_ops omapbl_ops = {
> -	.get_brightness = omapbl_get_intensity,
>  	.update_status  = omapbl_update_status,
>  };
>  
> @@ -139,9 +94,6 @@ static int omapbl_probe(struct platform_device *pdev)
>  	if (IS_ERR(dev))
>  		return PTR_ERR(dev);
>  
> -	bl->powermode = FB_BLANK_POWERDOWN;
> -	bl->current_intensity = 0;
> -
>  	bl->pdata = pdata;
>  	bl->dev = &pdev->dev;
>  
> @@ -149,7 +101,6 @@ static int omapbl_probe(struct platform_device *pdev)
>  
>  	omap_cfg_reg(PWL);	/* Conflicts with UART3 */
>  
> -	dev->props.fb_blank = FB_BLANK_UNBLANK;
>  	dev->props.brightness = pdata->default_intensity;
>  	omapbl_update_status(dev);
>  
> 
> -- 
> 2.34.1

Wow that gets rid of a lot of unnecessary code!

Reviewed-by: Stephen Kitt <steve@sk2.org>
Stephen Kitt Jan. 8, 2023, 7:32 p.m. UTC | #5
On Sat, 07 Jan 2023 19:26:29 +0100, Sam Ravnborg via B4 Submission Endpoint
<devnull+sam.ravnborg.org@kernel.org> wrote:

> From: Sam Ravnborg <sam@ravnborg.org>
> 
> With all users gone remove the deprecated fb_blank member in
> backlight_properties.
> 
> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> Cc: Lee Jones <lee@kernel.org>
> Cc: Daniel Thompson <daniel.thompson@linaro.org>
> Cc: Jingoo Han <jingoohan1@gmail.com>
> ---
>  drivers/video/backlight/backlight.c |  2 --
>  include/linux/backlight.h           | 22 ----------------------
>  2 files changed, 24 deletions(-)
> 
> diff --git a/drivers/video/backlight/backlight.c
> b/drivers/video/backlight/backlight.c index b788ff3d0f45..9b0557d094c5
> 100644 --- a/drivers/video/backlight/backlight.c
> +++ b/drivers/video/backlight/backlight.c
> @@ -118,14 +118,12 @@ static int fb_notifier_callback(struct notifier_block
> *self, bd->fb_bl_on[node] = true;
>  		if (!bd->use_count++) {
>  			bd->props.state &= ~BL_CORE_FBBLANK;
> -			bd->props.fb_blank = FB_BLANK_UNBLANK;
>  			backlight_update_status(bd);
>  		}
>  	} else if (fb_blank != FB_BLANK_UNBLANK && bd->fb_bl_on[node]) {
>  		bd->fb_bl_on[node] = false;
>  		if (!(--bd->use_count)) {
>  			bd->props.state |= BL_CORE_FBBLANK;
> -			bd->props.fb_blank = fb_blank;
>  			backlight_update_status(bd);
>  		}
>  	}
> diff --git a/include/linux/backlight.h b/include/linux/backlight.h
> index 614653e07e3a..c8622d6cc8c5 100644
> --- a/include/linux/backlight.h
> +++ b/include/linux/backlight.h
> @@ -218,25 +218,6 @@ struct backlight_properties {
>  	 */
>  	int power;
>  
> -	/**
> -	 * @fb_blank: The power state from the FBIOBLANK ioctl.
> -	 *
> -	 * When the FBIOBLANK ioctl is called @fb_blank is set to the
> -	 * blank parameter and the update_status() operation is called.
> -	 *
> -	 * When the backlight device is enabled @fb_blank is set
> -	 * to FB_BLANK_UNBLANK. When the backlight device is disabled
> -	 * @fb_blank is set to FB_BLANK_POWERDOWN.
> -	 *
> -	 * Backlight drivers should avoid using this property. It has been
> -	 * replaced by state & BL_CORE_FBLANK (although most drivers should
> -	 * use backlight_is_blank() as the preferred means to get the blank
> -	 * state).
> -	 *
> -	 * fb_blank is deprecated and will be removed.
> -	 */
> -	int fb_blank;
> -
>  	/**
>  	 * @type: The type of backlight supported.
>  	 *
> @@ -366,7 +347,6 @@ static inline int backlight_enable(struct
> backlight_device *bd) return 0;
>  
>  	bd->props.power = FB_BLANK_UNBLANK;
> -	bd->props.fb_blank = FB_BLANK_UNBLANK;
>  	bd->props.state &= ~BL_CORE_FBBLANK;
>  
>  	return backlight_update_status(bd);
> @@ -382,7 +362,6 @@ static inline int backlight_disable(struct
> backlight_device *bd) return 0;
>  
>  	bd->props.power = FB_BLANK_POWERDOWN;
> -	bd->props.fb_blank = FB_BLANK_POWERDOWN;
>  	bd->props.state |= BL_CORE_FBBLANK;
>  
>  	return backlight_update_status(bd);
> @@ -403,7 +382,6 @@ static inline int backlight_disable(struct
> backlight_device *bd) static inline bool backlight_is_blank(const struct
> backlight_device *bd) {
>  	return bd->props.power != FB_BLANK_UNBLANK ||
> -	       bd->props.fb_blank != FB_BLANK_UNBLANK ||
>  	       bd->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK);
>  }
>  
> 
> -- 
> 2.34.1

Reviewed-by: Stephen Kitt <steve@sk2.org>
Stephen Kitt Jan. 8, 2023, 7:36 p.m. UTC | #6
On Sat, 07 Jan 2023 19:26:25 +0100, Sam Ravnborg via B4 Submission Endpoint
<devnull+sam.ravnborg.org@kernel.org> wrote:

> From: Sam Ravnborg <sam@ravnborg.org>
> 
> Introduce backlight_get_brightness() to simplify logic
> and avoid direct access to backlight properties.
> 
> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Cc: linuxppc-dev@lists.ozlabs.org
> ---
>  drivers/macintosh/via-pmu-backlight.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/drivers/macintosh/via-pmu-backlight.c
> b/drivers/macintosh/via-pmu-backlight.c index 2194016122d2..c2d87e7fa85b
> 100644 --- a/drivers/macintosh/via-pmu-backlight.c
> +++ b/drivers/macintosh/via-pmu-backlight.c
> @@ -71,12 +71,7 @@ static int pmu_backlight_get_level_brightness(int level)
>  static int __pmu_backlight_update_status(struct backlight_device *bd)
>  {
>  	struct adb_request req;
> -	int level = bd->props.brightness;
> -
> -
> -	if (bd->props.power != FB_BLANK_UNBLANK ||
> -	    bd->props.fb_blank != FB_BLANK_UNBLANK)
> -		level = 0;
> +	int level = backlight_get_brightness(bd);
>  
>  	if (level > 0) {
>  		int pmulevel = pmu_backlight_get_level_brightness(level);
> 
> -- 
> 2.34.1

This one is already in 6.2-rc1, it went in via powerpc/next.

Regards,

Stephen
Sam Ravnborg Jan. 8, 2023, 8:24 p.m. UTC | #7
Hi Stephen.

 
> Here are my pending patches from last June on lore:
> 

All patches are handled I think except this:
> * https://lore.kernel.org/lkml/20220608205623.2106113-1-steve@sk2.org/

Can I ask you to drop the assignment that is not needed, and resend with
the collected acks/r-b.

With this, then all fbdev patches are handled.

	Sam
Sam Ravnborg Jan. 8, 2023, 8:26 p.m. UTC | #8
Hi Helge,

> > 
> > Helge - could you pick the reviewed patches from:
> > https://lore.kernel.org/all/20220607192335.1137249-1-steve@sk2.org/
> > [This is the same mail as Stephen refer to above - looked up via lore].
> 
> I just pulled those 7 patches into fbdev/for-next.
> If you need more, please let me know,

Thanks, we have one pending patch for atmel_lcdfb, but it need a small
adjustment before it is ready.

With this all fbdev drivers have the backlight_properties.fb_blank
removed.

	Sam
Stephen Kitt Jan. 9, 2023, 7:53 p.m. UTC | #9
Hi Sam,

On Sun, 8 Jan 2023 21:24:20 +0100, Sam Ravnborg <sam@ravnborg.org> wrote:
> > Here are my pending patches from last June on lore:
> >   
> 
> All patches are handled I think except this:
> > * https://lore.kernel.org/lkml/20220608205623.2106113-1-steve@sk2.org/  
> 
> Can I ask you to drop the assignment that is not needed, and resend with
> the collected acks/r-b.
> 
> With this, then all fbdev patches are handled.

Ah yes, it was revised as
https://lore.kernel.org/lkml/20220609180440.3138625-1-steve@sk2.org/ which
only got one ack (from you,
https://lore.kernel.org/lkml/YqJCKQmQEuVsbspK@ravnborg.org/). Should I
resend that or is that usable as-is? Or would it be better if I sent all the
fbdev patches again (collecting all the acks and reviews)?

Regards,

Stephen
Stephen Kitt Jan. 9, 2023, 8:03 p.m. UTC | #10
On Mon, 9 Jan 2023 20:53:44 +0100, Stephen Kitt <steve@sk2.org> wrote:
> On Sun, 8 Jan 2023 21:24:20 +0100, Sam Ravnborg <sam@ravnborg.org> wrote:
> > > Here are my pending patches from last June on lore:
> > >     
> > 
> > All patches are handled I think except this:  
> > > * https://lore.kernel.org/lkml/20220608205623.2106113-1-steve@sk2.org/
> > >   
> > 
> > Can I ask you to drop the assignment that is not needed, and resend with
> > the collected acks/r-b.
> > 
> > With this, then all fbdev patches are handled.  
> 
> Ah yes, it was revised as
> https://lore.kernel.org/lkml/20220609180440.3138625-1-steve@sk2.org/ which
> only got one ack (from you,
> https://lore.kernel.org/lkml/YqJCKQmQEuVsbspK@ravnborg.org/). Should I
> resend that or is that usable as-is? Or would it be better if I sent all the
> fbdev patches again (collecting all the acks and reviews)?

Since the others are already in fbdev/for-next, I’ve just resent v2 of this
patch with your ack.

Regards,

Stephen
Stephen Kitt Jan. 9, 2023, 8:18 p.m. UTC | #11
On Sun, 8 Jan 2023 18:26:12 +0100, Helge Deller <deller@gmx.de> wrote:

> On 1/7/23 21:53, Sam Ravnborg wrote:
> > Hi Stephen.
> >
> > On Sat, Jan 07, 2023 at 09:36:47PM +0100, Stephen Kitt wrote:  
> >> On 7 January 2023 19:26:15 CET, Sam Ravnborg via B4 Submission Endpoint
> >> <devnull+sam.ravnborg.org@kernel.org> wrote:  
> >>> From: Sam Ravnborg <sam@ravnborg.org>
> >>>
> >>> The atmel_lcdfb had code to save/restore power state.
> >>> This is not needed so drop it.
> >>>
> >>> Introduce backlight_is_brightness() to make logic simpler.
> >>>
> >>> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> >>> Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
> >>> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
> >>> Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
> >>> Cc: linux-fbdev@vger.kernel.org
> >>> Cc: linux-arm-kernel@lists.infradead.org
> >>> ---
> >>> drivers/video/fbdev/atmel_lcdfb.c | 24 +++---------------------
> >>> 1 file changed, 3 insertions(+), 21 deletions(-)  
> > ...  
> >>
> >> Hi Sam,
> >>
> >> I’d submitted quite a few more of these previously (and you’d reviewed
> >> them), see e.g. the thread starting at
> >> https://lkml.org/lkml/2022/6/7/4365, and yesterday,
> >> https://lkml.org/lkml/2023/1/6/520, https://lkml.org/lkml/2023/1/6/656,
> >> https://lkml.org/lkml/2023/1/6/970, https://lkml.org/lkml/2023/1/6/643,
> >> and https://lkml.org/lkml/2023/1/6/680. There are a few more, I can find
> >> them if it’s any use.  
> >
> > The patches from yesterday was what triggered me to resurrect an old
> > branch of mine where I had done something similar. I had lost all
> > memory of reviewing similar patches from you.
> >
> >
> > Helge - could you pick the reviewed patches from:
> > https://lore.kernel.org/all/20220607192335.1137249-1-steve@sk2.org/
> > [This is the same mail as Stephen refer to above - looked up via lore].  
> 
> I just pulled those 7 patches into fbdev/for-next.
> If you need more, please let me know,

Please pull
https://lore.kernel.org/lkml/20230109200239.1850611-1-steve@sk2.org/ too, it
completes the fbdev set. (It’s a re-send of
https://lore.kernel.org/lkml/20220609180440.3138625-1-steve@sk2.org/).

Thanks,

Stephen
Helge Deller Jan. 9, 2023, 8:34 p.m. UTC | #12
On 1/9/23 21:18, Stephen Kitt wrote:
> On Sun, 8 Jan 2023 18:26:12 +0100, Helge Deller <deller@gmx.de> wrote:
>
>> On 1/7/23 21:53, Sam Ravnborg wrote:
>>> Hi Stephen.
>>>
>>> On Sat, Jan 07, 2023 at 09:36:47PM +0100, Stephen Kitt wrote:
>>>> On 7 January 2023 19:26:15 CET, Sam Ravnborg via B4 Submission Endpoint
>>>> <devnull+sam.ravnborg.org@kernel.org> wrote:
>>>>> From: Sam Ravnborg <sam@ravnborg.org>
>>>>>
>>>>> The atmel_lcdfb had code to save/restore power state.
>>>>> This is not needed so drop it.
>>>>>
>>>>> Introduce backlight_is_brightness() to make logic simpler.
>>>>>
>>>>> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
>>>>> Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
>>>>> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
>>>>> Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
>>>>> Cc: linux-fbdev@vger.kernel.org
>>>>> Cc: linux-arm-kernel@lists.infradead.org
>>>>> ---
>>>>> drivers/video/fbdev/atmel_lcdfb.c | 24 +++---------------------
>>>>> 1 file changed, 3 insertions(+), 21 deletions(-)
>>> ...
>>>>
>>>> Hi Sam,
>>>>
>>>> I’d submitted quite a few more of these previously (and you’d reviewed
>>>> them), see e.g. the thread starting at
>>>> https://lkml.org/lkml/2022/6/7/4365, and yesterday,
>>>> https://lkml.org/lkml/2023/1/6/520, https://lkml.org/lkml/2023/1/6/656,
>>>> https://lkml.org/lkml/2023/1/6/970, https://lkml.org/lkml/2023/1/6/643,
>>>> and https://lkml.org/lkml/2023/1/6/680. There are a few more, I can find
>>>> them if it’s any use.
>>>
>>> The patches from yesterday was what triggered me to resurrect an old
>>> branch of mine where I had done something similar. I had lost all
>>> memory of reviewing similar patches from you.
>>>
>>>
>>> Helge - could you pick the reviewed patches from:
>>> https://lore.kernel.org/all/20220607192335.1137249-1-steve@sk2.org/
>>> [This is the same mail as Stephen refer to above - looked up via lore].
>>
>> I just pulled those 7 patches into fbdev/for-next.
>> If you need more, please let me know,
>
> Please pull
> https://lore.kernel.org/lkml/20230109200239.1850611-1-steve@sk2.org/ too, it
> completes the fbdev set. (It’s a re-send of
> https://lore.kernel.org/lkml/20220609180440.3138625-1-steve@sk2.org/).

Done.

Thanks!
Helge