diff options
Diffstat (limited to 'drivers/dahdi/voicebus/voicebus.c')
-rw-r--r-- | drivers/dahdi/voicebus/voicebus.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/drivers/dahdi/voicebus/voicebus.c b/drivers/dahdi/voicebus/voicebus.c index dfe59be..2395cfa 100644 --- a/drivers/dahdi/voicebus/voicebus.c +++ b/drivers/dahdi/voicebus/voicebus.c @@ -169,8 +169,8 @@ struct voicebus { #else struct kmem_cache *buffer_cache; #endif - /*! Base address of the VoiceBus interface registers in I/O space. */ - u32 iobase; + /*! Base address of the VoiceBus interface registers in memory space. */ + void __iomem *iobase; /*! The IRQ line for this VoiceBus interface. */ unsigned int irq; #if VOICEBUS_DEFERRED == WORKQUEUE @@ -482,7 +482,7 @@ EXPORT_SYMBOL(voicebus_is_latency_locked); static inline u32 __vb_getctl(struct voicebus *vb, u32 addr) { - return le32_to_cpu(inl(vb->iobase + addr)); + return readl(vb->iobase + addr); } /*! @@ -599,7 +599,8 @@ static inline void __vb_setctl(struct voicebus *vb, u32 addr, u32 val) { wmb(); - outl(cpu_to_le32(val), vb->iobase + addr); + writel(val, vb->iobase + addr); + readl(vb->iobase + addr); } /*! @@ -1233,7 +1234,9 @@ voicebus_release(struct voicebus *vb) vb->idle_vbb, vb->idle_vbb_dma_addr); } kmem_cache_destroy(vb->buffer_cache); - 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); kfree(vb); } @@ -1790,8 +1793,9 @@ voicebus_init(struct pci_dev *pdev, u32 framesize, const char *board_name, retval = -EIO; goto cleanup; } - vb->iobase = pci_resource_start(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; @@ -1805,7 +1809,8 @@ voicebus_init(struct pci_dev *pdev, u32 framesize, const char *board_name, Configure the hardware interface. ---------------------------------------------------------------- */ if (pci_set_dma_mask(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; } @@ -1865,7 +1870,7 @@ cleanup: kmem_cache_destroy(vb->buffer_cache); if (vb->iobase) - release_region(vb->iobase, 0xff); + pci_iounmap(vb->pdev, vb->iobase); if (vb->pdev) pci_disable_device(vb->pdev); |