aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-03-05 11:25:43 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-03-05 11:25:43 -0500
commit227c5fe7993a5430e582dfd4c3acd9484004c6fc (patch)
tree9724f1cbebaae71f86c8f2d168f34380355a6f0f
parent6ebf622b2577c50b1f496bd6a5e8739e55ae7b1c (diff)
parent202d4e602555e68c2bc71775228876b0356785c8 (diff)
Merge branch 'for-linus' of git://git.o-hand.com/linux-rpurdie-backlight
* 'for-linus' of git://git.o-hand.com/linux-rpurdie-backlight: backlight: Allow enable/disable of fb backlights, fixing regressions backlight: Fix nvidia backlight initial brightness
-rw-r--r--drivers/video/aty/aty128fb.c12
-rw-r--r--drivers/video/aty/atyfb_base.c10
-rw-r--r--drivers/video/aty/radeon_base.c10
-rw-r--r--drivers/video/nvidia/nv_backlight.c4
-rw-r--r--drivers/video/nvidia/nvidia.c12
-rw-r--r--drivers/video/riva/fbdev.c12
6 files changed, 52 insertions, 8 deletions
diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c
index 8726c3669713..e86d7e0c9825 100644
--- a/drivers/video/aty/aty128fb.c
+++ b/drivers/video/aty/aty128fb.c
@@ -357,6 +357,12 @@ static int default_lcd_on __devinitdata = 1;
357static int mtrr = 1; 357static int mtrr = 1;
358#endif 358#endif
359 359
360#ifdef CONFIG_PMAC_BACKLIGHT
361static int backlight __devinitdata = 1;
362#else
363static int backlight __devinitdata = 0;
364#endif
365
360/* PLL constants */ 366/* PLL constants */
361struct aty128_constants { 367struct aty128_constants {
362 u32 ref_clk; 368 u32 ref_clk;
@@ -1652,6 +1658,9 @@ static int __devinit aty128fb_setup(char *options)
1652 } else if (!strncmp(this_opt, "crt:", 4)) { 1658 } else if (!strncmp(this_opt, "crt:", 4)) {
1653 default_crt_on = simple_strtoul(this_opt+4, NULL, 0); 1659 default_crt_on = simple_strtoul(this_opt+4, NULL, 0);
1654 continue; 1660 continue;
1661 } else if (!strncmp(this_opt, "backlight:", 10)) {
1662 backlight = simple_strtoul(this_opt+10, NULL, 0);
1663 continue;
1655 } 1664 }
1656#ifdef CONFIG_MTRR 1665#ifdef CONFIG_MTRR
1657 if(!strncmp(this_opt, "nomtrr", 6)) { 1666 if(!strncmp(this_opt, "nomtrr", 6)) {
@@ -1985,7 +1994,8 @@ static int __devinit aty128_init(struct pci_dev *pdev, const struct pci_device_i
1985 par->lock_blank = 0; 1994 par->lock_blank = 0;
1986 1995
1987#ifdef CONFIG_FB_ATY128_BACKLIGHT 1996#ifdef CONFIG_FB_ATY128_BACKLIGHT
1988 aty128_bl_init(par); 1997 if (backlight)
1998 aty128_bl_init(par);
1989#endif 1999#endif
1990 2000
1991 if (register_framebuffer(info) < 0) 2001 if (register_framebuffer(info) < 0)
diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c
index b503ad874df7..d7627fc4f11e 100644
--- a/drivers/video/aty/atyfb_base.c
+++ b/drivers/video/aty/atyfb_base.c
@@ -309,6 +309,12 @@ static int xclk;
309static int comp_sync __devinitdata = -1; 309static int comp_sync __devinitdata = -1;
310static char *mode; 310static char *mode;
311 311
312#ifdef CONFIG_PMAC_BACKLIGHT
313static int backlight __devinitdata = 1;
314#else
315static int backlight __devinitdata = 0;
316#endif
317
312#ifdef CONFIG_PPC 318#ifdef CONFIG_PPC
313static int default_vmode __devinitdata = VMODE_CHOOSE; 319static int default_vmode __devinitdata = VMODE_CHOOSE;
314static int default_cmode __devinitdata = CMODE_CHOOSE; 320static int default_cmode __devinitdata = CMODE_CHOOSE;
@@ -2576,7 +2582,7 @@ static int __devinit aty_init(struct fb_info *info)
2576 | (USE_F32KHZ | TRISTATE_MEM_EN), par); 2582 | (USE_F32KHZ | TRISTATE_MEM_EN), par);
2577 } else 2583 } else
2578#endif 2584#endif
2579 if (M64_HAS(MOBIL_BUS)) { 2585 if (M64_HAS(MOBIL_BUS) && backlight) {
2580#ifdef CONFIG_FB_ATY_BACKLIGHT 2586#ifdef CONFIG_FB_ATY_BACKLIGHT
2581 aty_bl_init (par); 2587 aty_bl_init (par);
2582#endif 2588#endif
@@ -3758,6 +3764,8 @@ static int __init atyfb_setup(char *options)
3758 xclk = simple_strtoul(this_opt+5, NULL, 0); 3764 xclk = simple_strtoul(this_opt+5, NULL, 0);
3759 else if (!strncmp(this_opt, "comp_sync:", 10)) 3765 else if (!strncmp(this_opt, "comp_sync:", 10))
3760 comp_sync = simple_strtoul(this_opt+10, NULL, 0); 3766 comp_sync = simple_strtoul(this_opt+10, NULL, 0);
3767 else if (!strncmp(this_opt, "backlight:", 10))
3768 backlight = simple_strtoul(this_opt+10, NULL, 0);
3761#ifdef CONFIG_PPC 3769#ifdef CONFIG_PPC
3762 else if (!strncmp(this_opt, "vmode:", 6)) { 3770 else if (!strncmp(this_opt, "vmode:", 6)) {
3763 unsigned int vmode = 3771 unsigned int vmode =
diff --git a/drivers/video/aty/radeon_base.c b/drivers/video/aty/radeon_base.c
index 46ba1235f03a..1bf6f42eb400 100644
--- a/drivers/video/aty/radeon_base.c
+++ b/drivers/video/aty/radeon_base.c
@@ -268,6 +268,11 @@ static int nomtrr = 0;
268#endif 268#endif
269static int force_sleep; 269static int force_sleep;
270static int ignore_devlist; 270static int ignore_devlist;
271#ifdef CONFIG_PMAC_BACKLIGHT
272static int backlight = 1;
273#else
274static int backlight = 0;
275#endif
271 276
272/* 277/*
273 * prototypes 278 * prototypes
@@ -2348,7 +2353,8 @@ static int __devinit radeonfb_pci_register (struct pci_dev *pdev,
2348 MTRR_TYPE_WRCOMB, 1); 2353 MTRR_TYPE_WRCOMB, 1);
2349#endif 2354#endif
2350 2355
2351 radeonfb_bl_init(rinfo); 2356 if (backlight)
2357 radeonfb_bl_init(rinfo);
2352 2358
2353 printk ("radeonfb (%s): %s\n", pci_name(rinfo->pdev), rinfo->name); 2359 printk ("radeonfb (%s): %s\n", pci_name(rinfo->pdev), rinfo->name);
2354 2360
@@ -2469,6 +2475,8 @@ static int __init radeonfb_setup (char *options)
2469 force_dfp = 1; 2475 force_dfp = 1;
2470 } else if (!strncmp(this_opt, "panel_yres:", 11)) { 2476 } else if (!strncmp(this_opt, "panel_yres:", 11)) {
2471 panel_yres = simple_strtoul((this_opt+11), NULL, 0); 2477 panel_yres = simple_strtoul((this_opt+11), NULL, 0);
2478 } else if (!strncmp(this_opt, "backlight:", 10)) {
2479 backlight = simple_strtoul(this_opt+10, NULL, 0);
2472#ifdef CONFIG_MTRR 2480#ifdef CONFIG_MTRR
2473 } else if (!strncmp(this_opt, "nomtrr", 6)) { 2481 } else if (!strncmp(this_opt, "nomtrr", 6)) {
2474 nomtrr = 1; 2482 nomtrr = 1;
diff --git a/drivers/video/nvidia/nv_backlight.c b/drivers/video/nvidia/nv_backlight.c
index b7016e9b9e13..a50b303093a7 100644
--- a/drivers/video/nvidia/nv_backlight.c
+++ b/drivers/video/nvidia/nv_backlight.c
@@ -23,8 +23,6 @@
23#define MAX_LEVEL 0x534 23#define MAX_LEVEL 0x534
24#define LEVEL_STEP ((MAX_LEVEL - MIN_LEVEL) / FB_BACKLIGHT_MAX) 24#define LEVEL_STEP ((MAX_LEVEL - MIN_LEVEL) / FB_BACKLIGHT_MAX)
25 25
26static struct backlight_properties nvidia_bl_data;
27
28static int nvidia_bl_get_level_brightness(struct nvidia_par *par, 26static int nvidia_bl_get_level_brightness(struct nvidia_par *par,
29 int level) 27 int level)
30{ 28{
@@ -119,7 +117,7 @@ void nvidia_bl_init(struct nvidia_par *par)
119 0x534 * FB_BACKLIGHT_MAX / MAX_LEVEL); 117 0x534 * FB_BACKLIGHT_MAX / MAX_LEVEL);
120 118
121 bd->props.max_brightness = FB_BACKLIGHT_LEVELS - 1; 119 bd->props.max_brightness = FB_BACKLIGHT_LEVELS - 1;
122 bd->props.brightness = nvidia_bl_data.max_brightness; 120 bd->props.brightness = bd->props.max_brightness;
123 bd->props.power = FB_BLANK_UNBLANK; 121 bd->props.power = FB_BLANK_UNBLANK;
124 backlight_update_status(bd); 122 backlight_update_status(bd);
125 123
diff --git a/drivers/video/nvidia/nvidia.c b/drivers/video/nvidia/nvidia.c
index c18e9557ca30..b97ec6901263 100644
--- a/drivers/video/nvidia/nvidia.c
+++ b/drivers/video/nvidia/nvidia.c
@@ -83,6 +83,11 @@ static int bpp __devinitdata = 8;
83#ifdef CONFIG_MTRR 83#ifdef CONFIG_MTRR
84static int nomtrr __devinitdata = 0; 84static int nomtrr __devinitdata = 0;
85#endif 85#endif
86#ifdef CONFIG_PMAC_BACKLIGHT
87static int backlight __devinitdata = 1;
88#else
89static int backlight __devinitdata = 0;
90#endif
86 91
87static char *mode_option __devinitdata = NULL; 92static char *mode_option __devinitdata = NULL;
88 93
@@ -1311,7 +1316,10 @@ static int __devinit nvidiafb_probe(struct pci_dev *pd,
1311 nvidia_save_vga(par, &par->SavedReg); 1316 nvidia_save_vga(par, &par->SavedReg);
1312 1317
1313 pci_set_drvdata(pd, info); 1318 pci_set_drvdata(pd, info);
1314 nvidia_bl_init(par); 1319
1320 if (backlight)
1321 nvidia_bl_init(par);
1322
1315 if (register_framebuffer(info) < 0) { 1323 if (register_framebuffer(info) < 0) {
1316 printk(KERN_ERR PFX "error registering nVidia framebuffer\n"); 1324 printk(KERN_ERR PFX "error registering nVidia framebuffer\n");
1317 goto err_out_iounmap_fb; 1325 goto err_out_iounmap_fb;
@@ -1408,6 +1416,8 @@ static int __devinit nvidiafb_setup(char *options)
1408 paneltweak = simple_strtoul(this_opt+11, NULL, 0); 1416 paneltweak = simple_strtoul(this_opt+11, NULL, 0);
1409 } else if (!strncmp(this_opt, "vram:", 5)) { 1417 } else if (!strncmp(this_opt, "vram:", 5)) {
1410 vram = simple_strtoul(this_opt+5, NULL, 0); 1418 vram = simple_strtoul(this_opt+5, NULL, 0);
1419 } else if (!strncmp(this_opt, "backlight:", 10)) {
1420 backlight = simple_strtoul(this_opt+10, NULL, 0);
1411#ifdef CONFIG_MTRR 1421#ifdef CONFIG_MTRR
1412 } else if (!strncmp(this_opt, "nomtrr", 6)) { 1422 } else if (!strncmp(this_opt, "nomtrr", 6)) {
1413 nomtrr = 1; 1423 nomtrr = 1;
diff --git a/drivers/video/riva/fbdev.c b/drivers/video/riva/fbdev.c
index f8a3d608b208..1d1c7c624d7f 100644
--- a/drivers/video/riva/fbdev.c
+++ b/drivers/video/riva/fbdev.c
@@ -215,6 +215,11 @@ static int noaccel __devinitdata = 0;
215#ifdef CONFIG_MTRR 215#ifdef CONFIG_MTRR
216static int nomtrr __devinitdata = 0; 216static int nomtrr __devinitdata = 0;
217#endif 217#endif
218#ifdef CONFIG_PMAC_BACKLIGHT
219static int backlight __devinitdata = 1;
220#else
221static int backlight __devinitdata = 0;
222#endif
218 223
219static char *mode_option __devinitdata = NULL; 224static char *mode_option __devinitdata = NULL;
220static int strictmode = 0; 225static int strictmode = 0;
@@ -2059,7 +2064,10 @@ static int __devinit rivafb_probe(struct pci_dev *pd,
2059 info->monspecs.modedb = NULL; 2064 info->monspecs.modedb = NULL;
2060 2065
2061 pci_set_drvdata(pd, info); 2066 pci_set_drvdata(pd, info);
2062 riva_bl_init(info->par); 2067
2068 if (backlight)
2069 riva_bl_init(info->par);
2070
2063 ret = register_framebuffer(info); 2071 ret = register_framebuffer(info);
2064 if (ret < 0) { 2072 if (ret < 0) {
2065 printk(KERN_ERR PFX 2073 printk(KERN_ERR PFX
@@ -2157,6 +2165,8 @@ static int __init rivafb_setup(char *options)
2157 forceCRTC = -1; 2165 forceCRTC = -1;
2158 } else if (!strncmp(this_opt, "flatpanel", 9)) { 2166 } else if (!strncmp(this_opt, "flatpanel", 9)) {
2159 flatpanel = 1; 2167 flatpanel = 1;
2168 } else if (!strncmp(this_opt, "backlight:", 10)) {
2169 backlight = simple_strtoul(this_opt+10, NULL, 0);
2160#ifdef CONFIG_MTRR 2170#ifdef CONFIG_MTRR
2161 } else if (!strncmp(this_opt, "nomtrr", 6)) { 2171 } else if (!strncmp(this_opt, "nomtrr", 6)) {
2162 nomtrr = 1; 2172 nomtrr = 1;