diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2012-09-14 09:59:26 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2012-09-27 10:22:41 -0400 |
commit | 6d92f81dcf2d40b8ebb947bba5435642b830f649 (patch) | |
tree | 9a9f606f27c6e0007d473727326b5b761186c331 /drivers/gpu/drm/radeon/radeon_legacy_encoders.c | |
parent | 2e3b3b105ab3bb5b6a37198da4f193cd13781d13 (diff) | |
download | lwn-6d92f81dcf2d40b8ebb947bba5435642b830f649.tar.gz lwn-6d92f81dcf2d40b8ebb947bba5435642b830f649.zip |
drm/radeon: add get_backlight_level callback
Read back the backlight level from the hw.
Needed for proper backlight restoration on resume.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_legacy_encoders.c')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_legacy_encoders.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c index ec00deaab9ca..8ad9c5f16014 100644 --- a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c +++ b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c @@ -290,6 +290,19 @@ static uint8_t radeon_legacy_lvds_level(struct backlight_device *bd) return level; } +u8 +radeon_legacy_get_backlight_level(struct radeon_encoder *radeon_encoder) +{ + struct drm_device *dev = radeon_encoder->base.dev; + struct radeon_device *rdev = dev->dev_private; + u8 backlight_level; + + backlight_level = (RREG32(RADEON_LVDS_GEN_CNTL) >> + RADEON_LVDS_BL_MOD_LEVEL_SHIFT) & 0xff; + + return backlight_level; +} + void radeon_legacy_set_backlight_level(struct radeon_encoder *radeon_encoder, u8 level) { |