dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 01/15] video: fbdev: atmel_lcdfb: Rework backlight handling
  2023-01-07 18:26 [PATCH 00/15] backlight: Drop use of deprecated fb_blank property Sam Ravnborg via B4 Submission Endpoint
@ 2023-01-07 18:26 ` Sam Ravnborg via B4 Submission Endpoint
  2023-01-07 20:36   ` Stephen Kitt
  2023-01-09  9:14   ` Jani Nikula
  2023-01-07 18:26 ` [PATCH 02/15] video: fbdev: atyfb: Introduce backlight_get_brightness() Sam Ravnborg via B4 Submission Endpoint
                   ` (13 subsequent siblings)
  14 siblings, 2 replies; 53+ messages in thread
From: Sam Ravnborg via B4 Submission Endpoint @ 2023-01-07 18:26 UTC (permalink / raw)
  To: Nicolas Ferre, Helge Deller, Alexandre Belloni, Claudiu Beznea,
	Antonino Daplas, Benjamin Herrenschmidt, Paul Mackerras,
	Greg Kroah-Hartman, Robin van der Gracht, Miguel Ojeda,
	Lee Jones, Daniel Thompson, Jingoo Han
  Cc: linux-fbdev, Stephen Kitt, Sam Ravnborg, linux-staging,
	linux-kernel, dri-devel, Ludovic Desroches, linux-omap,
	linuxppc-dev, linux-arm-kernel

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(-)

diff --git a/drivers/video/fbdev/atmel_lcdfb.c b/drivers/video/fbdev/atmel_lcdfb.c
index 1fc8de4ecbeb..d297b3892637 100644
--- a/drivers/video/fbdev/atmel_lcdfb.c
+++ b/drivers/video/fbdev/atmel_lcdfb.c
@@ -49,7 +49,6 @@ struct atmel_lcdfb_info {
 	struct clk		*lcdc_clk;
 
 	struct backlight_device	*backlight;
-	u8			bl_power;
 	u8			saved_lcdcon;
 
 	u32			pseudo_palette[16];
@@ -109,32 +108,18 @@ static u32 contrast_ctr = ATMEL_LCDC_PS_DIV8
 static int atmel_bl_update_status(struct backlight_device *bl)
 {
 	struct atmel_lcdfb_info *sinfo = bl_get_data(bl);
-	int			power = sinfo->bl_power;
-	int			brightness = bl->props.brightness;
+	int brightness;
 
-	/* REVISIT there may be a meaningful difference between
-	 * fb_blank and power ... there seem to be some cases
-	 * this doesn't handle correctly.
-	 */
-	if (bl->props.fb_blank != sinfo->bl_power)
-		power = bl->props.fb_blank;
-	else if (bl->props.power != sinfo->bl_power)
-		power = bl->props.power;
-
-	if (brightness < 0 && power == FB_BLANK_UNBLANK)
-		brightness = lcdc_readl(sinfo, ATMEL_LCDC_CONTRAST_VAL);
-	else if (power != FB_BLANK_UNBLANK)
-		brightness = 0;
+	brightness = backlight_get_brightness(bl);
 
 	lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_VAL, brightness);
+
 	if (contrast_ctr & ATMEL_LCDC_POL_POSITIVE)
 		lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR,
 			brightness ? contrast_ctr : 0);
 	else
 		lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, contrast_ctr);
 
-	bl->props.fb_blank = bl->props.power = sinfo->bl_power = power;
-
 	return 0;
 }
 
@@ -155,8 +140,6 @@ static void init_backlight(struct atmel_lcdfb_info *sinfo)
 	struct backlight_properties props;
 	struct backlight_device	*bl;
 
-	sinfo->bl_power = FB_BLANK_UNBLANK;
-
 	if (sinfo->backlight)
 		return;
 
@@ -173,7 +156,6 @@ static void init_backlight(struct atmel_lcdfb_info *sinfo)
 	sinfo->backlight = bl;
 
 	bl->props.power = FB_BLANK_UNBLANK;
-	bl->props.fb_blank = FB_BLANK_UNBLANK;
 	bl->props.brightness = atmel_bl_get_brightness(bl);
 }
 

-- 
2.34.1

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

* [PATCH 00/15] backlight: Drop use of deprecated fb_blank property
@ 2023-01-07 18:26 Sam Ravnborg via B4 Submission Endpoint
  2023-01-07 18:26 ` [PATCH 01/15] video: fbdev: atmel_lcdfb: Rework backlight handling Sam Ravnborg via B4 Submission Endpoint
                   ` (14 more replies)
  0 siblings, 15 replies; 53+ messages in thread
From: Sam Ravnborg via B4 Submission Endpoint @ 2023-01-07 18:26 UTC (permalink / raw)
  To: Nicolas Ferre, Helge Deller, Alexandre Belloni, Claudiu Beznea,
	Antonino Daplas, Benjamin Herrenschmidt, Paul Mackerras,
	Greg Kroah-Hartman, Robin van der Gracht, Miguel Ojeda,
	Lee Jones, Daniel Thompson, Jingoo Han
  Cc: Kate Stewart, linux-fbdev, Stephen Kitt, Daniel Vetter,
	dri-devel, Laurent Pinchart, Sam Ravnborg, Peter Suti,
	Andy Shevchenko, linux-staging, Javier Martinez Canillas,
	Ludovic Desroches, Geert Uytterhoeven, linux-arm-kernel,
	Arnd Bergmann, Bartlomiej Zolnierkiewicz, Jani Nikula,
	Alexios Zavras, Thomas Gleixner, linux-omap, Allison Randal,
	Jason Yan, linuxppc-dev, linux-kernel, Souptick Joarder,
	Thomas Zimmermann, Enrico Weigelt

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,
-- 
Sam Ravnborg <sam@ravnborg.org>

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

* [PATCH 02/15] video: fbdev: atyfb: Introduce backlight_get_brightness()
  2023-01-07 18:26 [PATCH 00/15] backlight: Drop use of deprecated fb_blank property Sam Ravnborg via B4 Submission Endpoint
  2023-01-07 18:26 ` [PATCH 01/15] video: fbdev: atmel_lcdfb: Rework backlight handling Sam Ravnborg via B4 Submission Endpoint
@ 2023-01-07 18:26 ` Sam Ravnborg via B4 Submission Endpoint
  2023-01-09 17:44   ` Christophe Leroy
  2023-01-07 18:26 ` [PATCH 03/15] video: fbdev: nvidia: " Sam Ravnborg via B4 Submission Endpoint
                   ` (12 subsequent siblings)
  14 siblings, 1 reply; 53+ messages in thread
From: Sam Ravnborg via B4 Submission Endpoint @ 2023-01-07 18:26 UTC (permalink / raw)
  To: Nicolas Ferre, Helge Deller, Alexandre Belloni, Claudiu Beznea,
	Antonino Daplas, Benjamin Herrenschmidt, Paul Mackerras,
	Greg Kroah-Hartman, Robin van der Gracht, Miguel Ojeda,
	Lee Jones, Daniel Thompson, Jingoo Han
  Cc: linux-fbdev, Stephen Kitt, Arnd Bergmann,
	Bartlomiej Zolnierkiewicz, Jani Nikula, Sam Ravnborg,
	linux-staging, linux-kernel, dri-devel, Jason Yan,
	Souptick Joarder, Daniel Vetter, linux-omap, linuxppc-dev,
	linux-arm-kernel

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: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Souptick Joarder <jrdr.linux@gmail.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Jason Yan <yanaijie@huawei.com>
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Arnd Bergmann <arnd@arndb.de>
---
 drivers/video/fbdev/aty/atyfb_base.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/video/fbdev/aty/atyfb_base.c b/drivers/video/fbdev/aty/atyfb_base.c
