aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/riva
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/riva
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/riva')
-rw-r--r--drivers/video/riva/fbdev.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/video/riva/fbdev.c b/drivers/video/riva/fbdev.c
index 3a75def01b28..f8a3d608b208 100644
--- a/drivers/video/riva/fbdev.c
+++ b/drivers/video/riva/fbdev.c
@@ -308,11 +308,11 @@ static int riva_bl_update_status(struct backlight_device *bd)
308 U032 tmp_pcrt, tmp_pmc; 308 U032 tmp_pcrt, tmp_pmc;
309 int level; 309 int level;
310 310
311 if (bd->props->power != FB_BLANK_UNBLANK || 311 if (bd->props.power != FB_BLANK_UNBLANK ||
312 bd->props->fb_blank != FB_BLANK_UNBLANK) 312 bd->props.fb_blank != FB_BLANK_UNBLANK)
313 level = 0; 313 level = 0;
314 else 314 else
315 level = bd->props->brightness; 315 level = bd->props.brightness;
316 316
317 tmp_pmc = par->riva.PMC[0x10F0/4] & 0x0000FFFF; 317 tmp_pmc = par->riva.PMC[0x10F0/4] & 0x0000FFFF;
318 tmp_pcrt = par->riva.PCRTC0[0x081C/4] & 0xFFFFFFFC; 318 tmp_pcrt = par->riva.PCRTC0[0x081C/4] & 0xFFFFFFFC;
@@ -329,13 +329,12 @@ static int riva_bl_update_status(struct backlight_device *bd)
329 329
330static int riva_bl_get_brightness(struct backlight_device *bd) 330static int riva_bl_get_brightness(struct backlight_device *bd)
331{ 331{
332 return bd->props->brightness; 332 return bd->props.brightness;
333} 333}
334 334
335static struct backlight_properties riva_bl_data = { 335static struct backlight_ops riva_bl_ops = {
336 .get_brightness = riva_bl_get_brightness, 336 .get_brightness = riva_bl_get_brightness,
337 .update_status = riva_bl_update_status, 337 .update_status = riva_bl_update_status,
338 .max_brightness = (FB_BACKLIGHT_LEVELS - 1),
339}; 338};
340 339
341static void riva_bl_init(struct riva_par *par) 340static void riva_bl_init(struct riva_par *par)
@@ -355,7 +354,7 @@ static void riva_bl_init(struct riva_par *par)
355 354
356 snprintf(name, sizeof(name), "rivabl%d", info->node); 355 snprintf(name, sizeof(name), "rivabl%d", info->node);
357 356
358 bd = backlight_device_register(name, info->dev, par, &riva_bl_data); 357 bd = backlight_device_register(name, info->dev, par, &riva_bl_ops);
359 if (IS_ERR(bd)) { 358 if (IS_ERR(bd)) {
360 info->bl_dev = NULL; 359 info->bl_dev = NULL;
361 printk(KERN_WARNING "riva: Backlight registration failed\n"); 360 printk(KERN_WARNING "riva: Backlight registration failed\n");
@@ -367,8 +366,9 @@ static void riva_bl_init(struct riva_par *par)
367 MIN_LEVEL * FB_BACKLIGHT_MAX / MAX_LEVEL, 366 MIN_LEVEL * FB_BACKLIGHT_MAX / MAX_LEVEL,
368 FB_BACKLIGHT_MAX); 367 FB_BACKLIGHT_MAX);
369 368
370 bd->props->brightness = riva_bl_data.max_brightness; 369 bd->props.max_brightness = FB_BACKLIGHT_LEVELS - 1;
371 bd->props->power = FB_BLANK_UNBLANK; 370 bd->props.brightness = riva_bl_data.max_brightness;
371 bd->props.power = FB_BLANK_UNBLANK;
372 backlight_update_status(bd); 372 backlight_update_status(bd);
373 373
374 printk("riva: Backlight initialized (%s)\n", name); 374 printk("riva: Backlight initialized (%s)\n", name);