backlight: Allow enable/disable of fb backlights, fixing regressions

Enabling the backlight by default appears to cause problems for many
users. This patch disables backlight controls unless explicitly
enabled by users via a module parameter. Since PMAC users are known
to work, default to enabled in that case.

Signed-off-by: Richard Purdie <rpurdie@rpsys.net>

+51 -5
+11 -1
drivers/video/aty/aty128fb.c
··· 357 static int mtrr = 1; 358 #endif 359 360 /* PLL constants */ 361 struct aty128_constants { 362 u32 ref_clk; ··· 1658 } else if (!strncmp(this_opt, "crt:", 4)) { 1659 default_crt_on = simple_strtoul(this_opt+4, NULL, 0); 1660 continue; 1661 } 1662 #ifdef CONFIG_MTRR 1663 if(!strncmp(this_opt, "nomtrr", 6)) { ··· 1994 par->lock_blank = 0; 1995 1996 #ifdef CONFIG_FB_ATY128_BACKLIGHT 1997 - aty128_bl_init(par); 1998 #endif 1999 2000 if (register_framebuffer(info) < 0)
··· 357 static int mtrr = 1; 358 #endif 359 360 + #ifdef CONFIG_PMAC_BACKLIGHT 361 + static int backlight __devinitdata = 1; 362 + #else 363 + static int backlight __devinitdata = 0; 364 + #endif 365 + 366 /* PLL constants */ 367 struct aty128_constants { 368 u32 ref_clk; ··· 1652 } else if (!strncmp(this_opt, "crt:", 4)) { 1653 default_crt_on = simple_strtoul(this_opt+4, NULL, 0); 1654 continue; 1655 + } else if (!strncmp(this_opt, "backlight:", 10)) { 1656 + backlight = simple_strtoul(this_opt+10, NULL, 0); 1657 + continue; 1658 } 1659 #ifdef CONFIG_MTRR 1660 if(!strncmp(this_opt, "nomtrr", 6)) { ··· 1985 par->lock_blank = 0; 1986 1987 #ifdef CONFIG_FB_ATY128_BACKLIGHT 1988 + if (backlight) 1989 + aty128_bl_init(par); 1990 #endif 1991 1992 if (register_framebuffer(info) < 0)
+9 -1
drivers/video/aty/atyfb_base.c
··· 308 static int comp_sync __devinitdata = -1; 309 static char *mode; 310 311 #ifdef CONFIG_PPC 312 static int default_vmode __devinitdata = VMODE_CHOOSE; 313 static int default_cmode __devinitdata = CMODE_CHOOSE; ··· 2581 | (USE_F32KHZ | TRISTATE_MEM_EN), par); 2582 } else 2583 #endif 2584 - if (M64_HAS(MOBIL_BUS)) { 2585 #ifdef CONFIG_FB_ATY_BACKLIGHT 2586 aty_bl_init (par); 2587 #endif ··· 3763 xclk = simple_strtoul(this_opt+5, NULL, 0); 3764 else if (!strncmp(this_opt, "comp_sync:", 10)) 3765 comp_sync = simple_strtoul(this_opt+10, NULL, 0); 3766 #ifdef CONFIG_PPC 3767 else if (!strncmp(this_opt, "vmode:", 6)) { 3768 unsigned int vmode =
··· 308 static int comp_sync __devinitdata = -1; 309 static char *mode; 310 311 + #ifdef CONFIG_PMAC_BACKLIGHT 312 + static int backlight __devinitdata = 1; 313 + #else 314 + static int backlight __devinitdata = 0; 315 + #endif 316 + 317 #ifdef CONFIG_PPC 318 static int default_vmode __devinitdata = VMODE_CHOOSE; 319 static int default_cmode __devinitdata = CMODE_CHOOSE; ··· 2575 | (USE_F32KHZ | TRISTATE_MEM_EN), par); 2576 } else 2577 #endif 2578 + if (M64_HAS(MOBIL_BUS) && backlight) { 2579 #ifdef CONFIG_FB_ATY_BACKLIGHT 2580 aty_bl_init (par); 2581 #endif ··· 3757 xclk = simple_strtoul(this_opt+5, NULL, 0); 3758 else if (!strncmp(this_opt, "comp_sync:", 10)) 3759 comp_sync = simple_strtoul(this_opt+10, NULL, 0); 3760 + else if (!strncmp(this_opt, "backlight:", 10)) 3761 + backlight = simple_strtoul(this_opt+10, NULL, 0); 3762 #ifdef CONFIG_PPC 3763 else if (!strncmp(this_opt, "vmode:", 6)) { 3764 unsigned int vmode =
+9 -1
drivers/video/aty/radeon_base.c
··· 268 #endif 269 static int force_sleep; 270 static int ignore_devlist; 271 272 /* 273 * prototypes ··· 2353 MTRR_TYPE_WRCOMB, 1); 2354 #endif 2355 2356 - radeonfb_bl_init(rinfo); 2357 2358 printk ("radeonfb (%s): %s\n", pci_name(rinfo->pdev), rinfo->name); 2359 ··· 2475 force_dfp = 1; 2476 } else if (!strncmp(this_opt, "panel_yres:", 11)) { 2477 panel_yres = simple_strtoul((this_opt+11), NULL, 0); 2478 #ifdef CONFIG_MTRR 2479 } else if (!strncmp(this_opt, "nomtrr", 6)) { 2480 nomtrr = 1;
··· 268 #endif 269 static int force_sleep; 270 static int ignore_devlist; 271 + #ifdef CONFIG_PMAC_BACKLIGHT 272 + static int backlight = 1; 273 + #else 274 + static int backlight = 0; 275 + #endif 276 277 /* 278 * prototypes ··· 2348 MTRR_TYPE_WRCOMB, 1); 2349 #endif 2350 2351 + if (backlight) 2352 + radeonfb_bl_init(rinfo); 2353 2354 printk ("radeonfb (%s): %s\n", pci_name(rinfo->pdev), rinfo->name); 2355 ··· 2469 force_dfp = 1; 2470 } else if (!strncmp(this_opt, "panel_yres:", 11)) { 2471 panel_yres = simple_strtoul((this_opt+11), NULL, 0); 2472 + } else if (!strncmp(this_opt, "backlight:", 10)) { 2473 + backlight = simple_strtoul(this_opt+10, NULL, 0); 2474 #ifdef CONFIG_MTRR 2475 } else if (!strncmp(this_opt, "nomtrr", 6)) { 2476 nomtrr = 1;
+11 -1
drivers/video/nvidia/nvidia.c
··· 83 #ifdef CONFIG_MTRR 84 static int nomtrr __devinitdata = 0; 85 #endif 86 87 static char *mode_option __devinitdata = NULL; 88 ··· 1316 nvidia_save_vga(par, &par->SavedReg); 1317 1318 pci_set_drvdata(pd, info); 1319 - nvidia_bl_init(par); 1320 if (register_framebuffer(info) < 0) { 1321 printk(KERN_ERR PFX "error registering nVidia framebuffer\n"); 1322 goto err_out_iounmap_fb; ··· 1416 paneltweak = simple_strtoul(this_opt+11, NULL, 0); 1417 } else if (!strncmp(this_opt, "vram:", 5)) { 1418 vram = simple_strtoul(this_opt+5, NULL, 0); 1419 #ifdef CONFIG_MTRR 1420 } else if (!strncmp(this_opt, "nomtrr", 6)) { 1421 nomtrr = 1;
··· 83 #ifdef CONFIG_MTRR 84 static int nomtrr __devinitdata = 0; 85 #endif 86 + #ifdef CONFIG_PMAC_BACKLIGHT 87 + static int backlight __devinitdata = 1; 88 + #else 89 + static int backlight __devinitdata = 0; 90 + #endif 91 92 static char *mode_option __devinitdata = NULL; 93 ··· 1311 nvidia_save_vga(par, &par->SavedReg); 1312 1313 pci_set_drvdata(pd, info); 1314 + 1315 + if (backlight) 1316 + nvidia_bl_init(par); 1317 + 1318 if (register_framebuffer(info) < 0) { 1319 printk(KERN_ERR PFX "error registering nVidia framebuffer\n"); 1320 goto err_out_iounmap_fb; ··· 1408 paneltweak = simple_strtoul(this_opt+11, NULL, 0); 1409 } else if (!strncmp(this_opt, "vram:", 5)) { 1410 vram = simple_strtoul(this_opt+5, NULL, 0); 1411 + } else if (!strncmp(this_opt, "backlight:", 10)) { 1412 + backlight = simple_strtoul(this_opt+10, NULL, 0); 1413 #ifdef CONFIG_MTRR 1414 } else if (!strncmp(this_opt, "nomtrr", 6)) { 1415 nomtrr = 1;
+11 -1
drivers/video/riva/fbdev.c
··· 215 #ifdef CONFIG_MTRR 216 static int nomtrr __devinitdata = 0; 217 #endif 218 219 static char *mode_option __devinitdata = NULL; 220 static int strictmode = 0; ··· 2064 info->monspecs.modedb = NULL; 2065 2066 pci_set_drvdata(pd, info); 2067 - riva_bl_init(info->par); 2068 ret = register_framebuffer(info); 2069 if (ret < 0) { 2070 printk(KERN_ERR PFX ··· 2165 forceCRTC = -1; 2166 } else if (!strncmp(this_opt, "flatpanel", 9)) { 2167 flatpanel = 1; 2168 #ifdef CONFIG_MTRR 2169 } else if (!strncmp(this_opt, "nomtrr", 6)) { 2170 nomtrr = 1;
··· 215 #ifdef CONFIG_MTRR 216 static int nomtrr __devinitdata = 0; 217 #endif 218 + #ifdef CONFIG_PMAC_BACKLIGHT 219 + static int backlight __devinitdata = 1; 220 + #else 221 + static int backlight __devinitdata = 0; 222 + #endif 223 224 static char *mode_option __devinitdata = NULL; 225 static int strictmode = 0; ··· 2059 info->monspecs.modedb = NULL; 2060 2061 pci_set_drvdata(pd, info); 2062 + 2063 + if (backlight) 2064 + riva_bl_init(info->par); 2065 + 2066 ret = register_framebuffer(info); 2067 if (ret < 0) { 2068 printk(KERN_ERR PFX ··· 2157 forceCRTC = -1; 2158 } else if (!strncmp(this_opt, "flatpanel", 9)) { 2159 flatpanel = 1; 2160 + } else if (!strncmp(this_opt, "backlight:", 10)) { 2161 + backlight = simple_strtoul(this_opt+10, NULL, 0); 2162 #ifdef CONFIG_MTRR 2163 } else if (!strncmp(this_opt, "nomtrr", 6)) { 2164 nomtrr = 1;