index 0ccf5d401ecb..ca361e215904 100644
--- a/drivers/video/fbdev/aty/atyfb_base.c
+++ b/drivers/video/fbdev/aty/atyfb_base.c
@@ -2219,13 +2219,7 @@ static int aty_bl_update_status(struct backlight_device *bd)
 {
 	struct atyfb_par *par = bl_get_data(bd);
 	unsigned int reg = aty_ld_lcd(LCD_MISC_CNTL, par);
-	int level;
-
-	if (bd->props.power != FB_BLANK_UNBLANK ||
-	    bd->props.fb_blank != FB_BLANK_UNBLANK)
-		level = 0;
-	else
-		level = bd->props.brightness;
+	int level = backlight_get_brightness(bd);
 
 	reg |= (BLMOD_EN | BIASMOD_EN);
 	if (level > 0) {

-- 
2.34.1

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

* [PATCH 03/15] video: fbdev: nvidia: Introduce backlight_get_brightness()
  2023-01-07 18:26 [PATCH 00/15] backlight: Drop use of deprecated fb_blank property Sam Ravnborg via B4 Submission Endpoint
  2023-01-07 18:26 ` [PATCH 01/15] video: fbdev: atmel_lcdfb: Rework backlight handling Sam Ravnborg via B4 Submission Endpoint
  2023-01-07 18:26 ` [PATCH 02/15] video: fbdev: atyfb: Introduce backlight_get_brightness() Sam Ravnborg via B4 Submission Endpoint
@ 2023-01-07 18:26 ` Sam Ravnborg via B4 Submission Endpoint
  2023-01-07 18:26 ` [PATCH 04/15] video: fbdev: radeon: " Sam Ravnborg via B4 Submission Endpoint
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 53+ messages in thread
From: Sam Ravnborg via B4 Submission Endpoint @ 2023-01-07 18:26 UTC (permalink / raw)
  To: Nicolas Ferre, Helge Deller, Alexandre Belloni, Claudiu Beznea,
	Antonino Daplas, Benjamin Herrenschmidt, Paul Mackerras,
	Greg Kroah-Hartman, Robin van der Gracht, Miguel Ojeda,
	Lee Jones, Daniel Thompson, Jingoo Han
  Cc: linux-fbdev, Stephen Kitt, Sam Ravnborg, linux-staging,
	linux-kernel, dri-devel, linux-omap, linuxppc-dev,
	linux-arm-kernel

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: Antonino Daplas <adaplas@gmail.com>
Cc: linux-fbdev@vger.kernel.org
---
 drivers/video/fbdev/nvidia/nv_backlight.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/video/fbdev/nvidia/nv_backlight.c b/drivers/video/fbdev/nvidia/nv_backlight.c
index 2ce53529f636..503a7a683855 100644
--- a/drivers/video/fbdev/nvidia/nv_backlight.c
+++ b/drivers/video/fbdev/nvidia/nv_backlight.c
@@ -49,17 +49,11 @@ static int nvidia_bl_update_status(struct backlight_device *bd)
 {
 	struct nvidia_par *par = bl_get_data(bd);
 	u32 tmp_pcrt, tmp_pmc, fpcontrol;
-	int level;
+	int level = backlight_get_brightness(bd);
 
 	if (!par->FlatPanel)
 		return 0;
 
-	if (bd->props.power != FB_BLANK_UNBLANK ||
-	    bd->props.fb_blank != FB_BLANK_UNBLANK)
-		level = 0;
-	else
-		level = bd->props.brightness;
-
 	tmp_pmc = NV_RD32(par->PMC, 0x10F0) & 0x0000FFFF;
 	tmp_pcrt = NV_RD32(par->PCRTC0, 0x081C) & 0xFFFFFFFC;
 	fpcontrol = NV_RD32(par->PRAMDAC, 0x0848) & 0xCFFFFFCC;

-- 
2.34.1

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

* [PATCH 04/15] video: fbdev: radeon: Introduce backlight_get_brightness()
  2023-01-07 18:26 [PATCH 00/15] backlight: Drop use of deprecated fb_blank property Sam Ravnborg via B4 Submission Endpoint
                   ` (2 preceding siblings ...)
  2023-01-07 18:26 ` [PATCH 03/15] video: fbdev: nvidia: " Sam Ravnborg via B4 Submission Endpoint
@ 2023-01-07 18:26 ` Sam Ravnborg via B4 Submission Endpoint
  2023-01-07 18:26 ` [PATCH 05/15] video: fbdev: riva: " Sam Ravnborg via B4 Submission Endpoint
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 53+ messages in thread
From: Sam Ravnborg via B4 Submission Endpoint @ 2023-01-07 18:26 UTC (permalink / raw)
  To: Nicolas Ferre, Helge Deller, Alexandre Belloni, Claudiu Beznea,
	Antonino Daplas, Benjamin Herrenschmidt, Paul Mackerras,
	Greg Kroah-Hartman, Robin van der Gracht, Miguel Ojeda,
	Lee Jones, Daniel Thompson, Jingoo Han
  Cc: linux-fbdev, Stephen Kitt, Sam Ravnborg, linux-staging,
	linux-kernel, dri-devel, linux-omap, linuxppc-dev,
	linux-arm-kernel

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: linux-fbdev@vger.kernel.org
---
 drivers/video/fbdev/aty/radeon_backlight.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/video/fbdev/aty/radeon_backlight.c b/drivers/video/fbdev/aty/radeon_backlight.c
index d2c1263ad260..22a39fea7b89 100644
--- a/drivers/video/fbdev/aty/radeon_backlight.c
+++ b/drivers/video/fbdev/aty/radeon_backlight.c
@@ -54,14 +54,10 @@ static int radeon_bl_update_status(struct backlight_device *bd)
 		return 0;
 
 	/* We turn off the LCD completely instead of just dimming the
-	 * backlight. This provides some greater power saving and the display
-	 * is useless without backlight anyway.
+	 * backlight if level < 1. This provides some greater power saving
+	 * and the display is useless without backlight anyway.
 	 */
-        if (bd->props.power != FB_BLANK_UNBLANK ||
-	    bd->props.fb_blank != FB_BLANK_UNBLANK)
-		level = 0;
-	else
-		level = bd->props.brightness;
+	level = backlight_get_brightness(bd);
 
 	del_timer_sync(&rinfo->lvds_timer);
 	radeon_engine_idle();

-- 
2.34.1

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

* [PATCH 05/15] video: fbdev: riva: Introduce backlight_get_brightness()
  2023-01-07 18:26 [PATCH 00/15] backlight: Drop use of deprecated fb_blank property Sam Ravnborg via B4 Submission Endpoint
                   ` (3 preceding siblings ...)
  2023-01-07 18:26 ` [PATCH 04/15] video: fbdev: radeon: " Sam Ravnborg via B4 Submission Endpoint
@ 2023-01-07 18:26 ` Sam Ravnborg via B4 Submission Endpoint
  2023-01-07 18:26 ` [PATCH 06/15] video: fbdev: aty128fb: " Sam Ravnborg via B4 Submission Endpoint
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 53+ messages in thread
From: Sam Ravnborg via B4 Submission Endpoint @ 2023-01-07 18:26 UTC (permalink / raw)
  To: Nicolas Ferre, Helge Deller, Alexandre Belloni, Claudiu Beznea,
	Antonino Daplas, Benjamin Herrenschmidt, Paul Mackerras,
	Greg Kroah-Hartman, Robin van der Gracht, Miguel Ojeda,
	Lee Jones, Daniel Thompson, Jingoo Han
  Cc: linux-fbdev, Stephen Kitt, Sam Ravnborg, linux-staging,
	linux-kernel, dri-devel, linux-omap, linuxppc-dev,
	linux-arm-kernel

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: Antonino Daplas <adaplas@gmail.com>
Cc: linux-fbdev@vger.kernel.org
---
 drivers/video/fbdev/riva/fbdev.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/video/fbdev/riva/fbdev.c b/drivers/video/fbdev/riva/fbdev.c
index 644278146d3b..41edc6e79460 100644
--- a/drivers/video/fbdev/riva/fbdev.c
+++ b/drivers/video/fbdev/riva/fbdev.c
@@ -293,13 +293,7 @@ static int riva_bl_update_status(struct backlight_device *bd)
 {
 	struct riva_par *par = bl_get_data(bd);
 	U032 tmp_pcrt, tmp_pmc;
-	int level;
-
-	if (bd->props.power != FB_BLANK_UNBLANK ||
-	    bd->props.fb_blank != FB_BLANK_UNBLANK)
-		level = 0;
-	else
-		level = bd->props.brightness;
+	int level = backlight_get_brightness(bd);
 
 	tmp_pmc = NV_RD32(par->riva.PMC, 0x10F0) & 0x0000FFFF;
 	tmp_pcrt = NV_RD32(par->riva.PCRTC0, 0x081C) & 0xFFFFFFFC;

-- 
2.34.1

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

* [PATCH 06/15] video: fbdev: aty128fb: Introduce backlight_get_brightness()
  2023-01-07 18:26 [PATCH 00/15] backlight: Drop use of deprecated fb_blank property Sam Ravnborg via B4 Submission Endpoint
                   ` (4 preceding siblings ...)
  2023-01-07 18:26 ` [PATCH 05/15] video: fbdev: riva: " Sam Ravnborg via B4 Submission Endpoint
@ 2023-01-07 18:26 ` Sam Ravnborg via B4 Submission Endpoint
  2023-01-07 18:26 ` [PATCH 07/15] video: fbdev: mx3fb: " Sam Ravnborg via B4 Submission Endpoint
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 53+ messages in thread
From: Sam Ravnborg via B4 Submission Endpoint @ 2023-01-07 18:26 UTC (permalink / raw)
  To: Nicolas Ferre, Helge Deller, Alexandre Belloni, Claudiu Beznea,
	Antonino Daplas, Benjamin Herrenschmidt, Paul Mackerras,
	Greg Kroah-Hartman, Robin van der Gracht, Miguel Ojeda,
	Lee Jones, Daniel Thompson, Jingoo Han
  Cc: linux-fbdev, Stephen Kitt, Sam Ravnborg, linux-staging,
	linux-kernel, dri-devel, linux-omap, linuxppc-dev,
	linux-arm-kernel

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: Paul Mackerras <paulus@samba.org>
Cc: linux-fbdev@vger.kernel.org
---
 drivers/video/fbdev/aty/aty128fb.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/video/fbdev/aty/aty128fb.c b/drivers/video/fbdev/aty/aty128fb.c
index dd31b9d7d337..736126cc5049 100644
--- a/drivers/video/fbdev/aty/aty128fb.c
+++ b/drivers/video/fbdev/aty/aty128fb.c
@@ -1764,17 +1764,10 @@ static int aty128_bl_update_status(struct backlight_device *bd)
 {
 	struct aty128fb_par *par = bl_get_data(bd);
 	unsigned int reg = aty_ld_le32(LVDS_GEN_CNTL);
-	int level;
-
-	if (bd->props.power != FB_BLANK_UNBLANK ||
-	    bd->props.fb_blank != FB_BLANK_UNBLANK ||
-	    !par->lcd_on)
-		level = 0;
-	else
-		level = bd->props.brightness;
+	int level = backlight_get_brightness(bd);
 
 	reg |= LVDS_BL_MOD_EN | LVDS_BLON;
-	if (level > 0) {
+	if (level > 0 || par->lcd_on) {
 		reg |= LVDS_DIGION;
 		if (!(reg & LVDS_ON)) {
 			reg &= ~LVDS_BLON;

-- 
2.34.1

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

* [PATCH 07/15] video: fbdev: mx3fb: Introduce backlight_get_brightness()
  2023-01-07 18:26 [PATCH 00/15] backlight: Drop use of deprecated fb_blank property Sam Ravnborg via B4 Submission Endpoint
                   ` (5 preceding siblings ...)
  2023-01-07 18:26 ` [PATCH 06/15] video: fbdev: aty128fb: " Sam Ravnborg via B4 Submission Endpoint
@ 2023-01-07 18:26 ` Sam Ravnborg via B4 Submission Endpoint
  2023-01-07 18:26 ` [PATCH 08/15] video: fbdev: omap2: " Sam Ravnborg via B4 Submission Endpoint
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 53+ messages in thread
From: Sam Ravnborg via B4 Submission Endpoint @ 2023-01-07 18:26 UTC (permalink / raw)
  To: Nicolas Ferre, Helge Deller, Alexandre Belloni, Claudiu Beznea,
	Antonino Daplas, Benjamin Herrenschmidt, Paul Mackerras,
	Greg Kroah-Hartman, Robin van der Gracht, Miguel Ojeda,
	Lee Jones, Daniel Thompson, Jingoo Han
  Cc: Kate Stewart, linux-fbdev, Stephen Kitt, Arnd Bergmann,
	Jani Nikula, Sam Ravnborg, linux-staging, linux-kernel,
	dri-devel, Laurent Pinchart, Thomas Gleixner, linux-omap,
	linuxppc-dev, linux-arm-kernel

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: Sam Ravnborg <sam@ravnborg.org>
Cc: Kate Stewart <kstewart@linuxfoundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Jani Nikula <jani.nikula@intel.com>
---
 drivers/video/fbdev/mx3fb.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/video/fbdev/mx3fb.c b/drivers/video/fbdev/mx3fb.c
index b945b68984b9..bc35f664cbff 100644
--- a/drivers/video/fbdev/mx3fb.c
+++ b/drivers/video/fbdev/mx3fb.c
@@ -283,12 +283,7 @@ static int mx3fb_bl_get_brightness(struct backlight_device *bl)
 static int mx3fb_bl_update_status(struct backlight_device *bl)
 {
 	struct mx3fb_data *fbd = bl_get_data(bl);
-	int brightness = bl->props.brightness;
-
-	if (bl->props.power != FB_BLANK_UNBLANK)
-		brightness = 0;
-	if (bl->props.fb_blank != FB_BLANK_UNBLANK)
-		brightness = 0;
+	int brightness = backlight_get_brightness(bl);
 
 	fbd->backlight_level = (fbd->backlight_level & ~0xFF) | brightness;
 
@@ -325,7 +320,6 @@ static void mx3fb_init_backlight(struct mx3fb_data *fbd)
 
 	fbd->bl = bl;
 	bl->props.power = FB_BLANK_UNBLANK;
-	bl->props.fb_blank = FB_BLANK_UNBLANK;
 	bl->props.brightness = mx3fb_bl_get_brightness(bl);
 }
 

-- 
2.34.1

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

* [PATCH 08/15] video: fbdev: omap2: Introduce backlight_get_brightness()
  2023-01-07 18:26 [PATCH 00/15] backlight: Drop use of deprecated fb_blank property Sam Ravnborg via B4 Submission Endpoint
                   ` (6 preceding siblings ...)
  2023-01-07 18:26 ` [PATCH 07/15] video: fbdev: mx3fb: " Sam Ravnborg via B4 Submission Endpoint
@ 2023-01-07 18:26 ` Sam Ravnborg via B4 Submission Endpoint
  2023-01-07 18:26 ` [PATCH 09/15] staging: fbtft: fb_ssd1351.c: Introduce backlight_is_blank() Sam Ravnborg via B4 Submission Endpoint
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 53+ messages in thread
From: Sam Ravnborg via B4 Submission Endpoint @ 2023-01-07 18:26 UTC (permalink / raw)
  To: Nicolas Ferre, Helge Deller, Alexandre Belloni, Claudiu Beznea,
	Antonino Daplas, Benjamin Herrenschmidt, Paul Mackerras,
	Greg Kroah-Hartman, Robin van der Gracht, Miguel Ojeda,
	Lee Jones, Daniel Thompson, Jingoo Han
  Cc: Kate Stewart, Enrico Weigelt, linux-fbdev, Stephen Kitt,
	Sam Ravnborg, linux-staging, linux-kernel, dri-devel,
	Alexios Zavras, Allison Randal, Thomas Gleixner, linux-omap,
	linuxppc-dev, linux-arm-kernel

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: Allison Randal <allison@lohutok.net>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Kate Stewart <kstewart@linuxfoundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Enrico Weigelt <info@metux.net>
Cc: Alexios Zavras <alexios.zavras@intel.com>
---
 .../fbdev/omap2/omapfb/displays/panel-dsi-cm.c     | 19 +-----------------
 .../omap2/omapfb/displays/panel-sony-acx565akm.c   | 23 +++++++---------------
 2 files changed, 8 insertions(+), 34 deletions(-)

diff --git a/drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c b/drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c
index a2c7c5cb1523..bd73aa5328c9 100644
--- a/drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c
+++ b/drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c
@@ -330,14 +330,8 @@ static int dsicm_bl_update_status(struct backlight_device *dev)
 {
 	struct panel_drv_data *ddata = dev_get_drvdata(&dev->dev);
 	struct omap_dss_device *in = ddata->in;
+	int level = backlight_get_brightness(dev);
 	int r;
-	int level;
-
-	if (dev->props.fb_blank == FB_BLANK_UNBLANK &&
-			dev->props.power == FB_BLANK_UNBLANK)
-		level = dev->props.brightness;
-	else
-		level = 0;
 
 	dev_dbg(&ddata->pdev->dev, "update brightness to %d\n", level);
 
@@ -360,17 +354,7 @@ static int dsicm_bl_update_status(struct backlight_device *dev)
 	return r;
 }
 
-static int dsicm_bl_get_intensity(struct backlight_device *dev)
-{
-	if (dev->props.fb_blank == FB_BLANK_UNBLANK &&
-			dev->props.power == FB_BLANK_UNBLANK)
-		return dev->props.brightness;
-
-	return 0;
-}
-
 static const struct backlight_ops dsicm_bl_ops = {
-	.get_brightness = dsicm_bl_get_intensity,
 	.update_status  = dsicm_bl_update_status,
 };
 
@@ -1251,7 +1235,6 @@ static int dsicm_probe(struct platform_device *pdev)
 
 		ddata->bldev = bldev;
 
-		bldev->props.fb_blank = FB_BLANK_UNBLANK;
 		bldev->props.power = FB_BLANK_UNBLANK;
 		bldev->props.brightness = 255;
 
diff --git a/drivers/video/fbdev/omap2/omapfb/displays/panel-sony-acx565akm.c b/drivers/video/fbdev/omap2/omapfb/displays/panel-sony-acx565akm.c
index c0965bee12c5..c9c8f10e2e2f 100644
--- a/drivers/video/fbdev/omap2/omapfb/displays/panel-sony-acx565akm.c
+++ b/drivers/video/fbdev/omap2/omapfb/displays/panel-sony-acx565akm.c
@@ -337,16 +337,10 @@ static int acx565akm_get_actual_brightness(struct panel_drv_data *ddata)
 static int acx565akm_bl_update_status(struct backlight_device *dev)
 {
 	struct panel_drv_data *ddata = dev_get_drvdata(&dev->dev);
-	int level;
+	int level = backlight_get_brightness(dev);
 
 	dev_dbg(&ddata->spi->dev, "%s\n", __func__);
 
-	if (dev->props.fb_blank == FB_BLANK_UNBLANK &&
-			dev->props.power == FB_BLANK_UNBLANK)
-		level = dev->props.brightness;
-	else
-		level = 0;
-
 	if (ddata->has_bc)
 		acx565akm_set_brightness(ddata, level);
 	else
@@ -364,15 +358,13 @@ static int acx565akm_bl_get_intensity(struct backlight_device *dev)
 	if (!ddata->has_bc)
 		return -ENODEV;
 
-	if (dev->props.fb_blank == FB_BLANK_UNBLANK &&
-			dev->props.power == FB_BLANK_UNBLANK) {
-		if (ddata->has_bc)
-			return acx565akm_get_actual_brightness(ddata);
-		else
-			return dev->props.brightness;
-	}
+	if (backlight_is_blank(dev))
+		return 0;
 
-	return 0;
+	if (ddata->has_bc)
+		return acx565akm_get_actual_brightness(ddata);
+	else
+		return backlight_get_brightness(dev);
 }
 
 static int acx565akm_bl_update_status_locked(struct backlight_device *dev)
@@ -795,7 +787,6 @@ static int acx565akm_probe(struct spi_device *spi)
 	}
 
 	memset(&props, 0, sizeof(props));
-	props.fb_blank = FB_BLANK_UNBLANK;
 	props.power = FB_BLANK_UNBLANK;
 	props.type = BACKLIGHT_RAW;
 

-- 
2.34.1

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

* [PATCH 09/15] staging: fbtft: fb_ssd1351.c: Introduce backlight_is_blank()
  2023-01-07 18:26 [PATCH 00/15] backlight: Drop use of deprecated fb_blank property Sam Ravnborg via B4 Submission Endpoint
                   ` (7 preceding siblings ...)
  2023-01-07 18:26 ` [PATCH 08/15] video: fbdev: omap2: " Sam Ravnborg via B4 Submission Endpoint
@ 2023-01-07 18:26 ` Sam Ravnborg via B4 Submission Endpoint
  2023-01-08 19:28   ` Stephen Kitt
  2023-01-09 11:13   ` Andy Shevchenko
  2023-01-07 18:26 ` [PATCH 10/15] staging: fbtft: core: " Sam Ravnborg via B4 Submission Endpoint
                   ` (5 subsequent siblings)
  14 siblings, 2 replies; 53+ messages in thread
From: Sam Ravnborg via B4 Submission Endpoint @ 2023-01-07 18:26 UTC (permalink / raw)
  To: Nicolas Ferre, Helge Deller, Alexandre Belloni, Claudiu Beznea,
	Antonino Daplas, Benjamin Herrenschmidt, Paul Mackerras,
	Greg Kroah-Hartman, Robin van der Gracht, Miguel Ojeda,
	Lee Jones, Daniel Thompson, Jingoo Han
  Cc: linux-fbdev, Andy Shevchenko, Stephen Kitt, Sam Ravnborg,
	linux-staging, linux-kernel, dri-devel, linux-omap, linuxppc-dev,
	linux-arm-kernel

From: Sam Ravnborg <sam@ravnborg.org>

Avoiding direct access to backlight_properties.props.

Access to the deprecated props.fb_blank replaced by backlight_is_blank().
Access to props.power is dropped - it was only used for debug.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Stephen Kitt <steve@sk2.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Daniel Thompson <daniel.thompson@linaro.org>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: linux-fbdev@vger.kernel.org
---
 drivers/staging/fbtft/fb_ssd1351.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/fbtft/fb_ssd1351.c b/drivers/staging/fbtft/fb_ssd1351.c
index b8d55aa8c5c7..995fbd2f3dc6 100644
--- a/drivers/staging/fbtft/fb_ssd1351.c
+++ b/drivers/staging/fbtft/fb_ssd1351.c
@@ -190,15 +190,12 @@ static struct fbtft_display display = {
 static int update_onboard_backlight(struct backlight_device *bd)
 {
 	struct fbtft_par *par = bl_get_data(bd);
-	bool on;
+	bool blank = backlight_is_blank(bd);
 
-	fbtft_par_dbg(DEBUG_BACKLIGHT, par,
-		      "%s: power=%d, fb_blank=%d\n",
-		      __func__, bd->props.power, bd->props.fb_blank);
+	fbtft_par_dbg(DEBUG_BACKLIGHT, par, "%s: blank=%d\n", __func__, blank);
 
-	on = !backlight_is_blank(bd);
 	/* Onboard backlight connected to GPIO0 on SSD1351, GPIO1 unused */
-	write_reg(par, 0xB5, on ? 0x03 : 0x02);
+	write_reg(par, 0xB5, !blank ? 0x03 : 0x02);
 
 	return 0;
 }

-- 
2.34.1

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

* [PATCH 10/15] staging: fbtft: core: Introduce backlight_is_blank()
  2023-01-07 18:26 [PATCH 00/15] backlight: Drop use of deprecated fb_blank property Sam Ravnborg via B4 Submission Endpoint
                   ` (8 preceding siblings ...)
  2023-01-07 18:26 ` [PATCH 09/15] staging: fbtft: fb_ssd1351.c: Introduce backlight_is_blank() Sam Ravnborg via B4 Submission Endpoint
@ 2023-01-07 18:26 ` Sam Ravnborg via B4 Submission Endpoint
  2023-01-08 19:29   ` Stephen Kitt
  2023-01-09 11:15   ` Andy Shevchenko
  2023-01-07 18:26 ` [PATCH 11/15] powerpc: via-pmu-backlight: Introduce backlight_get_brightness() Sam Ravnborg via B4 Submission Endpoint
                   ` (4 subsequent siblings)
  14 siblings, 2 replies; 53+ messages in thread
From: Sam Ravnborg via B4 Submission Endpoint @ 2023-01-07 18:26 UTC (permalink / raw)
  To: Nicolas Ferre, Helge Deller, Alexandre Belloni, Claudiu Beznea,
	Antonino Daplas, Benjamin Herrenschmidt, Paul Mackerras,
	Greg Kroah-Hartman, Robin van der Gracht, Miguel Ojeda,
	Lee Jones, Daniel Thompson, Jingoo Han
  Cc: linux-fbdev, Andy Shevchenko, Stephen Kitt, Sam Ravnborg,
	linux-staging, linux-kernel, dri-devel, Javier Martinez Canillas,
	Thomas Zimmermann, linux-omap, linuxppc-dev, linux-arm-kernel,
	Peter Suti

From: Sam Ravnborg <sam@ravnborg.org>

Avoiding direct access to backlight_properties.props.

Access to the deprecated props.fb_blank replaced by backlight_is_blank().
Access to props.power is dropped - it was only used for debug.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Javier Martinez Canillas <javierm@redhat.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Stephen Kitt <steve@sk2.org>
Cc: Peter Suti <peter.suti@streamunlimited.com>
Cc: linux-fbdev@vger.kernel.org
---
 drivers/staging/fbtft/fbtft-core.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-core.c
index afaba94d1d1c..1746327e1939 100644
--- a/drivers/staging/fbtft/fbtft-core.c
+++ b/drivers/staging/fbtft/fbtft-core.c
@@ -132,15 +132,15 @@ static int fbtft_backlight_update_status(struct backlight_device *bd)
 {
 	struct fbtft_par *par = bl_get_data(bd);
 	bool polarity = par->polarity;
+	bool blank = backlight_is_blank(bd);
 
-	fbtft_par_dbg(DEBUG_BACKLIGHT, par,
-		      "%s: polarity=%d, power=%d, fb_blank=%d\n",
-		      __func__, polarity, bd->props.power, bd->props.fb_blank);
+	fbtft_par_dbg(DEBUG_BACKLIGHT, par, "%s: polarity=%d, blank=%d\n",
+		      __func__, polarity, blank);
 
-	if (!backlight_is_blank(bd))
-		gpiod_set_value(par->gpio.led[0], polarity);
-	else
+	if (blank)
 		gpiod_set_value(par->gpio.led[0], !polarity);
+	else
+		gpiod_set_value(par->gpio.led[0], polarity);
 
 	return 0;
 }

-- 
2.34.1

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

* [PATCH 11/15] powerpc: via-pmu-backlight: Introduce backlight_get_brightness()
  2023-01-07 18:26 [PATCH 00/15] backlight: Drop use of deprecated fb_blank property Sam Ravnborg via B4 Submission Endpoint
                   ` (9 preceding siblings ...)
  2023-01-07 18:26 ` [PATCH 10/15] staging: fbtft: core: " Sam Ravnborg via B4 Submission Endpoint
@ 2023-01-07 18:26 ` Sam Ravnborg via B4 Submission Endpoint
  2023-01-08 19:36   ` Stephen Kitt
  2023-01-07 18:26 ` [PATCH 12/15] auxdisplay: ht16k33: " Sam Ravnborg via B4 Submission Endpoint
                   ` (3 subsequent siblings)
  14 siblings, 1 reply; 53+ messages in thread
From: Sam Ravnborg via B4 Submission Endpoint @ 2023-01-07 18:26 UTC (permalink / raw)
  To: Nicolas Ferre, Helge Deller, Alexandre Belloni, Claudiu Beznea,
	Antonino Daplas, Benjamin Herrenschmidt, Paul Mackerras,
	Greg Kroah-Hartman, Robin van der Gracht, Miguel Ojeda,
	Lee Jones, Daniel Thompson, Jingoo Han
  Cc: linux-fbdev, Stephen Kitt, Sam Ravnborg, linux-staging,
	linux-kernel, dri-devel, linux-omap, linuxppc-dev,
	linux-arm-kernel

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

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

* [PATCH 12/15] auxdisplay: ht16k33: Introduce backlight_get_brightness()
  2023-01-07 18:26 [PATCH 00/15] backlight: Drop use of deprecated fb_blank property Sam Ravnborg via B4 Submission Endpoint
                   ` (10 preceding siblings ...)
  2023-01-07 18:26 ` [PATCH 11/15] powerpc: via-pmu-backlight: Introduce backlight_get_brightness() Sam Ravnborg via B4 Submission Endpoint
@ 2023-01-07 18:26 ` Sam Ravnborg via B4 Submission Endpoint
  2023-01-07 21:02   ` Miguel Ojeda
  2023-01-07 18:26 ` [PATCH 13/15] backlight: omap1: Use backlight helpers Sam Ravnborg via B4 Submission Endpoint
                   ` (2 subsequent siblings)
  14 siblings, 1 reply; 53+ messages in thread
From: Sam Ravnborg via B4 Submission Endpoint @ 2023-01-07 18:26 UTC (permalink / raw)
  To: Nicolas Ferre, Helge Deller, Alexandre Belloni, Claudiu Beznea,
	Antonino Daplas, Benjamin Herrenschmidt, Paul Mackerras,
	Greg Kroah-Hartman, Robin van der Gracht, Miguel Ojeda,
	Lee Jones, Daniel Thompson, Jingoo Han
  Cc: linux-fbdev, Stephen Kitt, Sam Ravnborg, linux-staging,
	linux-kernel, dri-devel, Geert Uytterhoeven, linux-omap,
	linuxppc-dev, linux-arm-kernel

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: Robin van der Gracht <robin@protonic.nl>
Cc: Miguel Ojeda <ojeda@kernel.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
---
 drivers/auxdisplay/ht16k33.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/auxdisplay/ht16k33.c b/drivers/auxdisplay/ht16k33.c
index 02425991c159..15ab118c80f5 100644
--- a/drivers/auxdisplay/ht16k33.c
+++ b/drivers/auxdisplay/ht16k33.c
@@ -314,14 +314,9 @@ static int ht16k33_initialize(struct ht16k33_priv *priv)
 
 static int ht16k33_bl_update_status(struct backlight_device *bl)
 {
-	int brightness = bl->props.brightness;
+	int brightness = backlight_get_brightness(bl);
 	struct ht16k33_priv *priv = bl_get_data(bl);
 
-	if (bl->props.power != FB_BLANK_UNBLANK ||
-	    bl->props.fb_blank != FB_BLANK_UNBLANK ||
-	    bl->props.state & BL_CORE_FBBLANK)
-		brightness = 0;
-
 	return ht16k33_brightness_set(priv, brightness);
 }
 

-- 
2.34.1

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

* [PATCH 13/15] backlight: omap1: Use backlight helpers
  2023-01-07 18:26 [PATCH 00/15] backlight: Drop use of deprecated fb_blank property Sam Ravnborg via B4 Submission Endpoint
                   ` (11 preceding siblings ...)
  2023-01-07 18:26 ` [PATCH 12/15] auxdisplay: ht16k33: " Sam Ravnborg via B4 Submission Endpoint
@ 2023-01-07 18:26 ` Sam Ravnborg via B4 Submission Endpoint
  2023-01-08 19:32   ` Stephen Kitt
  2023-01-09 11:02   ` Daniel Thompson
  2023-01-07 18:26 ` [PATCH 14/15] backlight: tosa: Use backlight helper Sam Ravnborg via B4 Submission Endpoint
  2023-01-07 18:26 ` [PATCH 15/15] backlight: backlight: Drop the deprecated fb_blank property Sam Ravnborg via B4 Submission Endpoint
  14 siblings, 2 replies; 53+ messages in thread
From: Sam Ravnborg via B4 Submission Endpoint @ 2023-01-07 18:26 UTC (permalink / raw)
  To: Nicolas Ferre, Helge Deller, Alexandre Belloni, Claudiu Beznea,
	Antonino Daplas, Benjamin Herrenschmidt, Paul Mackerras,
	Greg Kroah-Hartman, Robin van der Gracht, Miguel Ojeda,
	Lee Jones, Daniel Thompson, Jingoo Han
  Cc: linux-fbdev, Stephen Kitt, Sam Ravnborg, linux-staging,
	linux-kernel, dri-devel, linux-omap, linuxppc-dev,
	linux-arm-kernel

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

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

* [PATCH 14/15] backlight: tosa: Use backlight helper
  2023-01-07 18:26 [PATCH 00/15] backlight: Drop use of deprecated fb_blank property Sam Ravnborg via B4 Submission Endpoint
                   ` (12 preceding siblings ...)
  2023-01-07 18:26 ` [PATCH 13/15] backlight: omap1: Use backlight helpers Sam Ravnborg via B4 Submission Endpoint
@ 2023-01-07 18:26 ` Sam Ravnborg via B4 Submission Endpoint
  2023-01-09 11:04   ` Daniel Thompson
  2023-01-07 18:26 ` [PATCH 15/15] backlight: backlight: Drop the deprecated fb_blank property Sam Ravnborg via B4 Submission Endpoint
  14 siblings, 1 reply; 53+ messages in thread
From: Sam Ravnborg via B4 Submission Endpoint @ 2023-01-07 18:26 UTC (permalink / raw)
  To: Nicolas Ferre, Helge Deller, Alexandre Belloni, Claudiu Beznea,
	Antonino Daplas, Benjamin Herrenschmidt, Paul Mackerras,
	Greg Kroah-Hartman, Robin van der Gracht, Miguel Ojeda,
	Lee Jones, Daniel Thompson, Jingoo Han
  Cc: linux-fbdev, Stephen Kitt, Sam Ravnborg, linux-staging,
	linux-kernel, dri-devel, linux-omap, linuxppc-dev,
	linux-arm-kernel

From: Stephen Kitt <steve@sk2.org>

Instead of retrieving the backlight brightness in struct
backlight_properties manually, and then checking whether the backlight
should be on at all, use backlight_get_brightness() which does all
this and insulates this from future changes.

Signed-off-by: Stephen Kitt <steve@sk2.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
---
 drivers/video/backlight/tosa_bl.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/video/backlight/tosa_bl.c b/drivers/video/backlight/tosa_bl.c
index f55b3d616a87..cb07f13dd886 100644
--- a/drivers/video/backlight/tosa_bl.c
+++ b/drivers/video/backlight/tosa_bl.c
@@ -50,13 +50,8 @@ static void tosa_bl_set_backlight(struct tosa_bl_data *data, int brightness)
 
 static int tosa_bl_update_status(struct backlight_device *dev)
 {
-	struct backlight_properties *props = &dev->props;
 	struct tosa_bl_data *data = bl_get_data(dev);
-	int power = max(props->power, props->fb_blank);
-	int brightness = props->brightness;
-
-	if (power)
-		brightness = 0;
+	int brightness = backlight_get_brightness(dev);
 
 	tosa_bl_set_backlight(data, brightness);
 

-- 
2.34.1

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

* [PATCH 15/15] backlight: backlight: Drop the deprecated fb_blank property
  2023-01-07 18:26 [PATCH 00/15] backlight: Drop use of deprecated fb_blank property Sam Ravnborg via B4 Submission Endpoint
                   ` (13 preceding siblings ...)
  2023-01-07 18:26 ` [PATCH 14/15] backlight: tosa: Use backlight helper Sam Ravnborg via B4 Submission Endpoint
@ 2023-01-07 18:26 ` Sam Ravnborg via B4 Submission Endpoint
  2023-01-08 19:32   ` Stephen Kitt
                     ` (2 more replies)
  14 siblings, 3 replies; 53+ messages in thread
From: Sam Ravnborg via B4 Submission Endpoint @ 2023-01-07 18:26 UTC (permalink / raw)
  To: Nicolas Ferre, Helge Deller, Alexandre Belloni, Claudiu Beznea,
	Antonino Daplas, Benjamin Herrenschmidt, Paul Mackerras,
	Greg Kroah-Hartman, Robin van der Gracht, Miguel Ojeda,
	Lee Jones, Daniel Thompson, Jingoo Han
  Cc: linux-fbdev, Stephen Kitt, Sam Ravnborg, linux-staging,
	linux-kernel, dri-devel, linux-omap, linuxppc-dev,
	linux-arm-kernel

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

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

* Re: [PATCH 01/15] video: fbdev: atmel_lcdfb: Rework backlight handling
  2023-01-07 18:26 ` [PATCH 01/15] video: fbdev: atmel_lcdfb: Rework backlight handling Sam Ravnborg via B4 Submission Endpoint
@ 2023-01-07 20:36   ` Stephen Kitt
  2023-01-07 20:53     ` Sam Ravnborg
  2023-01-09  9:14   ` Jani Nikula
  1 sibling, 1 reply; 53+ messages in thread
From: Stephen Kitt @ 2023-01-07 20:36 UTC (permalink / raw)
  To: sam, Sam Ravnborg via B4 Submission Endpoint, Nicolas Ferre,
	Helge Deller, Alexandre Belloni, Claudiu Beznea, Antonino Daplas,
	Benjamin Herrenschmidt, Paul Mackerras, Greg Kroah-Hartman,
	Robin van der Gracht, Miguel Ojeda, Lee Jones, Daniel Thompson,
	Jingoo Han
  Cc: linux-fbdev, Sam Ravnborg, linux-staging, linux-kernel,
	dri-devel, Ludovic Desroches, linux-omap, linuxppc-dev,
	linux-arm-kernel

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(-)
>
>diff --git a/drivers/video/fbdev/atmel_lcdfb.c b/drivers/video/fbdev/atmel_lcdfb.c
>index 1fc8de4ecbeb..d297b3892637 100644
>--- a/drivers/video/fbdev/atmel_lcdfb.c
>+++ b/drivers/video/fbdev/atmel_lcdfb.c
>@@ -49,7 +49,6 @@ struct atmel_lcdfb_info {
> 	struct clk		*lcdc_clk;
> 
> 	struct backlight_device	*backlight;
>-	u8			bl_power;
> 	u8			saved_lcdcon;
> 
> 	u32			pseudo_palette[16];
>@@ -109,32 +108,18 @@ static u32 contrast_ctr = ATMEL_LCDC_PS_DIV8
> static int atmel_bl_update_status(struct backlight_device *bl)
> {
> 	struct atmel_lcdfb_info *sinfo = bl_get_data(bl);
>-	int			power = sinfo->bl_power;
>-	int			brightness = bl->props.brightness;
>+	int brightness;
> 
>-	/* REVISIT there may be a meaningful difference between
>-	 * fb_blank and power ... there seem to be some cases
>-	 * this doesn't handle correctly.
>-	 */
>-	if (bl->props.fb_blank != sinfo->bl_power)
>-		power = bl->props.fb_blank;
>-	else if (bl->props.power != sinfo->bl_power)
>-		power = bl->props.power;
>-
>-	if (brightness < 0 && power == FB_BLANK_UNBLANK)
>-		brightness = lcdc_readl(sinfo, ATMEL_LCDC_CONTRAST_VAL);
>-	else if (power != FB_BLANK_UNBLANK)
>-		brightness = 0;
>+	brightness = backlight_get_brightness(bl);
> 
> 	lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_VAL, brightness);
>+
> 	if (contrast_ctr & ATMEL_LCDC_POL_POSITIVE)
> 		lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR,
> 			brightness ? contrast_ctr : 0);
> 	else
> 		lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, contrast_ctr);
> 
>-	bl->props.fb_blank = bl->props.power = sinfo->bl_power = power;
>-
> 	return 0;
> }
> 
>@@ -155,8 +140,6 @@ static void init_backlight(struct atmel_lcdfb_info *sinfo)
> 	struct backlight_properties props;
> 	struct backlight_device	*bl;
> 
>-	sinfo->bl_power = FB_BLANK_UNBLANK;
>-
> 	if (sinfo->backlight)
> 		return;
> 
>@@ -173,7 +156,6 @@ static void init_backlight(struct atmel_lcdfb_info *sinfo)
> 	sinfo->backlight = bl;
> 
> 	bl->props.power = FB_BLANK_UNBLANK;
>-	bl->props.fb_blank = FB_BLANK_UNBLANK;
> 	bl->props.brightness = atmel_bl_get_brightness(bl);
> }
> 
>

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.

Regards,

Stephen

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

* Re: [PATCH 01/15] video: fbdev: atmel_lcdfb: Rework backlight handling
  2023-01-07 20:36   ` Stephen Kitt
@ 2023-01-07 20:53     ` Sam Ravnborg
  2023-01-08  7:45       ` Stephen Kitt
  2023-01-08 17:26       ` Helge Deller
  0 siblings, 2 replies; 53+ messages in thread
From: Sam Ravnborg @ 2023-01-07 20:53 UTC (permalink / raw)
  To: Stephen Kitt
  Cc: Alexandre Belloni, linux-staging, Greg Kroah-Hartman,
	linux-fbdev, dri-devel, linux-kernel, Paul Mackerras,
	Daniel Thompson, Helge Deller, Lee Jones, Ludovic Desroches,
	Miguel Ojeda, Sam Ravnborg via B4 Submission Endpoint,
	Antonino Daplas, linux-omap, linux-arm-kernel,
	Robin van der Gracht, Nicolas Ferre, Jingoo Han, linuxppc-dev,
	Claudiu Beznea

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

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

* Re: [PATCH 12/15] auxdisplay: ht16k33: Introduce backlight_get_brightness()
  2023-01-07 18:26 ` [PATCH 12/15] auxdisplay: ht16k33: " Sam Ravnborg via B4 Submission Endpoint
@ 2023-01-07 21:02   ` Miguel Ojeda
  2023-01-08  9:29     ` Sam Ravnborg
  0 siblings, 1 reply; 53+ messages in thread
From: Miguel Ojeda @ 2023-01-07 21:02 UTC (permalink / raw)
  To: sam, Stephen Kitt
  Cc: Alexandre Belloni, linux-omap, Antonino Daplas,
	Robin van der Gracht, Helge Deller, Lee Jones, linux-staging,
	Nicolas Ferre, dri-devel, linux-kernel, Jingoo Han,
	Paul Mackerras, linux-fbdev, Greg Kroah-Hartman, Miguel Ojeda,
	Geert Uytterhoeven, Daniel Thompson, linuxppc-dev,
	Claudiu Beznea, linux-arm-kernel

On Sat, Jan 7, 2023 at 7:26 PM Sam Ravnborg via B4 Submission Endpoint
<devnull+sam.ravnborg.org@kernel.org> wrote:
>
> Introduce backlight_get_brightness() to simplify logic
> and avoid direct access to backlight properties.

Note: Stephen sent this one too a while ago (with some more details in
the commit message, which is always nice); and then he sent yesterday
v2 [1] (to mention the functional change with `BL_CORE_SUSPENDED`
[2]).

Anyway, if it goes via drm-misc, feel free to have my:

    Acked-by: Miguel Ojeda <ojeda@kernel.org>

Though it would be nice to have Robin test the change.

Thanks!

[1] https://lore.kernel.org/lkml/20230106143002.1434266-1-steve@sk2.org/
[2] https://lore.kernel.org/lkml/CANiq72kRhmT37H1FAGYGny83ONYXeqJuO8ZPbym0ajQOWKY4Kw@mail.gmail.com/

Cheers,
Miguel

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

* Re: [PATCH 01/15] video: fbdev: atmel_lcdfb: Rework backlight handling
  2023-01-07 20:53     ` Sam Ravnborg
@ 2023-01-08  7:45       ` Stephen Kitt
  2023-01-08  7:47         ` Stephen Kitt
  2023-01-08 20:24         ` Sam Ravnborg
  2023-01-08 17:26       ` Helge Deller
  1 sibling, 2 replies; 53+ messages in thread
From: Stephen Kitt @ 2023-01-08  7:45 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Alexandre Belloni, linux-staging, Greg Kroah-Hartman,
	linux-fbdev, dri-devel, linux-kernel, Paul Mackerras,
	Daniel Thompson, Helge Deller, Lee Jones, Ludovic Desroches,
	Miguel Ojeda, Sam Ravnborg via B4 Submission Endpoint,
	Antonino Daplas, linux-omap, linux-arm-kernel,
	Robin van der Gracht, Nicolas Ferre, Jingoo Han, linuxppc-dev,
	Claudiu Beznea

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

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

* Re: [PATCH 01/15] video: fbdev: atmel_lcdfb: Rework backlight handling
  2023-01-08  7:45       ` Stephen Kitt
@ 2023-01-08  7:47         ` Stephen Kitt
  2023-01-08 20:24         ` Sam Ravnborg
  1 sibling, 0 replies; 53+ messages in thread
From: Stephen Kitt @ 2023-01-08  7:47 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Alexandre Belloni, linux-staging, Greg Kroah-Hartman,
	linux-fbdev, dri-devel, linux-kernel, Paul Mackerras,
	Daniel Thompson, Helge Deller, Lee Jones, Ludovic Desroches,
	Miguel Ojeda, Sam Ravnborg via B4 Submission Endpoint,
	Antonino Daplas, linux-omap, linux-arm-kernel,
	Robin van der Gracht, Nicolas Ferre, Jingoo Han, linuxppc-dev,
	Claudiu Beznea

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

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

* Re: [PATCH 12/15] auxdisplay: ht16k33: Introduce backlight_get_brightness()
  2023-01-07 21:02   ` Miguel Ojeda
@ 2023-01-08  9:29     ` Sam Ravnborg
  2023-01-09 10:12       ` Robin van der Gracht
  0 siblings, 1 reply; 53+ messages in thread
From: Sam Ravnborg @ 2023-01-08  9:29 UTC (permalink / raw)
  To: Miguel Ojeda, Robin van der Gracht
  Cc: Alexandre Belloni, linux-staging, Stephen Kitt,
	Greg Kroah-Hartman, linux-fbdev, dri-devel, linux-kernel,
	Paul Mackerras, Daniel Thompson, Helge Deller, Lee Jones,
	Geert Uytterhoeven, Miguel Ojeda, Antonino Daplas, linux-omap,
	linux-arm-kernel, Robin van der Gracht, Nicolas Ferre,
	Jingoo Han, linuxppc-dev, Claudiu Beznea

Hi Robin.

On Sat, Jan 07, 2023 at 10:02:38PM +0100, Miguel Ojeda wrote:
> On Sat, Jan 7, 2023 at 7:26 PM Sam Ravnborg via B4 Submission Endpoint
> <devnull+sam.ravnborg.org@kernel.org> wrote:
> >
> > Introduce backlight_get_brightness() to simplify logic
> > and avoid direct access to backlight properties.
> 
> Note: Stephen sent this one too a while ago (with some more details in
> the commit message, which is always nice); and then he sent yesterday
> v2 [1] (to mention the functional change with `BL_CORE_SUSPENDED`
> [2]).
Thanks for the pointers. I will try to move forward with Stephen's
patches.
> 
> Anyway, if it goes via drm-misc, feel free to have my:
> 
>     Acked-by: Miguel Ojeda <ojeda@kernel.org>
> 
> Though it would be nice to have Robin test the change.

Robin - can I get your ack to apply Stephen's original v2 patch to
drm-misc?

	Sam

> 
> Thanks!
> 
> [1] https://lore.kernel.org/lkml/20230106143002.1434266-1-steve@sk2.org/
> [2] https://lore.kernel.org/lkml/CANiq72kRhmT37H1FAGYGny83ONYXeqJuO8ZPbym0ajQOWKY4Kw@mail.gmail.com/
> 
> Cheers,
> Miguel

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

* Re: [PATCH 01/15] video: fbdev: atmel_lcdfb: Rework backlight handling
  2023-01-07 20:53     ` Sam Ravnborg
  2023-01-08  7:45       ` Stephen Kitt
@ 2023-01-08 17:26       ` Helge Deller
  2023-01-08 20:26         ` Sam Ravnborg
  2023-01-09 20:18         ` Stephen Kitt
  1 sibling, 2 replies; 53+ messages in thread
From: Helge Deller @ 2023-01-08 17:26 UTC (permalink / raw)
  To: Sam Ravnborg, Stephen Kitt
  Cc: Alexandre Belloni, linux-omap, Antonino Daplas,
	Robin van der Gracht, Lee Jones, linux-staging, Nicolas Ferre,
	dri-devel, linux-kernel, Jingoo Han, Ludovic Desroches,
	Paul Mackerras, linux-fbdev, Greg Kroah-Hartman, Miguel Ojeda,
	Sam Ravnborg via B4 Submission Endpoint, Daniel Thompson,
	linuxppc-dev, Claudiu Beznea, linux-arm-kernel

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


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

* Re: [PATCH 09/15] staging: fbtft: fb_ssd1351.c: Introduce backlight_is_blank()
  2023-01-07 18:26 ` [PATCH 09/15] staging: fbtft: fb_ssd1351.c: Introduce backlight_is_blank() Sam Ravnborg via B4 Submission Endpoint
@ 2023-01-08 19:28   ` Stephen Kitt
  2023-01-08 20:29     ` Sam Ravnborg
  2023-01-09 11:13   ` Andy Shevchenko
  1 sibling, 1 reply; 53+ messages in thread
From: Stephen Kitt @ 2023-01-08 19:28 UTC (permalink / raw)
  To: Sam Ravnborg via B4 Submission Endpoint
  Cc: Alexandre Belloni, linux-staging, Greg Kroah-Hartman,
	linux-fbdev, dri-devel, linux-kernel, Paul Mackerras, sam,
	Daniel Thompson, Andy Shevchenko, Helge Deller, Lee Jones,
	Miguel Ojeda, Antonino Daplas, linux-omap, linux-arm-kernel,
	Robin van der Gracht, Nicolas Ferre, Jingoo Han, linuxppc-dev,
	Claudiu Beznea

[-- Attachment #1: Type: text/plain, Size: 2184 bytes --]

On Sat, 07 Jan 2023 19:26:23 +0100, Sam Ravnborg via B4 Submission Endpoint
<devnull+sam.ravnborg.org@kernel.org> wrote:

> From: Sam Ravnborg <sam@ravnborg.org>
> 
> Avoiding direct access to backlight_properties.props.
> 
> Access to the deprecated props.fb_blank replaced by backlight_is_blank().
> Access to props.power is dropped - it was only used for debug.
> 
> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> Cc: Stephen Kitt <steve@sk2.org>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Daniel Thompson <daniel.thompson@linaro.org>
> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Cc: linux-fbdev@vger.kernel.org
> ---
>  drivers/staging/fbtft/fb_ssd1351.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/staging/fbtft/fb_ssd1351.c
> b/drivers/staging/fbtft/fb_ssd1351.c index b8d55aa8c5c7..995fbd2f3dc6 100644
> --- a/drivers/staging/fbtft/fb_ssd1351.c
> +++ b/drivers/staging/fbtft/fb_ssd1351.c
> @@ -190,15 +190,12 @@ static struct fbtft_display display = {
>  static int update_onboard_backlight(struct backlight_device *bd)
>  {
>  	struct fbtft_par *par = bl_get_data(bd);
> -	bool on;
> +	bool blank = backlight_is_blank(bd);
>  
> -	fbtft_par_dbg(DEBUG_BACKLIGHT, par,
> -		      "%s: power=%d, fb_blank=%d\n",
> -		      __func__, bd->props.power, bd->props.fb_blank);
> +	fbtft_par_dbg(DEBUG_BACKLIGHT, par, "%s: blank=%d\n", __func__,
> blank); 
> -	on = !backlight_is_blank(bd);
>  	/* Onboard backlight connected to GPIO0 on SSD1351, GPIO1 unused */
> -	write_reg(par, 0xB5, on ? 0x03 : 0x02);
> +	write_reg(par, 0xB5, !blank ? 0x03 : 0x02);
>  
>  	return 0;
>  }
> 
> -- 
> 2.34.1

For debugging purposes here, would there be any point in logging props.state?
As in

        fbtft_par_dbg(DEBUG_BACKLIGHT, par,
-                     "%s: power=%d, fb_blank=%d\n",
-                     __func__, bd->props.power, bd->props.fb_blank);
+                     "%s: power=%d, state=%u\n",
+                     __func__, bd->props.power, bd->props.state);

In any case,

Reviewed-by: Stephen Kitt <steve@sk2.org>

Regards,

Stephen

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 10/15] staging: fbtft: core: Introduce backlight_is_blank()
  2023-01-07 18:26 ` [PATCH 10/15] staging: fbtft: core: " Sam Ravnborg via B4 Submission Endpoint
@ 2023-01-08 19:29   ` Stephen Kitt
  2023-01-09 11:15   ` Andy Shevchenko
  1 sibling, 0 replies; 53+ messages in thread
From: Stephen Kitt @ 2023-01-08 19:29 UTC (permalink / raw)
  To: Sam Ravnborg via B4 Submission Endpoint
  Cc: Alexandre Belloni, linux-staging, Greg Kroah-Hartman,
	linux-fbdev, dri-devel, linux-kernel, Paul Mackerras, sam,
	Peter Suti, Daniel Thompson, Andy Shevchenko, Helge Deller,
	Lee Jones, Javier Martinez Canillas, Miguel Ojeda,
	Antonino Daplas, linux-omap, linux-arm-kernel,
	Robin van der Gracht, Nicolas Ferre, Thomas Zimmermann,
	Jingoo Han, linuxppc-dev, Claudiu Beznea

[-- Attachment #1: Type: text/plain, Size: 1974 bytes --]

On Sat, 07 Jan 2023 19:26:24 +0100, Sam Ravnborg via B4 Submission Endpoint
<devnull+sam.ravnborg.org@kernel.org> wrote:

> From: Sam Ravnborg <sam@ravnborg.org>
> 
> Avoiding direct access to backlight_properties.props.
> 
> Access to the deprecated props.fb_blank replaced by backlight_is_blank().
> Access to props.power is dropped - it was only used for debug.
> 
> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> Cc: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Cc: Javier Martinez Canillas <javierm@redhat.com>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Cc: Stephen Kitt <steve@sk2.org>
> Cc: Peter Suti <peter.suti@streamunlimited.com>
> Cc: linux-fbdev@vger.kernel.org
> ---
>  drivers/staging/fbtft/fbtft-core.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/staging/fbtft/fbtft-core.c
> b/drivers/staging/fbtft/fbtft-core.c index afaba94d1d1c..1746327e1939 100644
> --- a/drivers/staging/fbtft/fbtft-core.c
> +++ b/drivers/staging/fbtft/fbtft-core.c
> @@ -132,15 +132,15 @@ static int fbtft_backlight_update_status(struct
> backlight_device *bd) {
>  	struct fbtft_par *par = bl_get_data(bd);
>  	bool polarity = par->polarity;
> +	bool blank = backlight_is_blank(bd);
>  
> -	fbtft_par_dbg(DEBUG_BACKLIGHT, par,
> -		      "%s: polarity=%d, power=%d, fb_blank=%d\n",
> -		      __func__, polarity, bd->props.power,
> bd->props.fb_blank);
> +	fbtft_par_dbg(DEBUG_BACKLIGHT, par, "%s: polarity=%d, blank=%d\n",
> +		      __func__, polarity, blank);
>  
> -	if (!backlight_is_blank(bd))
> -		gpiod_set_value(par->gpio.led[0], polarity);
> -	else
> +	if (blank)
>  		gpiod_set_value(par->gpio.led[0], !polarity);
> +	else
> +		gpiod_set_value(par->gpio.led[0], polarity);
>  
>  	return 0;
>  }
> 
> -- 
> 2.34.1

Reviewed-by: Stephen Kitt <steve@sk2.org>

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 13/15] backlight: omap1: Use backlight helpers
  2023-01-07 18:26 ` [PATCH 13/15] backlight: omap1: Use backlight helpers Sam Ravnborg via B4 Submission Endpoint
@ 2023-01-08 19:32   ` Stephen Kitt
  2023-01-09 11:02   ` Daniel Thompson
  1 sibling, 0 replies; 53+ messages in thread
From: Stephen Kitt @ 2023-01-08 19:32 UTC (permalink / raw)
  To: Sam Ravnborg via B4 Submission Endpoint
  Cc: Alexandre Belloni, linux-omap, Antonino Daplas,
	Robin van der Gracht, Helge Deller, Lee Jones, linux-staging,
	Nicolas Ferre, dri-devel, linux-kernel, linuxppc-dev, Jingoo Han,
	Paul Mackerras, linux-fbdev, Greg Kroah-Hartman, Miguel Ojeda,
	Daniel Thompson, sam, Claudiu Beznea, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 4324 bytes --]

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>

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 15/15] backlight: backlight: Drop the deprecated fb_blank property
  2023-01-07 18:26 ` [PATCH 15/15] backlight: backlight: Drop the deprecated fb_blank property Sam Ravnborg via B4 Submission Endpoint
@ 2023-01-08 19:32   ` Stephen Kitt
  2023-01-09 11:06   ` Daniel Thompson
  2023-01-26 14:27   ` Lee Jones
  2 siblings, 0 replies; 53+ messages in thread
From: Stephen Kitt @ 2023-01-08 19:32 UTC (permalink / raw)
  To: Sam Ravnborg via B4 Submission Endpoint
  Cc: Alexandre Belloni, linux-omap, Antonino Daplas,
	Robin van der Gracht, Helge Deller, Lee Jones, linux-staging,
	Nicolas Ferre, dri-devel, linux-kernel, linuxppc-dev, Jingoo Han,
	Paul Mackerras, linux-fbdev, Greg Kroah-Hartman, Miguel Ojeda,
	Daniel Thompson, sam, Claudiu Beznea, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 3421 bytes --]

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>

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 11/15] powerpc: via-pmu-backlight: Introduce backlight_get_brightness()
  2023-01-07 18:26 ` [PATCH 11/15] powerpc: via-pmu-backlight: Introduce backlight_get_brightness() Sam Ravnborg via B4 Submission Endpoint
@ 2023-01-08 19:36   ` Stephen Kitt
  0 siblings, 0 replies; 53+ messages in thread
From: Stephen Kitt @ 2023-01-08 19:36 UTC (permalink / raw)
  To: Sam Ravnborg via B4 Submission Endpoint
  Cc: Alexandre Belloni, linux-omap, Antonino Daplas,
	Robin van der Gracht, Helge Deller, Lee Jones, linux-staging,
	Nicolas Ferre, dri-devel, linux-kernel, linuxppc-dev, Jingoo Han,
	Paul Mackerras, linux-fbdev, Greg Kroah-Hartman, Miguel Ojeda,
	Daniel Thompson, sam, Claudiu Beznea, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 1411 bytes --]

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

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 01/15] video: fbdev: atmel_lcdfb: Rework backlight handling
  2023-01-08  7:45       ` Stephen Kitt
  2023-01-08  7:47         ` Stephen Kitt
@ 2023-01-08 20:24         ` Sam Ravnborg
  2023-01-09 19:53           ` Stephen Kitt
  1 sibling, 1 reply; 53+ messages in thread
From: Sam Ravnborg @ 2023-01-08 20:24 UTC (permalink / raw)
  To: Stephen Kitt
  Cc: Jingoo Han, Alexandre Belloni, Lee Jones, Antonino Daplas,
	linux-omap, Greg Kroah-Hartman, Helge Deller, linux-staging,
	linux-fbdev, dri-devel, linux-kernel, Ludovic Desroches,
	Paul Mackerras, Robin van der Gracht, Miguel Ojeda,
	Sam Ravnborg via B4 Submission Endpoint, Daniel Thompson,
	linuxppc-dev, Claudiu Beznea, linux-arm-kernel, Nicolas Ferre

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

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

* Re: [PATCH 01/15] video: fbdev: atmel_lcdfb: Rework backlight handling
  2023-01-08 17:26       ` Helge Deller
@ 2023-01-08 20:26         ` Sam Ravnborg
  2023-01-09 20:18         ` Stephen Kitt
  1 sibling, 0 replies; 53+ messages in thread
From: Sam Ravnborg @ 2023-01-08 20:26 UTC (permalink / raw)
  To: Helge Deller
  Cc: Alexandre Belloni, linux-staging, Stephen Kitt, Antonino Daplas,
	Greg Kroah-Hartman, Robin van der Gracht, Lee Jones,
	Nicolas Ferre, dri-devel, linux-kernel, Ludovic Desroches,
	Paul Mackerras, linux-fbdev, Jingoo Han, Miguel Ojeda,
	Sam Ravnborg via B4 Submission Endpoint, Daniel Thompson,
	linux-omap, linuxppc-dev, Claudiu Beznea, linux-arm-kernel

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

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

* Re: [PATCH 09/15] staging: fbtft: fb_ssd1351.c: Introduce backlight_is_blank()
  2023-01-08 19:28   ` Stephen Kitt
@ 2023-01-08 20:29     ` Sam Ravnborg
  2023-01-09  7:04       ` Stephen Kitt
  2023-01-09 11:16       ` Daniel Thompson
  0 siblings, 2 replies; 53+ messages in thread
From: Sam Ravnborg @ 2023-01-08 20:29 UTC (permalink / raw)
  To: Stephen Kitt
  Cc: Alexandre Belloni, Andy Shevchenko, Antonino Daplas, Jingoo Han,
	Greg Kroah-Hartman, Helge Deller, linux-staging, linux-fbdev,
	dri-devel, linux-kernel, linux-omap, Paul Mackerras, Lee Jones,
	Robin van der Gracht, Miguel Ojeda,
	Sam Ravnborg via B4 Submission Endpoint, Daniel Thompson,
	linuxppc-dev, Claudiu Beznea, linux-arm-kernel, Nicolas Ferre

Hi Stephen,

On Sun, Jan 08, 2023 at 08:28:17PM +0100, Stephen Kitt wrote:
> On Sat, 07 Jan 2023 19:26:23 +0100, Sam Ravnborg via B4 Submission Endpoint
> <devnull+sam.ravnborg.org@kernel.org> wrote:
> 
> > From: Sam Ravnborg <sam@ravnborg.org>
> > 
> > Avoiding direct access to backlight_properties.props.
> > 
> > Access to the deprecated props.fb_blank replaced by backlight_is_blank().
> > Access to props.power is dropped - it was only used for debug.
> > 
> > Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> > Cc: Stephen Kitt <steve@sk2.org>
> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > Cc: Daniel Thompson <daniel.thompson@linaro.org>
> > Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > Cc: linux-fbdev@vger.kernel.org
> > ---
> >  drivers/staging/fbtft/fb_ssd1351.c | 9 +++------
> >  1 file changed, 3 insertions(+), 6 deletions(-)
> > 
> > diff --git a/drivers/staging/fbtft/fb_ssd1351.c
> > b/drivers/staging/fbtft/fb_ssd1351.c index b8d55aa8c5c7..995fbd2f3dc6 100644
> > --- a/drivers/staging/fbtft/fb_ssd1351.c
> > +++ b/drivers/staging/fbtft/fb_ssd1351.c
> > @@ -190,15 +190,12 @@ static struct fbtft_display display = {
> >  static int update_onboard_backlight(struct backlight_device *bd)
> >  {
> >  	struct fbtft_par *par = bl_get_data(bd);
> > -	bool on;
> > +	bool blank = backlight_is_blank(bd);
> >  
> > -	fbtft_par_dbg(DEBUG_BACKLIGHT, par,
> > -		      "%s: power=%d, fb_blank=%d\n",
> > -		      __func__, bd->props.power, bd->props.fb_blank);
> > +	fbtft_par_dbg(DEBUG_BACKLIGHT, par, "%s: blank=%d\n", __func__,
> > blank); 
> > -	on = !backlight_is_blank(bd);
> >  	/* Onboard backlight connected to GPIO0 on SSD1351, GPIO1 unused */
> > -	write_reg(par, 0xB5, on ? 0x03 : 0x02);
> > +	write_reg(par, 0xB5, !blank ? 0x03 : 0x02);
> >  
> >  	return 0;
> >  }
> > 
> > -- 
> > 2.34.1
> 
> For debugging purposes here, would there be any point in logging props.state?
> As in
> 
>         fbtft_par_dbg(DEBUG_BACKLIGHT, par,
> -                     "%s: power=%d, fb_blank=%d\n",
> -                     __func__, bd->props.power, bd->props.fb_blank);
> +                     "%s: power=%d, state=%u\n",
> +                     __func__, bd->props.power, bd->props.state);

Thanks for the suggestion - and the reviews!

I was tempted to just remove the debugging.
If we require debugging, then this could be added in the backlight core,
thus everyone would benefit from it.

The solution above avoid any direct use of backlight_properties
which I consider a layer violation outside the backlight core.
(We cannot avoid it today with the current interface - but we can
minimize it).

	Sam

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

* Re: [PATCH 09/15] staging: fbtft: fb_ssd1351.c: Introduce backlight_is_blank()
  2023-01-08 20:29     ` Sam Ravnborg
@ 2023-01-09  7:04       ` Stephen Kitt
  2023-01-09 11:16       ` Daniel Thompson
  1 sibling, 0 replies; 53+ messages in thread
From: Stephen Kitt @ 2023-01-09  7:04 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Alexandre Belloni, Andy Shevchenko, Antonino Daplas, Jingoo Han,
	Greg Kroah-Hartman, Helge Deller, linux-staging, linux-fbdev,
	dri-devel, linux-kernel, linux-omap, Paul Mackerras, Lee Jones,
	Robin van der Gracht, Miguel Ojeda,
	Sam Ravnborg via B4 Submission Endpoint, Daniel Thompson,
	linuxppc-dev, Claudiu Beznea, linux-arm-kernel, Nicolas Ferre

[-- Attachment #1: Type: text/plain, Size: 3056 bytes --]

Hi Sam,

On Sun, 8 Jan 2023 21:29:43 +0100, Sam Ravnborg <sam@ravnborg.org> wrote:
> On Sun, Jan 08, 2023 at 08:28:17PM +0100, Stephen Kitt wrote:
> > On Sat, 07 Jan 2023 19:26:23 +0100, Sam Ravnborg via B4 Submission
> > Endpoint <devnull+sam.ravnborg.org@kernel.org> wrote:
> >   
> > > From: Sam Ravnborg <sam@ravnborg.org>
> > > 
> > > Avoiding direct access to backlight_properties.props.
> > > 
> > > Access to the deprecated props.fb_blank replaced by
> > > backlight_is_blank(). Access to props.power is dropped - it was only
> > > used for debug.
> > > 
> > > Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> > > Cc: Stephen Kitt <steve@sk2.org>
> > > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > > Cc: Daniel Thompson <daniel.thompson@linaro.org>
> > > Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > > Cc: linux-fbdev@vger.kernel.org
> > > ---
> > >  drivers/staging/fbtft/fb_ssd1351.c | 9 +++------
> > >  1 file changed, 3 insertions(+), 6 deletions(-)
> > > 
> > > diff --git a/drivers/staging/fbtft/fb_ssd1351.c
> > > b/drivers/staging/fbtft/fb_ssd1351.c index b8d55aa8c5c7..995fbd2f3dc6
> > > 100644 --- a/drivers/staging/fbtft/fb_ssd1351.c
> > > +++ b/drivers/staging/fbtft/fb_ssd1351.c
> > > @@ -190,15 +190,12 @@ static struct fbtft_display display = {
> > >  static int update_onboard_backlight(struct backlight_device *bd)
> > >  {
> > >  	struct fbtft_par *par = bl_get_data(bd);
> > > -	bool on;
> > > +	bool blank = backlight_is_blank(bd);
> > >  
> > > -	fbtft_par_dbg(DEBUG_BACKLIGHT, par,
> > > -		      "%s: power=%d, fb_blank=%d\n",
> > > -		      __func__, bd->props.power, bd->props.fb_blank);
> > > +	fbtft_par_dbg(DEBUG_BACKLIGHT, par, "%s: blank=%d\n", __func__,
> > > blank); 
> > > -	on = !backlight_is_blank(bd);
> > >  	/* Onboard backlight connected to GPIO0 on SSD1351, GPIO1
> > > unused */
> > > -	write_reg(par, 0xB5, on ? 0x03 : 0x02);
> > > +	write_reg(par, 0xB5, !blank ? 0x03 : 0x02);
> > >  
> > >  	return 0;
> > >  }
> > > 
> > > -- 
> > > 2.34.1  
> > 
> > For debugging purposes here, would there be any point in logging
> > props.state? As in
> > 
> >         fbtft_par_dbg(DEBUG_BACKLIGHT, par,
> > -                     "%s: power=%d, fb_blank=%d\n",
> > -                     __func__, bd->props.power, bd->props.fb_blank);
> > +                     "%s: power=%d, state=%u\n",
> > +                     __func__, bd->props.power, bd->props.state);  
> 
> Thanks for the suggestion - and the reviews!
> 
> I was tempted to just remove the debugging.
> If we require debugging, then this could be added in the backlight core,
> thus everyone would benefit from it.
> 
> The solution above avoid any direct use of backlight_properties
> which I consider a layer violation outside the backlight core.
> (We cannot avoid it today with the current interface - but we can
> minimize it).

Ah yes, ideally backlight_properties should be viewed as an opaque structure,
that makes sense.

Regards,

Stephen

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 01/15] video: fbdev: atmel_lcdfb: Rework backlight handling
  2023-01-07 18:26 ` [PATCH 01/15] video: fbdev: atmel_lcdfb: Rework backlight handling Sam Ravnborg via B4 Submission Endpoint
  2023-01-07 20:36   ` Stephen Kitt
@ 2023-01-09  9:14   ` Jani Nikula
  1 sibling, 0 replies; 53+ messages in thread
From: Jani Nikula @ 2023-01-09  9:14 UTC (permalink / raw)
  To: Sam Ravnborg via B4 Submission Endpoint, Nicolas Ferre,
	Helge Deller, Alexandre Belloni, Claudiu Beznea, Antonino Daplas,
	Benjamin Herrenschmidt, Paul Mackerras, Greg Kroah-Hartman,
	Robin van der Gracht, Miguel Ojeda, Lee Jones, Daniel Thompson,
	Jingoo Han
  Cc: linux-fbdev, Stephen Kitt, linuxppc-dev, linux-staging,
	linux-kernel, dri-devel, Ludovic Desroches, linux-omap,
	Sam Ravnborg, linux-arm-kernel

On Sat, 07 Jan 2023, 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.

backlight_is_brightness?

BR,
Jani.


>
> 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(-)
>
> diff --git a/drivers/video/fbdev/atmel_lcdfb.c b/drivers/video/fbdev/atmel_lcdfb.c
> index 1fc8de4ecbeb..d297b3892637 100644
> --- a/drivers/video/fbdev/atmel_lcdfb.c
> +++ b/drivers/video/fbdev/atmel_lcdfb.c
> @@ -49,7 +49,6 @@ struct atmel_lcdfb_info {
>  	struct clk		*lcdc_clk;
>  
>  	struct backlight_device	*backlight;
> -	u8			bl_power;
>  	u8			saved_lcdcon;
>  
>  	u32			pseudo_palette[16];
> @@ -109,32 +108,18 @@ static u32 contrast_ctr = ATMEL_LCDC_PS_DIV8
>  static int atmel_bl_update_status(struct backlight_device *bl)
>  {
>  	struct atmel_lcdfb_info *sinfo = bl_get_data(bl);
> -	int			power = sinfo->bl_power;
> -	int			brightness = bl->props.brightness;
> +	int brightness;
>  
> -	/* REVISIT there may be a meaningful difference between
> -	 * fb_blank and power ... there seem to be some cases
> -	 * this doesn't handle correctly.
> -	 */
> -	if (bl->props.fb_blank != sinfo->bl_power)
> -		power = bl->props.fb_blank;
> -	else if (bl->props.power != sinfo->bl_power)
> -		power = bl->props.power;
> -
> -	if (brightness < 0 && power == FB_BLANK_UNBLANK)
> -		brightness = lcdc_readl(sinfo, ATMEL_LCDC_CONTRAST_VAL);
> -	else if (power != FB_BLANK_UNBLANK)
> -		brightness = 0;
> +	brightness = backlight_get_brightness(bl);
>  
>  	lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_VAL, brightness);
> +
>  	if (contrast_ctr & ATMEL_LCDC_POL_POSITIVE)
>  		lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR,
>  			brightness ? contrast_ctr : 0);
>  	else
>  		lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, contrast_ctr);
>  
> -	bl->props.fb_blank = bl->props.power = sinfo->bl_power = power;
> -
>  	return 0;
>  }
>  
> @@ -155,8 +140,6 @@ static void init_backlight(struct atmel_lcdfb_info *sinfo)
>  	struct backlight_properties props;
>  	struct backlight_device	*bl;
>  
> -	sinfo->bl_power = FB_BLANK_UNBLANK;
> -
>  	if (sinfo->backlight)
>  		return;
>  
> @@ -173,7 +156,6 @@ static void init_backlight(struct atmel_lcdfb_info *sinfo)
>  	sinfo->backlight = bl;
>  
>  	bl->props.power = FB_BLANK_UNBLANK;
> -	bl->props.fb_blank = FB_BLANK_UNBLANK;
>  	bl->props.brightness = atmel_bl_get_brightness(bl);
>  }

-- 
Jani Nikula, Intel Open Source Graphics Center

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

* Re: [PATCH 12/15] auxdisplay: ht16k33: Introduce backlight_get_brightness()
  2023-01-08  9:29     ` Sam Ravnborg
@ 2023-01-09 10:12       ` Robin van der Gracht
  2023-03-19 13:44         ` Stephen Kitt
  0 siblings, 1 reply; 53+ messages in thread
From: Robin van der Gracht @ 2023-01-09 10:12 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Alexandre Belloni, linux-staging, Stephen Kitt, linux-fbdev,
	dri-devel, linux-kernel, Paul Mackerras, Daniel Thompson,
	Helge Deller, Lee Jones, Geert Uytterhoeven, Miguel Ojeda,
	Antonino Daplas, linux-omap, linux-arm-kernel, Jingoo Han,
	Nicolas Ferre, Miguel Ojeda, Greg Kroah-Hartman, linuxppc-dev,
	Claudiu Beznea

Hi Sam,

On 2023-01-08 10:29, Sam Ravnborg wrote:
> Hi Robin.
> 
> On Sat, Jan 07, 2023 at 10:02:38PM +0100, Miguel Ojeda wrote:
>> On Sat, Jan 7, 2023 at 7:26 PM Sam Ravnborg via B4 Submission Endpoint
>> <devnull+sam.ravnborg.org@kernel.org> wrote:
>> >
>> > Introduce backlight_get_brightness() to simplify logic
>> > and avoid direct access to backlight properties.
>> 
>> Note: Stephen sent this one too a while ago (with some more details in
>> the commit message, which is always nice); and then he sent yesterday
>> v2 [1] (to mention the functional change with `BL_CORE_SUSPENDED`
>> [2]).
> Thanks for the pointers. I will try to move forward with Stephen's
> patches.
>> 
>> Anyway, if it goes via drm-misc, feel free to have my:
>> 
>>     Acked-by: Miguel Ojeda <ojeda@kernel.org>
>> 
>> Though it would be nice to have Robin test the change.
> 
> Robin - can I get your ack to apply Stephen's original v2 patch to
> drm-misc?

done! see: 
https://lore.kernel.org/lkml/0b16391f997e6ed005a326e4e48f2033@protonic.nl/

- Robin

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

* Re: [PATCH 13/15] backlight: omap1: Use backlight helpers
  2023-01-07 18:26 ` [PATCH 13/15] backlight: omap1: Use backlight helpers Sam Ravnborg via B4 Submission Endpoint
  2023-01-08 19:32   ` Stephen Kitt
@ 2023-01-09 11:02   ` Daniel Thompson
  1 sibling, 0 replies; 53+ messages in thread
From: Daniel Thompson @ 2023-01-09 11:02 UTC (permalink / raw)
  To: sam
  Cc: Alexandre Belloni, linux-staging, Stephen Kitt, Antonino Daplas,
	Robin van der Gracht, Helge Deller, Lee Jones, Nicolas Ferre,
	dri-devel, linux-kernel, Jingoo Han, Paul Mackerras, linux-fbdev,
	Greg Kroah-Hartman, Miguel Ojeda, linux-omap, linuxppc-dev,
	Claudiu Beznea, linux-arm-kernel

On Sat, Jan 07, 2023 at 07:26:27PM +0100, Sam Ravnborg via B4 Submission Endpoint 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>

This rework will result in additional calls to omapbl_send_enable()
during updates so, if anyone who cares about omap1, is filtering LKML
then a Tested-by: would be nice.

However, I doubt the additional calls will do any harm so even with
that absent:
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>


Daniel.

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

* Re: [PATCH 14/15] backlight: tosa: Use backlight helper
  2023-01-07 18:26 ` [PATCH 14/15] backlight: tosa: Use backlight helper Sam Ravnborg via B4 Submission Endpoint
@ 2023-01-09 11:04   ` Daniel Thompson
  0 siblings, 0 replies; 53+ messages in thread
From: Daniel Thompson @ 2023-01-09 11:04 UTC (permalink / raw)
  To: sam
  Cc: Alexandre Belloni, linux-staging, Stephen Kitt, Antonino Daplas,
	Robin van der Gracht, Helge Deller, Lee Jones, Nicolas Ferre,
	dri-devel, linux-kernel, Jingoo Han, Paul Mackerras, linux-fbdev,
	Greg Kroah-Hartman, Miguel Ojeda, linux-omap, linuxppc-dev,
	Claudiu Beznea, linux-arm-kernel

On Sat, Jan 07, 2023 at 07:26:28PM +0100, Sam Ravnborg via B4 Submission Endpoint wrote:
> From: Stephen Kitt <steve@sk2.org>
>
> Instead of retrieving the backlight brightness in struct
> backlight_properties manually, and then checking whether the backlight
> should be on at all, use backlight_get_brightness() which does all
> this and insulates this from future changes.
>
> Signed-off-by: Stephen Kitt <steve@sk2.org>
> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>

Just for completeness...
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>


Daniel.

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

* Re: [PATCH 15/15] backlight: backlight: Drop the deprecated fb_blank property
  2023-01-07 18:26 ` [PATCH 15/15] backlight: backlight: Drop the deprecated fb_blank property Sam Ravnborg via B4 Submission Endpoint
  2023-01-08 19:32   ` Stephen Kitt
@ 2023-01-09 11:06   ` Daniel Thompson
  2023-01-09 16:27     ` Sam Ravnborg
  2023-01-26 14:27   ` Lee Jones
  2 siblings, 1 reply; 53+ messages in thread
From: Daniel Thompson @ 2023-01-09 11:06 UTC (permalink / raw)
  To: sam
  Cc: Alexandre Belloni, linux-staging, Stephen Kitt, Antonino Daplas,
	Robin van der Gracht, Helge Deller, Lee Jones, Nicolas Ferre,
	dri-devel, linux-kernel, Jingoo Han, Paul Mackerras, linux-fbdev,
	Greg Kroah-Hartman, Miguel Ojeda, linux-omap, linuxppc-dev,
	Claudiu Beznea, linux-arm-kernel

On Sat, Jan 07, 2023 at 07:26:29PM +0100, Sam Ravnborg via B4 Submission Endpoint 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>


Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>


PS Please don't treat this like a maintainer Acked-by: and merge it
   (Lee's not on holiday so work with Lee to figure out the merge
   strategy ;-) ).

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

* Re: [PATCH 09/15] staging: fbtft: fb_ssd1351.c: Introduce backlight_is_blank()
  2023-01-07 18:26 ` [PATCH 09/15] staging: fbtft: fb_ssd1351.c: Introduce backlight_is_blank() Sam Ravnborg via B4 Submission Endpoint
  2023-01-08 19:28   ` Stephen Kitt
@ 2023-01-09 11:13   ` Andy Shevchenko
  1 sibling, 0 replies; 53+ messages in thread
From: Andy Shevchenko @ 2023-01-09 11:13 UTC (permalink / raw)
  To: sam
  Cc: Alexandre Belloni, linux-omap, Stephen Kitt, Antonino Daplas,
	Robin van der Gracht, Helge Deller, Lee Jones, linux-staging,
	Nicolas Ferre, dri-devel, linux-kernel, Jingoo Han,
	Paul Mackerras, linux-fbdev, Greg Kroah-Hartman, Miguel Ojeda,
	Daniel Thompson, linuxppc-dev, Claudiu Beznea, linux-arm-kernel

On Sat, Jan 07, 2023 at 07:26:23PM +0100, Sam Ravnborg via B4 Submission Endpoint wrote:
> From: Sam Ravnborg <sam@ravnborg.org>
> 
> Avoiding direct access to backlight_properties.props.
> 
> Access to the deprecated props.fb_blank replaced by backlight_is_blank().
> Access to props.power is dropped - it was only used for debug.

> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> Cc: Stephen Kitt <steve@sk2.org>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Daniel Thompson <daniel.thompson@linaro.org>
> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

> Cc: linux-fbdev@vger.kernel.org

Not sure why you have this (at least) explicitly mentioned as get_maintainer.pl
can generate it and git send-email can utilize the script output...

...

> -	write_reg(par, 0xB5, on ? 0x03 : 0x02);
> +	write_reg(par, 0xB5, !blank ? 0x03 : 0x02);

Why not positive conditional?

	write_reg(par, 0xB5, blank ? 0x02 : 0x03);

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH 10/15] staging: fbtft: core: Introduce backlight_is_blank()
  2023-01-07 18:26 ` [PATCH 10/15] staging: fbtft: core: " Sam Ravnborg via B4 Submission Endpoint
  2023-01-08 19:29   ` Stephen Kitt
@ 2023-01-09 11:15   ` Andy Shevchenko
  1 sibling, 0 replies; 53+ messages in thread
From: Andy Shevchenko @ 2023-01-09 11:15 UTC (permalink / raw)
  To: sam
  Cc: Alexandre Belloni, linux-staging, Stephen Kitt,
	Greg Kroah-Hartman, linux-fbdev, dri-devel, linux-kernel,
	Paul Mackerras, Peter Suti, Daniel Thompson, Helge Deller,
	Lee Jones, Javier Martinez Canillas, Miguel Ojeda,
	Antonino Daplas, linux-omap, linux-arm-kernel,
	Robin van der Gracht, Nicolas Ferre, Thomas Zimmermann,
	Jingoo Han, linuxppc-dev, Claudiu Beznea

On Sat, Jan 07, 2023 at 07:26:24PM +0100, Sam Ravnborg via B4 Submission Endpoint wrote:
> From: Sam Ravnborg <sam@ravnborg.org>
> 
> Avoiding direct access to backlight_properties.props.
> 
> Access to the deprecated props.fb_blank replaced by backlight_is_blank().
> Access to props.power is dropped - it was only used for debug.

...

> +	if (blank)
>  		gpiod_set_value(par->gpio.led[0], !polarity);
> +	else
> +		gpiod_set_value(par->gpio.led[0], polarity);

	if (blank)
		polarity = !polarity;

	gpiod_set_value(par->gpio.led[0], polarity);

?

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH 09/15] staging: fbtft: fb_ssd1351.c: Introduce backlight_is_blank()
  2023-01-08 20:29     ` Sam Ravnborg
  2023-01-09  7:04       ` Stephen Kitt
@ 2023-01-09 11:16       ` Daniel Thompson
  1 sibling, 0 replies; 53+ messages in thread
From: Daniel Thompson @ 2023-01-09 11:16 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Alexandre Belloni, Lee Jones, Stephen Kitt, Antonino Daplas,
	Jingoo Han, Greg Kroah-Hartman, Helge Deller, linux-staging,
	linux-fbdev, dri-devel, linux-kernel, linux-omap, Paul Mackerras,
	Robin van der Gracht, Miguel Ojeda,
	Sam Ravnborg via B4 Submission Endpoint, Andy Shevchenko,
	linuxppc-dev, Claudiu Beznea, linux-arm-kernel, Nicolas Ferre

On Sun, Jan 08, 2023 at 09:29:43PM +0100, Sam Ravnborg wrote:
> Hi Stephen,
>
> On Sun, Jan 08, 2023 at 08:28:17PM +0100, Stephen Kitt wrote:
> > On Sat, 07 Jan 2023 19:26:23 +0100, Sam Ravnborg via B4 Submission Endpoint
> > <devnull+sam.ravnborg.org@kernel.org> wrote:
> >
> > > From: Sam Ravnborg <sam@ravnborg.org>
> > >
> > > Avoiding direct access to backlight_properties.props.
> > >
> > > Access to the deprecated props.fb_blank replaced by backlight_is_blank().
> > > Access to props.power is dropped - it was only used for debug.
> > >
> > > Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> > > Cc: Stephen Kitt <steve@sk2.org>
> > > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > > Cc: Daniel Thompson <daniel.thompson@linaro.org>
> > > Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > > Cc: linux-fbdev@vger.kernel.org
> > > ---
> > >  drivers/staging/fbtft/fb_ssd1351.c | 9 +++------
> > >  1 file changed, 3 insertions(+), 6 deletions(-)
> > >
> > > diff --git a/drivers/staging/fbtft/fb_ssd1351.c
> > > b/drivers/staging/fbtft/fb_ssd1351.c index b8d55aa8c5c7..995fbd2f3dc6 100644
> > > --- a/drivers/staging/fbtft/fb_ssd1351.c
> > > +++ b/drivers/staging/fbtft/fb_ssd1351.c
> > > @@ -190,15 +190,12 @@ static struct fbtft_display display = {
> > >  static int update_onboard_backlight(struct backlight_device *bd)
> > >  {
> > >  	struct fbtft_par *par = bl_get_data(bd);
> > > -	bool on;
> > > +	bool blank = backlight_is_blank(bd);
> > >
> > > -	fbtft_par_dbg(DEBUG_BACKLIGHT, par,
> > > -		      "%s: power=%d, fb_blank=%d\n",
> > > -		      __func__, bd->props.power, bd->props.fb_blank);
> > > +	fbtft_par_dbg(DEBUG_BACKLIGHT, par, "%s: blank=%d\n", __func__,
> > > blank);
> > > -	on = !backlight_is_blank(bd);
> > >  	/* Onboard backlight connected to GPIO0 on SSD1351, GPIO1 unused */
> > > -	write_reg(par, 0xB5, on ? 0x03 : 0x02);
> > > +	write_reg(par, 0xB5, !blank ? 0x03 : 0x02);
> > >
> > >  	return 0;
> > >  }
> > >
> > > --
> > > 2.34.1
> >
> > For debugging purposes here, would there be any point in logging props.state?
> > As in
> >
> >         fbtft_par_dbg(DEBUG_BACKLIGHT, par,
> > -                     "%s: power=%d, fb_blank=%d\n",
> > -                     __func__, bd->props.power, bd->props.fb_blank);
> > +                     "%s: power=%d, state=%u\n",
> > +                     __func__, bd->props.power, bd->props.state);
>
> Thanks for the suggestion - and the reviews!
>
> I was tempted to just remove the debugging.
> If we require debugging, then this could be added in the backlight core,
> thus everyone would benefit from it.

I had the same instinct to remove the debug print here (esp. ones with
__func__ in them) but I think that's probably a much more widely scoped
clean up for fbtft ;-).

On that basis:
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>


Daniel.

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

* Re: [PATCH 15/15] backlight: backlight: Drop the deprecated fb_blank property
  2023-01-09 11:06   ` Daniel Thompson
