diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-18 17:50:40 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-18 17:50:40 -0700 |
commit | b6aefcce747b3bc54d701d3c329416d0c9616f10 (patch) | |
tree | 18340f3dea5abf9f1c67b2ff0e0e4941a432b46e /drivers/pnp/pnpacpi/rsparser.c | |
parent | 65740356ccfa66703e7e0d47fbe372ba5193916b (diff) | |
parent | 7a54f25cef6c763f16c9fd49ae382de162147873 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/pci-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/pci-2.6: (22 commits)
PCI Hotplug: move pci_hotplug.h to include/linux/
change pci hotplug subsystem maintainer to Kristen
PCI: optionally sort device lists breadth-first
cpcihp_generic: prevent loading without "bridge" parameter
pci: Additional search functions
PCI: quirks: switch quirks code offender to use pci_get API
PCI: Update MSI-HOWTO.txt according to pci_msi_supported()
PCI: Improve pci_msi_supported() comments
PCI hotplug: ioremap balanced with iounmap
shpchp: remove unnecessary cmd_busy member from struct controller
shpchp: fix command completion check
pci: Stamp out pci_find_* usage in fakephp
PCI: fix pcie_portdrv_restore_config undefined without CONFIG_PM error
Fix DMA resource allocation in ACPIPnP
PCI: Turn pci_fixup_video into generic for embedded VGA
PCI: add ICH7/8 ACPI/GPIO io resource quirks
PCI: pcie-check-and-return-bus_register-errors fix
PCI: VIA IRQ quirk behaviour change
pciehp: Remove unnecessary check in pciehp_ctrl.c
pciehp - add missing locking
...
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 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; } |