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