blob: 95c4ccb3a378619f2ffac07f0952f6d71d6aa4b9 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001
2/*******************************************************************************
3 *
4 * Module Name: hwregs - Read/write access functions for the various ACPI
5 * control and status registers.
6 *
7 ******************************************************************************/
8
9/*
Bob Moore4a90c7e2006-01-13 16:22:00 -050010 * Copyright (C) 2000 - 2006, R. Byron Moore
Linus Torvalds1da177e2005-04-16 15:20:36 -070011 * All rights reserved.
12 *
13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions
15 * are met:
16 * 1. Redistributions of source code must retain the above copyright
17 * notice, this list of conditions, and the following disclaimer,
18 * without modification.
19 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
20 * substantially similar to the "NO WARRANTY" disclaimer below
21 * ("Disclaimer") and any redistribution must be conditioned upon
22 * including a substantially similar Disclaimer requirement for further
23 * binary redistribution.
24 * 3. Neither the names of the above-listed copyright holders nor the names
25 * of any contributors may be used to endorse or promote products derived
26 * from this software without specific prior written permission.
27 *
28 * Alternatively, this software may be distributed under the terms of the
29 * GNU General Public License ("GPL") version 2 as published by the Free
30 * Software Foundation.
31 *
32 * NO WARRANTY
33 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
34 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
35 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
36 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
37 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
38 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
39 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
40 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
41 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
42 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
43 * POSSIBILITY OF SUCH DAMAGES.
44 */
45
46#include <linux/module.h>
47
48#include <acpi/acpi.h>
49#include <acpi/acnamesp.h>
50#include <acpi/acevents.h>
51
52#define _COMPONENT ACPI_HARDWARE
Len Brown4be44fc2005-08-05 00:44:28 -040053ACPI_MODULE_NAME("hwregs")
Linus Torvalds1da177e2005-04-16 15:20:36 -070054
55/*******************************************************************************
56 *
57 * FUNCTION: acpi_hw_clear_acpi_status
58 *
59 * PARAMETERS: Flags - Lock the hardware or not
60 *
61 * RETURN: none
62 *
63 * DESCRIPTION: Clears all fixed and general purpose status bits
64 * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED
65 *
66 ******************************************************************************/
Len Brown4be44fc2005-08-05 00:44:28 -040067acpi_status acpi_hw_clear_acpi_status(u32 flags)
Linus Torvalds1da177e2005-04-16 15:20:36 -070068{
Len Brown4be44fc2005-08-05 00:44:28 -040069 acpi_status status;
Linus Torvalds1da177e2005-04-16 15:20:36 -070070
Len Brown4be44fc2005-08-05 00:44:28 -040071 ACPI_FUNCTION_TRACE("hw_clear_acpi_status");
Linus Torvalds1da177e2005-04-16 15:20:36 -070072
Len Brown4be44fc2005-08-05 00:44:28 -040073 ACPI_DEBUG_PRINT((ACPI_DB_IO, "About to write %04X to %04X\n",
74 ACPI_BITMASK_ALL_FIXED_STATUS,
75 (u16) acpi_gbl_FADT->xpm1a_evt_blk.address));
Linus Torvalds1da177e2005-04-16 15:20:36 -070076
77 if (flags & ACPI_MTX_LOCK) {
Len Brown4be44fc2005-08-05 00:44:28 -040078 status = acpi_ut_acquire_mutex(ACPI_MTX_HARDWARE);
79 if (ACPI_FAILURE(status)) {
80 return_ACPI_STATUS(status);
Linus Torvalds1da177e2005-04-16 15:20:36 -070081 }
82 }
83
Len Brown4be44fc2005-08-05 00:44:28 -040084 status = acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK,
85 ACPI_REGISTER_PM1_STATUS,
86 ACPI_BITMASK_ALL_FIXED_STATUS);
87 if (ACPI_FAILURE(status)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -070088 goto unlock_and_exit;
89 }
90
91 /* Clear the fixed events */
92
93 if (acpi_gbl_FADT->xpm1b_evt_blk.address) {
Len Brown4be44fc2005-08-05 00:44:28 -040094 status =
95 acpi_hw_low_level_write(16, ACPI_BITMASK_ALL_FIXED_STATUS,
96 &acpi_gbl_FADT->xpm1b_evt_blk);
97 if (ACPI_FAILURE(status)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -070098 goto unlock_and_exit;
99 }
100 }
101
102 /* Clear the GPE Bits in all GPE registers in all GPE blocks */
103
Len Brown4be44fc2005-08-05 00:44:28 -0400104 status = acpi_ev_walk_gpe_list(acpi_hw_clear_gpe_block);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700105
Len Brown4be44fc2005-08-05 00:44:28 -0400106 unlock_and_exit:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700107 if (flags & ACPI_MTX_LOCK) {
Len Brown4be44fc2005-08-05 00:44:28 -0400108 (void)acpi_ut_release_mutex(ACPI_MTX_HARDWARE);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700109 }
Len Brown4be44fc2005-08-05 00:44:28 -0400110 return_ACPI_STATUS(status);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700111}
112
Linus Torvalds1da177e2005-04-16 15:20:36 -0700113/*******************************************************************************
114 *
115 * FUNCTION: acpi_get_sleep_type_data
116 *
117 * PARAMETERS: sleep_state - Numeric sleep state
118 * *sleep_type_a - Where SLP_TYPa is returned
119 * *sleep_type_b - Where SLP_TYPb is returned
120 *
121 * RETURN: Status - ACPI status
122 *
123 * DESCRIPTION: Obtain the SLP_TYPa and SLP_TYPb values for the requested sleep
124 * state.
125 *
126 ******************************************************************************/
127
128acpi_status
Len Brown4be44fc2005-08-05 00:44:28 -0400129acpi_get_sleep_type_data(u8 sleep_state, u8 * sleep_type_a, u8 * sleep_type_b)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700130{
Len Brown4be44fc2005-08-05 00:44:28 -0400131 acpi_status status = AE_OK;
132 struct acpi_parameter_info info;
133 char *sleep_state_name;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700134
Len Brown4be44fc2005-08-05 00:44:28 -0400135 ACPI_FUNCTION_TRACE("acpi_get_sleep_type_data");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700136
Robert Moore44f6c012005-04-18 22:49:35 -0400137 /* Validate parameters */
138
Len Brown4be44fc2005-08-05 00:44:28 -0400139 if ((sleep_state > ACPI_S_STATES_MAX) || !sleep_type_a || !sleep_type_b) {
140 return_ACPI_STATUS(AE_BAD_PARAMETER);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700141 }
142
Robert Moore44f6c012005-04-18 22:49:35 -0400143 /* Evaluate the namespace object containing the values for this state */
144
Linus Torvalds1da177e2005-04-16 15:20:36 -0700145 info.parameters = NULL;
Robert Moore44f6c012005-04-18 22:49:35 -0400146 info.return_object = NULL;
Bob Mooredefba1d2005-12-16 17:05:00 -0500147 sleep_state_name =
148 ACPI_CAST_PTR(char, acpi_gbl_sleep_state_names[sleep_state]);
Robert Moore44f6c012005-04-18 22:49:35 -0400149
Len Brown4be44fc2005-08-05 00:44:28 -0400150 status = acpi_ns_evaluate_by_name(sleep_state_name, &info);
151 if (ACPI_FAILURE(status)) {
152 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
153 "%s while evaluating sleep_state [%s]\n",
154 acpi_format_exception(status),
155 sleep_state_name));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700156
Len Brown4be44fc2005-08-05 00:44:28 -0400157 return_ACPI_STATUS(status);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700158 }
159
160 /* Must have a return object */
161
162 if (!info.return_object) {
Bob Mooreb8e4d892006-01-27 16:43:00 -0500163 ACPI_ERROR((AE_INFO, "No Sleep State object returned from [%s]",
164 sleep_state_name));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700165 status = AE_NOT_EXIST;
166 }
167
168 /* It must be of type Package */
169
Len Brown4be44fc2005-08-05 00:44:28 -0400170 else if (ACPI_GET_OBJECT_TYPE(info.return_object) != ACPI_TYPE_PACKAGE) {
Bob Mooreb8e4d892006-01-27 16:43:00 -0500171 ACPI_ERROR((AE_INFO,
172 "Sleep State return object is not a Package"));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700173 status = AE_AML_OPERAND_TYPE;
174 }
175
Robert Moore44f6c012005-04-18 22:49:35 -0400176 /*
177 * The package must have at least two elements. NOTE (March 2005): This
178 * goes against the current ACPI spec which defines this object as a
179 * package with one encoded DWORD element. However, existing practice
180 * by BIOS vendors seems to be to have 2 or more elements, at least
181 * one per sleep type (A/B).
182 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700183 else if (info.return_object->package.count < 2) {
Bob Mooreb8e4d892006-01-27 16:43:00 -0500184 ACPI_ERROR((AE_INFO,
185 "Sleep State return package does not have at least two elements"));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700186 status = AE_AML_NO_OPERAND;
187 }
188
189 /* The first two elements must both be of type Integer */
190
Len Brown4be44fc2005-08-05 00:44:28 -0400191 else if ((ACPI_GET_OBJECT_TYPE(info.return_object->package.elements[0])
192 != ACPI_TYPE_INTEGER) ||
193 (ACPI_GET_OBJECT_TYPE(info.return_object->package.elements[1])
194 != ACPI_TYPE_INTEGER)) {
Bob Mooreb8e4d892006-01-27 16:43:00 -0500195 ACPI_ERROR((AE_INFO,
196 "Sleep State return package elements are not both Integers (%s, %s)",
197 acpi_ut_get_object_type_name(info.return_object->
198 package.elements[0]),
199 acpi_ut_get_object_type_name(info.return_object->
200 package.elements[1])));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700201 status = AE_AML_OPERAND_TYPE;
Len Brown4be44fc2005-08-05 00:44:28 -0400202 } else {
Robert Moore44f6c012005-04-18 22:49:35 -0400203 /* Valid _Sx_ package size, type, and value */
204
205 *sleep_type_a = (u8)
Len Brown4be44fc2005-08-05 00:44:28 -0400206 (info.return_object->package.elements[0])->integer.value;
Robert Moore44f6c012005-04-18 22:49:35 -0400207 *sleep_type_b = (u8)
Len Brown4be44fc2005-08-05 00:44:28 -0400208 (info.return_object->package.elements[1])->integer.value;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700209 }
210
Len Brown4be44fc2005-08-05 00:44:28 -0400211 if (ACPI_FAILURE(status)) {
Bob Mooreb8e4d892006-01-27 16:43:00 -0500212 ACPI_EXCEPTION((AE_INFO, status,
213 "While evaluating sleep_state [%s], bad Sleep object %p type %s",
214 sleep_state_name, info.return_object,
215 acpi_ut_get_object_type_name(info.
216 return_object)));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700217 }
218
Len Brown4be44fc2005-08-05 00:44:28 -0400219 acpi_ut_remove_reference(info.return_object);
220 return_ACPI_STATUS(status);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700221}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700222
Len Brown4be44fc2005-08-05 00:44:28 -0400223EXPORT_SYMBOL(acpi_get_sleep_type_data);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700224
225/*******************************************************************************
226 *
227 * FUNCTION: acpi_hw_get_register_bit_mask
228 *
229 * PARAMETERS: register_id - Index of ACPI Register to access
230 *
Robert Moore44f6c012005-04-18 22:49:35 -0400231 * RETURN: The bitmask to be used when accessing the register
Linus Torvalds1da177e2005-04-16 15:20:36 -0700232 *
Robert Moore44f6c012005-04-18 22:49:35 -0400233 * DESCRIPTION: Map register_id into a register bitmask.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700234 *
235 ******************************************************************************/
236
Len Brown4be44fc2005-08-05 00:44:28 -0400237struct acpi_bit_register_info *acpi_hw_get_bit_register_info(u32 register_id)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700238{
Bob Moore4a90c7e2006-01-13 16:22:00 -0500239 ACPI_FUNCTION_ENTRY();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700240
241 if (register_id > ACPI_BITREG_MAX) {
Bob Mooreb8e4d892006-01-27 16:43:00 -0500242 ACPI_ERROR((AE_INFO, "Invalid bit_register ID: %X",
243 register_id));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700244 return (NULL);
245 }
246
247 return (&acpi_gbl_bit_register_info[register_id]);
248}
249
Linus Torvalds1da177e2005-04-16 15:20:36 -0700250/*******************************************************************************
251 *
252 * FUNCTION: acpi_get_register
253 *
254 * PARAMETERS: register_id - ID of ACPI bit_register to access
255 * return_value - Value that was read from the register
256 * Flags - Lock the hardware or not
257 *
258 * RETURN: Status and the value read from specified Register. Value
259 * returned is normalized to bit0 (is shifted all the way right)
260 *
261 * DESCRIPTION: ACPI bit_register read function.
262 *
263 ******************************************************************************/
264
Len Brown4be44fc2005-08-05 00:44:28 -0400265acpi_status acpi_get_register(u32 register_id, u32 * return_value, u32 flags)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700266{
Len Brown4be44fc2005-08-05 00:44:28 -0400267 u32 register_value = 0;
268 struct acpi_bit_register_info *bit_reg_info;
269 acpi_status status;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700270
Len Brown4be44fc2005-08-05 00:44:28 -0400271 ACPI_FUNCTION_TRACE("acpi_get_register");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700272
273 /* Get the info structure corresponding to the requested ACPI Register */
274
Len Brown4be44fc2005-08-05 00:44:28 -0400275 bit_reg_info = acpi_hw_get_bit_register_info(register_id);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700276 if (!bit_reg_info) {
Len Brown4be44fc2005-08-05 00:44:28 -0400277 return_ACPI_STATUS(AE_BAD_PARAMETER);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700278 }
279
280 if (flags & ACPI_MTX_LOCK) {
Len Brown4be44fc2005-08-05 00:44:28 -0400281 status = acpi_ut_acquire_mutex(ACPI_MTX_HARDWARE);
282 if (ACPI_FAILURE(status)) {
283 return_ACPI_STATUS(status);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700284 }
285 }
286
287 /* Read from the register */
288
Len Brown4be44fc2005-08-05 00:44:28 -0400289 status = acpi_hw_register_read(ACPI_MTX_DO_NOT_LOCK,
290 bit_reg_info->parent_register,
291 &register_value);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700292
293 if (flags & ACPI_MTX_LOCK) {
Len Brown4be44fc2005-08-05 00:44:28 -0400294 (void)acpi_ut_release_mutex(ACPI_MTX_HARDWARE);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700295 }
296
Len Brown4be44fc2005-08-05 00:44:28 -0400297 if (ACPI_SUCCESS(status)) {
Bob Moore52fc0b02006-10-02 00:00:00 -0400298
Linus Torvalds1da177e2005-04-16 15:20:36 -0700299 /* Normalize the value that was read */
300
Len Brown4be44fc2005-08-05 00:44:28 -0400301 register_value =
302 ((register_value & bit_reg_info->access_bit_mask)
303 >> bit_reg_info->bit_position);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700304
305 *return_value = register_value;
306
Len Brown4be44fc2005-08-05 00:44:28 -0400307 ACPI_DEBUG_PRINT((ACPI_DB_IO, "Read value %8.8X register %X\n",
308 register_value,
309 bit_reg_info->parent_register));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700310 }
311
Len Brown4be44fc2005-08-05 00:44:28 -0400312 return_ACPI_STATUS(status);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700313}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700314
Len Brown4be44fc2005-08-05 00:44:28 -0400315EXPORT_SYMBOL(acpi_get_register);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700316
317/*******************************************************************************
318 *
319 * FUNCTION: acpi_set_register
320 *
321 * PARAMETERS: register_id - ID of ACPI bit_register to access
322 * Value - (only used on write) value to write to the
323 * Register, NOT pre-normalized to the bit pos
324 * Flags - Lock the hardware or not
325 *
326 * RETURN: Status
327 *
328 * DESCRIPTION: ACPI Bit Register write function.
329 *
330 ******************************************************************************/
331
Len Brown4be44fc2005-08-05 00:44:28 -0400332acpi_status acpi_set_register(u32 register_id, u32 value, u32 flags)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700333{
Len Brown4be44fc2005-08-05 00:44:28 -0400334 u32 register_value = 0;
335 struct acpi_bit_register_info *bit_reg_info;
336 acpi_status status;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700337
Len Brown4be44fc2005-08-05 00:44:28 -0400338 ACPI_FUNCTION_TRACE_U32("acpi_set_register", register_id);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700339
340 /* Get the info structure corresponding to the requested ACPI Register */
341
Len Brown4be44fc2005-08-05 00:44:28 -0400342 bit_reg_info = acpi_hw_get_bit_register_info(register_id);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700343 if (!bit_reg_info) {
Bob Mooreb8e4d892006-01-27 16:43:00 -0500344 ACPI_ERROR((AE_INFO, "Bad ACPI HW register_id: %X",
345 register_id));
Len Brown4be44fc2005-08-05 00:44:28 -0400346 return_ACPI_STATUS(AE_BAD_PARAMETER);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700347 }
348
349 if (flags & ACPI_MTX_LOCK) {
Len Brown4be44fc2005-08-05 00:44:28 -0400350 status = acpi_ut_acquire_mutex(ACPI_MTX_HARDWARE);
351 if (ACPI_FAILURE(status)) {
352 return_ACPI_STATUS(status);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700353 }
354 }
355
356 /* Always do a register read first so we can insert the new bits */
357
Len Brown4be44fc2005-08-05 00:44:28 -0400358 status = acpi_hw_register_read(ACPI_MTX_DO_NOT_LOCK,
359 bit_reg_info->parent_register,
360 &register_value);
361 if (ACPI_FAILURE(status)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700362 goto unlock_and_exit;
363 }
364
365 /*
366 * Decode the Register ID
367 * Register ID = [Register block ID] | [bit ID]
368 *
369 * Check bit ID to fine locate Register offset.
370 * Check Mask to determine Register offset, and then read-write.
371 */
372 switch (bit_reg_info->parent_register) {
373 case ACPI_REGISTER_PM1_STATUS:
374
375 /*
376 * Status Registers are different from the rest. Clear by
377 * writing 1, and writing 0 has no effect. So, the only relevant
378 * information is the single bit we're interested in, all others should
379 * be written as 0 so they will be left unchanged.
380 */
Len Brown4be44fc2005-08-05 00:44:28 -0400381 value = ACPI_REGISTER_PREPARE_BITS(value,
382 bit_reg_info->bit_position,
383 bit_reg_info->
384 access_bit_mask);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700385 if (value) {
Len Brown4be44fc2005-08-05 00:44:28 -0400386 status = acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK,
387 ACPI_REGISTER_PM1_STATUS,
388 (u16) value);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700389 register_value = 0;
390 }
391 break;
392
Linus Torvalds1da177e2005-04-16 15:20:36 -0700393 case ACPI_REGISTER_PM1_ENABLE:
394
Len Brown4be44fc2005-08-05 00:44:28 -0400395 ACPI_REGISTER_INSERT_VALUE(register_value,
396 bit_reg_info->bit_position,
397 bit_reg_info->access_bit_mask,
398 value);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700399
Len Brown4be44fc2005-08-05 00:44:28 -0400400 status = acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK,
401 ACPI_REGISTER_PM1_ENABLE,
402 (u16) register_value);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700403 break;
404
Linus Torvalds1da177e2005-04-16 15:20:36 -0700405 case ACPI_REGISTER_PM1_CONTROL:
406
407 /*
408 * Write the PM1 Control register.
409 * Note that at this level, the fact that there are actually TWO
410 * registers (A and B - and B may not exist) is abstracted.
411 */
Len Brown4be44fc2005-08-05 00:44:28 -0400412 ACPI_DEBUG_PRINT((ACPI_DB_IO, "PM1 control: Read %X\n",
413 register_value));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700414
Len Brown4be44fc2005-08-05 00:44:28 -0400415 ACPI_REGISTER_INSERT_VALUE(register_value,
416 bit_reg_info->bit_position,
417 bit_reg_info->access_bit_mask,
418 value);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700419
Len Brown4be44fc2005-08-05 00:44:28 -0400420 status = acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK,
421 ACPI_REGISTER_PM1_CONTROL,
422 (u16) register_value);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700423 break;
424
Linus Torvalds1da177e2005-04-16 15:20:36 -0700425 case ACPI_REGISTER_PM2_CONTROL:
426
Len Brown4be44fc2005-08-05 00:44:28 -0400427 status = acpi_hw_register_read(ACPI_MTX_DO_NOT_LOCK,
428 ACPI_REGISTER_PM2_CONTROL,
429 &register_value);
430 if (ACPI_FAILURE(status)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700431 goto unlock_and_exit;
432 }
433
Len Brown4be44fc2005-08-05 00:44:28 -0400434 ACPI_DEBUG_PRINT((ACPI_DB_IO,
435 "PM2 control: Read %X from %8.8X%8.8X\n",
436 register_value,
437 ACPI_FORMAT_UINT64(acpi_gbl_FADT->
438 xpm2_cnt_blk.address)));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700439
Len Brown4be44fc2005-08-05 00:44:28 -0400440 ACPI_REGISTER_INSERT_VALUE(register_value,
441 bit_reg_info->bit_position,
442 bit_reg_info->access_bit_mask,
443 value);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700444
Len Brown4be44fc2005-08-05 00:44:28 -0400445 ACPI_DEBUG_PRINT((ACPI_DB_IO,
446 "About to write %4.4X to %8.8X%8.8X\n",
447 register_value,
448 ACPI_FORMAT_UINT64(acpi_gbl_FADT->
449 xpm2_cnt_blk.address)));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700450
Len Brown4be44fc2005-08-05 00:44:28 -0400451 status = acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK,
452 ACPI_REGISTER_PM2_CONTROL,
453 (u8) (register_value));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700454 break;
455
Linus Torvalds1da177e2005-04-16 15:20:36 -0700456 default:
457 break;
458 }
459
Len Brown4be44fc2005-08-05 00:44:28 -0400460 unlock_and_exit:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700461
462 if (flags & ACPI_MTX_LOCK) {
Len Brown4be44fc2005-08-05 00:44:28 -0400463 (void)acpi_ut_release_mutex(ACPI_MTX_HARDWARE);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700464 }
465
466 /* Normalize the value that was read */
467
Len Brown4be44fc2005-08-05 00:44:28 -0400468 ACPI_DEBUG_EXEC(register_value =
469 ((register_value & bit_reg_info->access_bit_mask) >>
470 bit_reg_info->bit_position));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700471
Len Brown4be44fc2005-08-05 00:44:28 -0400472 ACPI_DEBUG_PRINT((ACPI_DB_IO,
473 "Set bits: %8.8X actual %8.8X register %X\n", value,
474 register_value, bit_reg_info->parent_register));
475 return_ACPI_STATUS(status);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700476}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700477
Len Brown4be44fc2005-08-05 00:44:28 -0400478EXPORT_SYMBOL(acpi_set_register);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700479
480/******************************************************************************
481 *
482 * FUNCTION: acpi_hw_register_read
483 *
484 * PARAMETERS: use_lock - Mutex hw access
485 * register_id - register_iD + Offset
Robert Moore44f6c012005-04-18 22:49:35 -0400486 * return_value - Where the register value is returned
Linus Torvalds1da177e2005-04-16 15:20:36 -0700487 *
488 * RETURN: Status and the value read.
489 *
490 * DESCRIPTION: Acpi register read function. Registers are read at the
491 * given offset.
492 *
493 ******************************************************************************/
494
495acpi_status
Len Brown4be44fc2005-08-05 00:44:28 -0400496acpi_hw_register_read(u8 use_lock, u32 register_id, u32 * return_value)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700497{
Len Brown4be44fc2005-08-05 00:44:28 -0400498 u32 value1 = 0;
499 u32 value2 = 0;
500 acpi_status status;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700501
Len Brown4be44fc2005-08-05 00:44:28 -0400502 ACPI_FUNCTION_TRACE("hw_register_read");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700503
504 if (ACPI_MTX_LOCK == use_lock) {
Len Brown4be44fc2005-08-05 00:44:28 -0400505 status = acpi_ut_acquire_mutex(ACPI_MTX_HARDWARE);
506 if (ACPI_FAILURE(status)) {
507 return_ACPI_STATUS(status);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700508 }
509 }
510
511 switch (register_id) {
Len Brown4be44fc2005-08-05 00:44:28 -0400512 case ACPI_REGISTER_PM1_STATUS: /* 16-bit access */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700513
Len Brown4be44fc2005-08-05 00:44:28 -0400514 status =
515 acpi_hw_low_level_read(16, &value1,
516 &acpi_gbl_FADT->xpm1a_evt_blk);
517 if (ACPI_FAILURE(status)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700518 goto unlock_and_exit;
519 }
520
521 /* PM1B is optional */
522
Len Brown4be44fc2005-08-05 00:44:28 -0400523 status =
524 acpi_hw_low_level_read(16, &value2,
525 &acpi_gbl_FADT->xpm1b_evt_blk);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700526 value1 |= value2;
527 break;
528
Len Brown4be44fc2005-08-05 00:44:28 -0400529 case ACPI_REGISTER_PM1_ENABLE: /* 16-bit access */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700530
Len Brown4be44fc2005-08-05 00:44:28 -0400531 status =
532 acpi_hw_low_level_read(16, &value1, &acpi_gbl_xpm1a_enable);
533 if (ACPI_FAILURE(status)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700534 goto unlock_and_exit;
535 }
536
537 /* PM1B is optional */
538
Len Brown4be44fc2005-08-05 00:44:28 -0400539 status =
540 acpi_hw_low_level_read(16, &value2, &acpi_gbl_xpm1b_enable);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700541 value1 |= value2;
542 break;
543
Len Brown4be44fc2005-08-05 00:44:28 -0400544 case ACPI_REGISTER_PM1_CONTROL: /* 16-bit access */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700545
Len Brown4be44fc2005-08-05 00:44:28 -0400546 status =
547 acpi_hw_low_level_read(16, &value1,
548 &acpi_gbl_FADT->xpm1a_cnt_blk);
549 if (ACPI_FAILURE(status)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700550 goto unlock_and_exit;
551 }
552
Len Brown4be44fc2005-08-05 00:44:28 -0400553 status =
554 acpi_hw_low_level_read(16, &value2,
555 &acpi_gbl_FADT->xpm1b_cnt_blk);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700556 value1 |= value2;
557 break;
558
Len Brown4be44fc2005-08-05 00:44:28 -0400559 case ACPI_REGISTER_PM2_CONTROL: /* 8-bit access */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700560
Len Brown4be44fc2005-08-05 00:44:28 -0400561 status =
562 acpi_hw_low_level_read(8, &value1,
563 &acpi_gbl_FADT->xpm2_cnt_blk);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700564 break;
565
Len Brown4be44fc2005-08-05 00:44:28 -0400566 case ACPI_REGISTER_PM_TIMER: /* 32-bit access */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700567
Len Brown4be44fc2005-08-05 00:44:28 -0400568 status =
569 acpi_hw_low_level_read(32, &value1,
570 &acpi_gbl_FADT->xpm_tmr_blk);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700571 break;
572
Len Brown4be44fc2005-08-05 00:44:28 -0400573 case ACPI_REGISTER_SMI_COMMAND_BLOCK: /* 8-bit access */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700574
Len Brown4be44fc2005-08-05 00:44:28 -0400575 status = acpi_os_read_port(acpi_gbl_FADT->smi_cmd, &value1, 8);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700576 break;
577
578 default:
Bob Mooreb8e4d892006-01-27 16:43:00 -0500579 ACPI_ERROR((AE_INFO, "Unknown Register ID: %X", register_id));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700580 status = AE_BAD_PARAMETER;
581 break;
582 }
583
Len Brown4be44fc2005-08-05 00:44:28 -0400584 unlock_and_exit:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700585 if (ACPI_MTX_LOCK == use_lock) {
Len Brown4be44fc2005-08-05 00:44:28 -0400586 (void)acpi_ut_release_mutex(ACPI_MTX_HARDWARE);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700587 }
588
Len Brown4be44fc2005-08-05 00:44:28 -0400589 if (ACPI_SUCCESS(status)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700590 *return_value = value1;
591 }
592
Len Brown4be44fc2005-08-05 00:44:28 -0400593 return_ACPI_STATUS(status);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700594}
595
Linus Torvalds1da177e2005-04-16 15:20:36 -0700596/******************************************************************************
597 *
598 * FUNCTION: acpi_hw_register_write
599 *
600 * PARAMETERS: use_lock - Mutex hw access
601 * register_id - register_iD + Offset
602 * Value - The value to write
603 *
604 * RETURN: Status
605 *
606 * DESCRIPTION: Acpi register Write function. Registers are written at the
607 * given offset.
608 *
609 ******************************************************************************/
610
Len Brown4be44fc2005-08-05 00:44:28 -0400611acpi_status acpi_hw_register_write(u8 use_lock, u32 register_id, u32 value)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700612{
Len Brown4be44fc2005-08-05 00:44:28 -0400613 acpi_status status;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700614
Len Brown4be44fc2005-08-05 00:44:28 -0400615 ACPI_FUNCTION_TRACE("hw_register_write");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700616
617 if (ACPI_MTX_LOCK == use_lock) {
Len Brown4be44fc2005-08-05 00:44:28 -0400618 status = acpi_ut_acquire_mutex(ACPI_MTX_HARDWARE);
619 if (ACPI_FAILURE(status)) {
620 return_ACPI_STATUS(status);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700621 }
622 }
623
624 switch (register_id) {
Len Brown4be44fc2005-08-05 00:44:28 -0400625 case ACPI_REGISTER_PM1_STATUS: /* 16-bit access */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700626
Len Brown4be44fc2005-08-05 00:44:28 -0400627 status =
628 acpi_hw_low_level_write(16, value,
629 &acpi_gbl_FADT->xpm1a_evt_blk);
630 if (ACPI_FAILURE(status)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700631 goto unlock_and_exit;
632 }
633
634 /* PM1B is optional */
635
Len Brown4be44fc2005-08-05 00:44:28 -0400636 status =
637 acpi_hw_low_level_write(16, value,
638 &acpi_gbl_FADT->xpm1b_evt_blk);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700639 break;
640
Len Brown4be44fc2005-08-05 00:44:28 -0400641 case ACPI_REGISTER_PM1_ENABLE: /* 16-bit access */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700642
Len Brown4be44fc2005-08-05 00:44:28 -0400643 status =
644 acpi_hw_low_level_write(16, value, &acpi_gbl_xpm1a_enable);
645 if (ACPI_FAILURE(status)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700646 goto unlock_and_exit;
647 }
648
649 /* PM1B is optional */
650
Len Brown4be44fc2005-08-05 00:44:28 -0400651 status =
652 acpi_hw_low_level_write(16, value, &acpi_gbl_xpm1b_enable);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700653 break;
654
Len Brown4be44fc2005-08-05 00:44:28 -0400655 case ACPI_REGISTER_PM1_CONTROL: /* 16-bit access */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700656
Len Brown4be44fc2005-08-05 00:44:28 -0400657 status =
658 acpi_hw_low_level_write(16, value,
659 &acpi_gbl_FADT->xpm1a_cnt_blk);
660 if (ACPI_FAILURE(status)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700661 goto unlock_and_exit;
662 }
663
Len Brown4be44fc2005-08-05 00:44:28 -0400664 status =
665 acpi_hw_low_level_write(16, value,
666 &acpi_gbl_FADT->xpm1b_cnt_blk);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700667 break;
668
Len Brown4be44fc2005-08-05 00:44:28 -0400669 case ACPI_REGISTER_PM1A_CONTROL: /* 16-bit access */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700670
Len Brown4be44fc2005-08-05 00:44:28 -0400671 status =
672 acpi_hw_low_level_write(16, value,
673 &acpi_gbl_FADT->xpm1a_cnt_blk);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700674 break;
675
Len Brown4be44fc2005-08-05 00:44:28 -0400676 case ACPI_REGISTER_PM1B_CONTROL: /* 16-bit access */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700677
Len Brown4be44fc2005-08-05 00:44:28 -0400678 status =
679 acpi_hw_low_level_write(16, value,
680 &acpi_gbl_FADT->xpm1b_cnt_blk);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700681 break;
682
Len Brown4be44fc2005-08-05 00:44:28 -0400683 case ACPI_REGISTER_PM2_CONTROL: /* 8-bit access */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700684
Len Brown4be44fc2005-08-05 00:44:28 -0400685 status =
686 acpi_hw_low_level_write(8, value,
687 &acpi_gbl_FADT->xpm2_cnt_blk);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700688 break;
689
Len Brown4be44fc2005-08-05 00:44:28 -0400690 case ACPI_REGISTER_PM_TIMER: /* 32-bit access */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700691
Len Brown4be44fc2005-08-05 00:44:28 -0400692 status =
693 acpi_hw_low_level_write(32, value,
694 &acpi_gbl_FADT->xpm_tmr_blk);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700695 break;
696
Len Brown4be44fc2005-08-05 00:44:28 -0400697 case ACPI_REGISTER_SMI_COMMAND_BLOCK: /* 8-bit access */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700698
699 /* SMI_CMD is currently always in IO space */
700
Len Brown4be44fc2005-08-05 00:44:28 -0400701 status = acpi_os_write_port(acpi_gbl_FADT->smi_cmd, value, 8);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700702 break;
703
Linus Torvalds1da177e2005-04-16 15:20:36 -0700704 default:
705 status = AE_BAD_PARAMETER;
706 break;
707 }
708
Len Brown4be44fc2005-08-05 00:44:28 -0400709 unlock_and_exit:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700710 if (ACPI_MTX_LOCK == use_lock) {
Len Brown4be44fc2005-08-05 00:44:28 -0400711 (void)acpi_ut_release_mutex(ACPI_MTX_HARDWARE);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700712 }
713
Len Brown4be44fc2005-08-05 00:44:28 -0400714 return_ACPI_STATUS(status);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700715}
716
Linus Torvalds1da177e2005-04-16 15:20:36 -0700717/******************************************************************************
718 *
719 * FUNCTION: acpi_hw_low_level_read
720 *
721 * PARAMETERS: Width - 8, 16, or 32
722 * Value - Where the value is returned
723 * Reg - GAS register structure
724 *
725 * RETURN: Status
726 *
727 * DESCRIPTION: Read from either memory or IO space.
728 *
729 ******************************************************************************/
730
731acpi_status
Len Brown4be44fc2005-08-05 00:44:28 -0400732acpi_hw_low_level_read(u32 width, u32 * value, struct acpi_generic_address *reg)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700733{
Len Brown4be44fc2005-08-05 00:44:28 -0400734 u64 address;
735 acpi_status status;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700736
Len Brown4be44fc2005-08-05 00:44:28 -0400737 ACPI_FUNCTION_NAME("hw_low_level_read");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700738
739 /*
740 * Must have a valid pointer to a GAS structure, and
741 * a non-zero address within. However, don't return an error
742 * because the PM1A/B code must not fail if B isn't present.
743 */
744 if (!reg) {
745 return (AE_OK);
746 }
747
748 /* Get a local copy of the address. Handles possible alignment issues */
749
Len Brown4be44fc2005-08-05 00:44:28 -0400750 ACPI_MOVE_64_TO_64(&address, &reg->address);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700751 if (!address) {
752 return (AE_OK);
753 }
754 *value = 0;
755
756 /*
757 * Two address spaces supported: Memory or IO.
758 * PCI_Config is not supported here because the GAS struct is insufficient
759 */
760 switch (reg->address_space_id) {
761 case ACPI_ADR_SPACE_SYSTEM_MEMORY:
762
Len Brown4be44fc2005-08-05 00:44:28 -0400763 status = acpi_os_read_memory((acpi_physical_address) address,
764 value, width);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700765 break;
766
Linus Torvalds1da177e2005-04-16 15:20:36 -0700767 case ACPI_ADR_SPACE_SYSTEM_IO:
768
Len Brown4be44fc2005-08-05 00:44:28 -0400769 status = acpi_os_read_port((acpi_io_address) address,
770 value, width);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700771 break;
772
Linus Torvalds1da177e2005-04-16 15:20:36 -0700773 default:
Bob Mooreb8e4d892006-01-27 16:43:00 -0500774 ACPI_ERROR((AE_INFO,
775 "Unsupported address space: %X",
776 reg->address_space_id));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700777 return (AE_BAD_PARAMETER);
778 }
779
Len Brown4be44fc2005-08-05 00:44:28 -0400780 ACPI_DEBUG_PRINT((ACPI_DB_IO,
781 "Read: %8.8X width %2d from %8.8X%8.8X (%s)\n",
782 *value, width,
783 ACPI_FORMAT_UINT64(address),
784 acpi_ut_get_region_name(reg->address_space_id)));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700785
786 return (status);
787}
788
Linus Torvalds1da177e2005-04-16 15:20:36 -0700789/******************************************************************************
790 *
791 * FUNCTION: acpi_hw_low_level_write
792 *
793 * PARAMETERS: Width - 8, 16, or 32
794 * Value - To be written
795 * Reg - GAS register structure
796 *
797 * RETURN: Status
798 *
799 * DESCRIPTION: Write to either memory or IO space.
800 *
801 ******************************************************************************/
802
803acpi_status
Len Brown4be44fc2005-08-05 00:44:28 -0400804acpi_hw_low_level_write(u32 width, u32 value, struct acpi_generic_address * reg)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700805{
Len Brown4be44fc2005-08-05 00:44:28 -0400806 u64 address;
807 acpi_status status;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700808
Len Brown4be44fc2005-08-05 00:44:28 -0400809 ACPI_FUNCTION_NAME("hw_low_level_write");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700810
811 /*
812 * Must have a valid pointer to a GAS structure, and
813 * a non-zero address within. However, don't return an error
814 * because the PM1A/B code must not fail if B isn't present.
815 */
816 if (!reg) {
817 return (AE_OK);
818 }
819
820 /* Get a local copy of the address. Handles possible alignment issues */
821
Len Brown4be44fc2005-08-05 00:44:28 -0400822 ACPI_MOVE_64_TO_64(&address, &reg->address);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700823 if (!address) {
824 return (AE_OK);
825 }
826
827 /*
828 * Two address spaces supported: Memory or IO.
829 * PCI_Config is not supported here because the GAS struct is insufficient
830 */
831 switch (reg->address_space_id) {
832 case ACPI_ADR_SPACE_SYSTEM_MEMORY:
833
Len Brown4be44fc2005-08-05 00:44:28 -0400834 status = acpi_os_write_memory((acpi_physical_address) address,
835 value, width);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700836 break;
837
Linus Torvalds1da177e2005-04-16 15:20:36 -0700838 case ACPI_ADR_SPACE_SYSTEM_IO:
839
Len Brown4be44fc2005-08-05 00:44:28 -0400840 status = acpi_os_write_port((acpi_io_address) address,
841 value, width);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700842 break;
843
Linus Torvalds1da177e2005-04-16 15:20:36 -0700844 default:
Bob Mooreb8e4d892006-01-27 16:43:00 -0500845 ACPI_ERROR((AE_INFO,
846 "Unsupported address space: %X",
847 reg->address_space_id));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700848 return (AE_BAD_PARAMETER);
849 }
850
Len Brown4be44fc2005-08-05 00:44:28 -0400851 ACPI_DEBUG_PRINT((ACPI_DB_IO,
852 "Wrote: %8.8X width %2d to %8.8X%8.8X (%s)\n",
853 value, width,
854 ACPI_FORMAT_UINT64(address),
855 acpi_ut_get_region_name(reg->address_space_id)));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700856
857 return (status);
858}