diff options
Diffstat (limited to 'drivers/macintosh/via-pmu.c')
-rw-r--r-- | drivers/macintosh/via-pmu.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c index ea386801e215..dda03985dcf5 100644 --- a/drivers/macintosh/via-pmu.c +++ b/drivers/macintosh/via-pmu.c | |||
@@ -280,7 +280,7 @@ static char *pbook_type[] = { | |||
280 | int __init find_via_pmu(void) | 280 | int __init find_via_pmu(void) |
281 | { | 281 | { |
282 | u64 taddr; | 282 | u64 taddr; |
283 | u32 *reg; | 283 | const u32 *reg; |
284 | 284 | ||
285 | if (via != 0) | 285 | if (via != 0) |
286 | return 1; | 286 | return 1; |
@@ -288,7 +288,7 @@ int __init find_via_pmu(void) | |||
288 | if (vias == NULL) | 288 | if (vias == NULL) |
289 | return 0; | 289 | return 0; |
290 | 290 | ||
291 | reg = (u32 *)get_property(vias, "reg", NULL); | 291 | reg = get_property(vias, "reg", NULL); |
292 | if (reg == NULL) { | 292 | if (reg == NULL) { |
293 | printk(KERN_ERR "via-pmu: No \"reg\" property !\n"); | 293 | printk(KERN_ERR "via-pmu: No \"reg\" property !\n"); |
294 | goto fail; | 294 | goto fail; |
@@ -330,7 +330,7 @@ int __init find_via_pmu(void) | |||
330 | 330 | ||
331 | gpiop = of_find_node_by_name(NULL, "gpio"); | 331 | gpiop = of_find_node_by_name(NULL, "gpio"); |
332 | if (gpiop) { | 332 | if (gpiop) { |
333 | reg = (u32 *)get_property(gpiop, "reg", NULL); | 333 | reg = get_property(gpiop, "reg", NULL); |
334 | if (reg) | 334 | if (reg) |
335 | gaddr = of_translate_address(gpiop, reg); | 335 | gaddr = of_translate_address(gpiop, reg); |
336 | if (gaddr != OF_BAD_ADDR) | 336 | if (gaddr != OF_BAD_ADDR) |
@@ -479,9 +479,9 @@ static int __init via_pmu_dev_init(void) | |||
479 | pmu_batteries[1].flags |= PMU_BATT_TYPE_SMART; | 479 | pmu_batteries[1].flags |= PMU_BATT_TYPE_SMART; |
480 | } else { | 480 | } else { |
481 | struct device_node* prim = find_devices("power-mgt"); | 481 | struct device_node* prim = find_devices("power-mgt"); |
482 | u32 *prim_info = NULL; | 482 | const u32 *prim_info = NULL; |
483 | if (prim) | 483 | if (prim) |
484 | prim_info = (u32 *)get_property(prim, "prim-info", NULL); | 484 | prim_info = get_property(prim, "prim-info", NULL); |
485 | if (prim_info) { | 485 | if (prim_info) { |
486 | /* Other stuffs here yet unknown */ | 486 | /* Other stuffs here yet unknown */ |
487 | pmu_battery_count = (prim_info[6] >> 16) & 0xff; | 487 | pmu_battery_count = (prim_info[6] >> 16) & 0xff; |
@@ -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 | ||
1998 | extern void pmu_backlight_set_sleep(int sleep); | ||
1999 | |||
1998 | static int | 2000 | static int |
1999 | pmac_suspend_devices(void) | 2001 | pmac_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 | ||