diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
commit | ada47b5fe13d89735805b566185f4885f5a3f750 (patch) | |
tree | 644b88f8a71896307d71438e9b3af49126ffb22b /drivers/video/aty/radeon_backlight.c | |
parent | 43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff) | |
parent | 3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff) |
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/video/aty/radeon_backlight.c')
-rw-r--r-- | drivers/video/aty/radeon_backlight.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/video/aty/radeon_backlight.c b/drivers/video/aty/radeon_backlight.c index 1a056adb61c8..256966e9667d 100644 --- a/drivers/video/aty/radeon_backlight.c +++ b/drivers/video/aty/radeon_backlight.c | |||
@@ -12,6 +12,7 @@ | |||
12 | 12 | ||
13 | #include "radeonfb.h" | 13 | #include "radeonfb.h" |
14 | #include <linux/backlight.h> | 14 | #include <linux/backlight.h> |
15 | #include <linux/slab.h> | ||
15 | 16 | ||
16 | #ifdef CONFIG_PMAC_BACKLIGHT | 17 | #ifdef CONFIG_PMAC_BACKLIGHT |
17 | #include <asm/backlight.h> | 18 | #include <asm/backlight.h> |
@@ -134,6 +135,7 @@ static struct backlight_ops radeon_bl_data = { | |||
134 | 135 | ||
135 | void radeonfb_bl_init(struct radeonfb_info *rinfo) | 136 | void radeonfb_bl_init(struct radeonfb_info *rinfo) |
136 | { | 137 | { |
138 | struct backlight_properties props; | ||
137 | struct backlight_device *bd; | 139 | struct backlight_device *bd; |
138 | struct radeon_bl_privdata *pdata; | 140 | struct radeon_bl_privdata *pdata; |
139 | char name[12]; | 141 | char name[12]; |
@@ -155,7 +157,10 @@ void radeonfb_bl_init(struct radeonfb_info *rinfo) | |||
155 | 157 | ||
156 | snprintf(name, sizeof(name), "radeonbl%d", rinfo->info->node); | 158 | snprintf(name, sizeof(name), "radeonbl%d", rinfo->info->node); |
157 | 159 | ||
158 | bd = backlight_device_register(name, rinfo->info->dev, pdata, &radeon_bl_data); | 160 | memset(&props, 0, sizeof(struct backlight_properties)); |
161 | props.max_brightness = FB_BACKLIGHT_LEVELS - 1; | ||
162 | bd = backlight_device_register(name, rinfo->info->dev, pdata, | ||
163 | &radeon_bl_data, &props); | ||
159 | if (IS_ERR(bd)) { | 164 | if (IS_ERR(bd)) { |
160 | rinfo->info->bl_dev = NULL; | 165 | rinfo->info->bl_dev = NULL; |
161 | printk("radeonfb: Backlight registration failed\n"); | 166 | printk("radeonfb: Backlight registration failed\n"); |
@@ -175,9 +180,9 @@ void radeonfb_bl_init(struct radeonfb_info *rinfo) | |||
175 | 180 | ||
176 | #ifdef CONFIG_PMAC_BACKLIGHT | 181 | #ifdef CONFIG_PMAC_BACKLIGHT |
177 | pdata->negative = pdata->negative || | 182 | pdata->negative = pdata->negative || |
178 | machine_is_compatible("PowerBook4,3") || | 183 | of_machine_is_compatible("PowerBook4,3") || |
179 | machine_is_compatible("PowerBook6,3") || | 184 | of_machine_is_compatible("PowerBook6,3") || |
180 | machine_is_compatible("PowerBook6,5"); | 185 | of_machine_is_compatible("PowerBook6,5"); |
181 | #endif | 186 | #endif |
182 | 187 | ||
183 | rinfo->info->bl_dev = bd; | 188 | rinfo->info->bl_dev = bd; |
@@ -185,7 +190,6 @@ void radeonfb_bl_init(struct radeonfb_info *rinfo) | |||
185 | 63 * FB_BACKLIGHT_MAX / MAX_RADEON_LEVEL, | 190 | 63 * FB_BACKLIGHT_MAX / MAX_RADEON_LEVEL, |
186 | 217 * FB_BACKLIGHT_MAX / MAX_RADEON_LEVEL); | 191 | 217 * FB_BACKLIGHT_MAX / MAX_RADEON_LEVEL); |
187 | 192 | ||
188 | bd->props.max_brightness = FB_BACKLIGHT_LEVELS - 1; | ||
189 | bd->props.brightness = bd->props.max_brightness; | 193 | bd->props.brightness = bd->props.max_brightness; |
190 | bd->props.power = FB_BLANK_UNBLANK; | 194 | bd->props.power = FB_BLANK_UNBLANK; |
191 | backlight_update_status(bd); | 195 | backlight_update_status(bd); |