diff options
author | Len Brown <len.brown@intel.com> | 2010-10-26 14:51:00 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2010-10-26 14:51:00 -0400 |
commit | 7e31842441776b4d6ec7fd916c91663ad05b7814 (patch) | |
tree | 8d97d41b4f6861dcbc0dc3ac96fab7afddbed731 /drivers | |
parent | 1bd64d42abdd4f9d44f77011a31f0292112f4c3b (diff) | |
parent | b1d248d96c71665c79befb81207f38f894c7c082 (diff) | |
download | linux-3.10-7e31842441776b4d6ec7fd916c91663ad05b7814.tar.gz linux-3.10-7e31842441776b4d6ec7fd916c91663ad05b7814.tar.bz2 linux-3.10-7e31842441776b4d6ec7fd916c91663ad05b7814.zip |
Merge branch 'misc' into release
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/acpi/Kconfig | 2 | ||||
-rw-r--r-- | drivers/acpi/bus.c | 7 | ||||
-rw-r--r-- | drivers/acpi/dock.c | 6 | ||||
-rw-r--r-- | drivers/acpi/osl.c | 25 | ||||
-rw-r--r-- | drivers/acpi/processor_driver.c | 2 | ||||
-rw-r--r-- | drivers/acpi/processor_thermal.c | 178 | ||||
-rw-r--r-- | drivers/acpi/sleep.c | 12 | ||||
-rw-r--r-- | drivers/acpi/sleep.h | 1 |
8 files changed, 20 insertions, 213 deletions
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index 0f9de2b44c0..3f3489c5ca8 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig @@ -9,7 +9,6 @@ menuconfig ACPI depends on PCI depends on PM select PNP - select CPU_IDLE default y help Advanced Configuration and Power Interface (ACPI) support for @@ -200,6 +199,7 @@ config ACPI_DOCK config ACPI_PROCESSOR tristate "Processor" select THERMAL + select CPU_IDLE default y help This driver installs ACPI as the idle handler for Linux and uses diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 310e3b9749c..d68bd61072b 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -935,6 +935,12 @@ static int __init acpi_bus_init(void) goto error1; } + /* + * _PDC control method may load dynamic SSDT tables, + * and we need to install the table handler before that. + */ + acpi_sysfs_init(); + acpi_early_processor_set_pdc(); /* @@ -1026,7 +1032,6 @@ static int __init acpi_init(void) acpi_scan_init(); acpi_ec_init(); acpi_power_init(); - acpi_sysfs_init(); acpi_debugfs_init(); acpi_sleep_proc_init(); acpi_wakeup_device_init(); diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c index 44f99bd8374..81514a4918c 100644 --- a/drivers/acpi/dock.c +++ b/drivers/acpi/dock.c @@ -930,7 +930,7 @@ static struct attribute_group dock_attribute_group = { * allocated and initialize a new dock station device. Find all devices * that are on the dock station, and register for dock event notifications. */ -static int dock_add(acpi_handle handle) +static int __init dock_add(acpi_handle handle) { int ret, id; struct dock_station ds, *dock_station; @@ -1024,7 +1024,7 @@ static int dock_remove(struct dock_station *ds) * * This is called by acpi_walk_namespace to look for dock stations. */ -static acpi_status +static __init acpi_status find_dock(acpi_handle handle, u32 lvl, void *context, void **rv) { if (is_dock(handle)) @@ -1033,7 +1033,7 @@ find_dock(acpi_handle handle, u32 lvl, void *context, void **rv) return AE_OK; } -static acpi_status +static __init acpi_status find_bay(acpi_handle handle, u32 lvl, void *context, void **rv) { /* If bay is a dock, it's already handled */ diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 0c2e445410a..966feddf6b1 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c @@ -875,16 +875,6 @@ void acpi_os_wait_events_complete(void *context) EXPORT_SYMBOL(acpi_os_wait_events_complete); /* - * Allocate the memory for a spinlock and initialize it. - */ -acpi_status acpi_os_create_lock(acpi_spinlock * handle) -{ - spin_lock_init(*handle); - - return AE_OK; -} - -/* * Deallocate the memory for a spinlock. */ void acpi_os_delete_lock(acpi_spinlock handle) @@ -1265,21 +1255,6 @@ int acpi_check_region(resource_size_t start, resource_size_t n, } EXPORT_SYMBOL(acpi_check_region); -int acpi_check_mem_region(resource_size_t start, resource_size_t n, - const char *name) -{ - struct resource res = { - .start = start, - .end = start + n - 1, - .name = name, - .flags = IORESOURCE_MEM, - }; - - return acpi_check_resource_conflict(&res); - -} -EXPORT_SYMBOL(acpi_check_mem_region); - /* * Let drivers know whether the resource checks are effective */ diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c index 356c320bdd0..85e48047d7b 100644 --- a/drivers/acpi/processor_driver.c +++ b/drivers/acpi/processor_driver.c @@ -917,6 +917,4 @@ static void __exit acpi_processor_exit(void) module_init(acpi_processor_init); module_exit(acpi_processor_exit); -EXPORT_SYMBOL(acpi_processor_set_thermal_limit); - MODULE_ALIAS("processor"); diff --git a/drivers/acpi/processor_thermal.c b/drivers/acpi/processor_thermal.c index 953b25fb986..fde49b9b1d9 100644 --- a/drivers/acpi/processor_thermal.c +++ b/drivers/acpi/processor_thermal.c @@ -44,47 +44,6 @@ #define _COMPONENT ACPI_PROCESSOR_COMPONENT ACPI_MODULE_NAME("processor_thermal"); -/* -------------------------------------------------------------------------- - Limit Interface - -------------------------------------------------------------------------- */ -static int acpi_processor_apply_limit(struct acpi_processor *pr) -{ - int result = 0; - u16 px = 0; - u16 tx = 0; - - - if (!pr) - return -EINVAL; - - if (!pr->flags.limit) - return -ENODEV; - - if (pr->flags.throttling) { - if (pr->limit.user.tx > tx) - tx = pr->limit.user.tx; - if (pr->limit.thermal.tx > tx) - tx = pr->limit.thermal.tx; - - result = acpi_processor_set_throttling(pr, tx, false); - if (result) - goto end; - } - - pr->limit.state.px = px; - pr->limit.state.tx = tx; - - ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "Processor [%d] limit set to (P%d:T%d)\n", pr->id, - pr->limit.state.px, pr->limit.state.tx)); - - end: - if (result) - printk(KERN_ERR PREFIX "Unable to set limit\n"); - - return result; -} - #ifdef CONFIG_CPU_FREQ /* If a passive cooling situation is detected, primarily CPUfreq is used, as it @@ -107,36 +66,6 @@ static int cpu_has_cpufreq(unsigned int cpu) return 1; } -static int acpi_thermal_cpufreq_increase(unsigned int cpu) -{ - if (!cpu_has_cpufreq(cpu)) - return -ENODEV; - - if (per_cpu(cpufreq_thermal_reduction_pctg, cpu) < - CPUFREQ_THERMAL_MAX_STEP) { - per_cpu(cpufreq_thermal_reduction_pctg, cpu)++; - cpufreq_update_policy(cpu); - return 0; - } - - return -ERANGE; -} - -static int acpi_thermal_cpufreq_decrease(unsigned int cpu) -{ - if (!cpu_has_cpufreq(cpu)) - return -ENODEV; - - if (per_cpu(cpufreq_thermal_reduction_pctg, cpu) > - (CPUFREQ_THERMAL_MIN_STEP + 1)) - per_cpu(cpufreq_thermal_reduction_pctg, cpu)--; - else - per_cpu(cpufreq_thermal_reduction_pctg, cpu) = 0; - cpufreq_update_policy(cpu); - /* We reached max freq again and can leave passive mode */ - return !per_cpu(cpufreq_thermal_reduction_pctg, cpu); -} - static int acpi_thermal_cpufreq_notifier(struct notifier_block *nb, unsigned long event, void *data) { @@ -238,113 +167,6 @@ static int acpi_thermal_cpufreq_decrease(unsigned int cpu) #endif -int acpi_processor_set_thermal_limit(acpi_handle handle, int type) -{ - int result = 0; - struct acpi_processor *pr = NULL; - struct acpi_device *device = NULL; - int tx = 0, max_tx_px = 0; - - - if ((type < ACPI_PROCESSOR_LIMIT_NONE) - || (type > ACPI_PROCESSOR_LIMIT_DECREMENT)) - return -EINVAL; - - result = acpi_bus_get_device(handle, &device); - if (result) - return result; - - pr = acpi_driver_data(device); - if (!pr) - return -ENODEV; - - /* Thermal limits are always relative to the current Px/Tx state. */ - if (pr->flags.throttling) - pr->limit.thermal.tx = pr->throttling.state; - - /* - * Our default policy is to only use throttling at the lowest - * performance state. - */ - - tx = pr->limit.thermal.tx; - - switch (type) { - - case ACPI_PROCESSOR_LIMIT_NONE: - do { - result = acpi_thermal_cpufreq_decrease(pr->id); - } while (!result); - tx = 0; - break; - - case ACPI_PROCESSOR_LIMIT_INCREMENT: - /* if going up: P-states first, T-states later */ - - result = acpi_thermal_cpufreq_increase(pr->id); - if (!result) - goto end; - else if (result == -ERANGE) - ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "At maximum performance state\n")); - - if (pr->flags.throttling) { - if (tx == (pr->throttling.state_count - 1)) - ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "At maximum throttling state\n")); - else - tx++; - } - break; - - case ACPI_PROCESSOR_LIMIT_DECREMENT: - /* if going down: T-states first, P-states later */ - - if (pr->flags.throttling) { - if (tx == 0) { - max_tx_px = 1; - ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "At minimum throttling state\n")); - } else { - tx--; - goto end; - } - } - - result = acpi_thermal_cpufreq_decrease(pr->id); - if (result) { - /* - * We only could get -ERANGE, 1 or 0. - * In the first two cases we reached max freq again. - */ - ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "At minimum performance state\n")); - max_tx_px = 1; - } else - max_tx_px = 0; - - break; - } - - end: - if (pr->flags.throttling) { - pr->limit.thermal.px = 0; - pr->limit.thermal.tx = tx; - - result = acpi_processor_apply_limit(pr); - if (result) - printk(KERN_ERR PREFIX "Unable to set thermal limit\n"); - - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Thermal limit now (P%d:T%d)\n", - pr->limit.thermal.px, pr->limit.thermal.tx)); - } else - result = 0; - if (max_tx_px) - return 1; - else - return result; -} - int acpi_processor_get_limit_info(struct acpi_processor *pr) { diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index e807f4196f8..721d93b3cee 100644 --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c @@ -25,7 +25,7 @@ #include "internal.h" #include "sleep.h" -u8 sleep_states[ACPI_S_STATE_COUNT]; +static u8 sleep_states[ACPI_S_STATE_COUNT]; static u32 acpi_target_sleep_state = ACPI_STATE_S0; @@ -419,6 +419,14 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "Everex StepNote Series"), }, }, + { + .callback = init_nvs_nosave, + .ident = "Sony Vaio VPCEB1Z1E", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), + DMI_MATCH(DMI_PRODUCT_NAME, "VPCEB1Z1E"), + }, + }, {}, }; #endif /* CONFIG_SUSPEND */ @@ -706,7 +714,7 @@ static void acpi_power_off(void) * paths through the BIOS, so disable _GTS and _BFS by default, * but do speak up and offer the option to enable them. */ -void __init acpi_gts_bfs_check(void) +static void __init acpi_gts_bfs_check(void) { acpi_handle dummy; diff --git a/drivers/acpi/sleep.h b/drivers/acpi/sleep.h index d8821805c3b..74d59c8f467 100644 --- a/drivers/acpi/sleep.h +++ b/drivers/acpi/sleep.h @@ -1,5 +1,4 @@ -extern u8 sleep_states[]; extern int acpi_suspend(u32 state); extern void acpi_enable_wakeup_devices(u8 sleep_state); |