ACPI: add support for ACPI reconfiguration notifiers

Add support for ACPI reconfiguration notifiers to allow subsystems
to react to changes in the ACPI tables that happen after the initial
enumeration. This is similar with the way dynamic device tree
notifications work.

The reconfigure notifications supported for now are device add and
device remove.

Since ACPICA allows only one table notification handler, this patch
makes the table notifier function generic and moves it out of the
sysfs specific code.

Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
Octavian Purdila 2016-07-08 19:13:09 +03:00 committed by Rafael J. Wysocki
parent 10c7e20b2f
commit 68bdb67732
5 changed files with 99 additions and 5 deletions

View file

@ -541,6 +541,14 @@ static inline void acpi_device_clear_enumerated(struct acpi_device *adev)
adev->flags.visited = false;
}
enum acpi_reconfig_event {
ACPI_RECONFIG_DEVICE_ADD = 0,
ACPI_RECONFIG_DEVICE_REMOVE,
};
int acpi_reconfig_notifier_register(struct notifier_block *nb);
int acpi_reconfig_notifier_unregister(struct notifier_block *nb);
#else /* !CONFIG_ACPI */
#define acpi_disabled 1
@ -694,6 +702,16 @@ static inline void acpi_device_clear_enumerated(struct acpi_device *adev)
{
}
static inline int acpi_reconfig_notifier_register(struct notifier_block *nb)
{
return -EINVAL;
}
static inline int acpi_reconfig_notifier_unregister(struct notifier_block *nb)
{
return -EINVAL;
}
#endif /* !CONFIG_ACPI */
#ifdef CONFIG_ACPI