diff options
Diffstat (limited to 'drivers/acpi/hardware/hwacpi.c')
-rw-r--r-- | drivers/acpi/hardware/hwacpi.c | 56 |
1 files changed, 9 insertions, 47 deletions
diff --git a/drivers/acpi/hardware/hwacpi.c b/drivers/acpi/hardware/hwacpi.c index de50fab2a910..6031ca13dd2f 100644 --- a/drivers/acpi/hardware/hwacpi.c +++ b/drivers/acpi/hardware/hwacpi.c | |||
@@ -6,7 +6,7 @@ | |||
6 | *****************************************************************************/ | 6 | *****************************************************************************/ |
7 | 7 | ||
8 | /* | 8 | /* |
9 | * Copyright (C) 2000 - 2006, R. Byron Moore | 9 | * Copyright (C) 2000 - 2007, R. Byron Moore |
10 | * All rights reserved. | 10 | * All rights reserved. |
11 | * | 11 | * |
12 | * Redistribution and use in source and binary forms, with or without | 12 | * Redistribution and use in source and binary forms, with or without |
@@ -49,41 +49,6 @@ ACPI_MODULE_NAME("hwacpi") | |||
49 | 49 | ||
50 | /****************************************************************************** | 50 | /****************************************************************************** |
51 | * | 51 | * |
52 | * FUNCTION: acpi_hw_initialize | ||
53 | * | ||
54 | * PARAMETERS: None | ||
55 | * | ||
56 | * RETURN: Status | ||
57 | * | ||
58 | * DESCRIPTION: Initialize and validate the various ACPI registers defined in | ||
59 | * the FADT. | ||
60 | * | ||
61 | ******************************************************************************/ | ||
62 | acpi_status acpi_hw_initialize(void) | ||
63 | { | ||
64 | acpi_status status; | ||
65 | |||
66 | ACPI_FUNCTION_TRACE(hw_initialize); | ||
67 | |||
68 | /* We must have the ACPI tables by the time we get here */ | ||
69 | |||
70 | if (!acpi_gbl_FADT) { | ||
71 | ACPI_ERROR((AE_INFO, "No FADT is present")); | ||
72 | return_ACPI_STATUS(AE_NO_ACPI_TABLES); | ||
73 | } | ||
74 | |||
75 | /* Sanity check the FADT for valid values */ | ||
76 | |||
77 | status = acpi_ut_validate_fadt(); | ||
78 | if (ACPI_FAILURE(status)) { | ||
79 | return_ACPI_STATUS(status); | ||
80 | } | ||
81 | |||
82 | return_ACPI_STATUS(AE_OK); | ||
83 | } | ||
84 | |||
85 | /****************************************************************************** | ||
86 | * | ||
87 | * FUNCTION: acpi_hw_set_mode | 52 | * FUNCTION: acpi_hw_set_mode |
88 | * | 53 | * |
89 | * PARAMETERS: Mode - SYS_MODE_ACPI or SYS_MODE_LEGACY | 54 | * PARAMETERS: Mode - SYS_MODE_ACPI or SYS_MODE_LEGACY |
@@ -93,7 +58,6 @@ acpi_status acpi_hw_initialize(void) | |||
93 | * DESCRIPTION: Transitions the system into the requested mode. | 58 | * DESCRIPTION: Transitions the system into the requested mode. |
94 | * | 59 | * |
95 | ******************************************************************************/ | 60 | ******************************************************************************/ |
96 | |||
97 | acpi_status acpi_hw_set_mode(u32 mode) | 61 | acpi_status acpi_hw_set_mode(u32 mode) |
98 | { | 62 | { |
99 | 63 | ||
@@ -106,7 +70,7 @@ acpi_status acpi_hw_set_mode(u32 mode) | |||
106 | * ACPI 2.0 clarified that if SMI_CMD in FADT is zero, | 70 | * ACPI 2.0 clarified that if SMI_CMD in FADT is zero, |
107 | * system does not support mode transition. | 71 | * system does not support mode transition. |
108 | */ | 72 | */ |
109 | if (!acpi_gbl_FADT->smi_cmd) { | 73 | if (!acpi_gbl_FADT.smi_command) { |
110 | ACPI_ERROR((AE_INFO, | 74 | ACPI_ERROR((AE_INFO, |
111 | "No SMI_CMD in FADT, mode transition failed")); | 75 | "No SMI_CMD in FADT, mode transition failed")); |
112 | return_ACPI_STATUS(AE_NO_HARDWARE_RESPONSE); | 76 | return_ACPI_STATUS(AE_NO_HARDWARE_RESPONSE); |
@@ -119,7 +83,7 @@ acpi_status acpi_hw_set_mode(u32 mode) | |||
119 | * we make sure both the numbers are zero to determine these | 83 | * we make sure both the numbers are zero to determine these |
120 | * transitions are not supported. | 84 | * transitions are not supported. |
121 | */ | 85 | */ |
122 | if (!acpi_gbl_FADT->acpi_enable && !acpi_gbl_FADT->acpi_disable) { | 86 | if (!acpi_gbl_FADT.acpi_enable && !acpi_gbl_FADT.acpi_disable) { |
123 | ACPI_ERROR((AE_INFO, | 87 | ACPI_ERROR((AE_INFO, |
124 | "No ACPI mode transition supported in this system (enable/disable both zero)")); | 88 | "No ACPI mode transition supported in this system (enable/disable both zero)")); |
125 | return_ACPI_STATUS(AE_OK); | 89 | return_ACPI_STATUS(AE_OK); |
@@ -130,9 +94,8 @@ acpi_status acpi_hw_set_mode(u32 mode) | |||
130 | 94 | ||
131 | /* BIOS should have disabled ALL fixed and GP events */ | 95 | /* BIOS should have disabled ALL fixed and GP events */ |
132 | 96 | ||
133 | status = acpi_os_write_port(acpi_gbl_FADT->smi_cmd, | 97 | status = acpi_os_write_port(acpi_gbl_FADT.smi_command, |
134 | (u32) acpi_gbl_FADT->acpi_enable, | 98 | (u32) acpi_gbl_FADT.acpi_enable, 8); |
135 | 8); | ||
136 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 99 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
137 | "Attempting to enable ACPI mode\n")); | 100 | "Attempting to enable ACPI mode\n")); |
138 | break; | 101 | break; |
@@ -143,8 +106,8 @@ acpi_status acpi_hw_set_mode(u32 mode) | |||
143 | * BIOS should clear all fixed status bits and restore fixed event | 106 | * BIOS should clear all fixed status bits and restore fixed event |
144 | * enable bits to default | 107 | * enable bits to default |
145 | */ | 108 | */ |
146 | status = acpi_os_write_port(acpi_gbl_FADT->smi_cmd, | 109 | status = acpi_os_write_port(acpi_gbl_FADT.smi_command, |
147 | (u32) acpi_gbl_FADT->acpi_disable, | 110 | (u32) acpi_gbl_FADT.acpi_disable, |
148 | 8); | 111 | 8); |
149 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 112 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
150 | "Attempting to enable Legacy (non-ACPI) mode\n")); | 113 | "Attempting to enable Legacy (non-ACPI) mode\n")); |
@@ -204,12 +167,11 @@ u32 acpi_hw_get_mode(void) | |||
204 | * ACPI 2.0 clarified that if SMI_CMD in FADT is zero, | 167 | * ACPI 2.0 clarified that if SMI_CMD in FADT is zero, |
205 | * system does not support mode transition. | 168 | * system does not support mode transition. |
206 | */ | 169 | */ |
207 | if (!acpi_gbl_FADT->smi_cmd) { | 170 | if (!acpi_gbl_FADT.smi_command) { |
208 | return_UINT32(ACPI_SYS_MODE_ACPI); | 171 | return_UINT32(ACPI_SYS_MODE_ACPI); |
209 | } | 172 | } |
210 | 173 | ||
211 | status = | 174 | status = acpi_get_register(ACPI_BITREG_SCI_ENABLE, &value); |
212 | acpi_get_register(ACPI_BITREG_SCI_ENABLE, &value, ACPI_MTX_LOCK); | ||
213 | if (ACPI_FAILURE(status)) { | 175 | if (ACPI_FAILURE(status)) { |
214 | return_UINT32(ACPI_SYS_MODE_LEGACY); | 176 | return_UINT32(ACPI_SYS_MODE_LEGACY); |
215 | } | 177 | } |