Commit 82e18059 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

Merge branches 'acpi-processor', 'acpi-hotplug', 'acpi-init', 'acpi-pm' and 'acpica'

* acpi-processor:
  ACPI / scan: reduce log level of "ACPI: \_PR_.CPU4: failed to get CPU APIC ID"
  ACPI / processor: Return specific error value when mapping lapic id

* acpi-hotplug:
  ACPI / scan: Clear match_driver flag in acpi_bus_trim()

* acpi-init:
  ACPI / init: Flag use of ACPI and ACPI idioms for power supplies to regulator API

* acpi-pm:
  ACPI / PM: Use ACPI_COMPANION() to get ACPI companions of devices

* acpica:
  ACPICA: Remove bool usage from ACPICA.
...@@ -261,7 +261,7 @@ static int acpi_processor_get_info(struct acpi_device *device) ...@@ -261,7 +261,7 @@ static int acpi_processor_get_info(struct acpi_device *device)
apic_id = acpi_get_apicid(pr->handle, device_declaration, pr->acpi_id); apic_id = acpi_get_apicid(pr->handle, device_declaration, pr->acpi_id);
if (apic_id < 0) { if (apic_id < 0) {
acpi_handle_err(pr->handle, "failed to get CPU APIC ID.\n"); acpi_handle_debug(pr->handle, "failed to get CPU APIC ID.\n");
return -ENODEV; return -ENODEV;
} }
pr->apic_id = apic_id; pr->apic_id = apic_id;
......
...@@ -108,7 +108,7 @@ u8 ACPI_INIT_GLOBAL(acpi_gbl_use_default_register_widths, TRUE); ...@@ -108,7 +108,7 @@ u8 ACPI_INIT_GLOBAL(acpi_gbl_use_default_register_widths, TRUE);
/* /*
* Optionally enable output from the AML Debug Object. * Optionally enable output from the AML Debug Object.
*/ */
bool ACPI_INIT_GLOBAL(acpi_gbl_enable_aml_debug_object, FALSE); u8 ACPI_INIT_GLOBAL(acpi_gbl_enable_aml_debug_object, FALSE);
/* /*
* Optionally copy the entire DSDT to local memory (instead of simply * Optionally copy the entire DSDT to local memory (instead of simply
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <linux/acpi.h> #include <linux/acpi.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/regulator/machine.h>
#ifdef CONFIG_X86 #ifdef CONFIG_X86
#include <asm/mpspec.h> #include <asm/mpspec.h>
#endif #endif
...@@ -509,6 +510,14 @@ void __init acpi_early_init(void) ...@@ -509,6 +510,14 @@ void __init acpi_early_init(void)
goto error0; goto error0;
} }
/*
* If the system is using ACPI then we can be reasonably
* confident that any regulators are managed by the firmware
* so tell the regulator core it has everything it needs to
* know.
*/
regulator_has_full_constraints();
return; return;
error0: error0:
......
...@@ -726,18 +726,6 @@ int acpi_pm_device_sleep_wake(struct device *dev, bool enable) ...@@ -726,18 +726,6 @@ int acpi_pm_device_sleep_wake(struct device *dev, bool enable)
} }
#endif /* CONFIG_PM_SLEEP */ #endif /* CONFIG_PM_SLEEP */
/**
* acpi_dev_pm_get_node - Get ACPI device node for the given physical device.
* @dev: Device to get the ACPI node for.
*/
struct acpi_device *acpi_dev_pm_get_node(struct device *dev)
{
acpi_handle handle = ACPI_HANDLE(dev);
struct acpi_device *adev;
return handle && !acpi_bus_get_device(handle, &adev) ? adev : NULL;
}
/** /**
* acpi_dev_pm_low_power - Put ACPI device into a low-power state. * acpi_dev_pm_low_power - Put ACPI device into a low-power state.
* @dev: Device to put into a low-power state. * @dev: Device to put into a low-power state.
...@@ -778,7 +766,7 @@ static int acpi_dev_pm_full_power(struct acpi_device *adev) ...@@ -778,7 +766,7 @@ static int acpi_dev_pm_full_power(struct acpi_device *adev)
*/ */
int acpi_dev_runtime_suspend(struct device *dev) int acpi_dev_runtime_suspend(struct device *dev)
{ {
struct acpi_device *adev = acpi_dev_pm_get_node(dev); struct acpi_device *adev = ACPI_COMPANION(dev);
bool remote_wakeup; bool remote_wakeup;
int error; int error;
...@@ -809,7 +797,7 @@ EXPORT_SYMBOL_GPL(acpi_dev_runtime_suspend); ...@@ -809,7 +797,7 @@ EXPORT_SYMBOL_GPL(acpi_dev_runtime_suspend);
*/ */
int acpi_dev_runtime_resume(struct device *dev) int acpi_dev_runtime_resume(struct device *dev)
{ {
struct acpi_device *adev = acpi_dev_pm_get_node(dev); struct acpi_device *adev = ACPI_COMPANION(dev);
int error; int error;
if (!adev) if (!adev)
...@@ -862,7 +850,7 @@ EXPORT_SYMBOL_GPL(acpi_subsys_runtime_resume); ...@@ -862,7 +850,7 @@ EXPORT_SYMBOL_GPL(acpi_subsys_runtime_resume);
*/ */
int acpi_dev_suspend_late(struct device *dev) int acpi_dev_suspend_late(struct device *dev)
{ {
struct acpi_device *adev = acpi_dev_pm_get_node(dev); struct acpi_device *adev = ACPI_COMPANION(dev);
u32 target_state; u32 target_state;
bool wakeup; bool wakeup;
int error; int error;
...@@ -894,7 +882,7 @@ EXPORT_SYMBOL_GPL(acpi_dev_suspend_late); ...@@ -894,7 +882,7 @@ EXPORT_SYMBOL_GPL(acpi_dev_suspend_late);
*/ */
int acpi_dev_resume_early(struct device *dev) int acpi_dev_resume_early(struct device *dev)
{ {
struct acpi_device *adev = acpi_dev_pm_get_node(dev); struct acpi_device *adev = ACPI_COMPANION(dev);
int error; int error;
if (!adev) if (!adev)
...@@ -985,7 +973,7 @@ static struct dev_pm_domain acpi_general_pm_domain = { ...@@ -985,7 +973,7 @@ static struct dev_pm_domain acpi_general_pm_domain = {
*/ */
int acpi_dev_pm_attach(struct device *dev, bool power_on) int acpi_dev_pm_attach(struct device *dev, bool power_on)
{ {
struct acpi_device *adev = acpi_dev_pm_get_node(dev); struct acpi_device *adev = ACPI_COMPANION(dev);
if (!adev) if (!adev)
return -ENODEV; return -ENODEV;
...@@ -1017,7 +1005,7 @@ EXPORT_SYMBOL_GPL(acpi_dev_pm_attach); ...@@ -1017,7 +1005,7 @@ EXPORT_SYMBOL_GPL(acpi_dev_pm_attach);
*/ */
void acpi_dev_pm_detach(struct device *dev, bool power_off) void acpi_dev_pm_detach(struct device *dev, bool power_off)
{ {
struct acpi_device *adev = acpi_dev_pm_get_node(dev); struct acpi_device *adev = ACPI_COMPANION(dev);
if (adev && dev->pm_domain == &acpi_general_pm_domain) { if (adev && dev->pm_domain == &acpi_general_pm_domain) {
dev->pm_domain = NULL; dev->pm_domain = NULL;
......
...@@ -44,13 +44,13 @@ static int map_lapic_id(struct acpi_subtable_header *entry, ...@@ -44,13 +44,13 @@ static int map_lapic_id(struct acpi_subtable_header *entry,
(struct acpi_madt_local_apic *)entry; (struct acpi_madt_local_apic *)entry;
if (!(lapic->lapic_flags & ACPI_MADT_ENABLED)) if (!(lapic->lapic_flags & ACPI_MADT_ENABLED))
return 0; return -ENODEV;
if (lapic->processor_id != acpi_id) if (lapic->processor_id != acpi_id)
return 0; return -EINVAL;
*apic_id = lapic->id; *apic_id = lapic->id;
return 1; return 0;
} }
static int map_x2apic_id(struct acpi_subtable_header *entry, static int map_x2apic_id(struct acpi_subtable_header *entry,
...@@ -60,14 +60,14 @@ static int map_x2apic_id(struct acpi_subtable_header *entry, ...@@ -60,14 +60,14 @@ static int map_x2apic_id(struct acpi_subtable_header *entry,
(struct acpi_madt_local_x2apic *)entry; (struct acpi_madt_local_x2apic *)entry;
if (!(apic->lapic_flags & ACPI_MADT_ENABLED)) if (!(apic->lapic_flags & ACPI_MADT_ENABLED))
return 0; return -ENODEV;
if (device_declaration && (apic->uid == acpi_id)) { if (device_declaration && (apic->uid == acpi_id)) {
*apic_id = apic->local_apic_id; *apic_id = apic->local_apic_id;
return 1; return 0;
} }
return 0; return -EINVAL;
} }
static int map_lsapic_id(struct acpi_subtable_header *entry, static int map_lsapic_id(struct acpi_subtable_header *entry,
...@@ -77,16 +77,16 @@ static int map_lsapic_id(struct acpi_subtable_header *entry, ...@@ -77,16 +77,16 @@ static int map_lsapic_id(struct acpi_subtable_header *entry,
(struct acpi_madt_local_sapic *)entry; (struct acpi_madt_local_sapic *)entry;
if (!(lsapic->lapic_flags & ACPI_MADT_ENABLED)) if (!(lsapic->lapic_flags & ACPI_MADT_ENABLED))
return 0; return -ENODEV;
if (device_declaration) { if (device_declaration) {
if ((entry->length < 16) || (lsapic->uid != acpi_id)) if ((entry->length < 16) || (lsapic->uid != acpi_id))
return 0; return -EINVAL;
} else if (lsapic->processor_id != acpi_id) } else if (lsapic->processor_id != acpi_id)
return 0; return -EINVAL;
*apic_id = (lsapic->id << 8) | lsapic->eid; *apic_id = (lsapic->id << 8) | lsapic->eid;
return 1; return 0;
} }
static int map_madt_entry(int type, u32 acpi_id) static int map_madt_entry(int type, u32 acpi_id)
...@@ -116,13 +116,13 @@ static int map_madt_entry(int type, u32 acpi_id) ...@@ -116,13 +116,13 @@ static int map_madt_entry(int type, u32 acpi_id)
struct acpi_subtable_header *header = struct acpi_subtable_header *header =
(struct acpi_subtable_header *)entry; (struct acpi_subtable_header *)entry;
if (header->type == ACPI_MADT_TYPE_LOCAL_APIC) { if (header->type == ACPI_MADT_TYPE_LOCAL_APIC) {
if (map_lapic_id(header, acpi_id, &apic_id)) if (!map_lapic_id(header, acpi_id, &apic_id))
break; break;
} else if (header->type == ACPI_MADT_TYPE_LOCAL_X2APIC) { } else if (header->type == ACPI_MADT_TYPE_LOCAL_X2APIC) {
if (map_x2apic_id(header, type, acpi_id, &apic_id)) if (!map_x2apic_id(header, type, acpi_id, &apic_id))
break; break;
} else if (header->type == ACPI_MADT_TYPE_LOCAL_SAPIC) { } else if (header->type == ACPI_MADT_TYPE_LOCAL_SAPIC) {
if (map_lsapic_id(header, type, acpi_id, &apic_id)) if (!map_lsapic_id(header, type, acpi_id, &apic_id))
break; break;
} }
entry += header->length; entry += header->length;
......
...@@ -2105,6 +2105,7 @@ void acpi_bus_trim(struct acpi_device *adev) ...@@ -2105,6 +2105,7 @@ void acpi_bus_trim(struct acpi_device *adev)
list_for_each_entry_reverse(child, &adev->children, node) list_for_each_entry_reverse(child, &adev->children, node)
acpi_bus_trim(child); acpi_bus_trim(child);
adev->flags.match_driver = false;
if (handler) { if (handler) {
if (handler->detach) if (handler->detach)
handler->detach(adev); handler->detach(adev);
......
...@@ -226,7 +226,7 @@ module_param_call(trace_state, param_set_trace_state, param_get_trace_state, ...@@ -226,7 +226,7 @@ module_param_call(trace_state, param_set_trace_state, param_get_trace_state,
/* /sys/modules/acpi/parameters/aml_debug_output */ /* /sys/modules/acpi/parameters/aml_debug_output */
module_param_named(aml_debug_output, acpi_gbl_enable_aml_debug_object, module_param_named(aml_debug_output, acpi_gbl_enable_aml_debug_object,
bool, 0644); byte, 0644);
MODULE_PARM_DESC(aml_debug_output, MODULE_PARM_DESC(aml_debug_output,
"To enable/disable the ACPI Debug Object output."); "To enable/disable the ACPI Debug Object output.");
......
...@@ -77,7 +77,7 @@ extern u8 acpi_gbl_create_osi_method; ...@@ -77,7 +77,7 @@ extern u8 acpi_gbl_create_osi_method;
extern u8 acpi_gbl_disable_auto_repair; extern u8 acpi_gbl_disable_auto_repair;
extern u8 acpi_gbl_disable_ssdt_table_load; extern u8 acpi_gbl_disable_ssdt_table_load;
extern u8 acpi_gbl_do_not_use_xsdt; extern u8 acpi_gbl_do_not_use_xsdt;
extern bool acpi_gbl_enable_aml_debug_object; extern u8 acpi_gbl_enable_aml_debug_object;
extern u8 acpi_gbl_enable_interpreter_slack; extern u8 acpi_gbl_enable_interpreter_slack;
extern u32 acpi_gbl_trace_flags; extern u32 acpi_gbl_trace_flags;
extern acpi_name acpi_gbl_trace_method_name; extern acpi_name acpi_gbl_trace_method_name;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment