Skip to contentSkip to conversation

fbdev: Use backlight power constants

PATCH In review Thomas Zimmermann 2 participants 12 messages Jul 31, 2024 – Aug 16, 2024

Subsystems (7)
lore
Share & tools
lore
#0 lore raw

cover fbdev: Use backlight power constants

Commit a1cacb8a8e70 ("backlight: Add BACKLIGHT_POWER_ constants for power states") introduced dedicated constants for backlight power states. Convert fbdev drivers to the new constants.

The new constants replace the fbdev constants. This is part of a larger effort to make kernel subsystems more independent from fbdev code and headers.

Thomas Zimmermann (9):
fbdev: atmel_lcdfb: Use backlight power constants
fbdev: aty128fb: Use backlight power constants
fbdev: atyfb: Use backlight power constants
fbdev: chipsfb: Use backlight power constants
fbdev: nvidiafb: Use backlight power constants
fbdev: omapfb: Use backlight power constants
fbdev: radeonfb: Use backlight power constants
fbdev: rivafb: Use backlight power constants
fbdev: sh_mobile_lcdc_fb: Use backlight power constants

 drivers/video/fbdev/atmel_lcdfb.c                           | 4 ++--
 drivers/video/fbdev/aty/aty128fb.c                          | 6 +++---
 drivers/video/fbdev/aty/atyfb_base.c                        | 2 +-
 drivers/video/fbdev/aty/radeon_backlight.c                  | 2 +-
 drivers/video/fbdev/chipsfb.c                               | 2 +-
 drivers/video/fbdev/nvidia/nv_backlight.c                   | 2 +-
 drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c    | 4 ++--
 .../fbdev/omap2/omapfb/displays/panel-sony-acx565akm.c      | 2 +-
 drivers/video/fbdev/riva/fbdev.c                            | 2 +-
 drivers/video/fbdev/sh_mobile_lcdcfb.c                      | 6 +++---
 10 files changed, 16 insertions(+), 16 deletions(-)
Signature · 1 line
2.45.2
#1 lore raw

PATCH 1/9 fbdev: atmel_lcdfb: Use backlight power constants

Replace FB_BLANK_ constants with their counterparts from the backlight subsystem. The values are identical, so there's no change in functionality or semantics.

Cc Nicolas Ferre <[email protected]>
Cc Helge Deller <[email protected]>
Cc Alexandre Belloni <[email protected]>
Cc Claudiu Beznea <[email protected]>
---
 drivers/video/fbdev/atmel_lcdfb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/video/fbdev/atmel_lcdfb.c +2 -2
index 5574fb0361ee..4da233fb02a8 100644
@@ -152,7 +152,7 @@ static void init_backlight(struct atmel_lcdfb_info *sinfo)
 	}
 	sinfo->backlight = bl;
 
-	bl->props.power = FB_BLANK_UNBLANK;
+	bl->props.power = BACKLIGHT_POWER_ON;
 	bl->props.brightness = atmel_bl_get_brightness(bl);
 }
 
@@ -162,7 +162,7 @@ static void exit_backlight(struct atmel_lcdfb_info *sinfo)
 		return;
 
 	if (sinfo->backlight->ops) {
-		sinfo->backlight->props.power = FB_BLANK_POWERDOWN;
+		sinfo->backlight->props.power = BACKLIGHT_POWER_OFF;
 		sinfo->backlight->ops->update_status(sinfo->backlight);
 	}
 	backlight_device_unregister(sinfo->backlight);
Signature · 1 line
2.45.2
#2 lore raw

PATCH 2/9 fbdev: aty128fb: Use backlight power constants

In reply to Thomas Zimmermann

Replace FB_BLANK_ constants with their counterparts from the backlight subsystem. The values are identical, so there's no change in functionality or semantics.

---
 drivers/video/fbdev/aty/aty128fb.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/video/fbdev/aty/aty128fb.c +3 -3
index f4de11f19235..f55b4c7609a8 100644
@@ -1299,11 +1299,11 @@ static void aty128_set_lcd_enable(struct aty128fb_par *par, int on)
 		reg &= ~LVDS_DISPLAY_DIS;
 		aty_st_le32(LVDS_GEN_CNTL, reg);
 #ifdef CONFIG_FB_ATY128_BACKLIGHT
