summaryrefslogtreecommitdiffstats
path: root/drivers/sbus
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/sbus')
-rw-r--r--drivers/sbus/audio/amd7930.c6
-rw-r--r--drivers/sbus/audio/cs4231.c63
-rw-r--r--drivers/sbus/audio/dbri.c14
-rw-r--r--drivers/sbus/char/Makefile7
-rw-r--r--drivers/sbus/char/jsflash.c9
-rw-r--r--drivers/sbus/char/uctrl.c4
-rw-r--r--drivers/sbus/char/vfc_i2c.c2
7 files changed, 73 insertions, 32 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;
diff --git a/drivers/sbus/char/Makefile b/drivers/sbus/char/Makefile
index 9a4a59fe6..4a88efda3 100644
--- a/drivers/sbus/char/Makefile
+++ b/drivers/sbus/char/Makefile
@@ -103,6 +103,13 @@ else
endif
endif
+ifeq ($(CONFIG_SUN_JSFLASH),y)
+O_OBJS += jsflash.o
+endif
+ifeq ($(CONFIG_SUN_JSFLASH),m)
+M_OBJS += jsflash.o
+endif
+
include $(TOPDIR)/Rules.make
sunkbdmap.o: sunkeymap.c
diff --git a/drivers/sbus/char/jsflash.c b/drivers/sbus/char/jsflash.c
index ab4ff4f90..14f074023 100644
--- a/drivers/sbus/char/jsflash.c
+++ b/drivers/sbus/char/jsflash.c
@@ -191,12 +191,21 @@ static ssize_t jsf_read(struct file * file, char * buf,
}
if (p < JSF_BASE_ALL && togo != 0) {
+#if 0 /* __bzero XXX */
size_t x = JSF_BASE_ALL - p;
if (x > togo) x = togo;
clear_user(tmp, x);
tmp += x;
p += x;
togo -= x;
+#else
+ /*
+ * Implementation of clear_user() calls __bzero
+ * without regard to modversions,
+ * so we cannot build a module.
+ */
+ return 0;
+#endif
}
while (togo >= 4) {
diff --git a/drivers/sbus/char/uctrl.c b/drivers/sbus/char/uctrl.c
index f46cffe1b..6d9decaf3 100644
--- a/drivers/sbus/char/uctrl.c
+++ b/drivers/sbus/char/uctrl.c
@@ -1,4 +1,4 @@
-/* $Id: uctrl.c,v 1.5 1999/12/15 15:48:24 davem Exp $
+/* $Id: uctrl.c,v 1.6 2000/01/22 05:22:07 anton Exp $
* uctrl.c: TS102 Microcontroller interface on Tadpole Sparcbook 3
*
* Copyright 1999 Derrick J Brashear (shadow@dementia.org)
@@ -380,7 +380,7 @@ void uctrl_get_external_status()
#ifdef MODULE
int init_module(void)
#else
-int __init uctrl_init(void)
+int __init ts102_uctrl_init(void)
#endif
{
struct uctrl_driver *driver = &drv;
diff --git a/drivers/sbus/char/vfc_i2c.c b/drivers/sbus/char/vfc_i2c.c
index 2538c935f..6731caa78 100644
--- a/drivers/sbus/char/vfc_i2c.c
+++ b/drivers/sbus/char/vfc_i2c.c
@@ -115,7 +115,7 @@ int vfc_i2c_reset_bus(struct vfc_dev *dev)
{
VFC_I2C_DEBUG_PRINTK((KERN_DEBUG "vfc%d: Resetting the i2c bus\n",
dev->instance));
- if(dev == NULl)
+ if(dev == NULL)
return -EINVAL;
if(dev->regs == NULL)
return -EINVAL;