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>
This commit is contained in:
parent
bccfd58842
commit
a000503471
2 changed files with 20 additions and 17 deletions
|
@ -576,7 +576,7 @@ void __init pmac_pic_init(void)
|
||||||
#endif /* CONFIG_PPC32 */
|
#endif /* CONFIG_PPC32 */
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
#if defined(CONFIG_PM) && defined(CONFIG_PPC32)
|
||||||
/*
|
/*
|
||||||
* These procedures are used in implementing sleep on the powerbooks.
|
* These procedures are used in implementing sleep on the powerbooks.
|
||||||
* sleep_save_intrs() saves the states of all interrupt enables
|
* sleep_save_intrs() saves the states of all interrupt enables
|
||||||
|
@ -643,7 +643,7 @@ static int pmacpic_resume(struct sys_device *sysdev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_PM */
|
#endif /* CONFIG_PM && CONFIG_PPC32 */
|
||||||
|
|
||||||
static struct sysdev_class pmacpic_sysclass = {
|
static struct sysdev_class pmacpic_sysclass = {
|
||||||
set_kset_name("pmac_pic"),
|
set_kset_name("pmac_pic"),
|
||||||
|
@ -655,10 +655,10 @@ static struct sys_device device_pmacpic = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct sysdev_driver driver_pmacpic = {
|
static struct sysdev_driver driver_pmacpic = {
|
||||||
#ifdef CONFIG_PM
|
#if defined(CONFIG_PM) && defined(CONFIG_PPC32)
|
||||||
.suspend = &pmacpic_suspend,
|
.suspend = &pmacpic_suspend,
|
||||||
.resume = &pmacpic_resume,
|
.resume = &pmacpic_resume,
|
||||||
#endif /* CONFIG_PM */
|
#endif /* CONFIG_PM && CONFIG_PPC32 */
|
||||||
};
|
};
|
||||||
|
|
||||||
static int __init init_pmacpic_sysfs(void)
|
static int __init init_pmacpic_sysfs(void)
|
||||||
|
|
|
@ -155,10 +155,10 @@ static spinlock_t pmu_lock;
|
||||||
static u8 pmu_intr_mask;
|
static u8 pmu_intr_mask;
|
||||||
static int pmu_version;
|
static int pmu_version;
|
||||||
static int drop_interrupts;
|
static int drop_interrupts;
|
||||||
#ifdef CONFIG_PM
|
#if defined(CONFIG_PM) && defined(CONFIG_PPC32)
|
||||||
static int option_lid_wakeup = 1;
|
static int option_lid_wakeup = 1;
|
||||||
static int sleep_in_progress;
|
static int sleep_in_progress;
|
||||||
#endif /* CONFIG_PM */
|
#endif /* CONFIG_PM && CONFIG_PPC32 */
|
||||||
static unsigned long async_req_locks;
|
static unsigned long async_req_locks;
|
||||||
static unsigned int pmu_irq_stats[11];
|
static unsigned int pmu_irq_stats[11];
|
||||||
|
|
||||||
|
@ -865,7 +865,7 @@ proc_read_options(char *page, char **start, off_t off,
|
||||||
{
|
{
|
||||||
char *p = page;
|
char *p = page;
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
#if defined(CONFIG_PM) && defined(CONFIG_PPC32)
|
||||||
if (pmu_kind == PMU_KEYLARGO_BASED &&
|
if (pmu_kind == PMU_KEYLARGO_BASED &&
|
||||||
pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,0,-1) >= 0)
|
pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,0,-1) >= 0)
|
||||||
p += sprintf(p, "lid_wakeup=%d\n", option_lid_wakeup);
|
p += sprintf(p, "lid_wakeup=%d\n", option_lid_wakeup);
|
||||||
|
@ -906,7 +906,7 @@ proc_write_options(struct file *file, const char __user *buffer,
|
||||||
*(val++) = 0;
|
*(val++) = 0;
|
||||||
while(*val == ' ')
|
while(*val == ' ')
|
||||||
val++;
|
val++;
|
||||||
#ifdef CONFIG_PM
|
#if defined(CONFIG_PM) && defined(CONFIG_PPC32)
|
||||||
if (pmu_kind == PMU_KEYLARGO_BASED &&
|
if (pmu_kind == PMU_KEYLARGO_BASED &&
|
||||||
pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,0,-1) >= 0)
|
pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,0,-1) >= 0)
|
||||||
if (!strcmp(label, "lid_wakeup"))
|
if (!strcmp(label, "lid_wakeup"))
|
||||||
|
@ -2063,6 +2063,9 @@ pmu_unregister_sleep_notifier(struct pmu_sleep_notifier* n)
|
||||||
n->list.next = NULL;
|
n->list.next = NULL;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif /* CONFIG_PM */
|
||||||
|
|
||||||
|
#if defined(CONFIG_PM) && defined(CONFIG_PPC32)
|
||||||
|
|
||||||
/* Sleep is broadcast last-to-first */
|
/* Sleep is broadcast last-to-first */
|
||||||
static int
|
static int
|
||||||
|
@ -2687,7 +2690,7 @@ powerbook_sleep_3400(void)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_PM */
|
#endif /* CONFIG_PM && CONFIG_PPC32 */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Support for /dev/pmu device
|
* Support for /dev/pmu device
|
||||||
|
@ -2871,7 +2874,7 @@ pmu_ioctl(struct inode * inode, struct file *filp,
|
||||||
int error = -EINVAL;
|
int error = -EINVAL;
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
#ifdef CONFIG_PM
|
#if defined(CONFIG_PM) && defined(CONFIG_PPC32)
|
||||||
case PMU_IOC_SLEEP:
|
case PMU_IOC_SLEEP:
|
||||||
if (!capable(CAP_SYS_ADMIN))
|
if (!capable(CAP_SYS_ADMIN))
|
||||||
return -EACCES;
|
return -EACCES;
|
||||||
|
@ -2899,7 +2902,7 @@ pmu_ioctl(struct inode * inode, struct file *filp,
|
||||||
return put_user(0, argp);
|
return put_user(0, argp);
|
||||||
else
|
else
|
||||||
return put_user(1, argp);
|
return put_user(1, argp);
|
||||||
#endif /* CONFIG_PM */
|
#endif /* CONFIG_PM && CONFIG_PPC32 */
|
||||||
|
|
||||||
#ifdef CONFIG_PMAC_BACKLIGHT
|
#ifdef CONFIG_PMAC_BACKLIGHT
|
||||||
/* Backlight should have its own device or go via
|
/* Backlight should have its own device or go via
|
||||||
|
@ -3047,7 +3050,7 @@ pmu_polled_request(struct adb_request *req)
|
||||||
* to do suspend-to-disk.
|
* to do suspend-to-disk.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
#if defined(CONFIG_PM) && defined(CONFIG_PPC32)
|
||||||
|
|
||||||
static int pmu_sys_suspended = 0;
|
static int pmu_sys_suspended = 0;
|
||||||
|
|
||||||
|
@ -3082,7 +3085,7 @@ static int pmu_sys_resume(struct sys_device *sysdev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_PM */
|
#endif /* CONFIG_PM && CONFIG_PPC32 */
|
||||||
|
|
||||||
static struct sysdev_class pmu_sysclass = {
|
static struct sysdev_class pmu_sysclass = {
|
||||||
set_kset_name("pmu"),
|
set_kset_name("pmu"),
|
||||||
|
@ -3094,10 +3097,10 @@ static struct sys_device device_pmu = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct sysdev_driver driver_pmu = {
|
static struct sysdev_driver driver_pmu = {
|
||||||
#ifdef CONFIG_PM
|
#if defined(CONFIG_PM) && defined(CONFIG_PPC32)
|
||||||
.suspend = &pmu_sys_suspend,
|
.suspend = &pmu_sys_suspend,
|
||||||
.resume = &pmu_sys_resume,
|
.resume = &pmu_sys_resume,
|
||||||
#endif /* CONFIG_PM */
|
#endif /* CONFIG_PM && CONFIG_PPC32 */
|
||||||
};
|
};
|
||||||
|
|
||||||
static int __init init_pmu_sysfs(void)
|
static int __init init_pmu_sysfs(void)
|
||||||
|
@ -3135,12 +3138,12 @@ EXPORT_SYMBOL(pmu_i2c_combined_read);
|
||||||
EXPORT_SYMBOL(pmu_i2c_stdsub_write);
|
EXPORT_SYMBOL(pmu_i2c_stdsub_write);
|
||||||
EXPORT_SYMBOL(pmu_i2c_simple_read);
|
EXPORT_SYMBOL(pmu_i2c_simple_read);
|
||||||
EXPORT_SYMBOL(pmu_i2c_simple_write);
|
EXPORT_SYMBOL(pmu_i2c_simple_write);
|
||||||
#ifdef CONFIG_PM
|
#if defined(CONFIG_PM) && defined(CONFIG_PPC32)
|
||||||
EXPORT_SYMBOL(pmu_register_sleep_notifier);
|
EXPORT_SYMBOL(pmu_register_sleep_notifier);
|
||||||
EXPORT_SYMBOL(pmu_unregister_sleep_notifier);
|
EXPORT_SYMBOL(pmu_unregister_sleep_notifier);
|
||||||
EXPORT_SYMBOL(pmu_enable_irled);
|
EXPORT_SYMBOL(pmu_enable_irled);
|
||||||
EXPORT_SYMBOL(pmu_battery_count);
|
EXPORT_SYMBOL(pmu_battery_count);
|
||||||
EXPORT_SYMBOL(pmu_batteries);
|
EXPORT_SYMBOL(pmu_batteries);
|
||||||
EXPORT_SYMBOL(pmu_power_flags);
|
EXPORT_SYMBOL(pmu_power_flags);
|
||||||
#endif /* CONFIG_PM */
|
#endif /* CONFIG_PM && CONFIG_PPC32 */
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue