[svn-commits] sruffell: linux/trunk r8176 - /linux/trunk/drivers/dahdi/voicebus/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Mar 1 02:14:28 CST 2010


Author: sruffell
Date: Mon Mar  1 02:14:17 2010
New Revision: 8176

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=8176
Log:
wcte12xp, wctdm24xxp: Use memory mapped IO instead of port IO.

Some systems do not like the port I/O and this change allows it to work.
DAHDI-515.

Modified:
    linux/trunk/drivers/dahdi/voicebus/voicebus.c
    linux/trunk/drivers/dahdi/voicebus/voicebus.h

Modified: linux/trunk/drivers/dahdi/voicebus/voicebus.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/voicebus/voicebus.c?view=diff&rev=8176&r1=8175&r2=8176
==============================================================================
--- linux/trunk/drivers/dahdi/voicebus/voicebus.c (original)
+++ linux/trunk/drivers/dahdi/voicebus/voicebus.c Mon Mar  1 02:14:17 2010
@@ -312,7 +312,7 @@
 __vb_getctl(struct voicebus *vb, u32 addr)
 {
 	u32 ret;
-	ret = inl(vb->iobase + addr);
+	ret = readl(vb->iobase + addr);
 	rmb();
 	return ret;
 }
@@ -449,7 +449,7 @@
 __vb_setctl(struct voicebus *vb, u32 addr, u32 val)
 {
 	wmb();
-	outl(val, vb->iobase + addr);
+	writel(val, vb->iobase + addr);
 }
 
 /*!
@@ -1059,7 +1059,11 @@
 		dma_free_coherent(&vb->pdev->dev, VOICEBUS_SFRAME_SIZE,
 				  vb->idle_vbb, vb->idle_vbb_dma_addr);
 	}
-	release_region(vb->iobase, 0xff);
+
+	release_mem_region(pci_resource_start(vb->pdev, 1),
+		pci_resource_len(vb->pdev, 1));
+
+	pci_iounmap(vb->pdev, vb->iobase);
 	pci_disable_device(vb->pdev);
 }
 EXPORT_SYMBOL(voicebus_release);
@@ -1507,8 +1511,9 @@
 		retval = -EIO;
 		goto cleanup;
 	}
-	vb->iobase = pci_resource_start(vb->pdev, 0);
-	if (NULL == request_region(vb->iobase, 0xff, board_name)) {
+	vb->iobase = pci_iomap(vb->pdev, 1, 0);
+	if (!request_mem_region(pci_resource_start(vb->pdev, 1),
+	    pci_resource_len(vb->pdev, 1), board_name)) {
 		dev_err(&vb->pdev->dev, "IO Registers are in use by another "
 			"module.\n");
 		retval = -EIO;
@@ -1522,7 +1527,8 @@
 	   Configure the hardware interface.
 	   ---------------------------------------------------------------- */
 	if (pci_set_dma_mask(vb->pdev, DMA_BIT_MASK(32))) {
-		release_region(vb->iobase, 0xff);
+		release_mem_region(pci_resource_start(vb->pdev, 1),
+			pci_resource_len(vb->pdev, 1));
 		dev_warn(&vb->pdev->dev, "No suitable DMA available.\n");
 		goto cleanup;
 	}
@@ -1572,7 +1578,7 @@
 			  vb->idle_vbb, vb->idle_vbb_dma_addr);
 
 	if (vb->iobase)
-		release_region(vb->iobase, 0xff);
+		pci_iounmap(vb->pdev, vb->iobase);
 
 	if (vb->pdev)
 		pci_disable_device(vb->pdev);

Modified: linux/trunk/drivers/dahdi/voicebus/voicebus.h
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/voicebus/voicebus.h?view=diff&rev=8176&r1=8175&r2=8176
==============================================================================
--- linux/trunk/drivers/dahdi/voicebus/voicebus.h (original)
+++ linux/trunk/drivers/dahdi/voicebus/voicebus.h Mon Mar  1 02:14:17 2010
@@ -105,7 +105,7 @@
 	u8			*idle_vbb;
 	dma_addr_t		idle_vbb_dma_addr;
 	const int		*debug;
-	u32			iobase;
+	void __iomem 		*iobase;
 	struct tasklet_struct 	tasklet;
 
 #if defined(CONFIG_VOICEBUS_TIMER)




More information about the svn-commits mailing list