aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica/hwgpe.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/acpica/hwgpe.c')
-rw-r--r--drivers/acpi/acpica/hwgpe.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/drivers/acpi/acpica/hwgpe.c b/drivers/acpi/acpica/hwgpe.c
index 14750db2a1b..85c3cbd4304 100644
--- a/drivers/acpi/acpica/hwgpe.c
+++ b/drivers/acpi/acpica/hwgpe.c
@@ -62,10 +62,10 @@ acpi_hw_enable_wakeup_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
62 * PARAMETERS: gpe_event_info - Info block for the GPE 62 * PARAMETERS: gpe_event_info - Info block for the GPE
63 * gpe_register_info - Info block for the GPE register 63 * gpe_register_info - Info block for the GPE register
64 * 64 *
65 * RETURN: Status 65 * RETURN: Register mask with a one in the GPE bit position
66 * 66 *
67 * DESCRIPTION: Compute GPE enable mask with one bit corresponding to the given 67 * DESCRIPTION: Compute the register mask for this GPE. One bit is set in the
68 * GPE set. 68 * correct position for the input GPE.
69 * 69 *
70 ******************************************************************************/ 70 ******************************************************************************/
71 71
@@ -85,12 +85,12 @@ u32 acpi_hw_get_gpe_register_bit(struct acpi_gpe_event_info *gpe_event_info,
85 * 85 *
86 * RETURN: Status 86 * RETURN: Status
87 * 87 *
88 * DESCRIPTION: Enable or disable a single GPE in its enable register. 88 * DESCRIPTION: Enable or disable a single GPE in the parent enable register.
89 * 89 *
90 ******************************************************************************/ 90 ******************************************************************************/
91 91
92acpi_status 92acpi_status
93acpi_hw_low_set_gpe(struct acpi_gpe_event_info *gpe_event_info, u8 action) 93acpi_hw_low_set_gpe(struct acpi_gpe_event_info *gpe_event_info, u32 action)
94{ 94{
95 struct acpi_gpe_register_info *gpe_register_info; 95 struct acpi_gpe_register_info *gpe_register_info;
96 acpi_status status; 96 acpi_status status;
@@ -113,14 +113,20 @@ acpi_hw_low_set_gpe(struct acpi_gpe_event_info *gpe_event_info, u8 action)
113 return (status); 113 return (status);
114 } 114 }
115 115
116 /* Set ot clear just the bit that corresponds to this GPE */ 116 /* Set or clear just the bit that corresponds to this GPE */
117 117
118 register_bit = acpi_hw_get_gpe_register_bit(gpe_event_info, 118 register_bit = acpi_hw_get_gpe_register_bit(gpe_event_info,
119 gpe_register_info); 119 gpe_register_info);
120 switch (action) { 120 switch (action) {
121 case ACPI_GPE_COND_ENABLE: 121 case ACPI_GPE_CONDITIONAL_ENABLE:
122 if (!(register_bit & gpe_register_info->enable_for_run)) 122
123 /* Only enable if the enable_for_run bit is set */
124
125 if (!(register_bit & gpe_register_info->enable_for_run)) {
123 return (AE_BAD_PARAMETER); 126 return (AE_BAD_PARAMETER);
127 }
128
129 /*lint -fallthrough */
124 130
125 case ACPI_GPE_ENABLE: 131 case ACPI_GPE_ENABLE:
126 ACPI_SET_BIT(enable_mask, register_bit); 132 ACPI_SET_BIT(enable_mask, register_bit);
@@ -131,7 +137,7 @@ acpi_hw_low_set_gpe(struct acpi_gpe_event_info *gpe_event_info, u8 action)
131 break; 137 break;
132 138
133 default: 139 default:
134 ACPI_ERROR((AE_INFO, "Invalid action\n")); 140 ACPI_ERROR((AE_INFO, "Invalid GPE Action, %u\n", action));
135 return (AE_BAD_PARAMETER); 141 return (AE_BAD_PARAMETER);
136 } 142 }
137 143
@@ -168,13 +174,13 @@ acpi_status acpi_hw_clear_gpe(struct acpi_gpe_event_info * gpe_event_info)
168 return (AE_NOT_EXIST); 174 return (AE_NOT_EXIST);
169 } 175 }
170 176
171 register_bit = acpi_hw_get_gpe_register_bit(gpe_event_info,
172 gpe_register_info);
173
174 /* 177 /*
175 * Write a one to the appropriate bit in the status register to 178 * Write a one to the appropriate bit in the status register to
176 * clear this GPE. 179 * clear this GPE.
177 */ 180 */
181 register_bit =
182 acpi_hw_get_gpe_register_bit(gpe_event_info, gpe_register_info);
183
178 status = acpi_hw_write(register_bit, 184 status = acpi_hw_write(register_bit,
179 &gpe_register_info->status_address); 185 &gpe_register_info->status_address);
180 186
@@ -201,8 +207,8 @@ acpi_hw_get_gpe_status(struct acpi_gpe_event_info * gpe_event_info,
201 u32 in_byte; 207 u32 in_byte;
202 u32 register_bit; 208 u32 register_bit;
203 struct acpi_gpe_register_info *gpe_register_info; 209 struct acpi_gpe_register_info *gpe_register_info;
204 acpi_status status;
205 acpi_event_status local_event_status = 0; 210 acpi_event_status local_event_status = 0;
211 acpi_status status;
206 212
207 ACPI_FUNCTION_ENTRY(); 213 ACPI_FUNCTION_ENTRY();
208 214