diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2010-08-20 19:53:27 -0400 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2010-08-24 16:43:24 -0400 |
commit | ab8e8957a2ae21c0f036476c6db13e949be730ac (patch) | |
tree | fa1943e14c6fd363e28c83e66023491c5517e3b6 /drivers | |
parent | b879dc4b3e81069e3f715b7569bb0f43eed76c76 (diff) |
ACPI/PCI: Make acpi_pci_query_osc() return control bits
Make acpi_pci_query_osc() use an additional pointer argument to
return the mask of control bits obtained from the BIOS to the
caller.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/acpi/pci_root.c | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index e10dbafa0569..d2ae816df0f5 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c | |||
@@ -226,22 +226,35 @@ static acpi_status acpi_pci_run_osc(acpi_handle handle, | |||
226 | return status; | 226 | return status; |
227 | } | 227 | } |
228 | 228 | ||
229 | static acpi_status acpi_pci_query_osc(struct acpi_pci_root *root, u32 flags) | 229 | static acpi_status acpi_pci_query_osc(struct acpi_pci_root *root, |
230 | u32 support, | ||
231 | u32 *control) | ||
230 | { | 232 | { |
231 | acpi_status status; | 233 | acpi_status status; |
232 | u32 support_set, result, capbuf[3]; | 234 | u32 result, capbuf[3]; |
235 | |||
236 | support &= OSC_PCI_SUPPORT_MASKS; | ||
237 | support |= root->osc_support_set; | ||
233 | 238 | ||
234 | /* do _OSC query for all possible controls */ | ||
235 | support_set = root->osc_support_set | (flags & OSC_PCI_SUPPORT_MASKS); | ||
236 | capbuf[OSC_QUERY_TYPE] = OSC_QUERY_ENABLE; | 239 | capbuf[OSC_QUERY_TYPE] = OSC_QUERY_ENABLE; |
237 | capbuf[OSC_SUPPORT_TYPE] = support_set; | 240 | capbuf[OSC_SUPPORT_TYPE] = support; |
238 | capbuf[OSC_CONTROL_TYPE] = OSC_PCI_CONTROL_MASKS; | 241 | if (control) { |
242 | *control &= OSC_PCI_CONTROL_MASKS; | ||
243 | capbuf[OSC_CONTROL_TYPE] = *control | root->osc_control_set; | ||
244 | } else { | ||
245 | /* Run _OSC query for all possible controls. */ | ||
246 | capbuf[OSC_CONTROL_TYPE] = OSC_PCI_CONTROL_MASKS; | ||
247 | } | ||
239 | 248 | ||
240 | status = acpi_pci_run_osc(root->device->handle, capbuf, &result); | 249 | status = acpi_pci_run_osc(root->device->handle, capbuf, &result); |
241 | if (ACPI_SUCCESS(status)) { | 250 | if (ACPI_SUCCESS(status)) { |
242 | root->osc_support_set = support_set; | 251 | root->osc_support_set = support; |
243 | root->osc_control_qry = result; | 252 | if (control) { |
244 | root->osc_queried = 1; | 253 | *control = result; |
254 | } else { | ||
255 | root->osc_control_qry = result; | ||
256 | root->osc_queried = 1; | ||
257 | } | ||
245 | } | 258 | } |
246 | return status; | 259 | return status; |
247 | } | 260 | } |
@@ -255,7 +268,7 @@ static acpi_status acpi_pci_osc_support(struct acpi_pci_root *root, u32 flags) | |||
255 | if (ACPI_FAILURE(status)) | 268 | if (ACPI_FAILURE(status)) |
256 | return status; | 269 | return status; |
257 | mutex_lock(&osc_lock); | 270 | mutex_lock(&osc_lock); |
258 | status = acpi_pci_query_osc(root, flags); | 271 | status = acpi_pci_query_osc(root, flags, NULL); |
259 | mutex_unlock(&osc_lock); | 272 | mutex_unlock(&osc_lock); |
260 | return status; | 273 | return status; |
261 | } | 274 | } |
@@ -397,7 +410,7 @@ acpi_status acpi_pci_osc_control_set(acpi_handle handle, u32 flags) | |||
397 | 410 | ||
398 | /* Need to query controls first before requesting them */ | 411 | /* Need to query controls first before requesting them */ |
399 | if (!root->osc_queried) { | 412 | if (!root->osc_queried) { |
400 | status = acpi_pci_query_osc(root, root->osc_support_set); | 413 | status = acpi_pci_query_osc(root, root->osc_support_set, NULL); |
401 | if (ACPI_FAILURE(status)) | 414 | if (ACPI_FAILURE(status)) |
402 | goto out; | 415 | goto out; |
403 | } | 416 | } |