aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/macintosh/via-pmu.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2006-09-01 00:27:49 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-01 14:39:09 -0400
commitd565dd3b0824b67a8442df4de83cc44f7c726fc9 (patch)
treeefe10d3e6355353a3ffd416a873d609119d9fbd9 /drivers/macintosh/via-pmu.c
parent0b1d647a02c5a1b67d45287eeb6cb3b2219c41c3 (diff)
[PATCH] powerpc: More via-pmu backlight fixes
The via-pmu backlight code (introduced in 2.6.18) has various design issues causing crashes on machines using it like the old Wallstreet powerbook (Michael, the author, never managed to test on these and I just got my hand on one of those old beasts). This fixes them by no longer trying to hijack the backlight device of the frontmost framebuffer (causing that framebuffer to crash) but having it's own local bits instead. Might look weird but it's better that way on those old machines, at least as a last-minute fix for 2.6.18. We might rework the whole thing later. This patch also changes the way it gets notified of sleep and wakeup in order to properly shut the backlight down on sleep and bring it back on wakeup. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: "Antonino A. Daplas" <adaplas@pol.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/macintosh/via-pmu.c')
-rw-r--r--drivers/macintosh/via-pmu.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c
index ea386801e215..14610a63f580 100644
--- a/drivers/macintosh/via-pmu.c
+++ b/drivers/macintosh/via-pmu.c
@@ -1995,6 +1995,8 @@ restore_via_state(void)
1995 out_8(&via[IER], IER_SET | SR_INT | CB1_INT); 1995 out_8(&via[IER], IER_SET | SR_INT | CB1_INT);
1996} 1996}
1997 1997
1998extern void pmu_backlight_set_sleep(int sleep);
1999
1998static int 2000static int
1999pmac_suspend_devices(void) 2001pmac_suspend_devices(void)
2000{ 2002{
@@ -2032,6 +2034,11 @@ pmac_suspend_devices(void)
2032 return -EBUSY; 2034 return -EBUSY;
2033 } 2035 }
2034 2036
2037#ifdef CONFIG_PMAC_BACKLIGHT
2038 /* Tell backlight code not to muck around with the chip anymore */
2039 pmu_backlight_set_sleep(1);
2040#endif
2041
2035 /* Call platform functions marked "on sleep" */ 2042 /* Call platform functions marked "on sleep" */
2036 pmac_pfunc_i2c_suspend(); 2043 pmac_pfunc_i2c_suspend();
2037 pmac_pfunc_base_suspend(); 2044 pmac_pfunc_base_suspend();
@@ -2090,6 +2097,11 @@ pmac_wakeup_devices(void)
2090{ 2097{
2091 mdelay(100); 2098 mdelay(100);
2092 2099
2100#ifdef CONFIG_PMAC_BACKLIGHT
2101 /* Tell backlight code it can use the chip again */
2102 pmu_backlight_set_sleep(0);
2103#endif
2104
2093 /* Power back up system devices (including the PIC) */ 2105 /* Power back up system devices (including the PIC) */
2094 device_power_up(); 2106 device_power_up();
2095 2107