Commit 227c5fe7 authored by Linus Torvalds's avatar Linus Torvalds

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
parents 6ebf622b 202d4e60
...@@ -357,6 +357,12 @@ static int default_lcd_on __devinitdata = 1; ...@@ -357,6 +357,12 @@ static int default_lcd_on __devinitdata = 1;
static int mtrr = 1; static int mtrr = 1;
#endif #endif
#ifdef CONFIG_PMAC_BACKLIGHT
static int backlight __devinitdata = 1;
#else
static int backlight __devinitdata = 0;
#endif
/* PLL constants */ /* PLL constants */
struct aty128_constants { struct aty128_constants {
u32 ref_clk; u32 ref_clk;
...@@ -1652,6 +1658,9 @@ static int __devinit aty128fb_setup(char *options) ...@@ -1652,6 +1658,9 @@ static int __devinit aty128fb_setup(char *options)
} else if (!strncmp(this_opt, "crt:", 4)) { } else if (!strncmp(this_opt, "crt:", 4)) {
default_crt_on = simple_strtoul(this_opt+4, NULL, 0); default_crt_on = simple_strtoul(this_opt+4, NULL, 0);
continue; continue;
} else if (!strncmp(this_opt, "backlight:", 10)) {
backlight = simple_strtoul(this_opt+10, NULL, 0);
continue;
} }
#ifdef CONFIG_MTRR #ifdef CONFIG_MTRR
if(!strncmp(this_opt, "nomtrr", 6)) { 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,7 +1994,8 @@ static int __devinit aty128_init(struct pci_dev *pdev, const struct pci_device_i
par->lock_blank = 0; par->lock_blank = 0;
#ifdef CONFIG_FB_ATY128_BACKLIGHT #ifdef CONFIG_FB_ATY128_BACKLIGHT
aty128_bl_init(par); if (backlight)
aty128_bl_init(par);
#endif #endif
if (register_framebuffer(info) < 0) if (register_framebuffer(info) < 0)
......
...@@ -309,6 +309,12 @@ static int xclk; ...@@ -309,6 +309,12 @@ static int xclk;
static int comp_sync __devinitdata = -1; static int comp_sync __devinitdata = -1;
static char *mode; static char *mode;
#ifdef CONFIG_PMAC_BACKLIGHT
static int backlight __devinitdata = 1;
#else
static int backlight __devinitdata = 0;
#endif
#ifdef CONFIG_PPC #ifdef CONFIG_PPC
static int default_vmode __devinitdata = VMODE_CHOOSE; static int default_vmode __devinitdata = VMODE_CHOOSE;
static int default_cmode __devinitdata = CMODE_CHOOSE; static int default_cmode __devinitdata = CMODE_CHOOSE;
...@@ -2576,7 +2582,7 @@ static int __devinit aty_init(struct fb_info *info) ...@@ -2576,7 +2582,7 @@ static int __devinit aty_init(struct fb_info *info)
| (USE_F32KHZ | TRISTATE_MEM_EN), par); | (USE_F32KHZ | TRISTATE_MEM_EN), par);
} else } else
#endif #endif
if (M64_HAS(MOBIL_BUS)) { if (M64_HAS(MOBIL_BUS) && backlight) {
#ifdef CONFIG_FB_ATY_BACKLIGHT #ifdef CONFIG_FB_ATY_BACKLIGHT
aty_bl_init (par); aty_bl_init (par);
#endif #endif
...@@ -3758,6 +3764,8 @@ static int __init atyfb_setup(char *options) ...@@ -3758,6 +3764,8 @@ static int __init atyfb_setup(char *options)
xclk = simple_strtoul(this_opt+5, NULL, 0); xclk = simple_strtoul(this_opt+5, NULL, 0);
else if (!strncmp(this_opt, "comp_sync:", 10)) else if (!strncmp(this_opt, "comp_sync:", 10))
comp_sync = simple_strtoul(this_opt+10, NULL, 0); comp_sync = simple_strtoul(this_opt+10, NULL, 0);
else if (!strncmp(this_opt, "backlight:", 10))
backlight = simple_strtoul(this_opt+10, NULL, 0);
#ifdef CONFIG_PPC #ifdef CONFIG_PPC
else if (!strncmp(this_opt, "vmode:", 6)) { else if (!strncmp(this_opt, "vmode:", 6)) {
unsigned int vmode = unsigned int vmode =
......
...@@ -268,6 +268,11 @@ static int nomtrr = 0; ...@@ -268,6 +268,11 @@ static int nomtrr = 0;
#endif #endif
static int force_sleep; static int force_sleep;
static int ignore_devlist; static int ignore_devlist;
#ifdef CONFIG_PMAC_BACKLIGHT
static int backlight = 1;
#else
static int backlight = 0;
#endif
/* /*
* prototypes * prototypes
...@@ -2348,7 +2353,8 @@ static int __devinit radeonfb_pci_register (struct pci_dev *pdev, ...@@ -2348,7 +2353,8 @@ static int __devinit radeonfb_pci_register (struct pci_dev *pdev,
MTRR_TYPE_WRCOMB, 1); MTRR_TYPE_WRCOMB, 1);
#endif #endif
radeonfb_bl_init(rinfo); if (backlight)
radeonfb_bl_init(rinfo);
printk ("radeonfb (%s): %s\n", pci_name(rinfo->pdev), rinfo->name); printk ("radeonfb (%s): %s\n", pci_name(rinfo->pdev), rinfo->name);
...@@ -2469,6 +2475,8 @@ static int __init radeonfb_setup (char *options) ...@@ -2469,6 +2475,8 @@ static int __init radeonfb_setup (char *options)
force_dfp = 1; force_dfp = 1;
} else if (!strncmp(this_opt, "panel_yres:", 11)) { } else if (!strncmp(this_opt, "panel_yres:", 11)) {
panel_yres = simple_strtoul((this_opt+11), NULL, 0); panel_yres = simple_strtoul((this_opt+11), NULL, 0);
} else if (!strncmp(this_opt, "backlight:", 10)) {
backlight = simple_strtoul(this_opt+10, NULL, 0);
#ifdef CONFIG_MTRR #ifdef CONFIG_MTRR
} else if (!strncmp(this_opt, "nomtrr", 6)) { } else if (!strncmp(this_opt, "nomtrr", 6)) {
nomtrr = 1; nomtrr = 1;
......
...@@ -23,8 +23,6 @@ ...@@ -23,8 +23,6 @@
#define MAX_LEVEL 0x534 #define MAX_LEVEL 0x534
#define LEVEL_STEP ((MAX_LEVEL - MIN_LEVEL) / FB_BACKLIGHT_MAX) #define LEVEL_STEP ((MAX_LEVEL - MIN_LEVEL) / FB_BACKLIGHT_MAX)
static struct backlight_properties nvidia_bl_data;
static int nvidia_bl_get_level_brightness(struct nvidia_par *par, static int nvidia_bl_get_level_brightness(struct nvidia_par *par,
int level) int level)
{ {
...@@ -119,7 +117,7 @@ void nvidia_bl_init(struct nvidia_par *par) ...@@ -119,7 +117,7 @@ void nvidia_bl_init(struct nvidia_par *par)
0x534 * FB_BACKLIGHT_MAX / MAX_LEVEL); 0x534 * FB_BACKLIGHT_MAX / MAX_LEVEL);
bd->props.max_brightness = FB_BACKLIGHT_LEVELS - 1; bd->props.max_brightness = FB_BACKLIGHT_LEVELS - 1;
bd->props.brightness = nvidia_bl_data.max_brightness; bd->props.brightness = bd->props.max_brightness;
bd->props.power = FB_BLANK_UNBLANK; bd->props.power = FB_BLANK_UNBLANK;
backlight_update_status(bd); backlight_update_status(bd);
......
...@@ -83,6 +83,11 @@ static int bpp __devinitdata = 8; ...@@ -83,6 +83,11 @@ static int bpp __devinitdata = 8;
#ifdef CONFIG_MTRR #ifdef CONFIG_MTRR
static int nomtrr __devinitdata = 0; static int nomtrr __devinitdata = 0;
#endif #endif
#ifdef CONFIG_PMAC_BACKLIGHT
static int backlight __devinitdata = 1;
#else
static int backlight __devinitdata = 0;
#endif
static char *mode_option __devinitdata = NULL; static char *mode_option __devinitdata = NULL;
...@@ -1311,7 +1316,10 @@ static int __devinit nvidiafb_probe(struct pci_dev *pd, ...@@ -1311,7 +1316,10 @@ static int __devinit nvidiafb_probe(struct pci_dev *pd,
nvidia_save_vga(par, &par->SavedReg); nvidia_save_vga(par, &par->SavedReg);
pci_set_drvdata(pd, info); pci_set_drvdata(pd, info);
nvidia_bl_init(par);
if (backlight)
nvidia_bl_init(par);
if (register_framebuffer(info) < 0) { if (register_framebuffer(info) < 0) {
printk(KERN_ERR PFX "error registering nVidia framebuffer\n"); printk(KERN_ERR PFX "error registering nVidia framebuffer\n");
goto err_out_iounmap_fb; goto err_out_iounmap_fb;
...@@ -1408,6 +1416,8 @@ static int __devinit nvidiafb_setup(char *options) ...@@ -1408,6 +1416,8 @@ static int __devinit nvidiafb_setup(char *options)
paneltweak = simple_strtoul(this_opt+11, NULL, 0); paneltweak = simple_strtoul(this_opt+11, NULL, 0);
} else if (!strncmp(this_opt, "vram:", 5)) { } else if (!strncmp(this_opt, "vram:", 5)) {
vram = simple_strtoul(this_opt+5, NULL, 0); vram = simple_strtoul(this_opt+5, NULL, 0);
} else if (!strncmp(this_opt, "backlight:", 10)) {
backlight = simple_strtoul(this_opt+10, NULL, 0);
#ifdef CONFIG_MTRR #ifdef CONFIG_MTRR
} else if (!strncmp(this_opt, "nomtrr", 6)) { } else if (!strncmp(this_opt, "nomtrr", 6)) {
nomtrr = 1; nomtrr = 1;
......
...@@ -215,6 +215,11 @@ static int noaccel __devinitdata = 0; ...@@ -215,6 +215,11 @@ static int noaccel __devinitdata = 0;
#ifdef CONFIG_MTRR #ifdef CONFIG_MTRR
static int nomtrr __devinitdata = 0; static int nomtrr __devinitdata = 0;
#endif #endif
#ifdef CONFIG_PMAC_BACKLIGHT
static int backlight __devinitdata = 1;
#else
static int backlight __devinitdata = 0;
#endif
static char *mode_option __devinitdata = NULL; static char *mode_option __devinitdata = NULL;
static int strictmode = 0; static int strictmode = 0;
...@@ -2059,7 +2064,10 @@ static int __devinit rivafb_probe(struct pci_dev *pd, ...@@ -2059,7 +2064,10 @@ static int __devinit rivafb_probe(struct pci_dev *pd,
info->monspecs.modedb = NULL; info->monspecs.modedb = NULL;
pci_set_drvdata(pd, info); pci_set_drvdata(pd, info);
riva_bl_init(info->par);
if (backlight)
riva_bl_init(info->par);
ret = register_framebuffer(info); ret = register_framebuffer(info);
if (ret < 0) { if (ret < 0) {
printk(KERN_ERR PFX printk(KERN_ERR PFX
...@@ -2157,6 +2165,8 @@ static int __init rivafb_setup(char *options) ...@@ -2157,6 +2165,8 @@ static int __init rivafb_setup(char *options)
forceCRTC = -1; forceCRTC = -1;
} else if (!strncmp(this_opt, "flatpanel", 9)) { } else if (!strncmp(this_opt, "flatpanel", 9)) {
flatpanel = 1; flatpanel = 1;
} else if (!strncmp(this_opt, "backlight:", 10)) {
backlight = simple_strtoul(this_opt+10, NULL, 0);
#ifdef CONFIG_MTRR #ifdef CONFIG_MTRR
} else if (!strncmp(this_opt, "nomtrr", 6)) { } else if (!strncmp(this_opt, "nomtrr", 6)) {
nomtrr = 1; nomtrr = 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment