aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2005-11-01 23:08:17 -0500
committerPaul Mackerras <paulus@samba.org>2005-11-01 23:08:17 -0500
commita0005034713c1c2bb5ffe9d1cab829e817fddb73 (patch)
treeb359c2e5ce432255ededd4a21f3f2fd5ce5b137a
parentbccfd588423bb610fb1fde987da3ad23af1c46d7 (diff)
powerpc: exclude powerbook sleep code with CONFIG_PPC64 and CONFIG_PM
We were getting powerbook sleep code included, and giving compile errors, with CONFIG_PM=y on a 64-bit build. This excludes that code so the kernel will compile. One day BenH will implement on sleep on the G5... Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r--arch/powerpc/platforms/powermac/pic.c8
-rw-r--r--drivers/macintosh/via-pmu.c29
2 files changed, 20 insertions, 17 deletions
diff --git a/arch/powerpc/platforms/powermac/pic.c b/arch/powerpc/platforms/powermac/pic.c
index 0037a8c8c81f..83a49e80ac29 100644
--- a/arch/powerpc/platforms/powermac/pic.c
+++ b/arch/powerpc/platforms/powermac/pic.c
@@ -576,7 +576,7 @@ void __init pmac_pic_init(void)
576#endif /* CONFIG_PPC32 */ 576#endif /* CONFIG_PPC32 */
577} 577}
578 578
579#ifdef CONFIG_PM 579#if defined(CONFIG_PM) && defined(CONFIG_PPC32)
580/* 580/*
581 * These procedures are used in implementing sleep on the powerbooks. 581 * These procedures are used in implementing sleep on the powerbooks.
582 * sleep_save_intrs() saves the states of all interrupt enables 582 * sleep_save_intrs() saves the states of all interrupt enables
@@ -643,7 +643,7 @@ static int pmacpic_resume(struct sys_device *sysdev)
643 return 0; 643 return 0;
644} 644}
645 645
646#endif /* CONFIG_PM */ 646#endif /* CONFIG_PM && CONFIG_PPC32 */
647 647
648static struct sysdev_class pmacpic_sysclass = { 648static struct sysdev_class pmacpic_sysclass = {
649 set_kset_name("pmac_pic"), 649 set_kset_name("pmac_pic"),
@@ -655,10 +655,10 @@ static struct sys_device device_pmacpic = {
655}; 655};
656 656
657static struct sysdev_driver driver_pmacpic = { 657static struct sysdev_driver driver_pmacpic = {
658#ifdef CONFIG_PM 658#if defined(CONFIG_PM) && defined(CONFIG_PPC32)
659 .suspend = &pmacpic_suspend, 659 .suspend = &pmacpic_suspend,
660 .resume = &pmacpic_resume, 660 .resume = &pmacpic_resume,
661#endif /* CONFIG_PM */ 661#endif /* CONFIG_PM && CONFIG_PPC32 */
662}; 662};
663 663
664static int __init init_pmacpic_sysfs(void) 664static int __init init_pmacpic_sysfs(void)
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;
155static u8 pmu_intr_mask; 155static u8 pmu_intr_mask;
156static int pmu_version; 156static int pmu_version;
157static int drop_interrupts; 157static int drop_interrupts;
158#ifdef CONFIG_PM 158#if defined(CONFIG_PM) && defined(CONFIG_PPC32)
159static int option_lid_wakeup = 1; 159static int option_lid_wakeup = 1;
160static int sleep_in_progress; 160static int sleep_in_progress;
161#endif /* CONFIG_PM */ 161#endif /* CONFIG_PM && CONFIG_PPC32 */
162static unsigned long async_req_locks; 162static unsigned long async_req_locks;
163static unsigned int pmu_irq_stats[11]; 163static 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 */
2068static int 2071static 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
3052static int pmu_sys_suspended = 0; 3055static 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
3087static struct sysdev_class pmu_sysclass = { 3090static 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
3096static struct sysdev_driver driver_pmu = { 3099static 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
3103static int __init init_pmu_sysfs(void) 3106static int __init init_pmu_sysfs(void)
@@ -3135,12 +3138,12 @@ EXPORT_SYMBOL(pmu_i2c_combined_read);
3135EXPORT_SYMBOL(pmu_i2c_stdsub_write); 3138EXPORT_SYMBOL(pmu_i2c_stdsub_write);
3136EXPORT_SYMBOL(pmu_i2c_simple_read); 3139EXPORT_SYMBOL(pmu_i2c_simple_read);
3137EXPORT_SYMBOL(pmu_i2c_simple_write); 3140EXPORT_SYMBOL(pmu_i2c_simple_write);
3138#ifdef CONFIG_PM 3141#if defined(CONFIG_PM) && defined(CONFIG_PPC32)
3139EXPORT_SYMBOL(pmu_register_sleep_notifier); 3142EXPORT_SYMBOL(pmu_register_sleep_notifier);
3140EXPORT_SYMBOL(pmu_unregister_sleep_notifier); 3143EXPORT_SYMBOL(pmu_unregister_sleep_notifier);
3141EXPORT_SYMBOL(pmu_enable_irled); 3144EXPORT_SYMBOL(pmu_enable_irled);
3142EXPORT_SYMBOL(pmu_battery_count); 3145EXPORT_SYMBOL(pmu_battery_count);
3143EXPORT_SYMBOL(pmu_batteries); 3146EXPORT_SYMBOL(pmu_batteries);
3144EXPORT_SYMBOL(pmu_power_flags); 3147EXPORT_SYMBOL(pmu_power_flags);
3145#endif /* CONFIG_PM */ 3148#endif /* CONFIG_PM && CONFIG_PPC32 */
3146 3149