@ 2023-01-09 16:27     ` Sam Ravnborg
  2023-01-10 10:09       ` Lee Jones
  0 siblings, 1 reply; 53+ messages in thread
From: Sam Ravnborg @ 2023-01-09 16:27 UTC (permalink / raw)
  To: Daniel Thompson
  Cc: Alexandre Belloni, linux-staging, Stephen Kitt, Antonino Daplas,
	Robin van der Gracht, Helge Deller, Lee Jones, Nicolas Ferre,
	dri-devel, linux-kernel, Jingoo Han, Paul Mackerras, linux-fbdev,
	Greg Kroah-Hartman, Miguel Ojeda, linux-omap, linuxppc-dev,
	Claudiu Beznea, linux-arm-kernel

Hi Daniel.

On Mon, Jan 09, 2023 at 11:06:35AM +0000, Daniel Thompson wrote:
> On Sat, Jan 07, 2023 at 07:26:29PM +0100, Sam Ravnborg via B4 Submission Endpoint 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>
> 
> 
> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>

Thanks for the follow-up on all the backlight related patches.

> 
> 
> PS Please don't treat this like a maintainer Acked-by: and merge it
>    (Lee's not on holiday so work with Lee to figure out the merge
>    strategy ;-) ).
Nope, I am aware that the usual pattern here and wait for Lee to show
up.
For this patch there is a bug as I need to update a comment.
I will fix this when I resend after all the patches in flight has
landed. So likely after the next merge window,

	Sam


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

* Re: [PATCH 02/15] video: fbdev: atyfb: Introduce backlight_get_brightness()
  2023-01-07 18:26 ` [PATCH 02/15] video: fbdev: atyfb: Introduce backlight_get_brightness() Sam Ravnborg via B4 Submission Endpoint
@ 2023-01-09 17:44   ` Christophe Leroy
  2023-01-09 18:21     ` Sam Ravnborg
  0 siblings, 1 reply; 53+ messages in thread
From: Christophe Leroy @ 2023-01-09 17:44 UTC (permalink / raw)
  To: sam, Nicolas Ferre, Helge Deller, Alexandre Belloni,
	Claudiu Beznea, Antonino Daplas, Benjamin Herrenschmidt,
	Paul Mackerras, Greg Kroah-Hartman, Robin van der Gracht,
	Miguel Ojeda, Lee Jones, Daniel Thompson, Jingoo Han
  Cc: linux-fbdev, Stephen Kitt, Arnd Bergmann,
	Bartlomiej Zolnierkiewicz, Jani Nikula, Daniel Vetter,
	linux-staging, linux-kernel, dri-devel, Jason Yan,
	Souptick Joarder, linux-omap, linuxppc-dev, linux-arm-kernel



Le 07/01/2023 à 19:26, Sam Ravnborg via B4 Submission Endpoint a écrit :
> From: Sam Ravnborg <sam@ravnborg.org>
> 
> Introduce backlight_get_brightness() to simplify logic
> and avoid direct access to backlight properties.

When I read 'introduce' I understand that you are adding a new function.

In fact backlight_get_brightness() already exists, so maybe replace 
'introduce' by 'use'


> 
> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Souptick Joarder <jrdr.linux@gmail.com>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Jason Yan <yanaijie@huawei.com>
> Cc: Jani Nikula <jani.nikula@intel.com>
> Cc: Arnd Bergmann <arnd@arndb.de>
> ---
>   drivers/video/fbdev/aty/atyfb_base.c | 8 +-------
>   1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/drivers/video/fbdev/aty/atyfb_base.c b/drivers/video/fbdev/aty/atyfb_base.c
> index 0ccf5d401ecb..ca361e215904 100644
> --- a/drivers/video/fbdev/aty/atyfb_base.c
> +++ b/drivers/video/fbdev/aty/atyfb_base.c
> @@ -2219,13 +2219,7 @@ static int aty_bl_update_status(struct backlight_device *bd)
>   {
>          struct atyfb_par *par = bl_get_data(bd);
>          unsigned int reg = aty_ld_lcd(LCD_MISC_CNTL, par);
> -       int level;
> -
> -       if (bd->props.power != FB_BLANK_UNBLANK ||
> -           bd->props.fb_blank != FB_BLANK_UNBLANK)
> -               level = 0;
> -       else
> -               level = bd->props.brightness;
> +       int level = backlight_get_brightness(bd);
> 
>          reg |= (BLMOD_EN | BIASMOD_EN);
>          if (level > 0) {
> 
> --
> 2.34.1

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

* Re: [PATCH 02/15] video: fbdev: atyfb: Introduce backlight_get_brightness()
  2023-01-09 17:44   ` Christophe Leroy
@ 2023-01-09 18:21     ` Sam Ravnborg
  0 siblings, 0 replies; 53+ messages in thread
From: Sam Ravnborg @ 2023-01-09 18:21 UTC (permalink / raw)
  To: Christophe Leroy
  Cc: Alexandre Belloni, Lee Jones, Stephen Kitt, Greg Kroah-Hartman,
	linux-fbdev, dri-devel, linux-kernel, Paul Mackerras,
	Daniel Thompson, Antonino Daplas, Helge Deller, linux-staging,
	Daniel Vetter, Miguel Ojeda, Arnd Bergmann,
	Bartlomiej Zolnierkiewicz, Jani Nikula, linux-omap,
	linux-arm-kernel, Jason Yan, Robin van der Gracht, Nicolas Ferre,
	Souptick Joarder, Jingoo Han, linuxppc-dev, Claudiu Beznea

Hi Christophe,
On Mon, Jan 09, 2023 at 05:44:46PM +0000, Christophe Leroy wrote:
> 
> 
> Le 07/01/2023 à 19:26, Sam Ravnborg via B4 Submission Endpoint a écrit :
> > From: Sam Ravnborg <sam@ravnborg.org>
> > 
> > Introduce backlight_get_brightness() to simplify logic
> > and avoid direct access to backlight properties.
> 
> When I read 'introduce' I understand that you are adding a new function.
> 
> In fact backlight_get_brightness() already exists, so maybe replace 
> 'introduce' by 'use'

Thanks for your feedback. A similar patch is already applied to the
fbdev tree, so this patch can be ignored.

	Sam

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

* Re: [PATCH 01/15] video: fbdev: atmel_lcdfb: Rework backlight handling
  2023-01-08 20:24         ` Sam Ravnborg
