Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Thomas Zimmermann and committed by
Lee Jones
4551978b 9a7bb61f

+1 -31
-2
drivers/video/backlight/backlight.c
··· 118 118 bd->fb_bl_on[node] = true; 119 119 if (!bd->use_count++) { 120 120 bd->props.state &= ~BL_CORE_FBBLANK; 121 - bd->props.fb_blank = FB_BLANK_UNBLANK; 122 121 backlight_update_status(bd); 123 122 } 124 123 } else if (fb_blank != FB_BLANK_UNBLANK && bd->fb_bl_on[node]) { 125 124 bd->fb_bl_on[node] = false; 126 125 if (!(--bd->use_count)) { 127 126 bd->props.state |= BL_CORE_FBBLANK; 128 - bd->props.fb_blank = fb_blank; 129 127 backlight_update_status(bd); 130 128 } 131 129 }
-1
drivers/video/backlight/mp3309c.c
··· 363 363 props.scale = BACKLIGHT_SCALE_LINEAR; 364 364 props.type = BACKLIGHT_RAW; 365 365 props.power = FB_BLANK_UNBLANK; 366 - props.fb_blank = FB_BLANK_UNBLANK; 367 366 chip->bl = devm_backlight_device_register(dev, "mp3309c", dev, chip, 368 367 &mp3309c_bl_ops, &props); 369 368 if (IS_ERR(chip->bl))
-1
drivers/video/backlight/omap1_bl.c
··· 139 139 140 140 omap_cfg_reg(PWL); /* Conflicts with UART3 */ 141 141 142 - dev->props.fb_blank = FB_BLANK_UNBLANK; 143 142 dev->props.brightness = pdata->default_intensity; 144 143 omapbl_update_status(dev); 145 144
-1
drivers/video/fbdev/atmel_lcdfb.c
··· 153 153 sinfo->backlight = bl; 154 154 155 155 bl->props.power = FB_BLANK_UNBLANK; 156 - bl->props.fb_blank = FB_BLANK_UNBLANK; 157 156 bl->props.brightness = atmel_bl_get_brightness(bl); 158 157 } 159 158
-1
drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c
··· 1215 1215 1216 1216 ddata->bldev = bldev; 1217 1217 1218 - bldev->props.fb_blank = FB_BLANK_UNBLANK; 1219 1218 bldev->props.power = FB_BLANK_UNBLANK; 1220 1219 bldev->props.brightness = 255; 1221 1220
-1
drivers/video/fbdev/omap2/omapfb/displays/panel-sony-acx565akm.c
··· 753 753 } 754 754 755 755 memset(&props, 0, sizeof(props)); 756 - props.fb_blank = FB_BLANK_UNBLANK; 757 756 props.power = FB_BLANK_UNBLANK; 758 757 props.type = BACKLIGHT_RAW; 759 758
+1 -24
include/linux/backlight.h
··· 219 219 int power; 220 220 221 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 - 240 - /** 241 222 * @type: The type of backlight supported. 242 223 * 243 224 * The backlight type allows userspace to make appropriate ··· 347 366 return 0; 348 367 349 368 bd->props.power = FB_BLANK_UNBLANK; 350 - bd->props.fb_blank = FB_BLANK_UNBLANK; 351 369 bd->props.state &= ~BL_CORE_FBBLANK; 352 370 353 371 return backlight_update_status(bd); ··· 362 382 return 0; 363 383 364 384 bd->props.power = FB_BLANK_POWERDOWN; 365 - bd->props.fb_blank = FB_BLANK_POWERDOWN; 366 385 bd->props.state |= BL_CORE_FBBLANK; 367 386 368 387 return backlight_update_status(bd); ··· 374 395 * Display is expected to be blank if any of these is true:: 375 396 * 376 397 * 1) if power in not UNBLANK 377 - * 2) if fb_blank is not UNBLANK 378 - * 3) if state indicate BLANK or SUSPENDED 398 + * 2) if state indicate BLANK or SUSPENDED 379 399 * 380 400 * Returns true if display is expected to be blank, false otherwise. 381 401 */ 382 402 static inline bool backlight_is_blank(const struct backlight_device *bd) 383 403 { 384 404 return bd->props.power != FB_BLANK_UNBLANK || 385 - bd->props.fb_blank != FB_BLANK_UNBLANK || 386 405 bd->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK); 387 406 } 388 407