diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-01-29 07:59:00 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-01-29 07:59:00 -0500 |
commit | 8b4e2fa4ff72ba2c9f01af8def15d4c4eeeeed64 (patch) | |
tree | a2ebfb0b6aebb2fe07821fe862a79709be3ebc17 /drivers/acpi/acpica/rsmisc.c | |
parent | 64e94e7e0ffb20ee11a596aa04fcdeefb33e000d (diff) | |
parent | e375325ce55eb841ccda54a4472cf3b0139ea5f2 (diff) |
Merge branch 'acpi-lpss' into acpi-cleanup
The following commits depend on the 'acpi-lpss' material.
Diffstat (limited to 'drivers/acpi/acpica/rsmisc.c')
-rw-r--r-- | drivers/acpi/acpica/rsmisc.c | 74 |
1 files changed, 40 insertions, 34 deletions
diff --git a/drivers/acpi/acpica/rsmisc.c b/drivers/acpi/acpica/rsmisc.c index c6f291c2bc83..7b094ebff1db 100644 --- a/drivers/acpi/acpica/rsmisc.c +++ b/drivers/acpi/acpica/rsmisc.c | |||
@@ -136,30 +136,30 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource, | |||
136 | /* | 136 | /* |
137 | * Mask and shift the flag bit | 137 | * Mask and shift the flag bit |
138 | */ | 138 | */ |
139 | ACPI_SET8(destination) = (u8) | 139 | ACPI_SET8(destination, |
140 | ((ACPI_GET8(source) >> info->value) & 0x01); | 140 | ((ACPI_GET8(source) >> info->value) & 0x01)); |
141 | break; | 141 | break; |
142 | 142 | ||
143 | case ACPI_RSC_2BITFLAG: | 143 | case ACPI_RSC_2BITFLAG: |
144 | /* | 144 | /* |
145 | * Mask and shift the flag bits | 145 | * Mask and shift the flag bits |
146 | */ | 146 | */ |
147 | ACPI_SET8(destination) = (u8) | 147 | ACPI_SET8(destination, |
148 | ((ACPI_GET8(source) >> info->value) & 0x03); | 148 | ((ACPI_GET8(source) >> info->value) & 0x03)); |
149 | break; | 149 | break; |
150 | 150 | ||
151 | case ACPI_RSC_3BITFLAG: | 151 | case ACPI_RSC_3BITFLAG: |
152 | /* | 152 | /* |
153 | * Mask and shift the flag bits | 153 | * Mask and shift the flag bits |
154 | */ | 154 | */ |
155 | ACPI_SET8(destination) = (u8) | 155 | ACPI_SET8(destination, |
156 | ((ACPI_GET8(source) >> info->value) & 0x07); | 156 | ((ACPI_GET8(source) >> info->value) & 0x07)); |
157 | break; | 157 | break; |
158 | 158 | ||
159 | case ACPI_RSC_COUNT: | 159 | case ACPI_RSC_COUNT: |
160 | 160 | ||
161 | item_count = ACPI_GET8(source); | 161 | item_count = ACPI_GET8(source); |
162 | ACPI_SET8(destination) = (u8) item_count; | 162 | ACPI_SET8(destination, item_count); |
163 | 163 | ||
164 | resource->length = resource->length + | 164 | resource->length = resource->length + |
165 | (info->value * (item_count - 1)); | 165 | (info->value * (item_count - 1)); |
@@ -168,7 +168,7 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource, | |||
168 | case ACPI_RSC_COUNT16: | 168 | case ACPI_RSC_COUNT16: |
169 | 169 | ||
170 | item_count = aml_resource_length; | 170 | item_count = aml_resource_length; |
171 | ACPI_SET16(destination) = item_count; | 171 | ACPI_SET16(destination, item_count); |
172 | 172 | ||
173 | resource->length = resource->length + | 173 | resource->length = resource->length + |
174 | (info->value * (item_count - 1)); | 174 | (info->value * (item_count - 1)); |
@@ -181,13 +181,13 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource, | |||
181 | 181 | ||
182 | resource->length = resource->length + item_count; | 182 | resource->length = resource->length + item_count; |
183 | item_count = item_count / 2; | 183 | item_count = item_count / 2; |
184 | ACPI_SET16(destination) = item_count; | 184 | ACPI_SET16(destination, item_count); |
185 | break; | 185 | break; |
186 | 186 | ||
187 | case ACPI_RSC_COUNT_GPIO_VEN: | 187 | case ACPI_RSC_COUNT_GPIO_VEN: |
188 | 188 | ||
189 | item_count = ACPI_GET8(source); | 189 | item_count = ACPI_GET8(source); |
190 | ACPI_SET8(destination) = (u8)item_count; | 190 | ACPI_SET8(destination, item_count); |
191 | 191 | ||
192 | resource->length = resource->length + | 192 | resource->length = resource->length + |
193 | (info->value * item_count); | 193 | (info->value * item_count); |
@@ -216,7 +216,7 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource, | |||
216 | } | 216 | } |
217 | 217 | ||
218 | resource->length = resource->length + item_count; | 218 | resource->length = resource->length + item_count; |
219 | ACPI_SET16(destination) = item_count; | 219 | ACPI_SET16(destination, item_count); |
220 | break; | 220 | break; |
221 | 221 | ||
222 | case ACPI_RSC_COUNT_SERIAL_VEN: | 222 | case ACPI_RSC_COUNT_SERIAL_VEN: |
@@ -224,7 +224,7 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource, | |||
224 | item_count = ACPI_GET16(source) - info->value; | 224 | item_count = ACPI_GET16(source) - info->value; |
225 | 225 | ||
226 | resource->length = resource->length + item_count; | 226 | resource->length = resource->length + item_count; |
227 | ACPI_SET16(destination) = item_count; | 227 | ACPI_SET16(destination, item_count); |
228 | break; | 228 | break; |
229 | 229 | ||
230 | case ACPI_RSC_COUNT_SERIAL_RES: | 230 | case ACPI_RSC_COUNT_SERIAL_RES: |
@@ -234,7 +234,7 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource, | |||
234 | - ACPI_GET16(source) - info->value; | 234 | - ACPI_GET16(source) - info->value; |
235 | 235 | ||
236 | resource->length = resource->length + item_count; | 236 | resource->length = resource->length + item_count; |
237 | ACPI_SET16(destination) = item_count; | 237 | ACPI_SET16(destination, item_count); |
238 | break; | 238 | break; |
239 | 239 | ||
240 | case ACPI_RSC_LENGTH: | 240 | case ACPI_RSC_LENGTH: |
@@ -385,7 +385,7 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource, | |||
385 | } | 385 | } |
386 | 386 | ||
387 | target = ACPI_ADD_PTR(char, resource, info->value); | 387 | target = ACPI_ADD_PTR(char, resource, info->value); |
388 | ACPI_SET8(target) = (u8) item_count; | 388 | ACPI_SET8(target, item_count); |
389 | break; | 389 | break; |
390 | 390 | ||
391 | case ACPI_RSC_BITMASK16: | 391 | case ACPI_RSC_BITMASK16: |
@@ -401,7 +401,7 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource, | |||
401 | } | 401 | } |
402 | 402 | ||
403 | target = ACPI_ADD_PTR(char, resource, info->value); | 403 | target = ACPI_ADD_PTR(char, resource, info->value); |
404 | ACPI_SET8(target) = (u8) item_count; | 404 | ACPI_SET8(target, item_count); |
405 | break; | 405 | break; |
406 | 406 | ||
407 | case ACPI_RSC_EXIT_NE: | 407 | case ACPI_RSC_EXIT_NE: |
@@ -514,37 +514,40 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource, | |||
514 | /* | 514 | /* |
515 | * Clear the flag byte | 515 | * Clear the flag byte |
516 | */ | 516 | */ |
517 | ACPI_SET8(destination) = 0; | 517 | ACPI_SET8(destination, 0); |
518 | break; | 518 | break; |
519 | 519 | ||
520 | case ACPI_RSC_1BITFLAG: | 520 | case ACPI_RSC_1BITFLAG: |
521 | /* | 521 | /* |
522 | * Mask and shift the flag bit | 522 | * Mask and shift the flag bit |
523 | */ | 523 | */ |
524 | ACPI_SET8(destination) |= (u8) | 524 | ACPI_SET_BIT(*ACPI_CAST8(destination), (u8) |
525 | ((ACPI_GET8(source) & 0x01) << info->value); | 525 | ((ACPI_GET8(source) & 0x01) << info-> |
526 | value)); | ||
526 | break; | 527 | break; |
527 | 528 | ||
528 | case ACPI_RSC_2BITFLAG: | 529 | case ACPI_RSC_2BITFLAG: |
529 | /* | 530 | /* |
530 | * Mask and shift the flag bits | 531 | * Mask and shift the flag bits |
531 | */ | 532 | */ |
532 | ACPI_SET8(destination) |= (u8) | 533 | ACPI_SET_BIT(*ACPI_CAST8(destination), (u8) |
533 | ((ACPI_GET8(source) & 0x03) << info->value); | 534 | ((ACPI_GET8(source) & 0x03) << info-> |
535 | value)); | ||
534 | break; | 536 | break; |
535 | 537 | ||
536 | case ACPI_RSC_3BITFLAG: | 538 | case ACPI_RSC_3BITFLAG: |
537 | /* | 539 | /* |
538 | * Mask and shift the flag bits | 540 | * Mask and shift the flag bits |
539 | */ | 541 | */ |
540 | ACPI_SET8(destination) |= (u8) | 542 | ACPI_SET_BIT(*ACPI_CAST8(destination), (u8) |
541 | ((ACPI_GET8(source) & 0x07) << info->value); | 543 | ((ACPI_GET8(source) & 0x07) << info-> |
544 | value)); | ||
542 | break; | 545 | break; |
543 | 546 | ||
544 | case ACPI_RSC_COUNT: | 547 | case ACPI_RSC_COUNT: |
545 | 548 | ||
546 | item_count = ACPI_GET8(source); | 549 | item_count = ACPI_GET8(source); |
547 | ACPI_SET8(destination) = (u8) item_count; | 550 | ACPI_SET8(destination, item_count); |
548 | 551 | ||
549 | aml_length = | 552 | aml_length = |
550 | (u16) (aml_length + | 553 | (u16) (aml_length + |
@@ -561,18 +564,18 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource, | |||
561 | case ACPI_RSC_COUNT_GPIO_PIN: | 564 | case ACPI_RSC_COUNT_GPIO_PIN: |
562 | 565 | ||
563 | item_count = ACPI_GET16(source); | 566 | item_count = ACPI_GET16(source); |
564 | ACPI_SET16(destination) = (u16)aml_length; | 567 | ACPI_SET16(destination, aml_length); |
565 | 568 | ||
566 | aml_length = (u16)(aml_length + item_count * 2); | 569 | aml_length = (u16)(aml_length + item_count * 2); |
567 | target = ACPI_ADD_PTR(void, aml, info->value); | 570 | target = ACPI_ADD_PTR(void, aml, info->value); |
568 | ACPI_SET16(target) = (u16)aml_length; | 571 | ACPI_SET16(target, aml_length); |
569 | acpi_rs_set_resource_length(aml_length, aml); | 572 | acpi_rs_set_resource_length(aml_length, aml); |
570 | break; | 573 | break; |
571 | 574 | ||
572 | case ACPI_RSC_COUNT_GPIO_VEN: | 575 | case ACPI_RSC_COUNT_GPIO_VEN: |
573 | 576 | ||
574 | item_count = ACPI_GET16(source); | 577 | item_count = ACPI_GET16(source); |
575 | ACPI_SET16(destination) = (u16)item_count; | 578 | ACPI_SET16(destination, item_count); |
576 | 579 | ||
577 | aml_length = | 580 | aml_length = |
578 | (u16)(aml_length + (info->value * item_count)); | 581 | (u16)(aml_length + (info->value * item_count)); |
@@ -584,7 +587,7 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource, | |||
584 | /* Set resource source string length */ | 587 | /* Set resource source string length */ |
585 | 588 | ||
586 | item_count = ACPI_GET16(source); | 589 | item_count = ACPI_GET16(source); |
587 | ACPI_SET16(destination) = (u16)aml_length; | 590 | ACPI_SET16(destination, aml_length); |
588 | 591 | ||
589 | /* Compute offset for the Vendor Data */ | 592 | /* Compute offset for the Vendor Data */ |
590 | 593 | ||
@@ -594,7 +597,7 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource, | |||
594 | /* Set vendor offset only if there is vendor data */ | 597 | /* Set vendor offset only if there is vendor data */ |
595 | 598 | ||
596 | if (resource->data.gpio.vendor_length) { | 599 | if (resource->data.gpio.vendor_length) { |
597 | ACPI_SET16(target) = (u16)aml_length; | 600 | ACPI_SET16(target, aml_length); |
598 | } | 601 | } |
599 | 602 | ||
600 | acpi_rs_set_resource_length(aml_length, aml); | 603 | acpi_rs_set_resource_length(aml_length, aml); |
@@ -603,7 +606,7 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource, | |||
603 | case ACPI_RSC_COUNT_SERIAL_VEN: | 606 | case ACPI_RSC_COUNT_SERIAL_VEN: |
604 | 607 | ||
605 | item_count = ACPI_GET16(source); | 608 | item_count = ACPI_GET16(source); |
606 | ACPI_SET16(destination) = item_count + info->value; | 609 | ACPI_SET16(destination, item_count + info->value); |
607 | aml_length = (u16)(aml_length + item_count); | 610 | aml_length = (u16)(aml_length + item_count); |
608 | acpi_rs_set_resource_length(aml_length, aml); | 611 | acpi_rs_set_resource_length(aml_length, aml); |
609 | break; | 612 | break; |
@@ -686,7 +689,8 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource, | |||
686 | * Optional resource_source (Index and String) | 689 | * Optional resource_source (Index and String) |
687 | */ | 690 | */ |
688 | aml_length = | 691 | aml_length = |
689 | acpi_rs_set_resource_source(aml, (acpi_rs_length) | 692 | acpi_rs_set_resource_source(aml, |
693 | (acpi_rs_length) | ||
690 | aml_length, source); | 694 | aml_length, source); |
691 | acpi_rs_set_resource_length(aml_length, aml); | 695 | acpi_rs_set_resource_length(aml_length, aml); |
692 | break; | 696 | break; |
@@ -706,10 +710,12 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource, | |||
706 | /* | 710 | /* |
707 | * 8-bit encoded bitmask (DMA macro) | 711 | * 8-bit encoded bitmask (DMA macro) |
708 | */ | 712 | */ |
709 | ACPI_SET8(destination) = (u8) | 713 | ACPI_SET8(destination, |
710 | acpi_rs_encode_bitmask(source, | 714 | acpi_rs_encode_bitmask(source, |
711 | *ACPI_ADD_PTR(u8, resource, | 715 | *ACPI_ADD_PTR(u8, |
712 | info->value)); | 716 | resource, |
717 | info-> | ||
718 | value))); | ||
713 | break; | 719 | break; |
714 | 720 | ||
715 | case ACPI_RSC_BITMASK16: | 721 | case ACPI_RSC_BITMASK16: |