diff options
Diffstat (limited to 'drivers/sbus/audio')
-rw-r--r-- | drivers/sbus/audio/amd7930.c | 6 | ||||
-rw-r--r-- | drivers/sbus/audio/cs4231.c | 63 | ||||
-rw-r--r-- | drivers/sbus/audio/dbri.c | 14 |
3 files changed, 54 insertions, 29 deletions
diff --git a/drivers/sbus/audio/amd7930.c b/drivers/sbus/audio/amd7930.c index 1cb739719..f3f593bce 100644 --- a/drivers/sbus/audio/amd7930.c +++ b/drivers/sbus/audio/amd7930.c @@ -1,4 +1,4 @@ -/* $Id: amd7930.c,v 1.23 1999/11/19 09:55:58 davem Exp $ +/* $Id: amd7930.c,v 1.24 2000/01/22 05:10:27 anton Exp $ * drivers/sbus/audio/amd7930.c * * Copyright (C) 1996,1997 Thomas K. Dyas (tdyas@eden.rutgers.edu) @@ -1375,7 +1375,7 @@ static int amd7930_bopen(int dev, unsigned int chan, /* Enable B channel transmit */ sbus_writeb(AMR_LIU_LMR1, info->regs + CR); tmp = sbus_readb(info->regs + DR); - tmp |= AM_LIU_LMR1_B1_ENBL + chan; + tmp |= AM_LIU_LMR1_B1_ENABL + chan; sbus_writeb(tmp, info->regs + DR); /* Enable B channel interrupts */ @@ -1701,7 +1701,7 @@ int __init amd7930_init(void) continue; if (amd7930_attach(&drivers[num_drivers], - sdev->prom_node, sdev->my_bus, sdev) == 0) + sdev->prom_node, sdev->bus, sdev) == 0) num_drivers++; } } diff --git a/drivers/sbus/audio/cs4231.c b/drivers/sbus/audio/cs4231.c index 2d46a84e3..442c25206 100644 --- a/drivers/sbus/audio/cs4231.c +++ b/drivers/sbus/audio/cs4231.c @@ -1170,25 +1170,28 @@ static int cs4231_open(struct inode * inode, struct file * file, struct sparcaud static void cs4231_release(struct inode * inode, struct file * file, struct sparcaudio_driver *drv) { - struct cs4231_chip *cs4231_chip = (struct cs4231_chip *)drv->private; + struct cs4231_chip *cs4231_chip = (struct cs4231_chip *)drv->private; + void (*dma_unmap_single)(struct sbus_dev *, dma_addr_t, size_t) = sbus_unmap_single; +#ifdef EB4231_SUPPORT + if (cs4231_chip->status & CS_STATUS_IS_EBUS) + dma_unmap_single = (void (*)(struct sbus_dev *, dma_addr_t, size_t)) pci_unmap_single; +#endif /* zero out any info about what data we have as well */ if (file->f_mode & FMODE_READ) { /* stop capture here or midlevel? */ cs4231_chip->perchip_info.record.open = 0; if (cs4231_chip->input_dma_handle) { - if(!(cs4231_chip->status & CS_STATUS_IS_EBUS)) - sbus_unmap_single(drv->dev, - cs4231_chip->input_dma_handle, - cs4231_chip->input_dma_size); + dma_unmap_single(drv->dev, + cs4231_chip->input_dma_handle, + cs4231_chip->input_dma_size); cs4231_chip->input_dma_handle = 0; cs4231_chip->input_dma_size = 0; } if (cs4231_chip->input_next_dma_handle) { - if(!(cs4231_chip->status & CS_STATUS_IS_EBUS)) - sbus_unmap_single(drv->dev, - cs4231_chip->input_next_dma_handle, - cs4231_chip->input_next_dma_size); + dma_unmap_single(drv->dev, + cs4231_chip->input_next_dma_handle, + cs4231_chip->input_next_dma_size); cs4231_chip->input_next_dma_handle = 0; cs4231_chip->input_next_dma_size = 0; } @@ -1198,18 +1201,16 @@ static void cs4231_release(struct inode * inode, struct file * file, struct spar cs4231_chip->perchip_info.play.active = cs4231_chip->perchip_info.play.open = 0; if (cs4231_chip->output_dma_handle) { - if(!(cs4231_chip->status & CS_STATUS_IS_EBUS)) - sbus_unmap_single(drv->dev, - cs4231_chip->output_dma_handle, - cs4231_chip->output_dma_size); + dma_unmap_single(drv->dev, + cs4231_chip->output_dma_handle, + cs4231_chip->output_dma_size); cs4231_chip->output_dma_handle = 0; cs4231_chip->output_dma_size = 0; } if (cs4231_chip->output_next_dma_handle) { - if(!(cs4231_chip->status & CS_STATUS_IS_EBUS)) - sbus_unmap_single(drv->dev, - cs4231_chip->output_next_dma_handle, - cs4231_chip->output_next_dma_size); + dma_unmap_single(drv->dev, + cs4231_chip->output_next_dma_handle, + cs4231_chip->output_next_dma_size); cs4231_chip->output_next_dma_handle = 0; cs4231_chip->output_next_dma_size = 0; } @@ -1294,6 +1295,9 @@ static void eb4231_playintr(struct sparcaudio_driver *drv) cs4231_chip->playlen = cs4231_chip->output_size; if (cs4231_chip->output_dma_handle) { + pci_unmap_single((struct pci_dev *)drv->dev, + cs4231_chip->output_dma_handle, + cs4231_chip->output_dma_size); cs4231_chip->output_dma_handle = 0; cs4231_chip->output_dma_size = 0; cs4231_chip->playing_count--; @@ -1310,7 +1314,9 @@ static void eb4231_playintr(struct sparcaudio_driver *drv) if ((cs4231_chip->output_ptr && cs4231_chip->output_size > 0) && !(cs4231_chip->perchip_info.play.pause)) { cs4231_chip->output_next_dma_handle = - virt_to_bus(cs4231_chip->output_ptr); + pci_map_single((struct pci_dev *)drv->dev, + (char *)cs4231_chip->output_ptr, + cs4231_chip->output_size); cs4231_chip->output_next_dma_size = cs4231_chip->output_size; writel(cs4231_chip->output_next_dma_size, @@ -1410,6 +1416,9 @@ static int eb4231_recintr(struct sparcaudio_driver *drv) } if (cs4231_chip->input_dma_handle) { + pci_unmap_single((struct pci_dev *)drv->dev, + cs4231_chip->input_dma_handle, + cs4231_chip->input_dma_size); cs4231_chip->input_dma_handle = 0; cs4231_chip->input_dma_size = 0; cs4231_chip->recording_count--; @@ -1430,7 +1439,9 @@ static int eb4231_recintr(struct sparcaudio_driver *drv) cs4231_chip->input_size); cs4231_chip->input_next_dma_handle = - virt_to_bus(cs4231_chip->input_ptr); + pci_map_single((struct pci_dev *)drv->dev, + (char *)cs4231_chip->input_ptr, + cs4231_chip->input_size); cs4231_chip->input_next_dma_size = cs4231_chip->input_size; writel(cs4231_chip->input_next_dma_size, @@ -1543,11 +1554,17 @@ static void eb4231_stop_output(struct sparcaudio_driver *drv) cs4231_chip->output_size = 0; if (cs4231_chip->output_dma_handle) { + pci_unmap_single((struct pci_dev *)drv->dev, + cs4231_chip->output_dma_handle, + cs4231_chip->output_dma_size); cs4231_chip->output_dma_handle = 0; cs4231_chip->output_dma_size = 0; } if (cs4231_chip->output_next_dma_handle) { + pci_unmap_single((struct pci_dev *)drv->dev, + cs4231_chip->output_next_dma_handle, + cs4231_chip->output_next_dma_size); cs4231_chip->output_next_dma_handle = 0; cs4231_chip->output_next_dma_size = 0; } @@ -1746,11 +1763,17 @@ static void eb4231_stop_input(struct sparcaudio_driver *drv) cs4231_chip->input_size = 0; if (cs4231_chip->input_dma_handle) { + pci_unmap_single((struct pci_dev *)drv->dev, + cs4231_chip->input_dma_handle, + cs4231_chip->input_dma_size); cs4231_chip->input_dma_handle = 0; cs4231_chip->input_dma_size = 0; } if (cs4231_chip->input_next_dma_handle) { + pci_unmap_single((struct pci_dev *)drv->dev, + cs4231_chip->input_next_dma_handle, + cs4231_chip->input_next_dma_size); cs4231_chip->input_next_dma_handle = 0; cs4231_chip->input_next_dma_size = 0; } @@ -2236,6 +2259,8 @@ static int eb4231_attach(struct sparcaudio_driver *drv, cs4231_chip->input_size = cs4231_chip->output_size = 0; cs4231_chip->status = 0; + drv->dev = (struct sbus_dev *)edev->bus->self; + len = prom_getproperty(edev->prom_node, "reg", (void *)regs, sizeof(regs)); if ((len % sizeof(regs[0])) != 0) { printk("eb4231: Strange reg property size %d\n", len); diff --git a/drivers/sbus/audio/dbri.c b/drivers/sbus/audio/dbri.c index 66a34b35c..0b73b8e0d 100644 --- a/drivers/sbus/audio/dbri.c +++ b/drivers/sbus/audio/dbri.c @@ -1,4 +1,4 @@ -/* $Id: dbri.c,v 1.16 1999/11/19 09:56:05 davem Exp $ +/* $Id: dbri.c,v 1.17 2000/01/20 07:57:47 anton Exp $ * drivers/sbus/audio/dbri.c * * Copyright (C) 1997 Rudolf Koenig (rfkoenig@immd4.informatik.uni-erlangen.de) @@ -225,8 +225,8 @@ static void dbri_detach(struct dbri *dbri) dbri_reset(dbri); free_irq(dbri->irq, dbri); sbus_iounmap(dbri->regs, dbri->regs_size); - sbus_free_consistant(dbri->sdev, sizeof(struct dbri_dma), - dbri->dma, dbry->dma_dvma); + sbus_free_consistent(dbri->sdev, sizeof(struct dbri_dma), + dbri->dma, dbri->dma_dvma); kfree(dbri); } @@ -999,7 +999,7 @@ static void recv_on_pipe(struct dbri *dbri, int pipe, /* Make sure buffer size is multiple of four */ len &= ~3; - buf_buffer_base = buf_buffer = sbus_map_single(dbri->sdev, buffer, len); + bus_buffer_base = bus_buffer = sbus_map_single(dbri->sdev, buffer, len); while (len > 0) { int rd, mylen; @@ -2232,7 +2232,7 @@ static int dbri_attach(struct sparcaudio_driver *drv, dbri = (struct dbri *) drv->private; memset(dbri, 0, sizeof(*dbri)); - dbri->dma = sbus_alloc_consistant(sdev, + dbri->dma = sbus_alloc_consistent(sdev, sizeof(struct dbri_dma), &dbri->dma_dvma); @@ -2251,7 +2251,7 @@ static int dbri_attach(struct sparcaudio_driver *drv, "DBRI Registers"); if (!dbri->regs) { printk(KERN_ERR "DBRI: could not allocate registers\n"); - sbus_free_consistant(sdev, sizeof(struct dbri_dma), + sbus_free_consistent(sdev, sizeof(struct dbri_dma), dbri->dma, dbri->dma_dvma); kfree(drv->private); return -EIO; @@ -2265,7 +2265,7 @@ static int dbri_attach(struct sparcaudio_driver *drv, if (err) { printk(KERN_ERR "DBRI: Can't get irq %d\n", dbri->irq); sbus_iounmap(dbri->regs, dbri->regs_size); - sbus_free_consistant(sdev, sizeof(struct dbri_dma), + sbus_free_consistent(sdev, sizeof(struct dbri_dma), dbri->dma, dbri->dma_dvma); kfree(drv->private); return err; |