aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pnp/pnpacpi/rsparser.c
diff options
context:
space:
mode:
authorVojtech Pavlik <vojtech@suse.cz>2006-04-07 14:00:27 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2006-10-18 14:36:11 -0400
commitccc4c7bbd6a2d47bf5899c2c8cf2e0d176a4dc0f (patch)
tree24bd806a028fe5e1ac75eb55fdad0927fc104f69 /drivers/pnp/pnpacpi/rsparser.c
parentb5e4efe7e061ff52ac97b9fa45acca529d8daeea (diff)
Fix DMA resource allocation in ACPIPnP
The ACPIPnP implementation had the understanding of Linux resource flags very wrong, resulting in a nonfunctional implementation of DMA resource allocation. This was usually not a problem, since almost no on-board PnP devices use ISA DMA, with the exception of ECP parallel ports. Even with that, parallel port DMA is preconfigured by the BIOS, so this routine isn't normally called. Except in the case where somebody does 'rmmod parport_pc; modprobe parport_pc', where the rmmod case disables the ECP parallel port resources, and they need to be enabled again to initialize the module. This didn't work, resulting in a non-printing printer. The application doing exactly the above to force reprobing of printers is the YaST printer module. Thus without this fix YaST wedged the printer when configuring it, and was not able to print a test page. Reported-by: Ralf Flaxa <rf@suse.de> Reproduced-by: Jiri Dluhos <jdluhos@suse.cz> Signed-off-by: Vojtech Pavlik <vojtech@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pnp/pnpacpi/rsparser.c')
-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 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}