diff options
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/bus.c | 6 | ||||
-rw-r--r-- | drivers/acpi/button.c | 6 | ||||
-rw-r--r-- | drivers/acpi/osl.c | 2 | ||||
-rw-r--r-- | drivers/acpi/processor_idle.c | 14 | ||||
-rw-r--r-- | drivers/acpi/scan.c | 16 | ||||
-rw-r--r-- | drivers/acpi/sleep/main.c | 39 | ||||
-rw-r--r-- | drivers/acpi/thermal.c | 8 | ||||
-rw-r--r-- | drivers/acpi/toshiba_acpi.c | 2 | ||||
-rw-r--r-- | drivers/acpi/video.c | 4 |
9 files changed, 53 insertions, 44 deletions
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index a54234d3aac1..fb2cff9a2d24 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -194,7 +194,7 @@ int acpi_bus_set_power(acpi_handle handle, int state) if (!device->flags.power_manageable) { ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device `[%s]' is not power manageable\n", - device->dev.kobj.name)); + kobject_name(&device->dev.kobj))); return -ENODEV; } /* @@ -262,10 +262,12 @@ int acpi_bus_set_power(acpi_handle handle, int state) printk(KERN_WARNING PREFIX "Transitioning device [%s] to D%d\n", device->pnp.bus_id, state); - else + else { + device->power.state = state; ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device [%s] transitioned to D%d\n", device->pnp.bus_id, state)); + } return result; } diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c index 2e79a3395ecf..301e832e6961 100644 --- a/drivers/acpi/button.c +++ b/drivers/acpi/button.c @@ -434,18 +434,18 @@ static int acpi_button_add(struct acpi_device *device) switch (button->type) { case ACPI_BUTTON_TYPE_POWER: case ACPI_BUTTON_TYPE_POWERF: - input->evbit[0] = BIT(EV_KEY); + input->evbit[0] = BIT_MASK(EV_KEY); set_bit(KEY_POWER, input->keybit); break; case ACPI_BUTTON_TYPE_SLEEP: case ACPI_BUTTON_TYPE_SLEEPF: - input->evbit[0] = BIT(EV_KEY); + input->evbit[0] = BIT_MASK(EV_KEY); set_bit(KEY_SLEEP, input->keybit); break; case ACPI_BUTTON_TYPE_LID: - input->evbit[0] = BIT(EV_SW); + input->evbit[0] = BIT_MASK(EV_SW); set_bit(SW_LID, input->swbit); break; } diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 5d14d4f10b12..aabc6ca4a81c 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c @@ -1206,7 +1206,7 @@ acpi_os_validate_address ( } #ifdef CONFIG_DMI -static int dmi_osi_linux(struct dmi_system_id *d) +static int dmi_osi_linux(const struct dmi_system_id *d) { printk(KERN_NOTICE "%s detected: enabling _OSI(Linux)\n", d->ident); enable_osi_linux(1); diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 0cad56ca342b..f996d0e37689 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -102,7 +102,7 @@ static int acpi_processor_set_power_policy(struct acpi_processor *pr); * * To skip this limit, boot/load with a large max_cstate limit. */ -static int set_max_cstate(struct dmi_system_id *id) +static int set_max_cstate(const struct dmi_system_id *id) { if (max_cstate > ACPI_PROCESSOR_MAX_POWER) return 0; @@ -299,21 +299,12 @@ static void acpi_timer_check_state(int state, struct acpi_processor *pr, static void acpi_propagate_timer_broadcast(struct acpi_processor *pr) { -#ifdef CONFIG_GENERIC_CLOCKEVENTS unsigned long reason; reason = pr->power.timer_broadcast_on_state < INT_MAX ? CLOCK_EVT_NOTIFY_BROADCAST_ON : CLOCK_EVT_NOTIFY_BROADCAST_OFF; clockevents_notify(reason, &pr->id); -#else - cpumask_t mask = cpumask_of_cpu(pr->id); - - if (pr->power.timer_broadcast_on_state < INT_MAX) - on_each_cpu(switch_APIC_timer_to_ipi, &mask, 1, 1); - else - on_each_cpu(switch_ipi_to_APIC_timer, &mask, 1, 1); -#endif } /* Power(C) State timer broadcast control */ @@ -321,8 +312,6 @@ static void acpi_state_timer_broadcast(struct acpi_processor *pr, struct acpi_processor_cx *cx, int broadcast) { -#ifdef CONFIG_GENERIC_CLOCKEVENTS - int state = cx - pr->power.states; if (state >= pr->power.timer_broadcast_on_state) { @@ -332,7 +321,6 @@ static void acpi_state_timer_broadcast(struct acpi_processor *pr, CLOCK_EVT_NOTIFY_BROADCAST_EXIT; clockevents_notify(reason, &pr->id); } -#endif } #else diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 64620d668742..5b4d462117cf 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -319,16 +319,18 @@ static int acpi_bus_match(struct device *dev, struct device_driver *drv) return !acpi_match_device_ids(acpi_dev, acpi_drv->ids); } -static int acpi_device_uevent(struct device *dev, char **envp, int num_envp, - char *buffer, int buffer_size) +static int acpi_device_uevent(struct device *dev, struct kobj_uevent_env *env) { struct acpi_device *acpi_dev = to_acpi_device(dev); + int len; - strcpy(buffer, "MODALIAS="); - if (create_modalias(acpi_dev, buffer + 9, buffer_size - 9) > 0) { - envp[0] = buffer; - envp[1] = NULL; - } + if (add_uevent_var(env, "MODALIAS=")) + return -ENOMEM; + len = create_modalias(acpi_dev, &env->buf[env->buflen - 1], + sizeof(env->buf) - env->buflen); + if (len >= (sizeof(env->buf) - env->buflen)) + return -ENOMEM; + env->buflen += len; return 0; } diff --git a/drivers/acpi/sleep/main.c b/drivers/acpi/sleep/main.c index be616317fe53..f3d3867303ec 100644 --- a/drivers/acpi/sleep/main.c +++ b/drivers/acpi/sleep/main.c @@ -49,7 +49,7 @@ int acpi_sleep_prepare(u32 acpi_state) } #ifdef CONFIG_SUSPEND -static struct pm_ops acpi_pm_ops; +static struct platform_suspend_ops acpi_pm_ops; extern void do_suspend_lowlevel(void); @@ -84,13 +84,12 @@ static int acpi_pm_set_target(suspend_state_t pm_state) /** * acpi_pm_prepare - Do preliminary suspend work. - * @pm_state: ignored * * If necessary, set the firmware waking vector and do arch-specific * nastiness to get the wakeup code to the waking vector. */ -static int acpi_pm_prepare(suspend_state_t pm_state) +static int acpi_pm_prepare(void) { int error = acpi_sleep_prepare(acpi_target_sleep_state); @@ -159,13 +158,12 @@ static int acpi_pm_enter(suspend_state_t pm_state) /** * acpi_pm_finish - Finish up suspend sequence. - * @pm_state: ignored * * This is called after we wake back up (or if entering the sleep state * failed). */ -static int acpi_pm_finish(suspend_state_t pm_state) +static void acpi_pm_finish(void) { u32 acpi_state = acpi_target_sleep_state; @@ -183,7 +181,6 @@ static int acpi_pm_finish(suspend_state_t pm_state) init_8259A(0); } #endif - return 0; } static int acpi_pm_state_valid(suspend_state_t pm_state) @@ -202,7 +199,7 @@ static int acpi_pm_state_valid(suspend_state_t pm_state) } } -static struct pm_ops acpi_pm_ops = { +static struct platform_suspend_ops acpi_pm_ops = { .valid = acpi_pm_state_valid, .set_target = acpi_pm_set_target, .prepare = acpi_pm_prepare, @@ -214,7 +211,7 @@ static struct pm_ops acpi_pm_ops = { * Toshiba fails to preserve interrupts over S1, reinitialization * of 8259 is needed after S1 resume. */ -static int __init init_ints_after_s1(struct dmi_system_id *d) +static int __init init_ints_after_s1(const struct dmi_system_id *d) { printk(KERN_WARNING "%s with broken S1 detected.\n", d->ident); init_8259A_after_S1 = 1; @@ -232,6 +229,12 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = { #endif /* CONFIG_SUSPEND */ #ifdef CONFIG_HIBERNATION +static int acpi_hibernation_start(void) +{ + acpi_target_sleep_state = ACPI_STATE_S4; + return 0; +} + static int acpi_hibernation_prepare(void) { return acpi_sleep_prepare(ACPI_STATE_S4); @@ -253,6 +256,15 @@ static int acpi_hibernation_enter(void) return ACPI_SUCCESS(status) ? 0 : -EFAULT; } +static void acpi_hibernation_leave(void) +{ + /* + * If ACPI is not enabled by the BIOS and the boot kernel, we need to + * enable it here. + */ + acpi_enable(); +} + static void acpi_hibernation_finish(void) { /* @@ -265,6 +277,8 @@ static void acpi_hibernation_finish(void) /* reset firmware waking vector */ acpi_set_firmware_waking_vector((acpi_physical_address) 0); + + acpi_target_sleep_state = ACPI_STATE_S0; } static int acpi_hibernation_pre_restore(void) @@ -281,10 +295,13 @@ static void acpi_hibernation_restore_cleanup(void) acpi_hw_enable_all_runtime_gpes(); } -static struct hibernation_ops acpi_hibernation_ops = { +static struct platform_hibernation_ops acpi_hibernation_ops = { + .start = acpi_hibernation_start, + .pre_snapshot = acpi_hibernation_prepare, + .finish = acpi_hibernation_finish, .prepare = acpi_hibernation_prepare, .enter = acpi_hibernation_enter, - .finish = acpi_hibernation_finish, + .leave = acpi_hibernation_leave, .pre_restore = acpi_hibernation_pre_restore, .restore_cleanup = acpi_hibernation_restore_cleanup, }; @@ -421,7 +438,7 @@ int __init acpi_sleep_init(void) } } - pm_set_ops(&acpi_pm_ops); + suspend_set_ops(&acpi_pm_ops); #endif #ifdef CONFIG_HIBERNATION diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index 69ec73b0239d..5f79b4451212 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c @@ -1368,7 +1368,7 @@ static int acpi_thermal_resume(struct acpi_device *device) } #ifdef CONFIG_DMI -static int thermal_act(struct dmi_system_id *d) { +static int thermal_act(const struct dmi_system_id *d) { if (act == 0) { printk(KERN_NOTICE "ACPI: %s detected: " @@ -1377,14 +1377,14 @@ static int thermal_act(struct dmi_system_id *d) { } return 0; } -static int thermal_nocrt(struct dmi_system_id *d) { +static int thermal_nocrt(const struct dmi_system_id *d) { printk(KERN_NOTICE "ACPI: %s detected: " "disabling all critical thermal trip point actions.\n", d->ident); nocrt = 1; return 0; } -static int thermal_tzp(struct dmi_system_id *d) { +static int thermal_tzp(const struct dmi_system_id *d) { if (tzp == 0) { printk(KERN_NOTICE "ACPI: %s detected: " @@ -1393,7 +1393,7 @@ static int thermal_tzp(struct dmi_system_id *d) { } return 0; } -static int thermal_psv(struct dmi_system_id *d) { +static int thermal_psv(const struct dmi_system_id *d) { if (psv == 0) { printk(KERN_NOTICE "ACPI: %s detected: " diff --git a/drivers/acpi/toshiba_acpi.c b/drivers/acpi/toshiba_acpi.c index 13369b45563f..a736ef7bdee4 100644 --- a/drivers/acpi/toshiba_acpi.c +++ b/drivers/acpi/toshiba_acpi.c @@ -362,7 +362,7 @@ static unsigned long write_video(const char *buffer, unsigned long count) int crt_out = -1; int tv_out = -1; u32 hci_result; - int video_out; + u32 video_out; /* scan expression. Multiple expressions may be delimited with ; * diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index f31e3c8749e0..bac956b30c57 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c @@ -316,7 +316,7 @@ static int acpi_video_output_get(struct output_device *od) { unsigned long state; struct acpi_video_device *vd = - (struct acpi_video_device *)class_get_devdata(&od->class_dev); + (struct acpi_video_device *)dev_get_drvdata(&od->dev); acpi_video_device_get_state(vd, &state); return (int)state; } @@ -325,7 +325,7 @@ static int acpi_video_output_set(struct output_device *od) { unsigned long state = od->request_state; struct acpi_video_device *vd= - (struct acpi_video_device *)class_get_devdata(&od->class_dev); + (struct acpi_video_device *)dev_get_drvdata(&od->dev); return acpi_video_device_set_state(vd, state); } |