aboutsummaryrefslogtreecommitdiff
path: root/drivers/pnp
diff options
context:
space:
mode:
authorJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-11-22 12:06:44 -0600
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-11-22 12:06:44 -0600
commit0bd2af46839ad6262d25714a6ec0365db9d6b98f (patch)
treedcced72d230d69fd0c5816ac6dd03ab84799a93e /drivers/pnp
parente138a5d2356729b8752e88520cc1525fae9794ac (diff)
parentf26b90440cd74c78fe10c9bd5160809704a9627c (diff)
Merge ../scsi-rc-fixes-2.6
Diffstat (limited to 'drivers/pnp')
-rw-r--r--drivers/pnp/pnpacpi/rsparser.c41
1 files changed, 26 insertions, 15 deletions
diff --git a/drivers/pnp/pnpacpi/rsparser.c b/drivers/pnp/pnpacpi/rsparser.c
index dc79b0a0059..379048fdf05 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,
struct resource *p)
{
/* Note: pnp_assign_dma will copy pnp_dma->flags into p->flags */
- if (p->flags & IORESOURCE_DMA_COMPATIBLE)
- resource->data.dma.type = ACPI_COMPATIBILITY;
- else if (p->flags & IORESOURCE_DMA_TYPEA)
- resource->data.dma.type = ACPI_TYPE_A;
- else if (p->flags & IORESOURCE_DMA_TYPEB)
- resource->data.dma.type = ACPI_TYPE_B;
- else if (p->flags & IORESOURCE_DMA_TYPEF)
- resource->data.dma.type = ACPI_TYPE_F;
- if (p->flags & IORESOURCE_DMA_8BIT)
- resource->data.dma.transfer = ACPI_TRANSFER_8;
- else if (p->flags & IORESOURCE_DMA_8AND16BIT)
- resource->data.dma.transfer = ACPI_TRANSFER_8_16;
- else if (p->flags & IORESOURCE_DMA_16BIT)
- resource->data.dma.transfer = ACPI_TRANSFER_16;
- resource->data.dma.bus_master = p->flags & IORESOURCE_DMA_MASTER;
+ switch (p->flags & IORESOURCE_DMA_SPEED_MASK) {
+ case IORESOURCE_DMA_TYPEA:
+ resource->data.dma.type = ACPI_TYPE_A;
+ break;
+ case IORESOURCE_DMA_TYPEB:
+ resource->data.dma.type = ACPI_TYPE_B;
+ break;
+ case IORESOURCE_DMA_TYPEF:
+ resource->data.dma.type = ACPI_TYPE_F;
+ break;
+ default:
+ resource->data.dma.type = ACPI_COMPATIBILITY;
+ }
+
+ switch (p->flags & IORESOURCE_DMA_TYPE_MASK) {
+ case IORESOURCE_DMA_8BIT:
+ resource->data.dma.transfer = ACPI_TRANSFER_8;
+ break;
+ case IORESOURCE_DMA_8AND16BIT:
+ resource->data.dma.transfer = ACPI_TRANSFER_8_16;
+ break;
+ default:
+ resource->data.dma.transfer = ACPI_TRANSFER_16;
+ }
+
+ resource->data.dma.bus_master = !!(p->flags & IORESOURCE_DMA_MASTER);
resource->data.dma.channel_count = 1;
resource->data.dma.channels[0] = p->start;
}