Newer
Older
return;
}
bridge->context = context;
context->bridge = bridge;
/* Get a reference to the parent bridge. */
get_bridge(context->func.parent);
mutex_unlock(&acpiphp_context_lock);
}
/* must be added to the list prior to calling register_slot */
mutex_lock(&bridge_mutex);
list_add(&bridge->list, &bridge_list);
mutex_unlock(&bridge_mutex);
/* register all slot objects under this bridge */
status = acpi_walk_namespace(ACPI_TYPE_DEVICE, handle, 1,
register_slot, NULL, bridge, NULL);
if (ACPI_FAILURE(status)) {
acpi_handle_err(handle, "failed to register slots\n");
cleanup_bridge(bridge);
put_bridge(bridge);
}
/* Destroy hotplug slots associated with the PCI bus */
void acpiphp_remove_slots(struct pci_bus *bus)
struct acpiphp_bridge *bridge;
if (acpiphp_disabled)
return;
mutex_lock(&bridge_mutex);
list_for_each_entry(bridge, &bridge_list, list)
if (bridge->pci_bus == bus) {
mutex_unlock(&bridge_mutex);
cleanup_bridge(bridge);
put_bridge(bridge);
mutex_unlock(&bridge_mutex);
}
/**
* acpiphp_enable_slot - power on slot
*/
int acpiphp_enable_slot(struct acpiphp_slot *slot)
{
mutex_lock(&slot->crit_sect);
/* configure all functions */
if (!(slot->flags & SLOT_ENABLED))
enable_slot(slot);
mutex_unlock(&slot->crit_sect);
return 0;
* acpiphp_disable_and_eject_slot - power off and eject slot
int acpiphp_disable_and_eject_slot(struct acpiphp_slot *slot)
struct acpiphp_func *func;
mutex_lock(&slot->crit_sect);
disable_slot(slot);
list_for_each_entry(func, &slot->funcs, sibling)
if (func->flags & FUNC_HAS_EJ0) {
acpi_handle handle = func_to_handle(func);
if (ACPI_FAILURE(acpi_evaluate_ej0(handle)))
acpi_handle_err(handle, "_EJ0 failed\n");
break;
}
mutex_unlock(&slot->crit_sect);
return retval;
}
/*
* slot enabled: 1
* slot disabled: 0
*/
u8 acpiphp_get_power_status(struct acpiphp_slot *slot)
{
return (slot->flags & SLOT_ENABLED);
*/
u8 acpiphp_get_latch_status(struct acpiphp_slot *slot)
{
return !(get_slot_status(slot) & ACPI_STA_DEVICE_UI);
}
/*
* adapter presence : 1
* absence : 0
*/
u8 acpiphp_get_adapter_status(struct acpiphp_slot *slot)
{
return !!get_slot_status(slot);