summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica/utosi.c
diff options
context:
space:
mode:
authorLv Zheng <lv.zheng@intel.com>2013-07-22 16:08:16 +0800
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-07-23 04:06:03 +0200
commit2cf9f5bcc8d8cb31d6ea7baebac5056f39fb4f40 (patch)
treef91ff2046741f8c88c257ad7969ff5bd38d4f9ae /drivers/acpi/acpica/utosi.c
parent53b1631e3a274f84686853fa2531d1aa918ee36c (diff)
downloadlinux-stable-2cf9f5bcc8d8cb31d6ea7baebac5056f39fb4f40.tar.gz
linux-stable-2cf9f5bcc8d8cb31d6ea7baebac5056f39fb4f40.tar.bz2
linux-stable-2cf9f5bcc8d8cb31d6ea7baebac5056f39fb4f40.zip
ACPICA: Add acpi_update_interfaces() public interface
Add new API to allow OSPM to disable/enable specific types of _OSI interface strings. ACPICA does not have the knowledge about whether an _OSI interface string is an OS vendor string or a feature group string and there isn't any API interface to allow OSPM to install a new interface string as a feature group string. This patch simply adds all feature group strings defined by ACPI specification into the acpi_default_supported_interfaces with ACPI_OSI_FEATURE flag set to fix this gap. This patch also adds codes to keep their default states as ACPI_OSI_INVALID before the initialization and after the termination. Signed-off-by: Lv Zheng <lv.zheng@intel.com> Reviewed-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Acked-by: Len Brown <len.brown@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Conflicts: include/acpi/actypes.h (with commit 242b228)
Diffstat (limited to 'drivers/acpi/acpica/utosi.c')
-rw-r--r--drivers/acpi/acpica/utosi.c77
1 files changed, 64 insertions, 13 deletions
diff --git a/drivers/acpi/acpica/utosi.c b/drivers/acpi/acpica/utosi.c
index 7e807725c636..8856bd37bc76 100644
--- a/drivers/acpi/acpica/utosi.c
+++ b/drivers/acpi/acpica/utosi.c
@@ -77,21 +77,20 @@ static struct acpi_interface_info acpi_default_supported_interfaces[] = {
/* Feature Group Strings */
- {"Extended Address Space Descriptor", NULL, 0, 0}
+ {"Extended Address Space Descriptor", NULL, ACPI_OSI_FEATURE, 0},
/*
* All "optional" feature group strings (features that are implemented
- * by the host) should be dynamically added by the host via
- * acpi_install_interface and should not be manually added here.
- *
- * Examples of optional feature group strings:
- *
- * "Module Device"
- * "Processor Device"
- * "3.0 Thermal Model"
- * "3.0 _SCP Extensions"
- * "Processor Aggregator Device"
+ * by the host) should be dynamically modified to VALID by the host via
+ * acpi_install_interface or acpi_update_interfaces. Such optional feature
+ * group strings are set as INVALID by default here.
*/
+
+ {"Module Device", NULL, ACPI_OSI_OPTIONAL_FEATURE, 0},
+ {"Processor Device", NULL, ACPI_OSI_OPTIONAL_FEATURE, 0},
+ {"3.0 Thermal Model", NULL, ACPI_OSI_OPTIONAL_FEATURE, 0},
+ {"3.0 _SCP Extensions", NULL, ACPI_OSI_OPTIONAL_FEATURE, 0},
+ {"Processor Aggregator Device", NULL, ACPI_OSI_OPTIONAL_FEATURE, 0}
};
/*******************************************************************************
@@ -158,11 +157,20 @@ acpi_status acpi_ut_interface_terminate(void)
while (next_interface) {
acpi_gbl_supported_interfaces = next_interface->next;
- /* Only interfaces added at runtime can be freed */
-
if (next_interface->flags & ACPI_OSI_DYNAMIC) {
+
+ /* Only interfaces added at runtime can be freed */
+
ACPI_FREE(next_interface->name);
ACPI_FREE(next_interface);
+ } else {
+ /* Interface is in static list. Reset it to invalid or valid. */
+
+ if (next_interface->flags & ACPI_OSI_DEFAULT_INVALID) {
+ next_interface->flags |= ACPI_OSI_INVALID;
+ } else {
+ next_interface->flags &= ~ACPI_OSI_INVALID;
+ }
}
next_interface = acpi_gbl_supported_interfaces;
@@ -278,6 +286,49 @@ acpi_status acpi_ut_remove_interface(acpi_string interface_name)
/*******************************************************************************
*
+ * FUNCTION: acpi_ut_update_interfaces
+ *
+ * PARAMETERS: action - Actions to be performed during the
+ * update
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Update _OSI interface strings, disabling or enabling OS vendor
+ * strings or/and feature group strings.
+ * Caller MUST hold acpi_gbl_osi_mutex
+ *
+ ******************************************************************************/
+
+acpi_status acpi_ut_update_interfaces(u8 action)
+{
+ struct acpi_interface_info *next_interface;
+
+ next_interface = acpi_gbl_supported_interfaces;
+ while (next_interface) {
+ if (((next_interface->flags & ACPI_OSI_FEATURE) &&
+ (action & ACPI_FEATURE_STRINGS)) ||
+ (!(next_interface->flags & ACPI_OSI_FEATURE) &&
+ (action & ACPI_VENDOR_STRINGS))) {
+ if (action & ACPI_DISABLE_INTERFACES) {
+
+ /* Mark the interfaces as invalid */
+
+ next_interface->flags |= ACPI_OSI_INVALID;
+ } else {
+ /* Mark the interfaces as valid */
+
+ next_interface->flags &= ~ACPI_OSI_INVALID;
+ }
+ }
+
+ next_interface = next_interface->next;
+ }
+
+ return (AE_OK);
+}
+
+/*******************************************************************************
+ *
* FUNCTION: acpi_ut_get_interface
*
* PARAMETERS: interface_name - The interface to find