diff options
Diffstat (limited to 'drivers/macintosh')
-rw-r--r-- | drivers/macintosh/via-pmu.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c index 91920a1140fa..9bc6cc6e3845 100644 --- a/drivers/macintosh/via-pmu.c +++ b/drivers/macintosh/via-pmu.c | |||
@@ -155,10 +155,10 @@ static spinlock_t pmu_lock; | |||
155 | static u8 pmu_intr_mask; | 155 | static u8 pmu_intr_mask; |
156 | static int pmu_version; | 156 | static int pmu_version; |
157 | static int drop_interrupts; | 157 | static int drop_interrupts; |
158 | #ifdef CONFIG_PM | 158 | #if defined(CONFIG_PM) && defined(CONFIG_PPC32) |
159 | static int option_lid_wakeup = 1; | 159 | static int option_lid_wakeup = 1; |
160 | static int sleep_in_progress; | 160 | static int sleep_in_progress; |
161 | #endif /* CONFIG_PM */ | 161 | #endif /* CONFIG_PM && CONFIG_PPC32 */ |
162 | static unsigned long async_req_locks; | 162 | static unsigned long async_req_locks; |
163 | static unsigned int pmu_irq_stats[11]; | 163 | static unsigned int pmu_irq_stats[11]; |
164 | 164 | ||
@@ -865,7 +865,7 @@ proc_read_options(char *page, char **start, off_t off, | |||
865 | { | 865 | { |
866 | char *p = page; | 866 | char *p = page; |
867 | 867 | ||
868 | #ifdef CONFIG_PM | 868 | #if defined(CONFIG_PM) && defined(CONFIG_PPC32) |
869 | if (pmu_kind == PMU_KEYLARGO_BASED && | 869 | if (pmu_kind == PMU_KEYLARGO_BASED && |
870 | pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,0,-1) >= 0) | 870 | pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,0,-1) >= 0) |
871 | p += sprintf(p, "lid_wakeup=%d\n", option_lid_wakeup); | 871 | p += sprintf(p, "lid_wakeup=%d\n", option_lid_wakeup); |
@@ -906,7 +906,7 @@ proc_write_options(struct file *file, const char __user *buffer, | |||
906 | *(val++) = 0; | 906 | *(val++) = 0; |
907 | while(*val == ' ') | 907 | while(*val == ' ') |
908 | val++; | 908 | val++; |
909 | #ifdef CONFIG_PM | 909 | #if defined(CONFIG_PM) && defined(CONFIG_PPC32) |
910 | if (pmu_kind == PMU_KEYLARGO_BASED && | 910 | if (pmu_kind == PMU_KEYLARGO_BASED && |
911 | pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,0,-1) >= 0) | 911 | pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,0,-1) >= 0) |
912 | if (!strcmp(label, "lid_wakeup")) | 912 | if (!strcmp(label, "lid_wakeup")) |
@@ -2063,6 +2063,9 @@ pmu_unregister_sleep_notifier(struct pmu_sleep_notifier* n) | |||
2063 | n->list.next = NULL; | 2063 | n->list.next = NULL; |
2064 | return 0; | 2064 | return 0; |
2065 | } | 2065 | } |
2066 | #endif /* CONFIG_PM */ | ||
2067 | |||
2068 | #if defined(CONFIG_PM) && defined(CONFIG_PPC32) | ||
2066 | 2069 | ||
2067 | /* Sleep is broadcast last-to-first */ | 2070 | /* Sleep is broadcast last-to-first */ |
2068 | static int | 2071 | static int |
@@ -2687,7 +2690,7 @@ powerbook_sleep_3400(void) | |||
2687 | return 0; | 2690 | return 0; |
2688 | } | 2691 | } |
2689 | 2692 | ||
2690 | #endif /* CONFIG_PM */ | 2693 | #endif /* CONFIG_PM && CONFIG_PPC32 */ |
2691 | 2694 | ||
2692 | /* | 2695 | /* |
2693 | * Support for /dev/pmu device | 2696 | * Support for /dev/pmu device |
@@ -2871,7 +2874,7 @@ pmu_ioctl(struct inode * inode, struct file *filp, | |||
2871 | int error = -EINVAL; | 2874 | int error = -EINVAL; |
2872 | 2875 | ||
2873 | switch (cmd) { | 2876 | switch (cmd) { |
2874 | #ifdef CONFIG_PM | 2877 | #if defined(CONFIG_PM) && defined(CONFIG_PPC32) |
2875 | case PMU_IOC_SLEEP: | 2878 | case PMU_IOC_SLEEP: |
2876 | if (!capable(CAP_SYS_ADMIN)) | 2879 | if (!capable(CAP_SYS_ADMIN)) |
2877 | return -EACCES; | 2880 | return -EACCES; |
@@ -2899,7 +2902,7 @@ pmu_ioctl(struct inode * inode, struct file *filp, | |||
2899 | return put_user(0, argp); | 2902 | return put_user(0, argp); |
2900 | else | 2903 | else |
2901 | return put_user(1, argp); | 2904 | return put_user(1, argp); |
2902 | #endif /* CONFIG_PM */ | 2905 | #endif /* CONFIG_PM && CONFIG_PPC32 */ |
2903 | 2906 | ||
2904 | #ifdef CONFIG_PMAC_BACKLIGHT | 2907 | #ifdef CONFIG_PMAC_BACKLIGHT |
2905 | /* Backlight should have its own device or go via | 2908 | /* Backlight should have its own device or go via |
@@ -3047,7 +3050,7 @@ pmu_polled_request(struct adb_request *req) | |||
3047 | * to do suspend-to-disk. | 3050 | * to do suspend-to-disk. |
3048 | */ | 3051 | */ |
3049 | 3052 | ||
3050 | #ifdef CONFIG_PM | 3053 | #if defined(CONFIG_PM) && defined(CONFIG_PPC32) |
3051 | 3054 | ||
3052 | static int pmu_sys_suspended = 0; | 3055 | static int pmu_sys_suspended = 0; |
3053 | 3056 | ||
@@ -3082,7 +3085,7 @@ static int pmu_sys_resume(struct sys_device *sysdev) | |||
3082 | return 0; | 3085 | return 0; |
3083 | } | 3086 | } |
3084 | 3087 | ||
3085 | #endif /* CONFIG_PM */ | 3088 | #endif /* CONFIG_PM && CONFIG_PPC32 */ |
3086 | 3089 | ||
3087 | static struct sysdev_class pmu_sysclass = { | 3090 | static struct sysdev_class pmu_sysclass = { |
3088 | set_kset_name("pmu"), | 3091 | set_kset_name("pmu"), |
@@ -3094,10 +3097,10 @@ static struct sys_device device_pmu = { | |||
3094 | }; | 3097 | }; |
3095 | 3098 | ||
3096 | static struct sysdev_driver driver_pmu = { | 3099 | static struct sysdev_driver driver_pmu = { |
3097 | #ifdef CONFIG_PM | 3100 | #if defined(CONFIG_PM) && defined(CONFIG_PPC32) |
3098 | .suspend = &pmu_sys_suspend, | 3101 | .suspend = &pmu_sys_suspend, |
3099 | .resume = &pmu_sys_resume, | 3102 | .resume = &pmu_sys_resume, |
3100 | #endif /* CONFIG_PM */ | 3103 | #endif /* CONFIG_PM && CONFIG_PPC32 */ |
3101 | }; | 3104 | }; |
3102 | 3105 | ||
3103 | static int __init init_pmu_sysfs(void) | 3106 | static int __init init_pmu_sysfs(void) |
@@ -3135,12 +3138,12 @@ EXPORT_SYMBOL(pmu_i2c_combined_read); | |||
3135 | EXPORT_SYMBOL(pmu_i2c_stdsub_write); | 3138 | EXPORT_SYMBOL(pmu_i2c_stdsub_write); |
3136 | EXPORT_SYMBOL(pmu_i2c_simple_read); | 3139 | EXPORT_SYMBOL(pmu_i2c_simple_read); |
3137 | EXPORT_SYMBOL(pmu_i2c_simple_write); | 3140 | EXPORT_SYMBOL(pmu_i2c_simple_write); |
3138 | #ifdef CONFIG_PM | 3141 | #if defined(CONFIG_PM) && defined(CONFIG_PPC32) |
3139 | EXPORT_SYMBOL(pmu_register_sleep_notifier); | 3142 | EXPORT_SYMBOL(pmu_register_sleep_notifier); |
3140 | EXPORT_SYMBOL(pmu_unregister_sleep_notifier); | 3143 | EXPORT_SYMBOL(pmu_unregister_sleep_notifier); |
3141 | EXPORT_SYMBOL(pmu_enable_irled); | 3144 | EXPORT_SYMBOL(pmu_enable_irled); |
3142 | EXPORT_SYMBOL(pmu_battery_count); | 3145 | EXPORT_SYMBOL(pmu_battery_count); |
3143 | EXPORT_SYMBOL(pmu_batteries); | 3146 | EXPORT_SYMBOL(pmu_batteries); |
3144 | EXPORT_SYMBOL(pmu_power_flags); | 3147 | EXPORT_SYMBOL(pmu_power_flags); |
3145 | #endif /* CONFIG_PM */ | 3148 | #endif /* CONFIG_PM && CONFIG_PPC32 */ |
3146 | 3149 | ||