• Thomas Zimmermann's avatar
    backlight: Add BACKLIGHT_POWER_ constants for power states · a1cacb8a
    Thomas Zimmermann authored
    Duplicate FB_BLANK_ constants as BACKLIGHT_POWER__ constants in the
    backlight header file. Allows backlight drivers to avoid including
    the fbdev header file and removes a compile-time dependency between
    the two subsystems.
    
    The new BACKLIGHT_POWER_ constants have the same values as their
    FB_BLANK_ counterparts. Hence UAPI and internal semantics do not
    change. The backlight drivers can be converted one by one. Each
    instance of FB_BLANK_UNBLANK becomes BACKLIGHT_POWER_ON, each of
    FB_BLANK_POWERDOWN becomes BACKLIGHT_POWER_OFF, and FB_BLANK_NORMAL
    becomes BACKLIGHT_POWER_REDUCED.
    
    Backlight code or drivers do not use FB_BLANK_VSYNC_SUSPEND and
    FB_BLANK_HSYNC_SUSPEND, so no new constants for these are being
    added.
    
    The semantics of FB_BLANK_NORMAL appear inconsistent. In fbdev,
    NORMAL means display off with sync enabled. In backlight code,
    this translates to turn the backlight off, but some drivers
    interpret it as backlight on. So we keep the current code as is,
    but mark BACKLIGHT_POWER_REDUCED as deprecated. Drivers should be
    fixed and the constant removed. This affects ams369fg06 and a few
    DRM panel drivers.
    
    v2:
    - rename BL_CORE_ power constants to BACKLIGHT_POWER_ (Sam)
    - fix documentation
    Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
    Reviewed-by: default avatarDaniel Thompson <daniel.thompson@linaro.org>
    Link: https://lore.kernel.org/r/20240624152033.25016-2-tzimmermann@suse.deSigned-off-by: default avatarLee Jones <lee@kernel.org>
    a1cacb8a
sysfs-class-backlight 1.89 KB