Commit 4b49b9fe authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

Merge back earlier 'acpi-pci-hotplug' material.

Conflicts:
	drivers/pci/hotplug/acpiphp_glue.c
parents 72820594 21369c77
...@@ -923,19 +923,22 @@ ACPI_EXPORT_SYMBOL(acpi_detach_data) ...@@ -923,19 +923,22 @@ ACPI_EXPORT_SYMBOL(acpi_detach_data)
/******************************************************************************* /*******************************************************************************
* *
* FUNCTION: acpi_get_data * FUNCTION: acpi_get_data_full
* *
* PARAMETERS: obj_handle - Namespace node * PARAMETERS: obj_handle - Namespace node
* handler - Handler used in call to attach_data * handler - Handler used in call to attach_data
* data - Where the data is returned * data - Where the data is returned
* callback - function to execute before returning
* *
* RETURN: Status * RETURN: Status
* *
* DESCRIPTION: Retrieve data that was previously attached to a namespace node. * DESCRIPTION: Retrieve data that was previously attached to a namespace node
* and execute a callback before returning.
* *
******************************************************************************/ ******************************************************************************/
acpi_status acpi_status
acpi_get_data(acpi_handle obj_handle, acpi_object_handler handler, void **data) acpi_get_data_full(acpi_handle obj_handle, acpi_object_handler handler,
void **data, void (*callback)(void *))
{ {
struct acpi_namespace_node *node; struct acpi_namespace_node *node;
acpi_status status; acpi_status status;
...@@ -960,10 +963,34 @@ acpi_get_data(acpi_handle obj_handle, acpi_object_handler handler, void **data) ...@@ -960,10 +963,34 @@ acpi_get_data(acpi_handle obj_handle, acpi_object_handler handler, void **data)
} }
status = acpi_ns_get_attached_data(node, handler, data); status = acpi_ns_get_attached_data(node, handler, data);
if (ACPI_SUCCESS(status) && callback) {
callback(*data);
}
unlock_and_exit: unlock_and_exit:
(void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
return (status); return (status);
} }
ACPI_EXPORT_SYMBOL(acpi_get_data_full)
/*******************************************************************************
*
* FUNCTION: acpi_get_data
*
* PARAMETERS: obj_handle - Namespace node
* handler - Handler used in call to attach_data
* data - Where the data is returned
*
* RETURN: Status
*
* DESCRIPTION: Retrieve data that was previously attached to a namespace node.
*
******************************************************************************/
acpi_status
acpi_get_data(acpi_handle obj_handle, acpi_object_handler handler, void **data)
{
return acpi_get_data_full(obj_handle, handler, data, NULL);
}
ACPI_EXPORT_SYMBOL(acpi_get_data) ACPI_EXPORT_SYMBOL(acpi_get_data)
...@@ -340,60 +340,77 @@ static void acpi_bus_osc_support(void) ...@@ -340,60 +340,77 @@ static void acpi_bus_osc_support(void)
*/ */
static void acpi_bus_notify(acpi_handle handle, u32 type, void *data) static void acpi_bus_notify(acpi_handle handle, u32 type, void *data)
{ {
struct acpi_device *device = NULL; struct acpi_device *adev;
struct acpi_driver *driver; struct acpi_driver *driver;
acpi_status status;
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Notification %#02x to handle %p\n", u32 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE;
type, handle));
switch (type) { switch (type) {
case ACPI_NOTIFY_BUS_CHECK: case ACPI_NOTIFY_BUS_CHECK:
/* TBD */ acpi_handle_debug(handle, "ACPI_NOTIFY_BUS_CHECK event\n");
break; break;
case ACPI_NOTIFY_DEVICE_CHECK: case ACPI_NOTIFY_DEVICE_CHECK:
/* TBD */ acpi_handle_debug(handle, "ACPI_NOTIFY_DEVICE_CHECK event\n");
break; break;
case ACPI_NOTIFY_DEVICE_WAKE: case ACPI_NOTIFY_DEVICE_WAKE:
/* TBD */ acpi_handle_debug(handle, "ACPI_NOTIFY_DEVICE_WAKE event\n");
break; break;
case ACPI_NOTIFY_EJECT_REQUEST: case ACPI_NOTIFY_EJECT_REQUEST:
/* TBD */ acpi_handle_debug(handle, "ACPI_NOTIFY_EJECT_REQUEST event\n");
break; break;
case ACPI_NOTIFY_DEVICE_CHECK_LIGHT: case ACPI_NOTIFY_DEVICE_CHECK_LIGHT:
acpi_handle_debug(handle, "ACPI_NOTIFY_DEVICE_CHECK_LIGHT event\n");
/* TBD: Exactly what does 'light' mean? */ /* TBD: Exactly what does 'light' mean? */
break; break;
case ACPI_NOTIFY_FREQUENCY_MISMATCH: case ACPI_NOTIFY_FREQUENCY_MISMATCH:
/* TBD */ acpi_handle_err(handle, "Device cannot be configured due "
"to a frequency mismatch\n");
break; break;
case ACPI_NOTIFY_BUS_MODE_MISMATCH: case ACPI_NOTIFY_BUS_MODE_MISMATCH:
/* TBD */ acpi_handle_err(handle, "Device cannot be configured due "
"to a bus mode mismatch\n");
break; break;
case ACPI_NOTIFY_POWER_FAULT: case ACPI_NOTIFY_POWER_FAULT:
/* TBD */ acpi_handle_err(handle, "Device has suffered a power fault\n");
break; break;
default: default:
ACPI_DEBUG_PRINT((ACPI_DB_INFO, acpi_handle_warn(handle, "Unsupported event type 0x%x\n", type);
"Received unknown/unsupported notification [%08x]\n", ost_code = ACPI_OST_SC_UNRECOGNIZED_NOTIFY;
type)); goto err;
break;
} }
acpi_bus_get_device(handle, &device); adev = acpi_bus_get_acpi_device(handle);
if (device) { if (!adev)
driver = device->driver; goto err;
driver = adev->driver;
if (driver && driver->ops.notify && if (driver && driver->ops.notify &&
(driver->flags & ACPI_DRIVER_ALL_NOTIFY_EVENTS)) (driver->flags & ACPI_DRIVER_ALL_NOTIFY_EVENTS))
driver->ops.notify(device, type); driver->ops.notify(adev, type);
switch (type) {
case ACPI_NOTIFY_BUS_CHECK:
case ACPI_NOTIFY_DEVICE_CHECK:
case ACPI_NOTIFY_EJECT_REQUEST:
status = acpi_hotplug_execute(acpi_device_hotplug, adev, type);
if (ACPI_SUCCESS(status))
return;
default:
break;
} }
acpi_bus_put_acpi_device(adev);
return;
err:
acpi_evaluate_hotplug_ost(handle, type, ost_code, NULL);
} }
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
......
...@@ -73,6 +73,7 @@ static inline void acpi_lpss_init(void) {} ...@@ -73,6 +73,7 @@ static inline void acpi_lpss_init(void) {}
#endif #endif
bool acpi_queue_hotplug_work(struct work_struct *work); bool acpi_queue_hotplug_work(struct work_struct *work);
void acpi_device_hotplug(void *data, u32 src);
bool acpi_scan_is_offline(struct acpi_device *adev, bool uevent); bool acpi_scan_is_offline(struct acpi_device *adev, bool uevent);
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
......
...@@ -51,7 +51,7 @@ static void acpi_pci_root_remove(struct acpi_device *device); ...@@ -51,7 +51,7 @@ static void acpi_pci_root_remove(struct acpi_device *device);
static int acpi_pci_root_scan_dependent(struct acpi_device *adev) static int acpi_pci_root_scan_dependent(struct acpi_device *adev)
{ {
acpiphp_check_host_bridge(adev->handle); acpiphp_check_host_bridge(adev);
return 0; return 0;
} }
......
...@@ -41,6 +41,7 @@ static DEFINE_MUTEX(acpi_scan_lock); ...@@ -41,6 +41,7 @@ static DEFINE_MUTEX(acpi_scan_lock);
static LIST_HEAD(acpi_scan_handlers_list); static LIST_HEAD(acpi_scan_handlers_list);
DEFINE_MUTEX(acpi_device_lock); DEFINE_MUTEX(acpi_device_lock);
LIST_HEAD(acpi_wakeup_device_list); LIST_HEAD(acpi_wakeup_device_list);
static DEFINE_MUTEX(acpi_hp_context_lock);
struct acpi_device_bus_id{ struct acpi_device_bus_id{
char bus_id[15]; char bus_id[15];
...@@ -60,6 +61,16 @@ void acpi_scan_lock_release(void) ...@@ -60,6 +61,16 @@ void acpi_scan_lock_release(void)
} }
EXPORT_SYMBOL_GPL(acpi_scan_lock_release); EXPORT_SYMBOL_GPL(acpi_scan_lock_release);
void acpi_lock_hp_context(void)
{
mutex_lock(&acpi_hp_context_lock);
}
void acpi_unlock_hp_context(void)
{
mutex_unlock(&acpi_hp_context_lock);
}
int acpi_scan_add_handler(struct acpi_scan_handler *handler) int acpi_scan_add_handler(struct acpi_scan_handler *handler)
{ {
if (!handler || !handler->attach) if (!handler || !handler->attach)
...@@ -439,90 +450,74 @@ static int acpi_scan_bus_check(struct acpi_device *adev) ...@@ -439,90 +450,74 @@ static int acpi_scan_bus_check(struct acpi_device *adev)
return 0; return 0;
} }
static void acpi_device_hotplug(void *data, u32 src) static int acpi_generic_hotplug_event(struct acpi_device *adev, u32 type)
{ {
u32 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE; switch (type) {
struct acpi_device *adev = data;
int error;
lock_device_hotplug();
mutex_lock(&acpi_scan_lock);
/*
* The device object's ACPI handle cannot become invalid as long as we
* are holding acpi_scan_lock, but it may have become invalid before
* that lock was acquired.
*/
if (adev->handle == INVALID_ACPI_HANDLE)
goto out;
switch (src) {
case ACPI_NOTIFY_BUS_CHECK: case ACPI_NOTIFY_BUS_CHECK:
error = acpi_scan_bus_check(adev); return acpi_scan_bus_check(adev);
break;
case ACPI_NOTIFY_DEVICE_CHECK: case ACPI_NOTIFY_DEVICE_CHECK:
error = acpi_scan_device_check(adev); return acpi_scan_device_check(adev);
break;
case ACPI_NOTIFY_EJECT_REQUEST: case ACPI_NOTIFY_EJECT_REQUEST:
case ACPI_OST_EC_OSPM_EJECT: case ACPI_OST_EC_OSPM_EJECT:
error = acpi_scan_hot_remove(adev); if (adev->handler && !adev->handler->hotplug.enabled) {
break; dev_info(&adev->dev, "Eject disabled\n");
default: return -EPERM;
error = -EINVAL;
break;
} }
if (!error) acpi_evaluate_hotplug_ost(adev->handle, ACPI_NOTIFY_EJECT_REQUEST,
ost_code = ACPI_OST_SC_SUCCESS; ACPI_OST_SC_EJECT_IN_PROGRESS, NULL);
return acpi_scan_hot_remove(adev);
out: }
acpi_evaluate_hotplug_ost(adev->handle, src, ost_code, NULL); return -EINVAL;
put_device(&adev->dev);
mutex_unlock(&acpi_scan_lock);
unlock_device_hotplug();
} }
static void acpi_hotplug_notify_cb(acpi_handle handle, u32 type, void *data) void acpi_device_hotplug(void *data, u32 src)
{ {
u32 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE; u32 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE;
struct acpi_device *adev; struct acpi_device *adev = data;
acpi_status status; int error = -ENODEV;
if (acpi_bus_get_device(handle, &adev)) lock_device_hotplug();
goto err_out; mutex_lock(&acpi_scan_lock);
switch (type) { /*
case ACPI_NOTIFY_BUS_CHECK: * The device object's ACPI handle cannot become invalid as long as we
acpi_handle_debug(handle, "ACPI_NOTIFY_BUS_CHECK event\n"); * are holding acpi_scan_lock, but it might have become invalid before
break; * that lock was acquired.
case ACPI_NOTIFY_DEVICE_CHECK: */
acpi_handle_debug(handle, "ACPI_NOTIFY_DEVICE_CHECK event\n"); if (adev->handle == INVALID_ACPI_HANDLE)
break;
case ACPI_NOTIFY_EJECT_REQUEST:
acpi_handle_debug(handle, "ACPI_NOTIFY_EJECT_REQUEST event\n");
if (!adev->handler)
goto err_out; goto err_out;
if (!adev->handler->hotplug.enabled) { if (adev->flags.hotplug_notify) {
acpi_handle_err(handle, "Eject disabled\n"); error = acpi_generic_hotplug_event(adev, src);
if (error == -EPERM) {
ost_code = ACPI_OST_SC_EJECT_NOT_SUPPORTED; ost_code = ACPI_OST_SC_EJECT_NOT_SUPPORTED;
goto err_out; goto err_out;
} }
acpi_evaluate_hotplug_ost(handle, ACPI_NOTIFY_EJECT_REQUEST, } else {
ACPI_OST_SC_EJECT_IN_PROGRESS, NULL); int (*event)(struct acpi_device *, u32);
break;
default:
/* non-hotplug event; possibly handled by other handler */
return;
}
get_device(&adev->dev);
status = acpi_hotplug_execute(acpi_device_hotplug, adev, type);
if (ACPI_SUCCESS(status))
return;
put_device(&adev->dev); acpi_lock_hp_context();
event = adev->hp ? adev->hp->event : NULL;
acpi_unlock_hp_context();
/*
* There may be additional notify handlers for device objects
* without the .event() callback, so ignore them here.
*/
if (event)
error = event(adev, src);
else
goto out;
}
if (!error)
ost_code = ACPI_OST_SC_SUCCESS;
err_out: err_out:
acpi_evaluate_hotplug_ost(handle, type, ost_code, NULL); acpi_evaluate_hotplug_ost(adev->handle, src, ost_code, NULL);
out:
acpi_bus_put_acpi_device(adev);
mutex_unlock(&acpi_scan_lock);
unlock_device_hotplug();
} }
static ssize_t real_power_state_show(struct device *dev, static ssize_t real_power_state_show(struct device *dev,
...@@ -570,8 +565,6 @@ acpi_eject_store(struct device *d, struct device_attribute *attr, ...@@ -570,8 +565,6 @@ acpi_eject_store(struct device *d, struct device_attribute *attr,
if (ACPI_FAILURE(status) || !acpi_device->flags.ejectable) if (ACPI_FAILURE(status) || !acpi_device->flags.ejectable)
return -ENODEV; return -ENODEV;
acpi_evaluate_hotplug_ost(acpi_device->handle, ACPI_OST_EC_OSPM_EJECT,
ACPI_OST_SC_EJECT_IN_PROGRESS, NULL);
get_device(&acpi_device->dev); get_device(&acpi_device->dev);
status = acpi_hotplug_execute(acpi_device_hotplug, acpi_device, status = acpi_hotplug_execute(acpi_device_hotplug, acpi_device,
ACPI_OST_EC_OSPM_EJECT); ACPI_OST_EC_OSPM_EJECT);
...@@ -1114,14 +1107,16 @@ static void acpi_scan_drop_device(acpi_handle handle, void *context) ...@@ -1114,14 +1107,16 @@ static void acpi_scan_drop_device(acpi_handle handle, void *context)
mutex_unlock(&acpi_device_del_lock); mutex_unlock(&acpi_device_del_lock);
} }
int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device) static int acpi_get_device_data(acpi_handle handle, struct acpi_device **device,
void (*callback)(void *))
{ {
acpi_status status; acpi_status status;
if (!device) if (!device)
return -EINVAL; return -EINVAL;
status = acpi_get_data(handle, acpi_scan_drop_device, (void **)device); status = acpi_get_data_full(handle, acpi_scan_drop_device,
(void **)device, callback);
if (ACPI_FAILURE(status) || !*device) { if (ACPI_FAILURE(status) || !*device) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No context for object [%p]\n", ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No context for object [%p]\n",
handle)); handle));
...@@ -1129,8 +1124,32 @@ int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device) ...@@ -1129,8 +1124,32 @@ int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device)
} }
return 0; return 0;
} }
int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device)
{
return acpi_get_device_data(handle, device, NULL);
}
EXPORT_SYMBOL(acpi_bus_get_device); EXPORT_SYMBOL(acpi_bus_get_device);
static void get_acpi_device(void *dev)
{
if (dev)
get_device(&((struct acpi_device *)dev)->dev);
}
struct acpi_device *acpi_bus_get_acpi_device(acpi_handle handle)
{
struct acpi_device *adev = NULL;
acpi_get_device_data(handle, &adev, get_acpi_device);
return adev;
}
void acpi_bus_put_acpi_device(struct acpi_device *adev)
{
put_device(&adev->dev);
}
int acpi_device_add(struct acpi_device *device, int acpi_device_add(struct acpi_device *device,
void (*release)(struct device *)) void (*release)(struct device *))
{ {
...@@ -1941,33 +1960,19 @@ void acpi_scan_hotplug_enabled(struct acpi_hotplug_profile *hotplug, bool val) ...@@ -1941,33 +1960,19 @@ void acpi_scan_hotplug_enabled(struct acpi_hotplug_profile *hotplug, bool val)
mutex_unlock(&acpi_scan_lock); mutex_unlock(&acpi_scan_lock);
} }
static void acpi_scan_init_hotplug(acpi_handle handle, int type) static void acpi_scan_init_hotplug(struct acpi_device *adev)
{ {
struct acpi_device_pnp pnp = {};
struct acpi_hardware_id *hwid; struct acpi_hardware_id *hwid;
struct acpi_scan_handler *handler;
INIT_LIST_HEAD(&pnp.ids);
acpi_set_pnp_ids(handle, &pnp, type);
if (!pnp.type.hardware_id) list_for_each_entry(hwid, &adev->pnp.ids, list) {
goto out; struct acpi_scan_handler *handler;
/*
* This relies on the fact that acpi_install_notify_handler() will not
* install the same notify handler routine twice for the same handle.
*/
list_for_each_entry(hwid, &pnp.ids, list) {
handler = acpi_scan_match_handler(hwid->id, NULL); handler = acpi_scan_match_handler(hwid->id, NULL);
if (handler) { if (handler) {
acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY, adev->flags.hotplug_notify = true;
acpi_hotplug_notify_cb, handler);
break; break;
} }
} }
out:
acpi_free_pnp_ids(&pnp);
} }
static acpi_status acpi_bus_check_add(acpi_handle handle, u32 lvl_not_used, static acpi_status acpi_bus_check_add(acpi_handle handle, u32 lvl_not_used,
...@@ -1991,12 +1996,12 @@ static acpi_status acpi_bus_check_add(acpi_handle handle, u32 lvl_not_used, ...@@ -1991,12 +1996,12 @@ static acpi_status acpi_bus_check_add(acpi_handle handle, u32 lvl_not_used,
return AE_OK; return AE_OK;
} }
acpi_scan_init_hotplug(handle, type);
acpi_add_single_object(&device, handle, type, sta); acpi_add_single_object(&device, handle, type, sta);
if (!device) if (!device)
return AE_CTRL_DEPTH; return AE_CTRL_DEPTH;
acpi_scan_init_hotplug(device);
out: out:
if (!*return_value) if (!*return_value)
*return_value = device; *return_value = device;
......
...@@ -93,7 +93,6 @@ struct acpiphp_slot { ...@@ -93,7 +93,6 @@ struct acpiphp_slot {
struct list_head funcs; /* one slot may have different struct list_head funcs; /* one slot may have different
objects (i.e. for each function) */ objects (i.e. for each function) */
struct slot *slot; struct slot *slot;
struct mutex crit_sect;
u8 device; /* pci device# */ u8 device; /* pci device# */
u32 flags; /* see below */ u32 flags; /* see below */
...@@ -117,20 +116,30 @@ struct acpiphp_func { ...@@ -117,20 +116,30 @@ struct acpiphp_func {
}; };
struct acpiphp_context { struct acpiphp_context {
acpi_handle handle; struct acpi_hotplug_context hp;
struct acpiphp_func func; struct acpiphp_func func;
struct acpiphp_bridge *bridge; struct acpiphp_bridge *bridge;
unsigned int refcount; unsigned int refcount;
}; };
static inline struct acpiphp_context *to_acpiphp_context(struct acpi_hotplug_context *hp)
{
return container_of(hp, struct acpiphp_context, hp);
}
static inline struct acpiphp_context *func_to_context(struct acpiphp_func *func) static inline struct acpiphp_context *func_to_context(struct acpiphp_func *func)
{ {
return container_of(func, struct acpiphp_context, func); return container_of(func, struct acpiphp_context, func);
} }
static inline struct acpi_device *func_to_acpi_device(struct acpiphp_func *func)
{
return func_to_context(func)->hp.self;
}
static inline acpi_handle func_to_handle(struct acpiphp_func *func) static inline acpi_handle func_to_handle(struct acpiphp_func *func)
{ {
return func_to_context(func)->handle; return func_to_acpi_device(func)->handle;
} }
/* /*
...@@ -158,7 +167,6 @@ struct acpiphp_attention_info ...@@ -158,7 +167,6 @@ struct acpiphp_attention_info
#define FUNC_HAS_STA (0x00000001) #define FUNC_HAS_STA (0x00000001)
#define FUNC_HAS_EJ0 (0x00000002) #define FUNC_HAS_EJ0 (0x00000002)
#define FUNC_HAS_DCK (0x00000004)
/* function prototypes */ /* function prototypes */
......
This diff is collapsed.
...@@ -136,6 +136,16 @@ struct acpi_scan_handler { ...@@ -136,6 +136,16 @@ struct acpi_scan_handler {
struct acpi_hotplug_profile hotplug; struct acpi_hotplug_profile hotplug;
}; };
/*
* ACPI Hotplug Context
* --------------------
*/
struct acpi_hotplug_context {
struct acpi_device *self;
int (*event)(struct acpi_device *, u32);
};
/* /*
* ACPI Driver * ACPI Driver
* ----------- * -----------
...@@ -190,7 +200,8 @@ struct acpi_device_flags { ...@@ -190,7 +200,8 @@ struct acpi_device_flags {
u32 initialized:1; u32 initialized:1;
u32 visited:1; u32 visited:1;
u32 no_hotplug:1; u32 no_hotplug:1;
u32 reserved:24; u32 hotplug_notify:1;
u32 reserved:23;
}; };
/* File System */ /* File System */
...@@ -329,6 +340,7 @@ struct acpi_device { ...@@ -329,6 +340,7 @@ struct acpi_device {
struct acpi_device_perf performance; struct acpi_device_perf performance;
struct acpi_device_dir dir; struct acpi_device_dir dir;
struct acpi_scan_handler *handler; struct acpi_scan_handler *handler;
struct acpi_hotplug_context *hp;
struct acpi_driver *driver; struct acpi_driver *driver;
void *driver_data; void *driver_data;
struct device dev; struct device dev;
...@@ -351,6 +363,15 @@ static inline void acpi_set_device_status(struct acpi_device *adev, u32 sta) ...@@ -351,6 +363,15 @@ static inline void acpi_set_device_status(struct acpi_device *adev, u32 sta)
*((u32 *)&adev->status) = sta; *((u32 *)&adev->status) = sta;
} }
static inline void acpi_set_hp_context(struct acpi_device *adev,
struct acpi_hotplug_context *hp,
int (*event)(struct acpi_device *, u32))
{
hp->self = adev;
hp->event = event;
adev->hp = hp;
}
/* acpi_device.dev.bus == &acpi_bus_type */ /* acpi_device.dev.bus == &acpi_bus_type */
extern struct bus_type acpi_bus_type; extern struct bus_type acpi_bus_type;
...@@ -381,6 +402,8 @@ extern int unregister_acpi_notifier(struct notifier_block *); ...@@ -381,6 +402,8 @@ extern int unregister_acpi_notifier(struct notifier_block *);
*/ */
int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device); int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device);
struct acpi_device *acpi_bus_get_acpi_device(acpi_handle handle);
void acpi_bus_put_acpi_device(struct acpi_device *adev);
acpi_status acpi_bus_get_status_handle(acpi_handle handle, acpi_status acpi_bus_get_status_handle(acpi_handle handle,
unsigned long long *sta); unsigned long long *sta);
int acpi_bus_get_status(struct acpi_device *device); int acpi_bus_get_status(struct acpi_device *device);
...@@ -402,6 +425,8 @@ static inline bool acpi_bus_can_wakeup(acpi_handle handle) { return false; } ...@@ -402,6 +425,8 @@ static inline bool acpi_bus_can_wakeup(acpi_handle handle) { return false; }
void acpi_scan_lock_acquire(void); void acpi_scan_lock_acquire(void);
void acpi_scan_lock_release(void); void acpi_scan_lock_release(void);
void acpi_lock_hp_context(void);
void acpi_unlock_hp_context(void);
int acpi_scan_add_handler(struct acpi_scan_handler *handler); int acpi_scan_add_handler(struct acpi_scan_handler *handler);
int acpi_bus_register_driver(struct acpi_driver *driver); int acpi_bus_register_driver(struct acpi_driver *driver);
void acpi_bus_unregister_driver(struct acpi_driver *driver); void acpi_bus_unregister_driver(struct acpi_driver *driver);
......
...@@ -229,6 +229,10 @@ acpi_attach_data(acpi_handle object, acpi_object_handler handler, void *data); ...@@ -229,6 +229,10 @@ acpi_attach_data(acpi_handle object, acpi_object_handler handler, void *data);
acpi_status acpi_detach_data(acpi_handle object, acpi_object_handler handler); acpi_status acpi_detach_data(acpi_handle object, acpi_object_handler handler);
acpi_status
acpi_get_data_full(acpi_handle object, acpi_object_handler handler, void **data,
void (*callback)(void *));
acpi_status acpi_status
acpi_get_data(acpi_handle object, acpi_object_handler handler, void **data); acpi_get_data(acpi_handle object, acpi_object_handler handler, void **data);
......
...@@ -59,12 +59,12 @@ static inline void acpi_pci_slot_remove(struct pci_bus *bus) { } ...@@ -59,12 +59,12 @@ static inline void acpi_pci_slot_remove(struct pci_bus *bus) { }
void acpiphp_init(void); void acpiphp_init(void);
void acpiphp_enumerate_slots(struct pci_bus *bus); void acpiphp_enumerate_slots(struct pci_bus *bus);
void acpiphp_remove_slots(struct pci_bus *bus); void acpiphp_remove_slots(struct pci_bus *bus);
void acpiphp_check_host_bridge(acpi_handle handle); void acpiphp_check_host_bridge(struct acpi_device *adev);
#else #else
static inline void acpiphp_init(void) { } static inline void acpiphp_init(void) { }
static inline void acpiphp_enumerate_slots(struct pci_bus *bus) { } static inline void acpiphp_enumerate_slots(struct pci_bus *bus) { }
static inline void acpiphp_remove_slots(struct pci_bus *bus) { } static inline void acpiphp_remove_slots(struct pci_bus *bus) { }
static inline void acpiphp_check_host_bridge(acpi_handle handle) { } static inline void acpiphp_check_host_bridge(struct acpi_device *adev) { }
#endif #endif
#else /* CONFIG_ACPI */ #else /* CONFIG_ACPI */
......
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