diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-23 10:52:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-23 10:52:36 -0400 |
commit | 37224470c8c6d90a4062e76a08d4dc1fcf91fc89 (patch) | |
tree | 627f537177bf8e951c12bec04c4a85f0125f5ece /drivers/acpi/hardware/hwregs.c | |
parent | e83319510b04dd51a60da8a0b4ccf8b92b3ab1ad (diff) | |
parent | ae6c859b7dcd708efadf1c76279c33db213e3506 (diff) |
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (65 commits)
ACPI: suppress power button event on S3 resume
ACPI: resolve merge conflict between sem2mutex and processor_perflib.c
ACPI: use for_each_possible_cpu() instead of for_each_cpu()
ACPI: delete newly added debugging macros in processor_perflib.c
ACPI: UP build fix for bugzilla-5737
Enable P-state software coordination via _PDC
P-state software coordination for speedstep-centrino
P-state software coordination for acpi-cpufreq
P-state software coordination for ACPI core
ACPI: create acpi_thermal_resume()
ACPI: create acpi_fan_suspend()/acpi_fan_resume()
ACPI: pass pm_message_t from acpi_device_suspend() to root_suspend()
ACPI: create acpi_device_suspend()/acpi_device_resume()
ACPI: replace spin_lock_irq with mutex for ec poll mode
ACPI: Allow a WAN module enable/disable on a Thinkpad X60.
sem2mutex: acpi, acpi_link_lock
ACPI: delete unused acpi_bus_drivers_lock
sem2mutex: drivers/acpi/processor_perflib.c
ACPI add ia64 exports to build acpi_memhotplug as a module
ACPI: asus_acpi_init(): propagate correct return value
...
Manual resolve of conflicts in:
arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
include/acpi/processor.h
Diffstat (limited to 'drivers/acpi/hardware/hwregs.c')
-rw-r--r-- | drivers/acpi/hardware/hwregs.c | 146 |
1 files changed, 64 insertions, 82 deletions
diff --git a/drivers/acpi/hardware/hwregs.c b/drivers/acpi/hardware/hwregs.c index e1fe75498415..ae142de19507 100644 --- a/drivers/acpi/hardware/hwregs.c +++ b/drivers/acpi/hardware/hwregs.c | |||
@@ -43,8 +43,6 @@ | |||
43 | * POSSIBILITY OF SUCH DAMAGES. | 43 | * POSSIBILITY OF SUCH DAMAGES. |
44 | */ | 44 | */ |
45 | 45 | ||
46 | #include <linux/module.h> | ||
47 | |||
48 | #include <acpi/acpi.h> | 46 | #include <acpi/acpi.h> |
49 | #include <acpi/acnamesp.h> | 47 | #include <acpi/acnamesp.h> |
50 | #include <acpi/acevents.h> | 48 | #include <acpi/acevents.h> |
@@ -63,23 +61,21 @@ ACPI_MODULE_NAME("hwregs") | |||
63 | * DESCRIPTION: Clears all fixed and general purpose status bits | 61 | * DESCRIPTION: Clears all fixed and general purpose status bits |
64 | * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED | 62 | * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED |
65 | * | 63 | * |
64 | * NOTE: TBD: Flags parameter is obsolete, to be removed | ||
65 | * | ||
66 | ******************************************************************************/ | 66 | ******************************************************************************/ |
67 | acpi_status acpi_hw_clear_acpi_status(u32 flags) | 67 | acpi_status acpi_hw_clear_acpi_status(u32 flags) |
68 | { | 68 | { |
69 | acpi_status status; | 69 | acpi_status status; |
70 | acpi_cpu_flags lock_flags = 0; | ||
70 | 71 | ||
71 | ACPI_FUNCTION_TRACE("hw_clear_acpi_status"); | 72 | ACPI_FUNCTION_TRACE(hw_clear_acpi_status); |
72 | 73 | ||
73 | ACPI_DEBUG_PRINT((ACPI_DB_IO, "About to write %04X to %04X\n", | 74 | ACPI_DEBUG_PRINT((ACPI_DB_IO, "About to write %04X to %04X\n", |
74 | ACPI_BITMASK_ALL_FIXED_STATUS, | 75 | ACPI_BITMASK_ALL_FIXED_STATUS, |
75 | (u16) acpi_gbl_FADT->xpm1a_evt_blk.address)); | 76 | (u16) acpi_gbl_FADT->xpm1a_evt_blk.address)); |
76 | 77 | ||
77 | if (flags & ACPI_MTX_LOCK) { | 78 | lock_flags = acpi_os_acquire_lock(acpi_gbl_hardware_lock); |
78 | status = acpi_ut_acquire_mutex(ACPI_MTX_HARDWARE); | ||
79 | if (ACPI_FAILURE(status)) { | ||
80 | return_ACPI_STATUS(status); | ||
81 | } | ||
82 | } | ||
83 | 79 | ||
84 | status = acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK, | 80 | status = acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK, |
85 | ACPI_REGISTER_PM1_STATUS, | 81 | ACPI_REGISTER_PM1_STATUS, |
@@ -104,9 +100,7 @@ acpi_status acpi_hw_clear_acpi_status(u32 flags) | |||
104 | status = acpi_ev_walk_gpe_list(acpi_hw_clear_gpe_block); | 100 | status = acpi_ev_walk_gpe_list(acpi_hw_clear_gpe_block); |
105 | 101 | ||
106 | unlock_and_exit: | 102 | unlock_and_exit: |
107 | if (flags & ACPI_MTX_LOCK) { | 103 | acpi_os_release_lock(acpi_gbl_hardware_lock, lock_flags); |
108 | (void)acpi_ut_release_mutex(ACPI_MTX_HARDWARE); | ||
109 | } | ||
110 | return_ACPI_STATUS(status); | 104 | return_ACPI_STATUS(status); |
111 | } | 105 | } |
112 | 106 | ||
@@ -129,10 +123,9 @@ acpi_status | |||
129 | acpi_get_sleep_type_data(u8 sleep_state, u8 * sleep_type_a, u8 * sleep_type_b) | 123 | acpi_get_sleep_type_data(u8 sleep_state, u8 * sleep_type_a, u8 * sleep_type_b) |
130 | { | 124 | { |
131 | acpi_status status = AE_OK; | 125 | acpi_status status = AE_OK; |
132 | struct acpi_parameter_info info; | 126 | struct acpi_evaluate_info *info; |
133 | char *sleep_state_name; | ||
134 | 127 | ||
135 | ACPI_FUNCTION_TRACE("acpi_get_sleep_type_data"); | 128 | ACPI_FUNCTION_TRACE(acpi_get_sleep_type_data); |
136 | 129 | ||
137 | /* Validate parameters */ | 130 | /* Validate parameters */ |
138 | 131 | ||
@@ -140,34 +133,39 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 * sleep_type_a, u8 * sleep_type_b) | |||
140 | return_ACPI_STATUS(AE_BAD_PARAMETER); | 133 | return_ACPI_STATUS(AE_BAD_PARAMETER); |
141 | } | 134 | } |
142 | 135 | ||
143 | /* Evaluate the namespace object containing the values for this state */ | 136 | /* Allocate the evaluation information block */ |
137 | |||
138 | info = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_evaluate_info)); | ||
139 | if (!info) { | ||
140 | return_ACPI_STATUS(AE_NO_MEMORY); | ||
141 | } | ||
144 | 142 | ||
145 | info.parameters = NULL; | 143 | info->pathname = |
146 | info.return_object = NULL; | ||
147 | sleep_state_name = | ||
148 | ACPI_CAST_PTR(char, acpi_gbl_sleep_state_names[sleep_state]); | 144 | ACPI_CAST_PTR(char, acpi_gbl_sleep_state_names[sleep_state]); |
149 | 145 | ||
150 | status = acpi_ns_evaluate_by_name(sleep_state_name, &info); | 146 | /* Evaluate the namespace object containing the values for this state */ |
147 | |||
148 | status = acpi_ns_evaluate(info); | ||
151 | if (ACPI_FAILURE(status)) { | 149 | if (ACPI_FAILURE(status)) { |
152 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, | 150 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, |
153 | "%s while evaluating sleep_state [%s]\n", | 151 | "%s while evaluating SleepState [%s]\n", |
154 | acpi_format_exception(status), | 152 | acpi_format_exception(status), |
155 | sleep_state_name)); | 153 | info->pathname)); |
156 | 154 | ||
157 | return_ACPI_STATUS(status); | 155 | goto cleanup; |
158 | } | 156 | } |
159 | 157 | ||
160 | /* Must have a return object */ | 158 | /* Must have a return object */ |
161 | 159 | ||
162 | if (!info.return_object) { | 160 | if (!info->return_object) { |
163 | ACPI_ERROR((AE_INFO, "No Sleep State object returned from [%s]", | 161 | ACPI_ERROR((AE_INFO, "No Sleep State object returned from [%s]", |
164 | sleep_state_name)); | 162 | info->pathname)); |
165 | status = AE_NOT_EXIST; | 163 | status = AE_NOT_EXIST; |
166 | } | 164 | } |
167 | 165 | ||
168 | /* It must be of type Package */ | 166 | /* It must be of type Package */ |
169 | 167 | ||
170 | else if (ACPI_GET_OBJECT_TYPE(info.return_object) != ACPI_TYPE_PACKAGE) { | 168 | else if (ACPI_GET_OBJECT_TYPE(info->return_object) != ACPI_TYPE_PACKAGE) { |
171 | ACPI_ERROR((AE_INFO, | 169 | ACPI_ERROR((AE_INFO, |
172 | "Sleep State return object is not a Package")); | 170 | "Sleep State return object is not a Package")); |
173 | status = AE_AML_OPERAND_TYPE; | 171 | status = AE_AML_OPERAND_TYPE; |
@@ -180,7 +178,7 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 * sleep_type_a, u8 * sleep_type_b) | |||
180 | * by BIOS vendors seems to be to have 2 or more elements, at least | 178 | * by BIOS vendors seems to be to have 2 or more elements, at least |
181 | * one per sleep type (A/B). | 179 | * one per sleep type (A/B). |
182 | */ | 180 | */ |
183 | else if (info.return_object->package.count < 2) { | 181 | else if (info->return_object->package.count < 2) { |
184 | ACPI_ERROR((AE_INFO, | 182 | ACPI_ERROR((AE_INFO, |
185 | "Sleep State return package does not have at least two elements")); | 183 | "Sleep State return package does not have at least two elements")); |
186 | status = AE_AML_NO_OPERAND; | 184 | status = AE_AML_NO_OPERAND; |
@@ -188,39 +186,42 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 * sleep_type_a, u8 * sleep_type_b) | |||
188 | 186 | ||
189 | /* The first two elements must both be of type Integer */ | 187 | /* The first two elements must both be of type Integer */ |
190 | 188 | ||
191 | else if ((ACPI_GET_OBJECT_TYPE(info.return_object->package.elements[0]) | 189 | else if ((ACPI_GET_OBJECT_TYPE(info->return_object->package.elements[0]) |
192 | != ACPI_TYPE_INTEGER) || | 190 | != ACPI_TYPE_INTEGER) || |
193 | (ACPI_GET_OBJECT_TYPE(info.return_object->package.elements[1]) | 191 | (ACPI_GET_OBJECT_TYPE(info->return_object->package.elements[1]) |
194 | != ACPI_TYPE_INTEGER)) { | 192 | != ACPI_TYPE_INTEGER)) { |
195 | ACPI_ERROR((AE_INFO, | 193 | ACPI_ERROR((AE_INFO, |
196 | "Sleep State return package elements are not both Integers (%s, %s)", | 194 | "Sleep State return package elements are not both Integers (%s, %s)", |
197 | acpi_ut_get_object_type_name(info.return_object-> | 195 | acpi_ut_get_object_type_name(info->return_object-> |
198 | package.elements[0]), | 196 | package.elements[0]), |
199 | acpi_ut_get_object_type_name(info.return_object-> | 197 | acpi_ut_get_object_type_name(info->return_object-> |
200 | package.elements[1]))); | 198 | package.elements[1]))); |
201 | status = AE_AML_OPERAND_TYPE; | 199 | status = AE_AML_OPERAND_TYPE; |
202 | } else { | 200 | } else { |
203 | /* Valid _Sx_ package size, type, and value */ | 201 | /* Valid _Sx_ package size, type, and value */ |
204 | 202 | ||
205 | *sleep_type_a = (u8) | 203 | *sleep_type_a = (u8) |
206 | (info.return_object->package.elements[0])->integer.value; | 204 | (info->return_object->package.elements[0])->integer.value; |
207 | *sleep_type_b = (u8) | 205 | *sleep_type_b = (u8) |
208 | (info.return_object->package.elements[1])->integer.value; | 206 | (info->return_object->package.elements[1])->integer.value; |
209 | } | 207 | } |
210 | 208 | ||
211 | if (ACPI_FAILURE(status)) { | 209 | if (ACPI_FAILURE(status)) { |
212 | ACPI_EXCEPTION((AE_INFO, status, | 210 | ACPI_EXCEPTION((AE_INFO, status, |
213 | "While evaluating sleep_state [%s], bad Sleep object %p type %s", | 211 | "While evaluating SleepState [%s], bad Sleep object %p type %s", |
214 | sleep_state_name, info.return_object, | 212 | info->pathname, info->return_object, |
215 | acpi_ut_get_object_type_name(info. | 213 | acpi_ut_get_object_type_name(info-> |
216 | return_object))); | 214 | return_object))); |
217 | } | 215 | } |
218 | 216 | ||
219 | acpi_ut_remove_reference(info.return_object); | 217 | acpi_ut_remove_reference(info->return_object); |
218 | |||
219 | cleanup: | ||
220 | ACPI_FREE(info); | ||
220 | return_ACPI_STATUS(status); | 221 | return_ACPI_STATUS(status); |
221 | } | 222 | } |
222 | 223 | ||
223 | EXPORT_SYMBOL(acpi_get_sleep_type_data); | 224 | ACPI_EXPORT_SYMBOL(acpi_get_sleep_type_data) |
224 | 225 | ||
225 | /******************************************************************************* | 226 | /******************************************************************************* |
226 | * | 227 | * |
@@ -233,13 +234,12 @@ EXPORT_SYMBOL(acpi_get_sleep_type_data); | |||
233 | * DESCRIPTION: Map register_id into a register bitmask. | 234 | * DESCRIPTION: Map register_id into a register bitmask. |
234 | * | 235 | * |
235 | ******************************************************************************/ | 236 | ******************************************************************************/ |
236 | |||
237 | struct acpi_bit_register_info *acpi_hw_get_bit_register_info(u32 register_id) | 237 | struct acpi_bit_register_info *acpi_hw_get_bit_register_info(u32 register_id) |
238 | { | 238 | { |
239 | ACPI_FUNCTION_ENTRY(); | 239 | ACPI_FUNCTION_ENTRY(); |
240 | 240 | ||
241 | if (register_id > ACPI_BITREG_MAX) { | 241 | if (register_id > ACPI_BITREG_MAX) { |
242 | ACPI_ERROR((AE_INFO, "Invalid bit_register ID: %X", | 242 | ACPI_ERROR((AE_INFO, "Invalid BitRegister ID: %X", |
243 | register_id)); | 243 | register_id)); |
244 | return (NULL); | 244 | return (NULL); |
245 | } | 245 | } |
@@ -260,6 +260,8 @@ struct acpi_bit_register_info *acpi_hw_get_bit_register_info(u32 register_id) | |||
260 | * | 260 | * |
261 | * DESCRIPTION: ACPI bit_register read function. | 261 | * DESCRIPTION: ACPI bit_register read function. |
262 | * | 262 | * |
263 | * NOTE: TBD: Flags parameter is obsolete, to be removed | ||
264 | * | ||
263 | ******************************************************************************/ | 265 | ******************************************************************************/ |
264 | 266 | ||
265 | acpi_status acpi_get_register(u32 register_id, u32 * return_value, u32 flags) | 267 | acpi_status acpi_get_register(u32 register_id, u32 * return_value, u32 flags) |
@@ -268,7 +270,7 @@ acpi_status acpi_get_register(u32 register_id, u32 * return_value, u32 flags) | |||
268 | struct acpi_bit_register_info *bit_reg_info; | 270 | struct acpi_bit_register_info *bit_reg_info; |
269 | acpi_status status; | 271 | acpi_status status; |
270 | 272 | ||
271 | ACPI_FUNCTION_TRACE("acpi_get_register"); | 273 | ACPI_FUNCTION_TRACE(acpi_get_register); |
272 | 274 | ||
273 | /* Get the info structure corresponding to the requested ACPI Register */ | 275 | /* Get the info structure corresponding to the requested ACPI Register */ |
274 | 276 | ||
@@ -277,24 +279,14 @@ acpi_status acpi_get_register(u32 register_id, u32 * return_value, u32 flags) | |||
277 | return_ACPI_STATUS(AE_BAD_PARAMETER); | 279 | return_ACPI_STATUS(AE_BAD_PARAMETER); |
278 | } | 280 | } |
279 | 281 | ||
280 | if (flags & ACPI_MTX_LOCK) { | ||
281 | status = acpi_ut_acquire_mutex(ACPI_MTX_HARDWARE); | ||
282 | if (ACPI_FAILURE(status)) { | ||
283 | return_ACPI_STATUS(status); | ||
284 | } | ||
285 | } | ||
286 | |||
287 | /* Read from the register */ | 282 | /* Read from the register */ |
288 | 283 | ||
289 | status = acpi_hw_register_read(ACPI_MTX_DO_NOT_LOCK, | 284 | status = acpi_hw_register_read(ACPI_MTX_LOCK, |
290 | bit_reg_info->parent_register, | 285 | bit_reg_info->parent_register, |
291 | ®ister_value); | 286 | ®ister_value); |
292 | 287 | ||
293 | if (flags & ACPI_MTX_LOCK) { | ||
294 | (void)acpi_ut_release_mutex(ACPI_MTX_HARDWARE); | ||
295 | } | ||
296 | |||
297 | if (ACPI_SUCCESS(status)) { | 288 | if (ACPI_SUCCESS(status)) { |
289 | |||
298 | /* Normalize the value that was read */ | 290 | /* Normalize the value that was read */ |
299 | 291 | ||
300 | register_value = | 292 | register_value = |
@@ -311,7 +303,7 @@ acpi_status acpi_get_register(u32 register_id, u32 * return_value, u32 flags) | |||
311 | return_ACPI_STATUS(status); | 303 | return_ACPI_STATUS(status); |
312 | } | 304 | } |
313 | 305 | ||
314 | EXPORT_SYMBOL(acpi_get_register); | 306 | ACPI_EXPORT_SYMBOL(acpi_get_register) |
315 | 307 | ||
316 | /******************************************************************************* | 308 | /******************************************************************************* |
317 | * | 309 | * |
@@ -326,31 +318,28 @@ EXPORT_SYMBOL(acpi_get_register); | |||
326 | * | 318 | * |
327 | * DESCRIPTION: ACPI Bit Register write function. | 319 | * DESCRIPTION: ACPI Bit Register write function. |
328 | * | 320 | * |
321 | * NOTE: TBD: Flags parameter is obsolete, to be removed | ||
322 | * | ||
329 | ******************************************************************************/ | 323 | ******************************************************************************/ |
330 | |||
331 | acpi_status acpi_set_register(u32 register_id, u32 value, u32 flags) | 324 | acpi_status acpi_set_register(u32 register_id, u32 value, u32 flags) |
332 | { | 325 | { |
333 | u32 register_value = 0; | 326 | u32 register_value = 0; |
334 | struct acpi_bit_register_info *bit_reg_info; | 327 | struct acpi_bit_register_info *bit_reg_info; |
335 | acpi_status status; | 328 | acpi_status status; |
329 | acpi_cpu_flags lock_flags; | ||
336 | 330 | ||
337 | ACPI_FUNCTION_TRACE_U32("acpi_set_register", register_id); | 331 | ACPI_FUNCTION_TRACE_U32(acpi_set_register, register_id); |
338 | 332 | ||
339 | /* Get the info structure corresponding to the requested ACPI Register */ | 333 | /* Get the info structure corresponding to the requested ACPI Register */ |
340 | 334 | ||
341 | bit_reg_info = acpi_hw_get_bit_register_info(register_id); | 335 | bit_reg_info = acpi_hw_get_bit_register_info(register_id); |
342 | if (!bit_reg_info) { | 336 | if (!bit_reg_info) { |
343 | ACPI_ERROR((AE_INFO, "Bad ACPI HW register_id: %X", | 337 | ACPI_ERROR((AE_INFO, "Bad ACPI HW RegisterId: %X", |
344 | register_id)); | 338 | register_id)); |
345 | return_ACPI_STATUS(AE_BAD_PARAMETER); | 339 | return_ACPI_STATUS(AE_BAD_PARAMETER); |
346 | } | 340 | } |
347 | 341 | ||
348 | if (flags & ACPI_MTX_LOCK) { | 342 | lock_flags = acpi_os_acquire_lock(acpi_gbl_hardware_lock); |
349 | status = acpi_ut_acquire_mutex(ACPI_MTX_HARDWARE); | ||
350 | if (ACPI_FAILURE(status)) { | ||
351 | return_ACPI_STATUS(status); | ||
352 | } | ||
353 | } | ||
354 | 343 | ||
355 | /* Always do a register read first so we can insert the new bits */ | 344 | /* Always do a register read first so we can insert the new bits */ |
356 | 345 | ||
@@ -458,9 +447,7 @@ acpi_status acpi_set_register(u32 register_id, u32 value, u32 flags) | |||
458 | 447 | ||
459 | unlock_and_exit: | 448 | unlock_and_exit: |
460 | 449 | ||
461 | if (flags & ACPI_MTX_LOCK) { | 450 | acpi_os_release_lock(acpi_gbl_hardware_lock, lock_flags); |
462 | (void)acpi_ut_release_mutex(ACPI_MTX_HARDWARE); | ||
463 | } | ||
464 | 451 | ||
465 | /* Normalize the value that was read */ | 452 | /* Normalize the value that was read */ |
466 | 453 | ||
@@ -474,7 +461,7 @@ acpi_status acpi_set_register(u32 register_id, u32 value, u32 flags) | |||
474 | return_ACPI_STATUS(status); | 461 | return_ACPI_STATUS(status); |
475 | } | 462 | } |
476 | 463 | ||
477 | EXPORT_SYMBOL(acpi_set_register); | 464 | ACPI_EXPORT_SYMBOL(acpi_set_register) |
478 | 465 | ||
479 | /****************************************************************************** | 466 | /****************************************************************************** |
480 | * | 467 | * |
@@ -490,21 +477,18 @@ EXPORT_SYMBOL(acpi_set_register); | |||
490 | * given offset. | 477 | * given offset. |
491 | * | 478 | * |
492 | ******************************************************************************/ | 479 | ******************************************************************************/ |
493 | |||
494 | acpi_status | 480 | acpi_status |
495 | acpi_hw_register_read(u8 use_lock, u32 register_id, u32 * return_value) | 481 | acpi_hw_register_read(u8 use_lock, u32 register_id, u32 * return_value) |
496 | { | 482 | { |
497 | u32 value1 = 0; | 483 | u32 value1 = 0; |
498 | u32 value2 = 0; | 484 | u32 value2 = 0; |
499 | acpi_status status; | 485 | acpi_status status; |
486 | acpi_cpu_flags lock_flags = 0; | ||
500 | 487 | ||
501 | ACPI_FUNCTION_TRACE("hw_register_read"); | 488 | ACPI_FUNCTION_TRACE(hw_register_read); |
502 | 489 | ||
503 | if (ACPI_MTX_LOCK == use_lock) { | 490 | if (ACPI_MTX_LOCK == use_lock) { |
504 | status = acpi_ut_acquire_mutex(ACPI_MTX_HARDWARE); | 491 | lock_flags = acpi_os_acquire_lock(acpi_gbl_hardware_lock); |
505 | if (ACPI_FAILURE(status)) { | ||
506 | return_ACPI_STATUS(status); | ||
507 | } | ||
508 | } | 492 | } |
509 | 493 | ||
510 | switch (register_id) { | 494 | switch (register_id) { |
@@ -582,7 +566,7 @@ acpi_hw_register_read(u8 use_lock, u32 register_id, u32 * return_value) | |||
582 | 566 | ||
583 | unlock_and_exit: | 567 | unlock_and_exit: |
584 | if (ACPI_MTX_LOCK == use_lock) { | 568 | if (ACPI_MTX_LOCK == use_lock) { |
585 | (void)acpi_ut_release_mutex(ACPI_MTX_HARDWARE); | 569 | acpi_os_release_lock(acpi_gbl_hardware_lock, lock_flags); |
586 | } | 570 | } |
587 | 571 | ||
588 | if (ACPI_SUCCESS(status)) { | 572 | if (ACPI_SUCCESS(status)) { |
@@ -610,14 +594,12 @@ acpi_hw_register_read(u8 use_lock, u32 register_id, u32 * return_value) | |||
610 | acpi_status acpi_hw_register_write(u8 use_lock, u32 register_id, u32 value) | 594 | acpi_status acpi_hw_register_write(u8 use_lock, u32 register_id, u32 value) |
611 | { | 595 | { |
612 | acpi_status status; | 596 | acpi_status status; |
597 | acpi_cpu_flags lock_flags = 0; | ||
613 | 598 | ||
614 | ACPI_FUNCTION_TRACE("hw_register_write"); | 599 | ACPI_FUNCTION_TRACE(hw_register_write); |
615 | 600 | ||
616 | if (ACPI_MTX_LOCK == use_lock) { | 601 | if (ACPI_MTX_LOCK == use_lock) { |
617 | status = acpi_ut_acquire_mutex(ACPI_MTX_HARDWARE); | 602 | lock_flags = acpi_os_acquire_lock(acpi_gbl_hardware_lock); |
618 | if (ACPI_FAILURE(status)) { | ||
619 | return_ACPI_STATUS(status); | ||
620 | } | ||
621 | } | 603 | } |
622 | 604 | ||
623 | switch (register_id) { | 605 | switch (register_id) { |
@@ -707,7 +689,7 @@ acpi_status acpi_hw_register_write(u8 use_lock, u32 register_id, u32 value) | |||
707 | 689 | ||
708 | unlock_and_exit: | 690 | unlock_and_exit: |
709 | if (ACPI_MTX_LOCK == use_lock) { | 691 | if (ACPI_MTX_LOCK == use_lock) { |
710 | (void)acpi_ut_release_mutex(ACPI_MTX_HARDWARE); | 692 | acpi_os_release_lock(acpi_gbl_hardware_lock, lock_flags); |
711 | } | 693 | } |
712 | 694 | ||
713 | return_ACPI_STATUS(status); | 695 | return_ACPI_STATUS(status); |
@@ -733,7 +715,7 @@ acpi_hw_low_level_read(u32 width, u32 * value, struct acpi_generic_address *reg) | |||
733 | u64 address; | 715 | u64 address; |
734 | acpi_status status; | 716 | acpi_status status; |
735 | 717 | ||
736 | ACPI_FUNCTION_NAME("hw_low_level_read"); | 718 | ACPI_FUNCTION_NAME(hw_low_level_read); |
737 | 719 | ||
738 | /* | 720 | /* |
739 | * Must have a valid pointer to a GAS structure, and | 721 | * Must have a valid pointer to a GAS structure, and |
@@ -805,7 +787,7 @@ acpi_hw_low_level_write(u32 width, u32 value, struct acpi_generic_address * reg) | |||
805 | u64 address; | 787 | u64 address; |
806 | acpi_status status; | 788 | acpi_status status; |
807 | 789 | ||
808 | ACPI_FUNCTION_NAME("hw_low_level_write"); | 790 | ACPI_FUNCTION_NAME(hw_low_level_write); |
809 | 791 | ||
810 | /* | 792 | /* |
811 | * Must have a valid pointer to a GAS structure, and | 793 | * Must have a valid pointer to a GAS structure, and |