Commit fa19d63488bd108a308f575064779bb69123efbc

Authored by Benjamin Herrenschmidt
Committed by Paul Mackerras
1 parent 7f172890a8

[POWERPC] Fix sleep on some powerbooks

The PMU backlight code would kick in during sleep/resume even on
machines that use a different backlight method.  This breaks
sleep on some PowerBooks.

This fixes it by adding a flag to indicate whether the backlight
is controlled by the PMU, and testing that before trying to use
the PMU to turn off the backlight during sleep.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>

Showing 1 changed file with 3 additions and 2 deletions Side-by-side Diff

drivers/macintosh/via-pmu-backlight.c
... ... @@ -17,7 +17,7 @@
17 17  
18 18 static struct backlight_ops pmu_backlight_data;
19 19 static DEFINE_SPINLOCK(pmu_backlight_lock);
20   -static int sleeping;
  20 +static int sleeping, uses_pmu_bl;
21 21 static u8 bl_curve[FB_BACKLIGHT_LEVELS];
22 22  
23 23 static void pmu_backlight_init_curve(u8 off, u8 min, u8 max)
... ... @@ -128,7 +128,7 @@
128 128  
129 129 spin_lock_irqsave(&pmu_backlight_lock, flags);
130 130 sleeping = sleep;
131   - if (pmac_backlight) {
  131 + if (pmac_backlight && uses_pmu_bl) {
132 132 if (sleep) {
133 133 struct adb_request req;
134 134  
... ... @@ -166,6 +166,7 @@
166 166 printk(KERN_ERR "PMU Backlight registration failed\n");
167 167 return;
168 168 }
  169 + uses_pmu_bl = 1;
169 170 bd->props.max_brightness = FB_BACKLIGHT_LEVELS - 1;
170 171 pmu_backlight_init_curve(0x7F, 0x46, 0x0E);
171 172