diff options
author | Bob Moore <robert.moore@intel.com> | 2012-10-30 22:28:38 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2012-11-14 18:31:30 -0500 |
commit | 413fc3f592c65977858f8adce2e7af0e82aa1191 (patch) | |
tree | ba673bcb511b48dd0cf96f793fe2de28c978218a /drivers/acpi/acpica/utids.c | |
parent | 17b1f45a68ebd7944904a801d81a5c4206f9f76b (diff) |
ACPICA: AcpiGetObjectInfo: Add support for ACPI 5 _SUB method
Now calls _SUB in addition to the other ID methods: _HID, _CID,
and _UID.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/acpica/utids.c')
-rw-r--r-- | drivers/acpi/acpica/utids.c | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/drivers/acpi/acpica/utids.c b/drivers/acpi/acpica/utids.c index f18ac81c8399..774c3aefbf5d 100644 --- a/drivers/acpi/acpica/utids.c +++ b/drivers/acpi/acpica/utids.c | |||
@@ -127,6 +127,73 @@ cleanup: | |||
127 | 127 | ||
128 | /******************************************************************************* | 128 | /******************************************************************************* |
129 | * | 129 | * |
130 | * FUNCTION: acpi_ut_execute_SUB | ||
131 | * | ||
132 | * PARAMETERS: device_node - Node for the device | ||
133 | * return_id - Where the _SUB is returned | ||
134 | * | ||
135 | * RETURN: Status | ||
136 | * | ||
137 | * DESCRIPTION: Executes the _SUB control method that returns the subsystem | ||
138 | * ID of the device. The _SUB value is always a string containing | ||
139 | * either a valid PNP or ACPI ID. | ||
140 | * | ||
141 | * NOTE: Internal function, no parameter validation | ||
142 | * | ||
143 | ******************************************************************************/ | ||
144 | |||
145 | acpi_status | ||
146 | acpi_ut_execute_SUB(struct acpi_namespace_node *device_node, | ||
147 | struct acpi_pnp_device_id **return_id) | ||
148 | { | ||
149 | union acpi_operand_object *obj_desc; | ||
150 | struct acpi_pnp_device_id *sub; | ||
151 | u32 length; | ||
152 | acpi_status status; | ||
153 | |||
154 | ACPI_FUNCTION_TRACE(ut_execute_SUB); | ||
155 | |||
156 | status = acpi_ut_evaluate_object(device_node, METHOD_NAME__SUB, | ||
157 | ACPI_BTYPE_STRING, &obj_desc); | ||
158 | if (ACPI_FAILURE(status)) { | ||
159 | return_ACPI_STATUS(status); | ||
160 | } | ||
161 | |||
162 | /* Get the size of the String to be returned, includes null terminator */ | ||
163 | |||
164 | length = obj_desc->string.length + 1; | ||
165 | |||
166 | /* Allocate a buffer for the SUB */ | ||
167 | |||
168 | sub = | ||
169 | ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_pnp_device_id) + | ||
170 | (acpi_size) length); | ||
171 | if (!sub) { | ||
172 | status = AE_NO_MEMORY; | ||
173 | goto cleanup; | ||
174 | } | ||
175 | |||
176 | /* Area for the string starts after PNP_DEVICE_ID struct */ | ||
177 | |||
178 | sub->string = | ||
179 | ACPI_ADD_PTR(char, sub, sizeof(struct acpi_pnp_device_id)); | ||
180 | |||
181 | /* Simply copy existing string */ | ||
182 | |||
183 | ACPI_STRCPY(sub->string, obj_desc->string.pointer); | ||
184 | sub->length = length; | ||
185 | *return_id = sub; | ||
186 | |||
187 | cleanup: | ||
188 | |||
189 | /* On exit, we must delete the return object */ | ||
190 | |||
191 | acpi_ut_remove_reference(obj_desc); | ||
192 | return_ACPI_STATUS(status); | ||
193 | } | ||
194 | |||
195 | /******************************************************************************* | ||
196 | * | ||
130 | * FUNCTION: acpi_ut_execute_UID | 197 | * FUNCTION: acpi_ut_execute_UID |
131 | * | 198 | * |
132 | * PARAMETERS: device_node - Node for the device | 199 | * PARAMETERS: device_node - Node for the device |