Commit 228b79aa authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

Merge branches 'acpi-processor', 'acpi-cppc', 'acpi-dbg', 'acpi-misc' and 'acpi-pci'

* acpi-processor:
  ACPI: processor: idle: Allow probing on platforms with one ACPI C-state

* acpi-cppc:
  ACPI: CPPC: Fix reference count leak in acpi_cppc_processor_probe()
  ACPI: CPPC: Make some symbols static

* acpi-dbg:
  ACPI: debug: Make two functions static

* acpi-misc:
  ACPI: GED: use correct trigger type field in _Exx / _Lxx handling
  ACPI: GED: add support for _Exx / _Lxx handler methods
  ACPI: Delete unused proc filename macros

* acpi-pci:
  ACPI: hotplug: PCI: Use the new acpi_evaluate_reg() helper
  ACPI: utils: Add acpi_evaluate_reg() helper
...@@ -745,7 +745,7 @@ static const struct acpi_debugger_ops acpi_aml_debugger = { ...@@ -745,7 +745,7 @@ static const struct acpi_debugger_ops acpi_aml_debugger = {
.notify_command_complete = acpi_aml_notify_command_complete, .notify_command_complete = acpi_aml_notify_command_complete,
}; };
int __init acpi_aml_init(void) static int __init acpi_aml_init(void)
{ {
int ret; int ret;
...@@ -771,7 +771,7 @@ int __init acpi_aml_init(void) ...@@ -771,7 +771,7 @@ int __init acpi_aml_init(void)
return 0; return 0;
} }
void __exit acpi_aml_exit(void) static void __exit acpi_aml_exit(void)
{ {
if (acpi_aml_initialized) { if (acpi_aml_initialized) {
acpi_unregister_debugger(&acpi_aml_debugger); acpi_unregister_debugger(&acpi_aml_debugger);
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#define PREFIX "ACPI: " #define PREFIX "ACPI: "
#define ACPI_BUTTON_CLASS "button" #define ACPI_BUTTON_CLASS "button"
#define ACPI_BUTTON_FILE_INFO "info"
#define ACPI_BUTTON_FILE_STATE "state" #define ACPI_BUTTON_FILE_STATE "state"
#define ACPI_BUTTON_TYPE_UNKNOWN 0x00 #define ACPI_BUTTON_TYPE_UNKNOWN 0x00
#define ACPI_BUTTON_NOTIFY_STATUS 0x80 #define ACPI_BUTTON_NOTIFY_STATUS 0x80
......
...@@ -350,7 +350,7 @@ static void cppc_chan_tx_done(struct mbox_client *cl, void *msg, int ret) ...@@ -350,7 +350,7 @@ static void cppc_chan_tx_done(struct mbox_client *cl, void *msg, int ret)
*(u16 *)msg, ret); *(u16 *)msg, ret);
} }
struct mbox_client cppc_mbox_cl = { static struct mbox_client cppc_mbox_cl = {
.tx_done = cppc_chan_tx_done, .tx_done = cppc_chan_tx_done,
.knows_txdone = true, .knows_txdone = true,
}; };
...@@ -597,7 +597,7 @@ bool __weak cpc_ffh_supported(void) ...@@ -597,7 +597,7 @@ bool __weak cpc_ffh_supported(void)
* *
* Return: 0 for success, errno for failure * Return: 0 for success, errno for failure
*/ */
int pcc_data_alloc(int pcc_ss_id) static int pcc_data_alloc(int pcc_ss_id)
{ {
if (pcc_ss_id < 0 || pcc_ss_id >= MAX_PCC_SUBSPACES) if (pcc_ss_id < 0 || pcc_ss_id >= MAX_PCC_SUBSPACES)
return -EINVAL; return -EINVAL;
...@@ -846,6 +846,7 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr) ...@@ -846,6 +846,7 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr)
"acpi_cppc"); "acpi_cppc");
if (ret) { if (ret) {
per_cpu(cpc_desc_ptr, pr->id) = NULL; per_cpu(cpc_desc_ptr, pr->id) = NULL;
kobject_put(&cpc_ptr->kobj);
goto out_free; goto out_free;
} }
......
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
#define ACPI_EC_CLASS "embedded_controller" #define ACPI_EC_CLASS "embedded_controller"
#define ACPI_EC_DEVICE_NAME "Embedded Controller" #define ACPI_EC_DEVICE_NAME "Embedded Controller"
#define ACPI_EC_FILE_INFO "info"
/* EC status register */ /* EC status register */
#define ACPI_EC_FLAG_OBF 0x01 /* Output buffer full */ #define ACPI_EC_FLAG_OBF 0x01 /* Output buffer full */
......
...@@ -79,6 +79,8 @@ static acpi_status acpi_ged_request_interrupt(struct acpi_resource *ares, ...@@ -79,6 +79,8 @@ static acpi_status acpi_ged_request_interrupt(struct acpi_resource *ares,
struct resource r; struct resource r;
struct acpi_resource_irq *p = &ares->data.irq; struct acpi_resource_irq *p = &ares->data.irq;
struct acpi_resource_extended_irq *pext = &ares->data.extended_irq; struct acpi_resource_extended_irq *pext = &ares->data.extended_irq;
char ev_name[5];
u8 trigger;
if (ares->type == ACPI_RESOURCE_TYPE_END_TAG) if (ares->type == ACPI_RESOURCE_TYPE_END_TAG)
return AE_OK; return AE_OK;
...@@ -87,14 +89,28 @@ static acpi_status acpi_ged_request_interrupt(struct acpi_resource *ares, ...@@ -87,14 +89,28 @@ static acpi_status acpi_ged_request_interrupt(struct acpi_resource *ares,
dev_err(dev, "unable to parse IRQ resource\n"); dev_err(dev, "unable to parse IRQ resource\n");
return AE_ERROR; return AE_ERROR;
} }
if (ares->type == ACPI_RESOURCE_TYPE_IRQ) if (ares->type == ACPI_RESOURCE_TYPE_IRQ) {
gsi = p->interrupts[0]; gsi = p->interrupts[0];
else trigger = p->triggering;
} else {
gsi = pext->interrupts[0]; gsi = pext->interrupts[0];
trigger = pext->triggering;
}
irq = r.start; irq = r.start;
if (ACPI_FAILURE(acpi_get_handle(handle, "_EVT", &evt_handle))) { switch (gsi) {
case 0 ... 255:
sprintf(ev_name, "_%c%02hhX",
trigger == ACPI_EDGE_SENSITIVE ? 'E' : 'L', gsi);
if (ACPI_SUCCESS(acpi_get_handle(handle, ev_name, &evt_handle)))
break;
/* fall through */
default:
if (ACPI_SUCCESS(acpi_get_handle(handle, "_EVT", &evt_handle)))
break;
dev_err(dev, "cannot locate _EVT method\n"); dev_err(dev, "cannot locate _EVT method\n");
return AE_ERROR; return AE_ERROR;
} }
......
...@@ -31,8 +31,6 @@ ...@@ -31,8 +31,6 @@
ACPI_MODULE_NAME("pci_link"); ACPI_MODULE_NAME("pci_link");
#define ACPI_PCI_LINK_CLASS "pci_irq_routing" #define ACPI_PCI_LINK_CLASS "pci_irq_routing"
#define ACPI_PCI_LINK_DEVICE_NAME "PCI Interrupt Link" #define ACPI_PCI_LINK_DEVICE_NAME "PCI Interrupt Link"
#define ACPI_PCI_LINK_FILE_INFO "info"
#define ACPI_PCI_LINK_FILE_STATUS "state"
#define ACPI_PCI_LINK_MAX_POSSIBLE 16 #define ACPI_PCI_LINK_MAX_POSSIBLE 16
static int acpi_pci_link_add(struct acpi_device *device, static int acpi_pci_link_add(struct acpi_device *device,
......
...@@ -36,8 +36,6 @@ ...@@ -36,8 +36,6 @@
ACPI_MODULE_NAME("power"); ACPI_MODULE_NAME("power");
#define ACPI_POWER_CLASS "power_resource" #define ACPI_POWER_CLASS "power_resource"
#define ACPI_POWER_DEVICE_NAME "Power Resource" #define ACPI_POWER_DEVICE_NAME "Power Resource"
#define ACPI_POWER_FILE_INFO "info"
#define ACPI_POWER_FILE_STATUS "state"
#define ACPI_POWER_RESOURCE_STATE_OFF 0x00 #define ACPI_POWER_RESOURCE_STATE_OFF 0x00
#define ACPI_POWER_RESOURCE_STATE_ON 0x01 #define ACPI_POWER_RESOURCE_STATE_ON 0x01
#define ACPI_POWER_RESOURCE_STATE_UNKNOWN 0xFF #define ACPI_POWER_RESOURCE_STATE_UNKNOWN 0xFF
......
...@@ -308,11 +308,7 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr) ...@@ -308,11 +308,7 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr)
if (ret) if (ret)
return ret; return ret;
/* if (!pr->power.count)
* It is expected that there will be at least 2 states, C1 and
* something else (C2 or C3), so fail if that is not the case.
*/
if (pr->power.count < 2)
return -EFAULT; return -EFAULT;
pr->flags.has_cst = 1; pr->flags.has_cst = 1;
...@@ -468,7 +464,6 @@ static int acpi_processor_get_cstate_info(struct acpi_processor *pr) ...@@ -468,7 +464,6 @@ static int acpi_processor_get_cstate_info(struct acpi_processor *pr)
for (i = 1; i < ACPI_PROCESSOR_MAX_POWER; i++) { for (i = 1; i < ACPI_PROCESSOR_MAX_POWER; i++) {
if (pr->power.states[i].valid) { if (pr->power.states[i].valid) {
pr->power.count = i; pr->power.count = i;
if (pr->power.states[i].type >= ACPI_STATE_C2)
pr->flags.power = 1; pr->flags.power = 1;
} }
} }
......
...@@ -28,9 +28,6 @@ ...@@ -28,9 +28,6 @@
#define ACPI_SBS_CLASS "sbs" #define ACPI_SBS_CLASS "sbs"
#define ACPI_AC_CLASS "ac_adapter" #define ACPI_AC_CLASS "ac_adapter"
#define ACPI_SBS_DEVICE_NAME "Smart Battery System" #define ACPI_SBS_DEVICE_NAME "Smart Battery System"
#define ACPI_SBS_FILE_INFO "info"
#define ACPI_SBS_FILE_STATE "state"
#define ACPI_SBS_FILE_ALARM "alarm"
#define ACPI_BATTERY_DIR_NAME "BAT%i" #define ACPI_BATTERY_DIR_NAME "BAT%i"
#define ACPI_AC_DIR_NAME "AC0" #define ACPI_AC_DIR_NAME "AC0"
......
...@@ -605,6 +605,31 @@ acpi_status acpi_evaluate_lck(acpi_handle handle, int lock) ...@@ -605,6 +605,31 @@ acpi_status acpi_evaluate_lck(acpi_handle handle, int lock)
return status; return status;
} }
/**
* acpi_evaluate_reg: Evaluate _REG method to register OpRegion presence
* @handle: ACPI device handle
* @space_id: ACPI address space id to register OpRegion presence for
* @function: Parameter to pass to _REG one of ACPI_REG_CONNECT or
* ACPI_REG_DISCONNECT
*
* Evaluate device's _REG method to register OpRegion presence.
*/
acpi_status acpi_evaluate_reg(acpi_handle handle, u8 space_id, u32 function)
{
struct acpi_object_list arg_list;
union acpi_object params[2];
params[0].type = ACPI_TYPE_INTEGER;
params[0].integer.value = space_id;
params[1].type = ACPI_TYPE_INTEGER;
params[1].integer.value = function;
arg_list.count = 2;
arg_list.pointer = params;
return acpi_evaluate_object(handle, "_REG", &arg_list, NULL);
}
EXPORT_SYMBOL(acpi_evaluate_reg);
/** /**
* acpi_evaluate_dsm - evaluate device's _DSM method * acpi_evaluate_dsm - evaluate device's _DSM method
* @handle: ACPI device handle * @handle: ACPI device handle
......
...@@ -385,19 +385,12 @@ static unsigned char acpiphp_max_busnr(struct pci_bus *bus) ...@@ -385,19 +385,12 @@ static unsigned char acpiphp_max_busnr(struct pci_bus *bus)
static void acpiphp_set_acpi_region(struct acpiphp_slot *slot) static void acpiphp_set_acpi_region(struct acpiphp_slot *slot)
{ {
struct acpiphp_func *func; struct acpiphp_func *func;
union acpi_object params[2];
struct acpi_object_list arg_list;
list_for_each_entry(func, &slot->funcs, sibling) { list_for_each_entry(func, &slot->funcs, sibling) {
arg_list.count = 2;
arg_list.pointer = params;
params[0].type = ACPI_TYPE_INTEGER;
params[0].integer.value = ACPI_ADR_SPACE_PCI_CONFIG;
params[1].type = ACPI_TYPE_INTEGER;
params[1].integer.value = 1;
/* _REG is optional, we don't care about if there is failure */ /* _REG is optional, we don't care about if there is failure */
acpi_evaluate_object(func_to_handle(func), "_REG", &arg_list, acpi_evaluate_reg(func_to_handle(func),
NULL); ACPI_ADR_SPACE_PCI_CONFIG,
ACPI_REG_CONNECT);
} }
} }
......
...@@ -44,6 +44,7 @@ acpi_status acpi_execute_simple_method(acpi_handle handle, char *method, ...@@ -44,6 +44,7 @@ acpi_status acpi_execute_simple_method(acpi_handle handle, char *method,
u64 arg); u64 arg);
acpi_status acpi_evaluate_ej0(acpi_handle handle); acpi_status acpi_evaluate_ej0(acpi_handle handle);
acpi_status acpi_evaluate_lck(acpi_handle handle, int lock); acpi_status acpi_evaluate_lck(acpi_handle handle, int lock);
acpi_status acpi_evaluate_reg(acpi_handle handle, u8 space_id, u32 function);
bool acpi_ata_match(acpi_handle handle); bool acpi_ata_match(acpi_handle handle);
bool acpi_bay_match(acpi_handle handle); bool acpi_bay_match(acpi_handle handle);
bool acpi_dock_match(acpi_handle handle); bool acpi_dock_match(acpi_handle handle);
......
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