@ 2023-01-09 19:53           ` Stephen Kitt
  2023-01-09 20:03             ` Stephen Kitt
  0 siblings, 1 reply; 53+ messages in thread
From: Stephen Kitt @ 2023-01-09 19:53 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Jingoo Han, Alexandre Belloni, Lee Jones, Antonino Daplas,
	linux-omap, Greg Kroah-Hartman, Helge Deller, linux-staging,
	linux-fbdev, dri-devel, linux-kernel, Ludovic Desroches,
	Paul Mackerras, Robin van der Gracht, Miguel Ojeda,
	Sam Ravnborg via B4 Submission Endpoint, Daniel Thompson,
	linuxppc-dev, Claudiu Beznea, linux-arm-kernel, Nicolas Ferre

[-- Attachment #1: Type: text/plain, Size: 809 bytes --]

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

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 01/15] video: fbdev: atmel_lcdfb: Rework backlight handling
  2023-01-09 19:53           ` Stephen Kitt
@ 2023-01-09 20:03             ` Stephen Kitt
  0 siblings, 0 replies; 53+ messages in thread
From: Stephen Kitt @ 2023-01-09 20:03 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Jingoo Han, Alexandre Belloni, Lee Jones, Antonino Daplas,
	linux-omap, Greg Kroah-Hartman, Helge Deller, linux-staging,
	linux-fbdev, dri-devel, linux-kernel, Ludovic Desroches,
	Paul Mackerras, Robin van der Gracht, Miguel Ojeda,
	Sam Ravnborg via B4 Submission Endpoint, Daniel Thompson,
	linuxppc-dev, Claudiu Beznea, linux-arm-kernel, Nicolas Ferre

[-- Attachment #1: Type: text/plain, Size: 1023 bytes --]

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

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 01/15] video: fbdev: atmel_lcdfb: Rework backlight handling
  2023-01-08 17:26       ` Helge Deller
  2023-01-08 20:26         ` Sam Ravnborg
@ 2023-01-09 20:18         ` Stephen Kitt
  2023-01-09 20:34           ` Helge Deller
  1 sibling, 1 reply; 53+ messages in thread
From: Stephen Kitt @ 2023-01-09 20:18 UTC (permalink / raw)
  To: Helge Deller
  Cc: Alexandre Belloni, linux-staging, Greg Kroah-Hartman,
	linux-fbdev, dri-devel, linux-kernel, Paul Mackerras,
	Sam Ravnborg, Daniel Thompson, Lee Jones, Ludovic Desroches,
	Miguel Ojeda, Sam Ravnborg via B4 Submission Endpoint,
	Antonino Daplas, linux-omap, linux-arm-kernel,
	Robin van der Gracht, Nicolas Ferre, Jingoo Han, linuxppc-dev,
	Claudiu Beznea

[-- Attachment #1: Type: text/plain, Size: 2266 bytes --]

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

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 01/15] video: fbdev: atmel_lcdfb: Rework backlight handling
  2023-01-09 20:18         ` Stephen Kitt
@ 2023-01-09 20:34           ` Helge Deller
  0 siblings, 0 replies; 53+ messages in thread
From: Helge Deller @ 2023-01-09 20:34 UTC (permalink / raw)
  To: Stephen Kitt
  Cc: Alexandre Belloni, linux-staging, Greg Kroah-Hartman,
	linux-fbdev, dri-devel, linux-kernel, Paul Mackerras,
	Sam Ravnborg, Daniel Thompson, Lee Jones, Ludovic Desroches,
	Miguel Ojeda, Sam Ravnborg via B4 Submission Endpoint,
	Antonino Daplas, linux-omap, linux-arm-kernel,
	Robin van der Gracht, Nicolas Ferre, Jingoo Han, linuxppc-dev,
	Claudiu Beznea

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


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

* Re: [PATCH 15/15] backlight: backlight: Drop the deprecated fb_blank property
  2023-01-09 16:27     ` Sam Ravnborg
@ 2023-01-10 10:09       ` Lee Jones
  0 siblings, 0 replies; 53+ messages in thread
