diff options
Diffstat (limited to 'drivers/pnp/pnpacpi/rsparser.c')
-rw-r--r-- | drivers/pnp/pnpacpi/rsparser.c | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/drivers/pnp/pnpacpi/rsparser.c b/drivers/pnp/pnpacpi/rsparser.c index dc79b0a0059f..379048fdf05d 100644 --- a/drivers/pnp/pnpacpi/rsparser.c +++ b/drivers/pnp/pnpacpi/rsparser.c | |||
@@ -776,21 +776,32 @@ static void pnpacpi_encode_dma(struct acpi_resource *resource, | |||
776 | struct resource *p) | 776 | struct resource *p) |
777 | { | 777 | { |
778 | /* Note: pnp_assign_dma will copy pnp_dma->flags into p->flags */ | 778 | /* Note: pnp_assign_dma will copy pnp_dma->flags into p->flags */ |
779 | if (p->flags & IORESOURCE_DMA_COMPATIBLE) | 779 | switch (p->flags & IORESOURCE_DMA_SPEED_MASK) { |
780 | resource->data.dma.type = ACPI_COMPATIBILITY; | 780 | case IORESOURCE_DMA_TYPEA: |
781 | else if (p->flags & IORESOURCE_DMA_TYPEA) | 781 | resource->data.dma.type = ACPI_TYPE_A; |
782 | resource->data.dma.type = ACPI_TYPE_A; | 782 | break; |
783 | else if (p->flags & IORESOURCE_DMA_TYPEB) | 783 | case IORESOURCE_DMA_TYPEB: |
784 | resource->data.dma.type = ACPI_TYPE_B; | 784 | resource->data.dma.type = ACPI_TYPE_B; |
785 | else if (p->flags & IORESOURCE_DMA_TYPEF) | 785 | break; |
786 | resource->data.dma.type = ACPI_TYPE_F; | 786 | case IORESOURCE_DMA_TYPEF: |
787 | if (p->flags & IORESOURCE_DMA_8BIT) | 787 | resource->data.dma.type = ACPI_TYPE_F; |
788 | resource->data.dma.transfer = ACPI_TRANSFER_8; | 788 | break; |
789 | else if (p->flags & IORESOURCE_DMA_8AND16BIT) | 789 | default: |
790 | resource->data.dma.transfer = ACPI_TRANSFER_8_16; | 790 | resource->data.dma.type = ACPI_COMPATIBILITY; |
791 | else if (p->flags & IORESOURCE_DMA_16BIT) | 791 | } |
792 | resource->data.dma.transfer = ACPI_TRANSFER_16; | 792 | |
793 | resource->data.dma.bus_master = p->flags & IORESOURCE_DMA_MASTER; | 793 | switch (p->flags & IORESOURCE_DMA_TYPE_MASK) { |
794 | case IORESOURCE_DMA_8BIT: | ||
795 | resource->data.dma.transfer = ACPI_TRANSFER_8; | ||
796 | break; | ||
797 | case IORESOURCE_DMA_8AND16BIT: | ||
798 | resource->data.dma.transfer = ACPI_TRANSFER_8_16; | ||
799 | break; | ||
800 | default: | ||
801 | resource->data.dma.transfer = ACPI_TRANSFER_16; | ||
802 | } | ||
803 | |||
804 | resource->data.dma.bus_master = !!(p->flags & IORESOURCE_DMA_MASTER); | ||
794 | resource->data.dma.channel_count = 1; | 805 | resource->data.dma.channel_count = 1; |
795 | resource->data.dma.channels[0] = p->start; | 806 | resource->data.dma.channels[0] = p->start; |
796 | } | 807 | } |