Skip to content

Commit 4551978

Browse files
Thomas Zimmermannlag-linaro
authored andcommitted
backlight: Remove fb_blank from struct backlight_properties
Remove the field fb_blank from struct backlight_properties and remove all code that still sets or reads it. Backlight blank status is now tracked exclusively in struct backlight_properties.state. The core backlight code keeps the fb_blank and state fields in sync, but doesn't do anything else with fb_blank. Several drivers initialize fb_blank to FB_BLANK_UNBLANK to enable the backlight. This is already the default for the state field. So we can delete the fb_blank code from core and drivers and rely on the state field. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Cc: Flavio Suligoi <f.suligoi@asem.it> Cc: Nicolas Ferre <nicolas.ferre@microchip.com> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com> Cc: Claudiu Beznea <claudiu.beznea@tuxon.dev> Tested-by: Flavio Suligoi <f.suligoi@asem.it> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://lore.kernel.org/r/20240319093915.31778-7-tzimmermann@suse.de Signed-off-by: Lee Jones <lee@kernel.org>
1 parent 9a7bb61 commit 4551978

File tree

7 files changed

+1
-31
lines changed

7 files changed

+1
-31
lines changed

drivers/video/backlight/backlight.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,12 @@ static int fb_notifier_callback(struct notifier_block *self,
118118
bd->fb_bl_on[node] = true;
119119
if (!bd->use_count++) {
120120
bd->props.state &= ~BL_CORE_FBBLANK;
121-
bd->props.fb_blank = FB_BLANK_UNBLANK;
122121
backlight_update_status(bd);
123122
}
124123
} else if (fb_blank != FB_BLANK_UNBLANK && bd->fb_bl_on[node]) {
125124
bd->fb_bl_on[node] = false;
126125
if (!(--bd->use_count)) {
127126
bd->props.state |= BL_CORE_FBBLANK;
128-
bd->props.fb_blank = fb_blank;
129127
backlight_update_status(bd);
130128
}
131129
}

drivers/video/backlight/mp3309c.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,6 @@ static int mp3309c_probe(struct i2c_client *client)
363363
props.scale = BACKLIGHT_SCALE_LINEAR;
364364
props.type = BACKLIGHT_RAW;
365365
props.power = FB_BLANK_UNBLANK;
366-
props.fb_blank = FB_BLANK_UNBLANK;
367366
chip->bl = devm_backlight_device_register(dev, "mp3309c", dev, chip,
368367
&mp3309c_bl_ops, &props);
369368
if (IS_ERR(chip->bl))

drivers/video/backlight/omap1_bl.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ static int omapbl_probe(struct platform_device *pdev)
139139

140140
omap_cfg_reg(PWL); /* Conflicts with UART3 */
141141

142-
dev->props.fb_blank = FB_BLANK_UNBLANK;
143142
dev->props.brightness = pdata->default_intensity;
144143
omapbl_update_status(dev);
145144

drivers/video/fbdev/atmel_lcdfb.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ static void init_backlight(struct atmel_lcdfb_info *sinfo)
153153
sinfo->backlight = bl;
154154

155155
bl->props.power = FB_BLANK_UNBLANK;
156-
bl->props.fb_blank = FB_BLANK_UNBLANK;
157156
bl->props.brightness = atmel_bl_get_brightness(bl);
158157
}
159158

drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1215,7 +1215,6 @@ static int dsicm_probe(struct platform_device *pdev)
12151215

12161216
ddata->bldev = bldev;
12171217

1218-
bldev->props.fb_blank = FB_BLANK_UNBLANK;
12191218
bldev->props.power = FB_BLANK_UNBLANK;
12201219
bldev->props.brightness = 255;
12211220

drivers/video/fbdev/omap2/omapfb/displays/panel-sony-acx565akm.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,6 @@ static int acx565akm_probe(struct spi_device *spi)
753753
}
754754

755755
memset(&props, 0, sizeof(props));
756-
props.fb_blank = FB_BLANK_UNBLANK;
757756
props.power = FB_BLANK_UNBLANK;
758757
props.type = BACKLIGHT_RAW;
759758

include/linux/backlight.h

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -218,25 +218,6 @@ struct backlight_properties {
218218
*/
219219
int power;
220220

221-
/**
222-
* @fb_blank: The power state from the FBIOBLANK ioctl.
223-
*
224-
* When the FBIOBLANK ioctl is called @fb_blank is set to the
225-
* blank parameter and the update_status() operation is called.
226-
*
227-
* When the backlight device is enabled @fb_blank is set
228-
* to FB_BLANK_UNBLANK. When the backlight device is disabled
229-
* @fb_blank is set to FB_BLANK_POWERDOWN.
230-
*
231-
* Backlight drivers should avoid using this property. It has been
232-
* replaced by state & BL_CORE_FBLANK (although most drivers should
233-
* use backlight_is_blank() as the preferred means to get the blank
234-
* state).
235-
*
236-
* fb_blank is deprecated and will be removed.
237-
*/
238-
int fb_blank;
239-
240221
/**
241222
* @type: The type of backlight supported.
242223
*
@@ -366,7 +347,6 @@ static inline int backlight_enable(struct backlight_device *bd)
366347
return 0;
367348

368349
bd->props.power = FB_BLANK_UNBLANK;
369-
bd->props.fb_blank = FB_BLANK_UNBLANK;
370350
bd->props.state &= ~BL_CORE_FBBLANK;
371351

372352
return backlight_update_status(bd);
@@ -382,7 +362,6 @@ static inline int backlight_disable(struct backlight_device *bd)
382362
return 0;
383363

384364
bd->props.power = FB_BLANK_POWERDOWN;
385-
bd->props.fb_blank = FB_BLANK_POWERDOWN;
386365
bd->props.state |= BL_CORE_FBBLANK;
387366

388367
return backlight_update_status(bd);
@@ -395,15 +374,13 @@ static inline int backlight_disable(struct backlight_device *bd)
395374
* Display is expected to be blank if any of these is true::
396375
*
397376
* 1) if power in not UNBLANK
398-
* 2) if fb_blank is not UNBLANK
399-
* 3) if state indicate BLANK or SUSPENDED
377+
* 2) if state indicate BLANK or SUSPENDED
400378
*
401379
* Returns true if display is expected to be blank, false otherwise.
402380
*/
403381
static inline bool backlight_is_blank(const struct backlight_device *bd)
404382
{
405383
return bd->props.power != FB_BLANK_UNBLANK ||
406-
bd->props.fb_blank != FB_BLANK_UNBLANK ||
407384
bd->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK);
408385
}
409386

0 commit comments

Comments
 (0)