From: Lee Jones @ 2023-01-10 10:09 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Daniel Thompson, Stephen Kitt, Antonino Daplas,
	Robin van der Gracht, Helge Deller, linux-staging, Nicolas Ferre,
	dri-devel, linux-kernel, Jingoo Han, Paul Mackerras,
	Alexandre Belloni, linux-fbdev, Greg Kroah-Hartman, Miguel Ojeda,
	linux-omap, linuxppc-dev, Claudiu Beznea, linux-arm-kernel

On Mon, 09 Jan 2023, Sam Ravnborg wrote:

> Hi Daniel.
> 
> On Mon, Jan 09, 2023 at 11:06:35AM +0000, Daniel Thompson wrote:
> > On Sat, Jan 07, 2023 at 07:26:29PM +0100, Sam Ravnborg via B4 Submission Endpoint 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>
> > 
> > 
> > Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
> 
> Thanks for the follow-up on all the backlight related patches.
> 
> > 
> > 
> > PS Please don't treat this like a maintainer Acked-by: and merge it
> >    (Lee's not on holiday so work with Lee to figure out the merge
> >    strategy ;-) ).
> Nope, I am aware that the usual pattern here and wait for Lee to show
> up.

It's on the list.  Only 50 more reviews in the backlog now!

> For this patch there is a bug as I need to update a comment.
> I will fix this when I resend after all the patches in flight has
> landed. So likely after the next merge window,

-- 
Lee Jones [李琼斯]

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

* Re: [PATCH 15/15] backlight: backlight: Drop the deprecated fb_blank property
  2023-01-07 18:26 ` [PATCH 15/15] backlight: backlight: Drop the deprecated fb_blank property Sam Ravnborg via B4 Submission Endpoint
  2023-01-08 19:32   ` Stephen Kitt
  2023-01-09 11:06   ` Daniel Thompson
@ 2023-01-26 14:27   ` Lee Jones
  2023-01-26 16:11     ` Sam Ravnborg
  2 siblings, 1 reply; 53+ messages in thread
From: Lee Jones @ 2023-01-26 14:27 UTC (permalink / raw)
  To: sam
  Cc: Alexandre Belloni, linux-omap, Stephen Kitt, Antonino Daplas,
	Robin van der Gracht, Helge Deller, linux-staging, Nicolas Ferre,
	dri-devel, linux-kernel, Jingoo Han, Paul Mackerras, linux-fbdev,
	Greg Kroah-Hartman, Miguel Ojeda, Daniel Thompson, linuxppc-dev,
	Claudiu Beznea, linux-arm-kernel

On Sat, 07 Jan 2023, Sam Ravnborg via B4 Submission Endpoint 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(-)

Applied, thanks

-- 
Lee Jones [李琼斯]

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

* Re: [PATCH 15/15] backlight: backlight: Drop the deprecated fb_blank property
  2023-01-26 14:27   ` Lee Jones
@ 2023-01-26 16:11     ` Sam Ravnborg
  2023-01-26 16:30       ` Lee Jones
  0 siblings, 1 reply; 53+ messages in thread
From: Sam Ravnborg @ 2023-01-26 16:11 UTC (permalink / raw)
  To: Lee Jones
  Cc: Alexandre Belloni, linux-omap, Stephen Kitt, Antonino Daplas,
	Robin van der Gracht, Helge Deller, linux-staging, Nicolas Ferre,
	dri-devel, linux-kernel, Jingoo Han, Paul Mackerras, linux-fbdev,
	Greg Kroah-Hartman, Miguel Ojeda, Daniel Thompson, linuxppc-dev,
	Claudiu Beznea, linux-arm-kernel

Hi Lee,
On Thu, Jan 26, 2023 at 02:27:26PM +0000, Lee Jones wrote:
> On Sat, 07 Jan 2023, Sam Ravnborg via B4 Submission Endpoint 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(-)
> 
> Applied, thanks

Some of the dependent patches in this series are not yet applied.
I have them queued up for processing this weekend, but I missed the -rc6
window for drm-misc so they will likely not hit upstream in the upcoming
merge window.
I can try to expedite it.

But if you have not yet pushed it, please revert this patch.
Then I will resend only when the remaining patches are upstream.

	Sam

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

* Re: [PATCH 15/15] backlight: backlight: Drop the deprecated fb_blank property
  2023-01-26 16:11     ` Sam Ravnborg
@ 2023-01-26 16:30       ` Lee Jones
  0 siblings, 0 replies; 53+ messages in thread
From: Lee Jones @ 2023-01-26 16:30 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Alexandre Belloni, linux-omap, Stephen Kitt, Antonino Daplas,
	Robin van der Gracht, Helge Deller, linux-staging, Nicolas Ferre,
	dri-devel, linux-kernel, Jingoo Han, Paul Mackerras, linux-fbdev,
	Greg Kroah-Hartman, Miguel Ojeda, Daniel Thompson, linuxppc-dev,
	Claudiu Beznea, linux-arm-kernel

On Thu, 26 Jan 2023, Sam Ravnborg wrote:

> Hi Lee,
> On Thu, Jan 26, 2023 at 02:27:26PM +0000, Lee Jones wrote:
> > On Sat, 07 Jan 2023, Sam Ravnborg via B4 Submission Endpoint 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(-)
> > 
> > Applied, thanks
> 
> Some of the dependent patches in this series are not yet applied.
> I have them queued up for processing this weekend, but I missed the -rc6
> window for drm-misc so they will likely not hit upstream in the upcoming
> merge window.
> I can try to expedite it.
> 
> But if you have not yet pushed it, please revert this patch.
> Then I will resend only when the remaining patches are upstream.

Thanks for the info.  Dropped.

-- 
Lee Jones [李琼斯]

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

* Re: [PATCH 12/15] auxdisplay: ht16k33: Introduce backlight_get_brightness()
  2023-01-09 10:12       ` Robin van der Gracht
@ 2023-03-19 13:44         ` Stephen Kitt
  2023-03-19 18:44           ` Sam Ravnborg
  0 siblings, 1 reply; 53+ messages in thread
From: Stephen Kitt @ 2023-03-19 13:44 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Alexandre Belloni, linux-staging, linux-fbdev, dri-devel,
	linux-kernel, Paul Mackerras, Daniel Thompson, Helge Deller,
	Lee Jones, Geert Uytterhoeven, Miguel Ojeda, Antonino Daplas,
	linux-omap, linux-arm-kernel, Jingoo Han, Greg Kroah-Hartman,
	Nicolas Ferre, Miguel Ojeda, Robin van der Gracht, linuxppc-dev,
	Claudiu Beznea

Hi,

On Mon, 09 Jan 2023 11:12:02 +0100, Robin van der Gracht <robin@protonic.nl>
wrote:
> On 2023-01-08 10:29, Sam Ravnborg wrote:
> > On Sat, Jan 07, 2023 at 10:02:38PM +0100, Miguel Ojeda wrote:  
> >> On Sat, Jan 7, 2023 at 7:26 PM Sam Ravnborg via B4 Submission Endpoint
> >> <devnull+sam.ravnborg.org@kernel.org> wrote:  
> >> >
> >> > Introduce backlight_get_brightness() to simplify logic
> >> > and avoid direct access to backlight properties.  
> >> 
> >> Note: Stephen sent this one too a while ago (with some more details in
> >> the commit message, which is always nice); and then he sent yesterday
> >> v2 [1] (to mention the functional change with `BL_CORE_SUSPENDED`
> >> [2]).  
> > Thanks for the pointers. I will try to move forward with Stephen's
> > patches.  
> >> 
> >> Anyway, if it goes via drm-misc, feel free to have my:
> >> 
> >>     Acked-by: Miguel Ojeda <ojeda@kernel.org>
> >> 
> >> Though it would be nice to have Robin test the change.  
> > 
> > Robin - can I get your ack to apply Stephen's original v2 patch to
> > drm-misc?  
> 
> done! see: 
> https://lore.kernel.org/lkml/0b16391f997e6ed005a326e4e48f2033@protonic.nl/

As far as I can tell, this never got applied to drm-misc, and I don’t see it
anywhere else. I guess it slipped through the cracks ;-)

Regards,

Stephen

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

* Re: [PATCH 12/15] auxdisplay: ht16k33: Introduce backlight_get_brightness()
  2023-03-19 13:44         ` Stephen Kitt
@ 2023-03-19 18:44           ` Sam Ravnborg
  0 siblings, 0 replies; 53+ messages in thread
From: Sam Ravnborg @ 2023-03-19 18:44 UTC (permalink / raw)
  To: Stephen Kitt
  Cc: Alexandre Belloni, Lee Jones, Antonino Daplas,
	Robin van der Gracht, Jingoo Han, Helge Deller, linux-staging,
	linux-fbdev, dri-devel, linux-kernel, Miguel Ojeda, linux-omap,
	Paul Mackerras, Greg Kroah-Hartman, Miguel Ojeda,
	Geert Uytterhoeven, Daniel Thompson, linuxppc-dev,
	Claudiu Beznea, linux-arm-kernel, Nicolas Ferre

On Sun, Mar 19, 2023 at 02:44:08PM +0100, Stephen Kitt wrote:
> Hi,
> 
> On Mon, 09 Jan 2023 11:12:02 +0100, Robin van der Gracht <robin@protonic.nl>
> wrote:
> > On 2023-01-08 10:29, Sam Ravnborg wrote:
> > > On Sat, Jan 07, 2023 at 10:02:38PM +0100, Miguel Ojeda wrote:  
> > >> On Sat, Jan 7, 2023 at 7:26 PM Sam Ravnborg via B4 Submission Endpoint
> > >> <devnull+sam.ravnborg.org@kernel.org> wrote:  
> > >> >
> > >> > Introduce backlight_get_brightness() to simplify logic
> > >> > and avoid direct access to backlight properties.  
> > >> 
> > >> Note: Stephen sent this one too a while ago (with some more details in
> > >> the commit message, which is always nice); and then he sent yesterday
> > >> v2 [1] (to mention the functional change with `BL_CORE_SUSPENDED`
> > >> [2]).  
> > > Thanks for the pointers. I will try to move forward with Stephen's
> > > patches.  
> > >> 
> > >> Anyway, if it goes via drm-misc, feel free to have my:
> > >> 
> > >>     Acked-by: Miguel Ojeda <ojeda@kernel.org>
> > >> 
> > >> Though it would be nice to have Robin test the change.  
> > > 
> > > Robin - can I get your ack to apply Stephen's original v2 patch to
> > > drm-misc?  
> > 
> > done! see: 
> > https://lore.kernel.org/lkml/0b16391f997e6ed005a326e4e48f2033@protonic.nl/
> 
> As far as I can tell, this never got applied to drm-misc, and I don’t see it
> anywhere else. I guess it slipped through the cracks ;-)

Yes, I have been busy with a lot of other stuff lately, and cannot
promise when I get back to do Linux work.
So if someone else could pick it up that would be nice.

	Sam

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

end of thread, other threads:[~2023-03-19 18:44 UTC | newest]

Thread overview: 53+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-07 18:26 [PATCH 00/15] backlight: Drop use of deprecated fb_blank property Sam Ravnborg via B4 Submission Endpoint
2023-01-07 18:26 ` [PATCH 01/15] video: fbdev: atmel_lcdfb: Rework backlight handling Sam Ravnborg via B4 Submission Endpoint
2023-01-07 20:36   ` Stephen Kitt
2023-01-07 20:53     ` Sam Ravnborg
2023-01-08  7:45       ` Stephen Kitt
2023-01-08  7:47         ` Stephen Kitt
2023-01-08 20:24         ` Sam Ravnborg
2023-01-09 19:53           ` Stephen Kitt
2023-01-09 20:03             ` Stephen Kitt
2023-01-08 17:26       ` Helge Deller
2023-01-08 20:26         ` Sam Ravnborg
2023-01-09 20:18         ` Stephen Kitt
2023-01-09 20:34           ` Helge Deller
2023-01-09  9:14   ` Jani Nikula
2023-01-07 18:26 ` [PATCH 02/15] video: fbdev: atyfb: Introduce backlight_get_brightness() Sam Ravnborg via B4 Submission Endpoint
2023-01-09 17:44   ` Christophe Leroy
2023-01-09 18:21     ` Sam Ravnborg
2023-01-07 18:26 ` [PATCH 03/15] video: fbdev: nvidia: " Sam Ravnborg via B4 Submission Endpoint
2023-01-07 18:26 ` [PATCH 04/15] video: fbdev: radeon: " Sam Ravnborg via B4 Submission Endpoint
2023-01-07 18:26 ` [PATCH 05/15] video: fbdev: riva: " Sam Ravnborg via B4 Submission Endpoint
2023-01-07 18:26 ` [PATCH 06/15] video: fbdev: aty128fb: " Sam Ravnborg via B4 Submission Endpoint
2023-01-07 18:26 ` [PATCH 07/15] video: fbdev: mx3fb: " Sam Ravnborg via B4 Submission Endpoint
2023-01-07 18:26 ` [PATCH 08/15] video: fbdev: omap2: " Sam Ravnborg via B4 Submission Endpoint
2023-01-07 18:26 ` [PATCH 09/15] staging: fbtft: fb_ssd1351.c: Introduce backlight_is_blank() Sam Ravnborg via B4 Submission Endpoint
2023-01-08 19:28   ` Stephen Kitt
2023-01-08 20:29     ` Sam Ravnborg
2023-01-09  7:04       ` Stephen Kitt
2023-01-09 11:16       ` Daniel Thompson
2023-01-09 11:13   ` Andy Shevchenko
2023-01-07 18:26 ` [PATCH 10/15] staging: fbtft: core: " Sam Ravnborg via B4 Submission Endpoint
2023-01-08 19:29   ` Stephen Kitt
2023-01-09 11:15   ` Andy Shevchenko
2023-01-07 18:26 ` [PATCH 11/15] powerpc: via-pmu-backlight: Introduce backlight_get_brightness() Sam Ravnborg via B4 Submission Endpoint
2023-01-08 19:36   ` Stephen Kitt
2023-01-07 18:26 ` [PATCH 12/15] auxdisplay: ht16k33: " Sam Ravnborg via B4 Submission Endpoint
2023-01-07 21:02   ` Miguel Ojeda
2023-01-08  9:29     ` Sam Ravnborg
2023-01-09 10:12       ` Robin van der Gracht
2023-03-19 13:44         ` Stephen Kitt
2023-03-19 18:44           ` Sam Ravnborg
2023-01-07 18:26 ` [PATCH 13/15] backlight: omap1: Use backlight helpers Sam Ravnborg via B4 Submission Endpoint
2023-01-08 19:32   ` Stephen Kitt
2023-01-09 11:02   ` Daniel Thompson
2023-01-07 18:26 ` [PATCH 14/15] backlight: tosa: Use backlight helper Sam Ravnborg via B4 Submission Endpoint
2023-01-09 11:04   ` Daniel Thompson
2023-01-07 18:26 ` [PATCH 15/15] backlight: backlight: Drop the deprecated fb_blank property Sam Ravnborg via B4 Submission Endpoint
2023-01-08 19:32   ` Stephen Kitt
2023-01-09 11:06   ` Daniel Thompson
2023-01-09 16:27     ` Sam Ravnborg
2023-01-10 10:09       ` Lee Jones
2023-01-26 14:27   ` Lee Jones
2023-01-26 16:11     ` Sam Ravnborg
2023-01-26 16:30       ` Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).