aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/aty/radeon_backlight.c
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@rpsys.net>2007-02-10 18:07:48 -0500
committerRichard Purdie <rpurdie@rpsys.net>2007-02-20 04:26:53 -0500
commit599a52d12629394236d785615808845823875868 (patch)
tree4e2dfa3a25ce761be0ecc0490acabac553f77a67 /drivers/video/aty/radeon_backlight.c
parent321709c5994f952b78d567fd7083dbebbdc381b7 (diff)
backlight: Separate backlight properties from backlight ops pointers
Per device data such as brightness belongs to the indivdual device and should therefore be separate from the the backlight operation function pointers. This patch splits the two types of data and allows simplifcation of some code. Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Diffstat (limited to 'drivers/video/aty/radeon_backlight.c')
-rw-r--r--drivers/video/aty/radeon_backlight.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/video/aty/radeon_backlight.c b/drivers/video/aty/radeon_backlight.c
index 8c775e6a7e03..0be25fa5540c 100644
--- a/drivers/video/aty/radeon_backlight.c
+++ b/drivers/video/aty/radeon_backlight.c
@@ -19,8 +19,6 @@
19 19
20#define MAX_RADEON_LEVEL 0xFF 20#define MAX_RADEON_LEVEL 0xFF
21 21
22static struct backlight_properties radeon_bl_data;
23
24struct radeon_bl_privdata { 22struct radeon_bl_privdata {
25 struct radeonfb_info *rinfo; 23 struct radeonfb_info *rinfo;
26 uint8_t negative; 24 uint8_t negative;
@@ -61,11 +59,11 @@ static int radeon_bl_update_status(struct backlight_device *bd)
61 * backlight. This provides some greater power saving and the display 59 * backlight. This provides some greater power saving and the display
62 * is useless without backlight anyway. 60 * is useless without backlight anyway.
63 */ 61 */
64 if (bd->props->power != FB_BLANK_UNBLANK || 62 if (bd->props.power != FB_BLANK_UNBLANK ||
65 bd->props->fb_blank != FB_BLANK_UNBLANK) 63 bd->props.fb_blank != FB_BLANK_UNBLANK)
66 level = 0; 64 level = 0;
67 else 65 else
68 level = bd->props->brightness; 66 level = bd->props.brightness;
69 67
70 del_timer_sync(&rinfo->lvds_timer); 68 del_timer_sync(&rinfo->lvds_timer);
71 radeon_engine_idle(); 69 radeon_engine_idle();
@@ -126,13 +124,12 @@ static int radeon_bl_update_status(struct backlight_device *bd)
126 124
127static int radeon_bl_get_brightness(struct backlight_device *bd) 125static int radeon_bl_get_brightness(struct backlight_device *bd)
128{ 126{
129 return bd->props->brightness; 127 return bd->props.brightness;
130} 128}
131 129
132static struct backlight_properties radeon_bl_data = { 130static struct backlight_ops radeon_bl_data = {
133 .get_brightness = radeon_bl_get_brightness, 131 .get_brightness = radeon_bl_get_brightness,
134 .update_status = radeon_bl_update_status, 132 .update_status = radeon_bl_update_status,
135 .max_brightness = (FB_BACKLIGHT_LEVELS - 1),
136}; 133};
137 134
138void radeonfb_bl_init(struct radeonfb_info *rinfo) 135void radeonfb_bl_init(struct radeonfb_info *rinfo)
@@ -188,8 +185,9 @@ void radeonfb_bl_init(struct radeonfb_info *rinfo)
188 63 * FB_BACKLIGHT_MAX / MAX_RADEON_LEVEL, 185 63 * FB_BACKLIGHT_MAX / MAX_RADEON_LEVEL,
189 217 * FB_BACKLIGHT_MAX / MAX_RADEON_LEVEL); 186 217 * FB_BACKLIGHT_MAX / MAX_RADEON_LEVEL);
190 187
191 bd->props->brightness = radeon_bl_data.max_brightness; 188 bd->props.max_brightness = FB_BACKLIGHT_LEVELS - 1;
192 bd->props->power = FB_BLANK_UNBLANK; 189 bd->props.brightness = bd->props.max_brightness;
190 bd->props.power = FB_BLANK_UNBLANK;
193 backlight_update_status(bd); 191 backlight_update_status(bd);
194 192
195 printk("radeonfb: Backlight initialized (%s)\n", name); 193 printk("radeonfb: Backlight initialized (%s)\n", name);