diff options
Diffstat (limited to 'drivers/acpi/acpica/exfield.c')
-rw-r--r-- | drivers/acpi/acpica/exfield.c | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/drivers/acpi/acpica/exfield.c b/drivers/acpi/acpica/exfield.c index 0bde2230c02..dc092f5b35d 100644 --- a/drivers/acpi/acpica/exfield.c +++ b/drivers/acpi/acpica/exfield.c | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2011, Intel Corp. | 8 | * Copyright (C) 2000 - 2012, Intel Corp. |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
@@ -100,18 +100,25 @@ acpi_ex_read_data_from_field(struct acpi_walk_state *walk_state, | |||
100 | (obj_desc->field.region_obj->region.space_id == | 100 | (obj_desc->field.region_obj->region.space_id == |
101 | ACPI_ADR_SPACE_SMBUS | 101 | ACPI_ADR_SPACE_SMBUS |
102 | || obj_desc->field.region_obj->region.space_id == | 102 | || obj_desc->field.region_obj->region.space_id == |
103 | ACPI_ADR_SPACE_GSBUS | ||
104 | || obj_desc->field.region_obj->region.space_id == | ||
103 | ACPI_ADR_SPACE_IPMI)) { | 105 | ACPI_ADR_SPACE_IPMI)) { |
104 | /* | 106 | /* |
105 | * This is an SMBus or IPMI read. We must create a buffer to hold | 107 | * This is an SMBus, GSBus or IPMI read. We must create a buffer to hold |
106 | * the data and then directly access the region handler. | 108 | * the data and then directly access the region handler. |
107 | * | 109 | * |
108 | * Note: Smbus protocol value is passed in upper 16-bits of Function | 110 | * Note: SMBus and GSBus protocol value is passed in upper 16-bits of Function |
109 | */ | 111 | */ |
110 | if (obj_desc->field.region_obj->region.space_id == | 112 | if (obj_desc->field.region_obj->region.space_id == |
111 | ACPI_ADR_SPACE_SMBUS) { | 113 | ACPI_ADR_SPACE_SMBUS) { |
112 | length = ACPI_SMBUS_BUFFER_SIZE; | 114 | length = ACPI_SMBUS_BUFFER_SIZE; |
113 | function = | 115 | function = |
114 | ACPI_READ | (obj_desc->field.attribute << 16); | 116 | ACPI_READ | (obj_desc->field.attribute << 16); |
117 | } else if (obj_desc->field.region_obj->region.space_id == | ||
118 | ACPI_ADR_SPACE_GSBUS) { | ||
119 | length = ACPI_GSBUS_BUFFER_SIZE; | ||
120 | function = | ||
121 | ACPI_READ | (obj_desc->field.attribute << 16); | ||
115 | } else { /* IPMI */ | 122 | } else { /* IPMI */ |
116 | 123 | ||
117 | length = ACPI_IPMI_BUFFER_SIZE; | 124 | length = ACPI_IPMI_BUFFER_SIZE; |
@@ -248,21 +255,23 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc, | |||
248 | (obj_desc->field.region_obj->region.space_id == | 255 | (obj_desc->field.region_obj->region.space_id == |
249 | ACPI_ADR_SPACE_SMBUS | 256 | ACPI_ADR_SPACE_SMBUS |
250 | || obj_desc->field.region_obj->region.space_id == | 257 | || obj_desc->field.region_obj->region.space_id == |
258 | ACPI_ADR_SPACE_GSBUS | ||
259 | || obj_desc->field.region_obj->region.space_id == | ||
251 | ACPI_ADR_SPACE_IPMI)) { | 260 | ACPI_ADR_SPACE_IPMI)) { |
252 | /* | 261 | /* |
253 | * This is an SMBus or IPMI write. We will bypass the entire field | 262 | * This is an SMBus, GSBus or IPMI write. We will bypass the entire field |
254 | * mechanism and handoff the buffer directly to the handler. For | 263 | * mechanism and handoff the buffer directly to the handler. For |
255 | * these address spaces, the buffer is bi-directional; on a write, | 264 | * these address spaces, the buffer is bi-directional; on a write, |
256 | * return data is returned in the same buffer. | 265 | * return data is returned in the same buffer. |
257 | * | 266 | * |
258 | * Source must be a buffer of sufficient size: | 267 | * Source must be a buffer of sufficient size: |
259 | * ACPI_SMBUS_BUFFER_SIZE or ACPI_IPMI_BUFFER_SIZE. | 268 | * ACPI_SMBUS_BUFFER_SIZE, ACPI_GSBUS_BUFFER_SIZE, or ACPI_IPMI_BUFFER_SIZE. |
260 | * | 269 | * |
261 | * Note: SMBus protocol type is passed in upper 16-bits of Function | 270 | * Note: SMBus and GSBus protocol type is passed in upper 16-bits of Function |
262 | */ | 271 | */ |
263 | if (source_desc->common.type != ACPI_TYPE_BUFFER) { | 272 | if (source_desc->common.type != ACPI_TYPE_BUFFER) { |
264 | ACPI_ERROR((AE_INFO, | 273 | ACPI_ERROR((AE_INFO, |
265 | "SMBus or IPMI write requires Buffer, found type %s", | 274 | "SMBus/IPMI/GenericSerialBus write requires Buffer, found type %s", |
266 | acpi_ut_get_object_type_name(source_desc))); | 275 | acpi_ut_get_object_type_name(source_desc))); |
267 | 276 | ||
268 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); | 277 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); |
@@ -273,6 +282,11 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc, | |||
273 | length = ACPI_SMBUS_BUFFER_SIZE; | 282 | length = ACPI_SMBUS_BUFFER_SIZE; |
274 | function = | 283 | function = |
275 | ACPI_WRITE | (obj_desc->field.attribute << 16); | 284 | ACPI_WRITE | (obj_desc->field.attribute << 16); |
285 | } else if (obj_desc->field.region_obj->region.space_id == | ||
286 | ACPI_ADR_SPACE_GSBUS) { | ||
287 | length = ACPI_GSBUS_BUFFER_SIZE; | ||
288 | function = | ||
289 | ACPI_WRITE | (obj_desc->field.attribute << 16); | ||
276 | } else { /* IPMI */ | 290 | } else { /* IPMI */ |
277 | 291 | ||
278 | length = ACPI_IPMI_BUFFER_SIZE; | 292 | length = ACPI_IPMI_BUFFER_SIZE; |
@@ -281,7 +295,7 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc, | |||
281 | 295 | ||
282 | if (source_desc->buffer.length < length) { | 296 | if (source_desc->buffer.length < length) { |
283 | ACPI_ERROR((AE_INFO, | 297 | ACPI_ERROR((AE_INFO, |
284 | "SMBus or IPMI write requires Buffer of length %u, found length %u", | 298 | "SMBus/IPMI/GenericSerialBus write requires Buffer of length %u, found length %u", |
285 | length, source_desc->buffer.length)); | 299 | length, source_desc->buffer.length)); |
286 | 300 | ||
287 | return_ACPI_STATUS(AE_AML_BUFFER_LIMIT); | 301 | return_ACPI_STATUS(AE_AML_BUFFER_LIMIT); |