From a8f340e394ff30b79ab5b03c67ab4c94b2ac3646 Mon Sep 17 00:00:00 2001 From: Jon Smirl Date: Mon, 10 Jul 2006 04:44:12 -0700 Subject: [PATCH] vt: Remove VT-specific declarations and definitions from tty.h MAX_NR_CONSOLES, fg_console, want_console and last_console are more of a function of the VT layer than the TTY one. Moving these to vt.h and vt_kern.h allows all of the framebuffer and VT console drivers to remove their dependency on tty.h. [akpm@osdl.org: fix alpha build] Signed-off-by: Jon Smirl Signed-off-by: Antonino Daplas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/video/aty/aty128fb.c | 1 - drivers/video/aty/radeon_base.c | 1 - 2 files changed, 2 deletions(-) (limited to 'drivers/video/aty') diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c index 72c5891..1006f12 100644 --- a/drivers/video/aty/aty128fb.c +++ b/drivers/video/aty/aty128fb.c @@ -52,7 +52,6 @@ #include #include #include -#include #include #include #include diff --git a/drivers/video/aty/radeon_base.c b/drivers/video/aty/radeon_base.c index 51b78f8..8d85fc5 100644 --- a/drivers/video/aty/radeon_base.c +++ b/drivers/video/aty/radeon_base.c @@ -58,7 +58,6 @@ #include #include #include -#include #include #include #include -- cgit v1.1 From e01af0384f54023b4548b7742952da2ffcafd4cd Mon Sep 17 00:00:00 2001 From: Michael Hanselmann Date: Mon, 10 Jul 2006 04:44:45 -0700 Subject: [PATCH] powermac: Combined fixes for backlight code This patch fixes several problems: - pmac_backlight_key() is called under interrupt context, and therefore can't use mutexes or semaphores, so defer the backlight level for later, as it's not critical (original code by Aristeu S. Rozanski F. ). - Add exports for functions that might be called from modules - Fix Kconfig depdencies on PMAC_BACKLIGHT. - Fix locking issues on calls from inside the driver (reported by Aristeu S. Rozanski F., too) - Fix wrong calculation of backlight values in some of the drivers - Replace pmac_backlight_key_up/down by inline functions [akpm@osdl.org: fix function prototypes] Signed-off-by: Michael Hanselmann Acked-by: Aristeu S. Rozanski F. Acked-by: Rene Nussbaumer Cc: Benjamin Herrenschmidt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/video/aty/aty128fb.c | 66 ++++++++++++++++++++++-------------------- drivers/video/aty/atyfb_base.c | 53 ++++++++++++++++++--------------- 2 files changed, 65 insertions(+), 54 deletions(-) (limited to 'drivers/video/aty') diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c index 1006f12..c64a717 100644 --- a/drivers/video/aty/aty128fb.c +++ b/drivers/video/aty/aty128fb.c @@ -455,6 +455,7 @@ static void do_wait_for_fifo(u16 entries, struct aty128fb_par *par); static void wait_for_fifo(u16 entries, struct aty128fb_par *par); static void wait_for_idle(struct aty128fb_par *par); static u32 depth_to_dst(u32 depth); +static void aty128_bl_set_power(struct fb_info *info, int power); #define BIOS_IN8(v) (readb(bios + (v))) #define BIOS_IN16(v) (readb(bios + (v)) | \ @@ -1257,25 +1258,11 @@ static void aty128_set_lcd_enable(struct aty128fb_par *par, int on) reg &= ~LVDS_DISPLAY_DIS; aty_st_le32(LVDS_GEN_CNTL, reg); #ifdef CONFIG_FB_ATY128_BACKLIGHT - mutex_lock(&info->bl_mutex); - if (info->bl_dev) { - down(&info->bl_dev->sem); - info->bl_dev->props->update_status(info->bl_dev); - up(&info->bl_dev->sem); - } - mutex_unlock(&info->bl_mutex); + aty128_bl_set_power(info, FB_BLANK_UNBLANK); #endif } else { #ifdef CONFIG_FB_ATY128_BACKLIGHT - mutex_lock(&info->bl_mutex); - if (info->bl_dev) { - down(&info->bl_dev->sem); - info->bl_dev->props->brightness = 0; - info->bl_dev->props->power = FB_BLANK_POWERDOWN; - info->bl_dev->props->update_status(info->bl_dev); - up(&info->bl_dev->sem); - } - mutex_unlock(&info->bl_mutex); + aty128_bl_set_power(info, FB_BLANK_POWERDOWN); #endif reg = aty_ld_le32(LVDS_GEN_CNTL); reg |= LVDS_DISPLAY_DIS; @@ -1702,6 +1689,7 @@ static int __devinit aty128fb_setup(char *options) static struct backlight_properties aty128_bl_data; +/* Call with fb_info->bl_mutex held */ static int aty128_bl_get_level_brightness(struct aty128fb_par *par, int level) { @@ -1709,10 +1697,8 @@ static int aty128_bl_get_level_brightness(struct aty128fb_par *par, int atylevel; /* Get and convert the value */ - mutex_lock(&info->bl_mutex); atylevel = MAX_LEVEL - (info->bl_curve[level] * FB_BACKLIGHT_MAX / MAX_LEVEL); - mutex_unlock(&info->bl_mutex); if (atylevel < 0) atylevel = 0; @@ -1730,7 +1716,8 @@ static int aty128_bl_get_level_brightness(struct aty128fb_par *par, /* That one prevents proper CRT output with LCD off */ #undef BACKLIGHT_DAC_OFF -static int aty128_bl_update_status(struct backlight_device *bd) +/* Call with fb_info->bl_mutex held */ +static int __aty128_bl_update_status(struct backlight_device *bd) { struct aty128fb_par *par = class_get_devdata(&bd->class_dev); unsigned int reg = aty_ld_le32(LVDS_GEN_CNTL); @@ -1783,6 +1770,19 @@ static int aty128_bl_update_status(struct backlight_device *bd) return 0; } +static int aty128_bl_update_status(struct backlight_device *bd) +{ + struct aty128fb_par *par = class_get_devdata(&bd->class_dev); + struct fb_info *info = pci_get_drvdata(par->pdev); + int ret; + + mutex_lock(&info->bl_mutex); + ret = __aty128_bl_update_status(bd); + mutex_unlock(&info->bl_mutex); + + return ret; +} + static int aty128_bl_get_brightness(struct backlight_device *bd) { return bd->props->brightness; @@ -1795,6 +1795,16 @@ static struct backlight_properties aty128_bl_data = { .max_brightness = (FB_BACKLIGHT_LEVELS - 1), }; +static void aty128_bl_set_power(struct fb_info *info, int power) +{ + mutex_lock(&info->bl_mutex); + up(&info->bl_dev->sem); + info->bl_dev->props->power = power; + __aty128_bl_update_status(info->bl_dev); + down(&info->bl_dev->sem); + mutex_unlock(&info->bl_mutex); +} + static void aty128_bl_init(struct aty128fb_par *par) { struct fb_info *info = pci_get_drvdata(par->pdev); @@ -2197,12 +2207,8 @@ static int aty128fb_blank(int blank, struct fb_info *fb) return 0; #ifdef CONFIG_FB_ATY128_BACKLIGHT - if (machine_is(powermac) && blank) { - down(&fb->bl_dev->sem); - fb->bl_dev->props->power = FB_BLANK_POWERDOWN; - fb->bl_dev->props->update_status(fb->bl_dev); - up(&fb->bl_dev->sem); - } + if (machine_is(powermac) && blank) + aty128_bl_set_power(fb, FB_BLANK_POWERDOWN); #endif if (blank & FB_BLANK_VSYNC_SUSPEND) @@ -2218,14 +2224,12 @@ static int aty128fb_blank(int blank, struct fb_info *fb) aty128_set_crt_enable(par, par->crt_on && !blank); aty128_set_lcd_enable(par, par->lcd_on && !blank); } + #ifdef CONFIG_FB_ATY128_BACKLIGHT - if (machine_is(powermac) && !blank) { - down(&fb->bl_dev->sem); - fb->bl_dev->props->power = FB_BLANK_UNBLANK; - fb->bl_dev->props->update_status(fb->bl_dev); - up(&fb->bl_dev->sem); - } + if (machine_is(powermac) && !blank) + aty128_bl_set_power(fb, FB_BLANK_UNBLANK); #endif + return 0; } diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c index 0c97067..1507d19 100644 --- a/drivers/video/aty/atyfb_base.c +++ b/drivers/video/aty/atyfb_base.c @@ -2129,15 +2129,14 @@ static int atyfb_pci_resume(struct pci_dev *pdev) static struct backlight_properties aty_bl_data; +/* Call with fb_info->bl_mutex held */ static int aty_bl_get_level_brightness(struct atyfb_par *par, int level) { struct fb_info *info = pci_get_drvdata(par->pdev); int atylevel; /* Get and convert the value */ - mutex_lock(&info->bl_mutex); atylevel = info->bl_curve[level] * FB_BACKLIGHT_MAX / MAX_LEVEL; - mutex_unlock(&info->bl_mutex); if (atylevel < 0) atylevel = 0; @@ -2147,7 +2146,8 @@ static int aty_bl_get_level_brightness(struct atyfb_par *par, int level) return atylevel; } -static int aty_bl_update_status(struct backlight_device *bd) +/* Call with fb_info->bl_mutex held */ +static int __aty_bl_update_status(struct backlight_device *bd) { struct atyfb_par *par = class_get_devdata(&bd->class_dev); unsigned int reg = aty_ld_lcd(LCD_MISC_CNTL, par); @@ -2172,6 +2172,19 @@ static int aty_bl_update_status(struct backlight_device *bd) return 0; } +static int aty_bl_update_status(struct backlight_device *bd) +{ + struct atyfb_par *par = class_get_devdata(&bd->class_dev); + struct fb_info *info = pci_get_drvdata(par->pdev); + int ret; + + mutex_lock(&info->bl_mutex); + ret = __aty_bl_update_status(bd); + mutex_unlock(&info->bl_mutex); + + return ret; +} + static int aty_bl_get_brightness(struct backlight_device *bd) { return bd->props->brightness; @@ -2184,6 +2197,16 @@ static struct backlight_properties aty_bl_data = { .max_brightness = (FB_BACKLIGHT_LEVELS - 1), }; +static void aty_bl_set_power(struct fb_info *info, int power) +{ + mutex_lock(&info->bl_mutex); + up(&info->bl_dev->sem); + info->bl_dev->props->power = power; + __aty_bl_update_status(info->bl_dev); + down(&info->bl_dev->sem); + mutex_unlock(&info->bl_mutex); +} + static void aty_bl_init(struct atyfb_par *par) { struct fb_info *info = pci_get_drvdata(par->pdev); @@ -2790,16 +2813,8 @@ static int atyfb_blank(int blank, struct fb_info *info) return 0; #ifdef CONFIG_PMAC_BACKLIGHT - if (machine_is(powermac) && blank > FB_BLANK_NORMAL) { - mutex_lock(&info->bl_mutex); - if (info->bl_dev) { - down(&info->bl_dev->sem); - info->bl_dev->props->power = FB_BLANK_POWERDOWN; - info->bl_dev->props->update_status(info->bl_dev); - up(&info->bl_dev->sem); - } - mutex_unlock(&info->bl_mutex); - } + if (machine_is(powermac) && blank > FB_BLANK_NORMAL) + aty_bl_set_power(info, FB_BLANK_POWERDOWN); #elif defined(CONFIG_FB_ATY_GENERIC_LCD) if (par->lcd_table && blank > FB_BLANK_NORMAL && (aty_ld_lcd(LCD_GEN_CNTL, par) & LCD_ON)) { @@ -2830,16 +2845,8 @@ static int atyfb_blank(int blank, struct fb_info *info) aty_st_le32(CRTC_GEN_CNTL, gen_cntl, par); #ifdef CONFIG_PMAC_BACKLIGHT - if (machine_is(powermac) && blank <= FB_BLANK_NORMAL) { - mutex_lock(&info->bl_mutex); - if (info->bl_dev) { - down(&info->bl_dev->sem); - info->bl_dev->props->power = FB_BLANK_UNBLANK; - info->bl_dev->props->update_status(info->bl_dev); - up(&info->bl_dev->sem); - } - mutex_unlock(&info->bl_mutex); - } + if (machine_is(powermac) && blank <= FB_BLANK_NORMAL) + aty_bl_set_power(info, FB_BLANK_UNBLANK); #elif defined(CONFIG_FB_ATY_GENERIC_LCD) if (par->lcd_table && blank <= FB_BLANK_NORMAL && (aty_ld_lcd(LCD_GEN_CNTL, par) & LCD_ON)) { -- cgit v1.1 From 994aad251acab32a5d40d4a9501dc3e736562b6d Mon Sep 17 00:00:00 2001 From: Volker Braun Date: Sun, 30 Jul 2006 03:04:18 -0700 Subject: [PATCH] radeonfb sleep fixes Many IBM Thinkpad T4* models and some R* and X* with radeon video cards draw too much power when suspended to RAM, reducing drastically the battery lifetime. The solution is to enable suspend-to-D2 on these machines. They are whitelisted through their subsystem vendor/device ID. This fixes http://bugzilla.kernel.org/show_bug.cgi?id=3022 The patch introduces a framework to alter the pm_mode and reinit_func fields of the radeonfb_info structure based on a whitelist. This should facilitate future hardware-dependent workarounds. The workaround for the Samsung P35 that is already in the radeonfb code has been rewritten using this framework. The behavior can be overridden with module options: i) video=radeonfb:force_sleep=1 enable suspend-to-D2 also on non-whitelisted machines (useful for testing new notebook models), ii) video=radeonfb:ignore_devlist=1 Disable checking the whitelist and do not apply any workarounds. Cc: Benjamin Herrenschmidt Cc: "Antonino A. Daplas" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/video/aty/radeon_base.c | 18 ++++- drivers/video/aty/radeon_pm.c | 146 ++++++++++++++++++++++++++++++++++------ drivers/video/aty/radeonfb.h | 6 +- 3 files changed, 145 insertions(+), 25 deletions(-) (limited to 'drivers/video/aty') diff --git a/drivers/video/aty/radeon_base.c b/drivers/video/aty/radeon_base.c index 8d85fc5..8e3400d 100644 --- a/drivers/video/aty/radeon_base.c +++ b/drivers/video/aty/radeon_base.c @@ -266,6 +266,8 @@ static int force_measure_pll = 0; #ifdef CONFIG_MTRR static int nomtrr = 0; #endif +static int force_sleep; +static int ignore_devlist; /* * prototypes @@ -2327,9 +2329,9 @@ static int __devinit radeonfb_pci_register (struct pci_dev *pdev, /* -2 is special: means ON on mobility chips and do not * change on others */ - radeonfb_pm_init(rinfo, rinfo->is_mobility ? 1 : -1); + radeonfb_pm_init(rinfo, rinfo->is_mobility ? 1 : -1, ignore_devlist, force_sleep); } else - radeonfb_pm_init(rinfo, default_dynclk); + radeonfb_pm_init(rinfo, default_dynclk, ignore_devlist, force_sleep); pci_set_drvdata(pdev, info); @@ -2477,6 +2479,12 @@ static int __init radeonfb_setup (char *options) force_measure_pll = 1; } else if (!strncmp(this_opt, "ignore_edid", 11)) { ignore_edid = 1; +#if defined(CONFIG_PM) && defined(CONFIG_X86) + } else if (!strncmp(this_opt, "force_sleep", 11)) { + force_sleep = 1; + } else if (!strncmp(this_opt, "ignore_devlist", 14)) { + ignore_devlist = 1; +#endif } else mode_option = this_opt; } @@ -2532,3 +2540,9 @@ module_param(panel_yres, int, 0); MODULE_PARM_DESC(panel_yres, "int: set panel yres"); module_param(mode_option, charp, 0); MODULE_PARM_DESC(mode_option, "Specify resolution as \"x[-][@]\" "); +#if defined(CONFIG_PM) && defined(CONFIG_X86) +module_param(force_sleep, bool, 0); +MODULE_PARM_DESC(force_sleep, "bool: force D2 sleep mode on all hardware"); +module_param(ignore_devlist, bool, 0); +MODULE_PARM_DESC(ignore_devlist, "bool: ignore workarounds for bugs in specific laptops"); +#endif diff --git a/drivers/video/aty/radeon_pm.c b/drivers/video/aty/radeon_pm.c index c709176..f31e606 100644 --- a/drivers/video/aty/radeon_pm.c +++ b/drivers/video/aty/radeon_pm.c @@ -27,6 +27,99 @@ #include "ati_ids.h" +static void radeon_reinitialize_M10(struct radeonfb_info *rinfo); + +/* + * Workarounds for bugs in PC laptops: + * - enable D2 sleep in some IBM Thinkpads + * - special case for Samsung P35 + * + * Whitelist by subsystem vendor/device because + * its the subsystem vendor's fault! + */ + +#if defined(CONFIG_PM) && defined(CONFIG_X86) +struct radeon_device_id { + const char *ident; /* (arbitrary) Name */ + const unsigned short subsystem_vendor; /* Subsystem Vendor ID */ + const unsigned short subsystem_device; /* Subsystem Device ID */ + const enum radeon_pm_mode pm_mode_modifier; /* modify pm_mode */ + const reinit_function_ptr new_reinit_func; /* changed reinit_func */ +}; + +#define BUGFIX(model, sv, sd, pm, fn) { \ + .ident = model, \ + .subsystem_vendor = sv, \ + .subsystem_device = sd, \ + .pm_mode_modifier = pm, \ + .new_reinit_func = fn \ +} + +static struct radeon_device_id radeon_workaround_list[] = { + BUGFIX("IBM Thinkpad R32", + PCI_VENDOR_ID_IBM, 0x1905, + radeon_pm_d2, NULL), + BUGFIX("IBM Thinkpad R40", + PCI_VENDOR_ID_IBM, 0x0526, + radeon_pm_d2, NULL), + BUGFIX("IBM Thinkpad R40", + PCI_VENDOR_ID_IBM, 0x0527, + radeon_pm_d2, NULL), + BUGFIX("IBM Thinkpad R50/R51/T40/T41", + PCI_VENDOR_ID_IBM, 0x0531, + radeon_pm_d2, NULL), + BUGFIX("IBM Thinkpad R51/T40/T41/T42", + PCI_VENDOR_ID_IBM, 0x0530, + radeon_pm_d2, NULL), + BUGFIX("IBM Thinkpad T30", + PCI_VENDOR_ID_IBM, 0x0517, + radeon_pm_d2, NULL), + BUGFIX("IBM Thinkpad T40p", + PCI_VENDOR_ID_IBM, 0x054d, + radeon_pm_d2, NULL), + BUGFIX("IBM Thinkpad T42", + PCI_VENDOR_ID_IBM, 0x0550, + radeon_pm_d2, NULL), + BUGFIX("IBM Thinkpad X31/X32", + PCI_VENDOR_ID_IBM, 0x052f, + radeon_pm_d2, NULL), + BUGFIX("Samsung P35", + PCI_VENDOR_ID_SAMSUNG, 0xc00c, + radeon_pm_off, radeon_reinitialize_M10), + { .ident = NULL } +}; + +static int radeon_apply_workarounds(struct radeonfb_info *rinfo) +{ + struct radeon_device_id *id; + + for (id = radeon_workaround_list; id->ident != NULL; id++ ) + if ((id->subsystem_vendor == rinfo->pdev->subsystem_vendor ) && + (id->subsystem_device == rinfo->pdev->subsystem_device )) { + + /* we found a device that requires workaround */ + printk(KERN_DEBUG "radeonfb: %s detected" + ", enabling workaround\n", id->ident); + + rinfo->pm_mode |= id->pm_mode_modifier; + + if (id->new_reinit_func != NULL) + rinfo->reinit_func = id->new_reinit_func; + + return 1; + } + return 0; /* not found */ +} + +#else /* defined(CONFIG_PM) && defined(CONFIG_X86) */ +static inline int radeon_apply_workarounds(struct radeonfb_info *rinfo) +{ + return 0; +} +#endif /* defined(CONFIG_PM) && defined(CONFIG_X86) */ + + + static void radeon_pm_disable_dynamic_mode(struct radeonfb_info *rinfo) { u32 tmp; @@ -852,18 +945,26 @@ static void radeon_pm_setup_for_suspend(struct radeonfb_info *rinfo) /* because both INPLL and OUTPLL take the same lock, that's why. */ tmp = INPLL( pllMCLK_MISC) | MCLK_MISC__EN_MCLK_TRISTATE_IN_SUSPEND; OUTPLL( pllMCLK_MISC, tmp); - - /* AGP PLL control */ - if (rinfo->family <= CHIP_FAMILY_RV280) { - OUTREG(BUS_CNTL1, INREG(BUS_CNTL1) | BUS_CNTL1__AGPCLK_VALID); - OUTREG(BUS_CNTL1, - (INREG(BUS_CNTL1) & ~BUS_CNTL1__MOBILE_PLATFORM_SEL_MASK) - | (2<family <= CHIP_FAMILY_RV280) { + OUTREG(BUS_CNTL1, INREG(BUS_CNTL1) | BUS_CNTL1__AGPCLK_VALID); + OUTREG(BUS_CNTL1, + (INREG(BUS_CNTL1) & ~BUS_CNTL1__MOBILE_PLATFORM_SEL_MASK) + | (2<pm_reg = pci_find_capability(rinfo->pdev, PCI_CAP_ID_PM); @@ -2729,22 +2830,13 @@ void radeonfb_pm_init(struct radeonfb_info *rinfo, int dynclk) } #if defined(CONFIG_PM) +#if defined(CONFIG_PPC_PMAC) /* Check if we can power manage on suspend/resume. We can do * D2 on M6, M7 and M9, and we can resume from D3 cold a few other * "Mac" cards, but that's all. We need more infos about what the * BIOS does tho. Right now, all this PM stuff is pmac-only for that * reason. --BenH */ - /* Special case for Samsung P35 laptops - */ - if ((rinfo->pdev->vendor == PCI_VENDOR_ID_ATI) && - (rinfo->pdev->device == PCI_CHIP_RV350_NP) && - (rinfo->pdev->subsystem_vendor == PCI_VENDOR_ID_SAMSUNG) && - (rinfo->pdev->subsystem_device == 0xc00c)) { - rinfo->reinit_func = radeon_reinitialize_M10; - rinfo->pm_mode |= radeon_pm_off; - } -#if defined(CONFIG_PPC_PMAC) if (machine_is(powermac) && rinfo->of_node) { if (rinfo->is_mobility && rinfo->pm_reg && rinfo->family <= CHIP_FAMILY_RV250) @@ -2790,6 +2882,18 @@ void radeonfb_pm_init(struct radeonfb_info *rinfo, int dynclk) } #endif /* defined(CONFIG_PPC_PMAC) */ #endif /* defined(CONFIG_PM) */ + + if (ignore_devlist) + printk(KERN_DEBUG + "radeonfb: skipping test for device workarounds\n"); + else + radeon_apply_workarounds(rinfo); + + if (force_sleep) { + printk(KERN_DEBUG + "radeonfb: forcefully enabling D2 sleep mode\n"); + rinfo->pm_mode |= radeon_pm_d2; + } } void radeonfb_pm_exit(struct radeonfb_info *rinfo) diff --git a/drivers/video/aty/radeonfb.h b/drivers/video/aty/radeonfb.h index 38657b2..d5ff224 100644 --- a/drivers/video/aty/radeonfb.h +++ b/drivers/video/aty/radeonfb.h @@ -273,6 +273,8 @@ enum radeon_pm_mode { radeon_pm_off = 0x00000002, /* Can resume from D3 cold */ }; +typedef void (*reinit_function_ptr)(struct radeonfb_info *rinfo); + struct radeonfb_info { struct fb_info *info; @@ -338,7 +340,7 @@ struct radeonfb_info { int dynclk; int no_schedule; enum radeon_pm_mode pm_mode; - void (*reinit_func)(struct radeonfb_info *rinfo); + reinit_function_ptr reinit_func; /* Lock on register access */ spinlock_t reg_lock; @@ -600,7 +602,7 @@ extern int radeon_probe_i2c_connector(struct radeonfb_info *rinfo, int conn, u8 /* PM Functions */ extern int radeonfb_pci_suspend(struct pci_dev *pdev, pm_message_t state); extern int radeonfb_pci_resume(struct pci_dev *pdev); -extern void radeonfb_pm_init(struct radeonfb_info *rinfo, int dynclk); +extern void radeonfb_pm_init(struct radeonfb_info *rinfo, int dynclk, int ignore_devlist, int force_sleep); extern void radeonfb_pm_exit(struct radeonfb_info *rinfo); /* Monitor probe functions */ -- cgit v1.1 From 4b755999d6e0c1d988fb448289abb6c226cd8c36 Mon Sep 17 00:00:00 2001 From: Michael Hanselmann Date: Sun, 30 Jul 2006 03:04:19 -0700 Subject: [PATCH] powermac: More powermac backlight fixes This patch fixes several problems: - The legacy backlight value might be set at interrupt time. Introduced a worker to prevent it from directly calling the backlight code. - via-pmu allows the backlight to be grabbed, in which case we need to prevent other kernel code from changing the brightness. - Don't send PMU requests in via-pmu-backlight when the machine is about to sleep or waking up. - More Kconfig fixes. Signed-off-by: Michael Hanselmann Cc: Benjamin Herrenschmidt Cc: "Antonino A. Daplas" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/video/aty/aty128fb.c | 3 +++ drivers/video/aty/atyfb_base.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'drivers/video/aty') diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c index c64a717..8b08121 100644 --- a/drivers/video/aty/aty128fb.c +++ b/drivers/video/aty/aty128fb.c @@ -455,7 +455,10 @@ static void do_wait_for_fifo(u16 entries, struct aty128fb_par *par); static void wait_for_fifo(u16 entries, struct aty128fb_par *par); static void wait_for_idle(struct aty128fb_par *par); static u32 depth_to_dst(u32 depth); + +#ifdef CONFIG_FB_ATY128_BACKLIGHT static void aty128_bl_set_power(struct fb_info *info, int power); +#endif #define BIOS_IN8(v) (readb(bios + (v))) #define BIOS_IN16(v) (readb(bios + (v)) | \ diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c index 1507d19..053ff63 100644 --- a/drivers/video/aty/atyfb_base.c +++ b/drivers/video/aty/atyfb_base.c @@ -2812,7 +2812,7 @@ static int atyfb_blank(int blank, struct fb_info *info) if (par->lock_blank || par->asleep) return 0; -#ifdef CONFIG_PMAC_BACKLIGHT +#ifdef CONFIG_FB_ATY_BACKLIGHT if (machine_is(powermac) && blank > FB_BLANK_NORMAL) aty_bl_set_power(info, FB_BLANK_POWERDOWN); #elif defined(CONFIG_FB_ATY_GENERIC_LCD) @@ -2844,7 +2844,7 @@ static int atyfb_blank(int blank, struct fb_info *info) } aty_st_le32(CRTC_GEN_CNTL, gen_cntl, par); -#ifdef CONFIG_PMAC_BACKLIGHT +#ifdef CONFIG_FB_ATY_BACKLIGHT if (machine_is(powermac) && blank <= FB_BLANK_NORMAL) aty_bl_set_power(info, FB_BLANK_UNBLANK); #elif defined(CONFIG_FB_ATY_GENERIC_LCD) -- cgit v1.1