Skip to content

Commit

Permalink
[POWERPC] Fix sleep on some powerbooks
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Paul Mackerras <[email protected]>
  • Loading branch information
ozbenh authored and paulusmack committed Mar 12, 2008
1 parent 7f17289 commit fa19d63
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/macintosh/via-pmu-backlight.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

static struct backlight_ops pmu_backlight_data;
static DEFINE_SPINLOCK(pmu_backlight_lock);
static int sleeping;
static int sleeping, uses_pmu_bl;
static u8 bl_curve[FB_BACKLIGHT_LEVELS];

static void pmu_backlight_init_curve(u8 off, u8 min, u8 max)
Expand Down Expand Up @@ -128,7 +128,7 @@ void pmu_backlight_set_sleep(int sleep)

spin_lock_irqsave(&pmu_backlight_lock, flags);
sleeping = sleep;
if (pmac_backlight) {
if (pmac_backlight && uses_pmu_bl) {
if (sleep) {
struct adb_request req;

Expand Down Expand Up @@ -166,6 +166,7 @@ void __init pmu_backlight_init()
printk(KERN_ERR "PMU Backlight registration failed\n");
return;
}
uses_pmu_bl = 1;
bd->props.max_brightness = FB_BACKLIGHT_LEVELS - 1;
pmu_backlight_init_curve(0x7F, 0x46, 0x0E);

Expand Down

0 comments on commit fa19d63

Please sign in to comment.