mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-10 07:00:48 +00:00
drm/radeon: fix compilation with backlight disabled
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
a1871936c0
commit
cd23492af3
@ -370,6 +370,7 @@ int radeon_atif_handler(struct radeon_device *rdev,
|
||||
|
||||
radeon_set_backlight_level(rdev, enc, req.backlight_level);
|
||||
|
||||
#if defined(CONFIG_BACKLIGHT_CLASS_DEVICE) || defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE)
|
||||
if (rdev->is_atom_bios) {
|
||||
struct radeon_encoder_atom_dig *dig = enc->enc_priv;
|
||||
backlight_force_update(dig->bl_dev,
|
||||
@ -379,6 +380,7 @@ int radeon_atif_handler(struct radeon_device *rdev,
|
||||
backlight_force_update(dig->bl_dev,
|
||||
BACKLIGHT_UPDATE_HOTKEY);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
/* TODO: check other events */
|
||||
|
@ -269,27 +269,6 @@ static const struct drm_encoder_helper_funcs radeon_legacy_lvds_helper_funcs = {
|
||||
.disable = radeon_legacy_encoder_disable,
|
||||
};
|
||||
|
||||
#if defined(CONFIG_BACKLIGHT_CLASS_DEVICE) || defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE)
|
||||
|
||||
static uint8_t radeon_legacy_lvds_level(struct backlight_device *bd)
|
||||
{
|
||||
struct radeon_backlight_privdata *pdata = bl_get_data(bd);
|
||||
uint8_t level;
|
||||
|
||||
/* Convert brightness to hardware level */
|
||||
if (bd->props.brightness < 0)
|
||||
level = 0;
|
||||
else if (bd->props.brightness > RADEON_MAX_BL_LEVEL)
|
||||
level = RADEON_MAX_BL_LEVEL;
|
||||
else
|
||||
level = bd->props.brightness;
|
||||
|
||||
if (pdata->negative)
|
||||
level = RADEON_MAX_BL_LEVEL - level;
|
||||
|
||||
return level;
|
||||
}
|
||||
|
||||
u8
|
||||
radeon_legacy_get_backlight_level(struct radeon_encoder *radeon_encoder)
|
||||
{
|
||||
@ -331,6 +310,27 @@ radeon_legacy_set_backlight_level(struct radeon_encoder *radeon_encoder, u8 leve
|
||||
radeon_legacy_lvds_update(&radeon_encoder->base, dpms_mode);
|
||||
}
|
||||
|
||||
#if defined(CONFIG_BACKLIGHT_CLASS_DEVICE) || defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE)
|
||||
|
||||
static uint8_t radeon_legacy_lvds_level(struct backlight_device *bd)
|
||||
{
|
||||
struct radeon_backlight_privdata *pdata = bl_get_data(bd);
|
||||
uint8_t level;
|
||||
|
||||
/* Convert brightness to hardware level */
|
||||
if (bd->props.brightness < 0)
|
||||
level = 0;
|
||||
else if (bd->props.brightness > RADEON_MAX_BL_LEVEL)
|
||||
level = RADEON_MAX_BL_LEVEL;
|
||||
else
|
||||
level = bd->props.brightness;
|
||||
|
||||
if (pdata->negative)
|
||||
level = RADEON_MAX_BL_LEVEL - level;
|
||||
|
||||
return level;
|
||||
}
|
||||
|
||||
static int radeon_legacy_backlight_update_status(struct backlight_device *bd)
|
||||
{
|
||||
struct radeon_backlight_privdata *pdata = bl_get_data(bd);
|
||||
|
Loading…
x
Reference in New Issue
Block a user