-		aty128_bl_set_power(info, FB_BLANK_UNBLANK);
+		aty128_bl_set_power(info, BACKLIGHT_POWER_ON);
 #endif
 	} else {
 #ifdef CONFIG_FB_ATY128_BACKLIGHT
-		aty128_bl_set_power(info, FB_BLANK_POWERDOWN);
+		aty128_bl_set_power(info, BACKLIGHT_POWER_OFF);
 #endif
 		reg = aty_ld_le32(LVDS_GEN_CNTL);
 		reg |= LVDS_DISPLAY_DIS;
@@ -1858,7 +1858,7 @@ static void aty128_bl_init(struct aty128fb_par *par)
 		219 * FB_BACKLIGHT_MAX / MAX_LEVEL);
 
 	bd->props.brightness = bd->props.max_brightness;
-	bd->props.power = FB_BLANK_UNBLANK;
+	bd->props.power = BACKLIGHT_POWER_ON;
 	backlight_update_status(bd);
 
 	printk("aty128: Backlight initialized (%s)\n", name);
Signature · 1 line
2.45.2
#3 lore raw

PATCH 3/9 fbdev: atyfb: Use backlight power constants

In reply to Thomas Zimmermann

Replace FB_BLANK_ constants with their counterparts from the backlight subsystem. The values are identical, so there's no change in functionality or semantics.

---
 drivers/video/fbdev/aty/atyfb_base.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/fbdev/aty/atyfb_base.c +1 -1
index a6dd1cd27125..210fd3ac18a4 100644
@@ -2272,7 +2272,7 @@ static void aty_bl_init(struct atyfb_par *par)
 			    0xFF * FB_BACKLIGHT_MAX / MAX_LEVEL);
 
 	bd->props.brightness = bd->props.max_brightness;
-	bd->props.power = FB_BLANK_UNBLANK;
+	bd->props.power = BACKLIGHT_POWER_ON;
 	backlight_update_status(bd);
 
 	printk("aty: Backlight initialized (%s)\n", name);
Signature · 1 line
2.45.2
#4 lore raw

PATCH 4/9 fbdev: chipsfb: Use backlight power constants

In reply to Thomas Zimmermann

Replace FB_BLANK_ constants with their counterparts from the backlight subsystem. The values are identical, so there's no change in functionality or semantics

---
 drivers/video/fbdev/chipsfb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/fbdev/chipsfb.c +1 -1
index b16a905588fe..33caf0b99a45 100644
@@ -399,7 +399,7 @@ static int chipsfb_pci_init(struct pci_dev *dp, const struct pci_device_id *ent)
 	/* turn on the backlight */
 	mutex_lock(&pmac_backlight_mutex);
 	if (pmac_backlight) {
-		pmac_backlight->props.power = FB_BLANK_UNBLANK;
+		pmac_backlight->props.power = BACKLIGHT_POWER_ON;
 		backlight_update_status(pmac_backlight);
 	}
 	mutex_unlock(&pmac_backlight_mutex);
Signature · 1 line
2.45.2
#5 lore raw

PATCH 5/9 fbdev: nvidiafb: Use backlight power constants

In reply to Thomas Zimmermann

Replace FB_BLANK_ constants with their counterparts from the backlight subsystem. The values are identical, so there's no change in functionality or semantics.

Cc Antonino Daplas <[email protected]>
Cc Helge Deller <[email protected]>
---
 drivers/video/fbdev/nvidia/nv_backlight.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/fbdev/nvidia/nv_backlight.c +1 -1
index 160da9c50a52..7edd47ab16e9 100644
@@ -112,7 +112,7 @@ void nvidia_bl_init(struct nvidia_par *par)
 		0x534 * FB_BACKLIGHT_MAX / MAX_LEVEL);
 
 	bd->props.brightness = bd->props.max_brightness;
-	bd->props.power = FB_BLANK_UNBLANK;
+	bd->props.power = BACKLIGHT_POWER_ON;
 	backlight_update_status(bd);
 
 	printk("nvidia: Backlight initialized (%s)\n", name);
Signature · 1 line
2.45.2
#6 lore raw

PATCH 6/9 fbdev: omapfb: Use backlight power constants

In reply to Thomas Zimmermann

Replace FB_BLANK_ constants with their counterparts from the backlight subsystem. The values are identical, so there's no change in functionality or semantics.

---
 drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c      | 4 ++--
 .../video/fbdev/omap2/omapfb/displays/panel-sony-acx565akm.c  | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c +2 -2
index 274bdf7b3b45..35ed1b2db993 100644
@@ -1215,7 +1215,7 @@ static int dsicm_probe(struct platform_device *pdev)
 
 		ddata->bldev = bldev;
 
