]> Pileus Git - ~andy/linux/blobdiff - drivers/macintosh/via-pmu.c
[PATCH] powerpc: More via-pmu backlight fixes
[~andy/linux] / drivers / macintosh / via-pmu.c
index ea386801e215976ae002604f070c01ba9a224d1f..14610a63f580dbb5b1ec2ec032fff3544f6ac732 100644 (file)
@@ -1995,6 +1995,8 @@ restore_via_state(void)
        out_8(&via[IER], IER_SET | SR_INT | CB1_INT);
 }
 
+extern void pmu_backlight_set_sleep(int sleep);
+
 static int
 pmac_suspend_devices(void)
 {
@@ -2032,6 +2034,11 @@ pmac_suspend_devices(void)
                return -EBUSY;
        }
 
+#ifdef CONFIG_PMAC_BACKLIGHT
+       /* Tell backlight code not to muck around with the chip anymore */
+       pmu_backlight_set_sleep(1);
+#endif
+
        /* Call platform functions marked "on sleep" */
        pmac_pfunc_i2c_suspend();
        pmac_pfunc_base_suspend();
@@ -2090,6 +2097,11 @@ pmac_wakeup_devices(void)
 {
        mdelay(100);
 
+#ifdef CONFIG_PMAC_BACKLIGHT
+       /* Tell backlight code it can use the chip again */
+       pmu_backlight_set_sleep(0);
+#endif
+
        /* Power back up system devices (including the PIC) */
        device_power_up();