diff options
Diffstat (limited to 'drivers/acpi/acpica/hwregs.c')
-rw-r--r-- | drivers/acpi/acpica/hwregs.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/acpi/acpica/hwregs.c b/drivers/acpi/acpica/hwregs.c index 4ea4eeb51bfd..6b6c83b87b52 100644 --- a/drivers/acpi/acpica/hwregs.c +++ b/drivers/acpi/acpica/hwregs.c | |||
@@ -51,6 +51,7 @@ | |||
51 | #define _COMPONENT ACPI_HARDWARE | 51 | #define _COMPONENT ACPI_HARDWARE |
52 | ACPI_MODULE_NAME("hwregs") | 52 | ACPI_MODULE_NAME("hwregs") |
53 | 53 | ||
54 | #if (!ACPI_REDUCED_HARDWARE) | ||
54 | /* Local Prototypes */ | 55 | /* Local Prototypes */ |
55 | static acpi_status | 56 | static acpi_status |
56 | acpi_hw_read_multiple(u32 *value, | 57 | acpi_hw_read_multiple(u32 *value, |
@@ -62,6 +63,8 @@ acpi_hw_write_multiple(u32 value, | |||
62 | struct acpi_generic_address *register_a, | 63 | struct acpi_generic_address *register_a, |
63 | struct acpi_generic_address *register_b); | 64 | struct acpi_generic_address *register_b); |
64 | 65 | ||
66 | #endif /* !ACPI_REDUCED_HARDWARE */ | ||
67 | |||
65 | /****************************************************************************** | 68 | /****************************************************************************** |
66 | * | 69 | * |
67 | * FUNCTION: acpi_hw_validate_register | 70 | * FUNCTION: acpi_hw_validate_register |
@@ -154,6 +157,7 @@ acpi_hw_validate_register(struct acpi_generic_address *reg, | |||
154 | acpi_status acpi_hw_read(u32 *value, struct acpi_generic_address *reg) | 157 | acpi_status acpi_hw_read(u32 *value, struct acpi_generic_address *reg) |
155 | { | 158 | { |
156 | u64 address; | 159 | u64 address; |
160 | u64 value64; | ||
157 | acpi_status status; | 161 | acpi_status status; |
158 | 162 | ||
159 | ACPI_FUNCTION_NAME(hw_read); | 163 | ACPI_FUNCTION_NAME(hw_read); |
@@ -175,7 +179,9 @@ acpi_status acpi_hw_read(u32 *value, struct acpi_generic_address *reg) | |||
175 | */ | 179 | */ |
176 | if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) { | 180 | if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) { |
177 | status = acpi_os_read_memory((acpi_physical_address) | 181 | status = acpi_os_read_memory((acpi_physical_address) |
178 | address, value, reg->bit_width); | 182 | address, &value64, reg->bit_width); |
183 | |||
184 | *value = (u32)value64; | ||
179 | } else { /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */ | 185 | } else { /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */ |
180 | 186 | ||
181 | status = acpi_hw_read_port((acpi_io_address) | 187 | status = acpi_hw_read_port((acpi_io_address) |
@@ -225,7 +231,8 @@ acpi_status acpi_hw_write(u32 value, struct acpi_generic_address *reg) | |||
225 | */ | 231 | */ |
226 | if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) { | 232 | if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) { |
227 | status = acpi_os_write_memory((acpi_physical_address) | 233 | status = acpi_os_write_memory((acpi_physical_address) |
228 | address, value, reg->bit_width); | 234 | address, (u64)value, |
235 | reg->bit_width); | ||
229 | } else { /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */ | 236 | } else { /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */ |
230 | 237 | ||
231 | status = acpi_hw_write_port((acpi_io_address) | 238 | status = acpi_hw_write_port((acpi_io_address) |
@@ -240,6 +247,7 @@ acpi_status acpi_hw_write(u32 value, struct acpi_generic_address *reg) | |||
240 | return (status); | 247 | return (status); |
241 | } | 248 | } |
242 | 249 | ||
250 | #if (!ACPI_REDUCED_HARDWARE) | ||
243 | /******************************************************************************* | 251 | /******************************************************************************* |
244 | * | 252 | * |
245 | * FUNCTION: acpi_hw_clear_acpi_status | 253 | * FUNCTION: acpi_hw_clear_acpi_status |
@@ -285,7 +293,7 @@ exit: | |||
285 | 293 | ||
286 | /******************************************************************************* | 294 | /******************************************************************************* |
287 | * | 295 | * |
288 | * FUNCTION: acpi_hw_get_register_bit_mask | 296 | * FUNCTION: acpi_hw_get_bit_register_info |
289 | * | 297 | * |
290 | * PARAMETERS: register_id - Index of ACPI Register to access | 298 | * PARAMETERS: register_id - Index of ACPI Register to access |
291 | * | 299 | * |
@@ -658,3 +666,5 @@ acpi_hw_write_multiple(u32 value, | |||
658 | 666 | ||
659 | return (status); | 667 | return (status); |
660 | } | 668 | } |
669 | |||
670 | #endif /* !ACPI_REDUCED_HARDWARE */ | ||