-		bldev->props.power = FB_BLANK_UNBLANK;
+		bldev->props.power = BACKLIGHT_POWER_ON;
 		bldev->props.brightness = 255;
 
 		dsicm_bl_update_status(bldev);
@@ -1253,7 +1253,7 @@ static void dsicm_remove(struct platform_device *pdev)
 
 	bldev = ddata->bldev;
 	if (bldev != NULL) {
-		bldev->props.power = FB_BLANK_POWERDOWN;
+		bldev->props.power = BACKLIGHT_POWER_OFF;
 		dsicm_bl_update_status(bldev);
 		backlight_device_unregister(bldev);
 	}
drivers/video/fbdev/omap2/omapfb/displays/panel-sony-acx565akm.c +1 -1
index 71d2e015960c..e0747a90dc50 100644
@@ -753,7 +753,7 @@ static int acx565akm_probe(struct spi_device *spi)
 	}
 
 	memset(&props, 0, sizeof(props));
-	props.power = FB_BLANK_UNBLANK;
+	props.power = BACKLIGHT_POWER_ON;
 	props.type = BACKLIGHT_RAW;
 
 	bldev = backlight_device_register("acx565akm", &ddata->spi->dev,
Signature · 1 line
2.45.2
#7 lore raw

PATCH 7/9 fbdev: radeonfb: Use backlight power constants

In reply to Thomas Zimmermann

Replace FB_BLANK_ constants with their counterparts from the backlight subsystem. The values are identical, so there's no change in functionality or semantics.

Cc Benjamin Herrenschmidt <[email protected]>
Cc Helge Deller <[email protected]>
---
 drivers/video/fbdev/aty/radeon_backlight.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/fbdev/aty/radeon_backlight.c +1 -1
index 23a38c3f3977..9e41d2a18649 100644
@@ -179,7 +179,7 @@ void radeonfb_bl_init(struct radeonfb_info *rinfo)
 		217 * FB_BACKLIGHT_MAX / MAX_RADEON_LEVEL);
 
 	bd->props.brightness = bd->props.max_brightness;
-	bd->props.power = FB_BLANK_UNBLANK;
+	bd->props.power = BACKLIGHT_POWER_ON;
 	backlight_update_status(bd);
 
 	printk("radeonfb: Backlight initialized (%s)\n", name);
Signature · 1 line
2.45.2
#8 lore raw

PATCH 8/9 fbdev: rivafb: Use backlight power constants

In reply to Thomas Zimmermann

Replace FB_BLANK_ constants with their counterparts from the backlight subsystem. The values are identical, so there's no change in functionality or semantics.

Cc Antonino Daplas <[email protected]>
Cc Helge Deller <[email protected]>
---
 drivers/video/fbdev/riva/fbdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/fbdev/riva/fbdev.c +1 -1
index 237db738af13..1e377b2ec089 100644
@@ -347,7 +347,7 @@ static void riva_bl_init(struct riva_par *par)
 		FB_BACKLIGHT_MAX);
 
 	bd->props.brightness = bd->props.max_brightness;
-	bd->props.power = FB_BLANK_UNBLANK;
+	bd->props.power = BACKLIGHT_POWER_ON;
 	backlight_update_status(bd);
 
 	printk("riva: Backlight initialized (%s)\n", name);
Signature · 1 line
2.45.2
#9 lore raw

PATCH 9/9 fbdev: sh_mobile_lcdc_fb: Use backlight power constants

In reply to Thomas Zimmermann

Replace FB_BLANK_ constants with their counterparts from the backlight subsystem. The values are identical, so there's no change in functionality or semantics.

---
 drivers/video/fbdev/sh_mobile_lcdcfb.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/video/fbdev/sh_mobile_lcdcfb.c +3 -3
index 73c69e39a68d..fcc1446ae746 100644
@@ -1049,7 +1049,7 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
 		sh_mobile_lcdc_display_on(ch);
 
 		if (ch->bl) {
-			ch->bl->props.power = FB_BLANK_UNBLANK;
+			ch->bl->props.power = BACKLIGHT_POWER_ON;
 			backlight_update_status(ch->bl);
 		}
 	}
@@ -1082,7 +1082,7 @@ static void sh_mobile_lcdc_stop(struct sh_mobile_lcdc_priv *priv)
 		}
 
 		if (ch->bl) {
-			ch->bl->props.power = FB_BLANK_POWERDOWN;
+			ch->bl->props.power = BACKLIGHT_POWER_OFF;
 			backlight_update_status(ch->bl);
 		}
 
@@ -2125,7 +2125,7 @@ static int sh_mobile_lcdc_update_bl(struct backlight_device *bdev)
 	struct sh_mobile_lcdc_chan *ch = bl_get_data(bdev);
 	int brightness = bdev->props.brightness;
 
-	if (bdev->props.power != FB_BLANK_UNBLANK ||
+	if (bdev->props.power != BACKLIGHT_POWER_ON ||
 	    bdev->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK))
 		brightness = 0;
 
Signature · 1 line
2.45.2
#10 lore raw
In reply to Thomas Zimmermann

Ping for review

Am 31.07.24 um 14:33 schrieb Thomas Zimmermann:

Quoted 31 lines

Commit a1cacb8a8e70 ("backlight: Add BACKLIGHT_POWER_ constants for power states") introduced dedicated constants for backlight power states. Convert fbdev drivers to the new constants.

The new constants replace the fbdev constants. This is part of a larger effort to make kernel subsystems more independent from fbdev code and headers.

Thomas Zimmermann (9):
fbdev: atmel_lcdfb: Use backlight power constants
fbdev: aty128fb: Use backlight power constants
fbdev: atyfb: Use backlight power constants
fbdev: chipsfb: Use backlight power constants
fbdev: nvidiafb: Use backlight power constants
fbdev: omapfb: Use backlight power constants
fbdev: radeonfb: Use backlight power constants
fbdev: rivafb: Use backlight power constants
fbdev: sh_mobile_lcdc_fb: Use backlight power constants

  drivers/video/fbdev/atmel_lcdfb.c                           | 4 ++--
  drivers/video/fbdev/aty/aty128fb.c                          | 6 +++---
  drivers/video/fbdev/aty/atyfb_base.c                        | 2 +-
  drivers/video/fbdev/aty/radeon_backlight.c                  | 2 +-
  drivers/video/fbdev/chipsfb.c                               | 2 +-
  drivers/video/fbdev/nvidia/nv_backlight.c                   | 2 +-
  drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c    | 4 ++--
  .../fbdev/omap2/omapfb/displays/panel-sony-acx565akm.c      | 2 +-
  drivers/video/fbdev/riva/fbdev.c                            | 2 +-
  drivers/video/fbdev/sh_mobile_lcdcfb.c                      | 6 +++---
  10 files changed, 16 insertions(+), 16 deletions(-)
Signature · 7 lines
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)
Reviewed-by
#11 lore raw
Quoted 1 line · Thomas Zimmermann

Ping for review

On the series,

Quoted 33 lines

Am 31.07.24 um 14:33 schrieb Thomas Zimmermann:

Quoted 31 lines

Commit a1cacb8a8e70 ("backlight: Add BACKLIGHT_POWER_ constants for power states") introduced dedicated constants for backlight power states. Convert fbdev drivers to the new constants.

The new constants replace the fbdev constants. This is part of a larger effort to make kernel subsystems more independent from fbdev code and headers.

Thomas Zimmermann (9):
fbdev: atmel_lcdfb: Use backlight power constants
fbdev: aty128fb: Use backlight power constants
fbdev: atyfb: Use backlight power constants
fbdev: chipsfb: Use backlight power constants
fbdev: nvidiafb: Use backlight power constants
fbdev: omapfb: Use backlight power constants
fbdev: radeonfb: Use backlight power constants
fbdev: rivafb: Use backlight power constants
fbdev: sh_mobile_lcdc_fb: Use backlight power constants

  drivers/video/fbdev/atmel_lcdfb.c                           | 4 ++--
  drivers/video/fbdev/aty/aty128fb.c                          | 6 +++---
  drivers/video/fbdev/aty/atyfb_base.c                        | 2 +-
  drivers/video/fbdev/aty/radeon_backlight.c                  | 2 +-
  drivers/video/fbdev/chipsfb.c                               | 2 +-
  drivers/video/fbdev/nvidia/nv_backlight.c                   | 2 +-
  drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c    | 4 ++--
  .../fbdev/omap2/omapfb/displays/panel-sony-acx565akm.c      | 2 +-
  drivers/video/fbdev/riva/fbdev.c                            | 2 +-
  drivers/video/fbdev/sh_mobile_lcdcfb.c                      | 6 +++---
  10 files changed, 16 insertions(+), 16 deletions(-)
Signature · 1 line
Jani Nikula, Intel