summaryrefslogtreecommitdiffstats
path: root/drivers/sbus
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-02-24 00:12:35 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-02-24 00:12:35 +0000
commit482368b1a8e45430672c58c9a42e7d2004367126 (patch)
treece2a1a567d4d62dee7c2e71a46a99cf72cf1d606 /drivers/sbus
parente4d0251c6f56ab2e191afb70f80f382793e23f74 (diff)
Merge with 2.3.47. Guys, this is buggy as shit. You've been warned.
Diffstat (limited to 'drivers/sbus')
-rw-r--r--drivers/sbus/audio/audio.c8
-rw-r--r--drivers/sbus/audio/cs4231.c66
-rw-r--r--drivers/sbus/audio/dbri.c31
-rw-r--r--drivers/sbus/char/bpp.c12
-rw-r--r--drivers/sbus/char/pcikbd.c5
-rw-r--r--drivers/sbus/char/sunkbd.c15
-rw-r--r--drivers/sbus/char/vfc.h3
-rw-r--r--drivers/sbus/char/vfc_dev.c15
-rw-r--r--drivers/sbus/dvma.c3
9 files changed, 108 insertions, 50 deletions
diff --git a/drivers/sbus/audio/audio.c b/drivers/sbus/audio/audio.c
index 62d295a8e..01c76073f 100644
--- a/drivers/sbus/audio/audio.c
+++ b/drivers/sbus/audio/audio.c
@@ -1,4 +1,4 @@
-/* $Id: audio.c,v 1.48 2000/02/09 22:33:19 davem Exp $
+/* $Id: audio.c,v 1.49 2000/02/17 05:52:41 davem Exp $
* drivers/sbus/audio/audio.c
*
* Copyright 1996 Thomas K. Dyas (tdyas@noc.rutgers.edu)
@@ -32,6 +32,7 @@
#include <linux/init.h>
#include <linux/soundcard.h>
#include <linux/version.h>
+#include <linux/devfs_fs_kernel.h>
#include <asm/delay.h>
#include <asm/pgtable.h>
@@ -2198,9 +2199,8 @@ int __init sparcaudio_init(void)
#endif
/* Register our character device driver with the VFS. */
- if (register_chrdev(SOUND_MAJOR, "sparcaudio", &sparcaudio_fops))
+ if (devfs_register_chrdev(SOUND_MAJOR, "sparcaudio", &sparcaudio_fops))
return -EIO;
-
#ifdef CONFIG_SPARCAUDIO_AMD7930
amd7930_init();
@@ -2221,7 +2221,7 @@ int __init sparcaudio_init(void)
#ifdef MODULE
void cleanup_module(void)
{
- unregister_chrdev(SOUND_MAJOR, "sparcaudio");
+ devfs_unregister_chrdev(SOUND_MAJOR, "sparcaudio");
}
#endif
diff --git a/drivers/sbus/audio/cs4231.c b/drivers/sbus/audio/cs4231.c
index 82e0fc494..e155a73b4 100644
--- a/drivers/sbus/audio/cs4231.c
+++ b/drivers/sbus/audio/cs4231.c
@@ -1,4 +1,4 @@
-/* $Id: cs4231.c,v 1.42 2000/01/28 13:42:48 jj Exp $
+/* $Id: cs4231.c,v 1.43 2000/02/18 13:49:39 davem Exp $
* drivers/sbus/audio/cs4231.c
*
* Copyright 1996, 1997, 1998, 1999 Derrick J Brashear (shadow@andrew.cmu.edu)
@@ -1171,11 +1171,11 @@ 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;
- void (*dma_unmap_single)(struct sbus_dev *, dma_addr_t, size_t) = sbus_unmap_single;
+ void (*dma_unmap_single)(struct sbus_dev *, dma_addr_t, size_t, int) = 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;
+ dma_unmap_single = (void (*)(struct sbus_dev *, dma_addr_t, size_t, int)) pci_unmap_single;
#endif
/* zero out any info about what data we have as well */
if (file->f_mode & FMODE_READ) {
@@ -1184,14 +1184,16 @@ static void cs4231_release(struct inode * inode, struct file * file, struct spar
if (cs4231_chip->input_dma_handle) {
dma_unmap_single(drv->dev,
cs4231_chip->input_dma_handle,
- cs4231_chip->input_dma_size);
+ cs4231_chip->input_dma_size,
+ SBUS_DMA_FROMDEVICE);
cs4231_chip->input_dma_handle = 0;
cs4231_chip->input_dma_size = 0;
}
if (cs4231_chip->input_next_dma_handle) {
dma_unmap_single(drv->dev,
cs4231_chip->input_next_dma_handle,
- cs4231_chip->input_next_dma_size);
+ cs4231_chip->input_next_dma_size,
+ SBUS_DMA_FROMDEVICE);
cs4231_chip->input_next_dma_handle = 0;
cs4231_chip->input_next_dma_size = 0;
}
@@ -1203,14 +1205,16 @@ static void cs4231_release(struct inode * inode, struct file * file, struct spar
if (cs4231_chip->output_dma_handle) {
dma_unmap_single(drv->dev,
cs4231_chip->output_dma_handle,
- cs4231_chip->output_dma_size);
+ cs4231_chip->output_dma_size,
+ SBUS_DMA_TODEVICE);
cs4231_chip->output_dma_handle = 0;
cs4231_chip->output_dma_size = 0;
}
if (cs4231_chip->output_next_dma_handle) {
dma_unmap_single(drv->dev,
cs4231_chip->output_next_dma_handle,
- cs4231_chip->output_next_dma_size);
+ cs4231_chip->output_next_dma_size,
+ SBUS_DMA_TODEVICE);
cs4231_chip->output_next_dma_handle = 0;
cs4231_chip->output_next_dma_size = 0;
}
@@ -1248,7 +1252,8 @@ static void cs4231_playintr(struct sparcaudio_driver *drv, int push)
if (cs4231_chip->output_dma_handle) {
sbus_unmap_single(drv->dev,
cs4231_chip->output_dma_handle,
- cs4231_chip->output_dma_size);
+ cs4231_chip->output_dma_size,
+ SBUS_DMA_TODEVICE);
cs4231_chip->output_dma_handle = 0;
cs4231_chip->output_dma_size = 0;
cs4231_chip->playing_count--;
@@ -1267,7 +1272,8 @@ static void cs4231_playintr(struct sparcaudio_driver *drv, int push)
cs4231_chip->output_next_dma_handle =
sbus_map_single(drv->dev,
(char *)cs4231_chip->output_ptr,
- cs4231_chip->output_size);
+ cs4231_chip->output_size,
+ SBUS_DMA_TODEVICE);
cs4231_chip->output_next_dma_size = cs4231_chip->output_size;
sbus_writel(cs4231_chip->output_next_dma_handle,
cs4231_chip->regs + APCPNVA);
@@ -1297,7 +1303,8 @@ static void eb4231_playintr(struct sparcaudio_driver *drv)
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_size,
+ PCI_DMA_TODEVICE);
cs4231_chip->output_dma_handle = 0;
cs4231_chip->output_dma_size = 0;
cs4231_chip->playing_count--;
@@ -1316,7 +1323,8 @@ static void eb4231_playintr(struct sparcaudio_driver *drv)
cs4231_chip->output_next_dma_handle =
pci_map_single((struct pci_dev *)drv->dev,
(char *)cs4231_chip->output_ptr,
- cs4231_chip->output_size);
+ cs4231_chip->output_size,
+ PCI_DMA_TODEVICE);
cs4231_chip->output_next_dma_size = cs4231_chip->output_size;
writel(cs4231_chip->output_next_dma_size,
@@ -1362,7 +1370,8 @@ static int cs4231_recintr(struct sparcaudio_driver *drv)
if (cs4231_chip->input_dma_handle) {
sbus_unmap_single(drv->dev,
cs4231_chip->input_dma_handle,
- cs4231_chip->input_dma_size);
+ cs4231_chip->input_dma_size,
+ SBUS_DMA_FROMDEVICE);
cs4231_chip->input_dma_handle = 0;
cs4231_chip->input_dma_size = 0;
cs4231_chip->recording_count--;
@@ -1384,7 +1393,8 @@ static int cs4231_recintr(struct sparcaudio_driver *drv)
cs4231_chip->input_next_dma_handle =
sbus_map_single(drv->dev,
(char *)cs4231_chip->input_ptr,
- cs4231_chip->input_size);
+ cs4231_chip->input_size,
+ SBUS_DMA_FROMDEVICE);
cs4231_chip->input_next_dma_size = cs4231_chip->input_size;
sbus_writel(cs4231_chip->input_next_dma_handle,
cs4231_chip->regs + APCCNVA);
@@ -1418,7 +1428,8 @@ 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_size,
+ PCI_DMA_FROMDEVICE);
cs4231_chip->input_dma_handle = 0;
cs4231_chip->input_dma_size = 0;
cs4231_chip->recording_count--;
@@ -1441,7 +1452,8 @@ static int eb4231_recintr(struct sparcaudio_driver *drv)
cs4231_chip->input_next_dma_handle =
pci_map_single((struct pci_dev *)drv->dev,
(char *)cs4231_chip->input_ptr,
- cs4231_chip->input_size);
+ cs4231_chip->input_size,
+ PCI_DMA_FROMDEVICE);
cs4231_chip->input_next_dma_size = cs4231_chip->input_size;
writel(cs4231_chip->input_next_dma_size,
@@ -1556,7 +1568,8 @@ static void eb4231_stop_output(struct sparcaudio_driver *drv)
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_size,
+ PCI_DMA_TODEVICE);
cs4231_chip->output_dma_handle = 0;
cs4231_chip->output_dma_size = 0;
}
@@ -1564,7 +1577,8 @@ static void eb4231_stop_output(struct sparcaudio_driver *drv)
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_size,
+ PCI_DMA_TODEVICE);
cs4231_chip->output_next_dma_handle = 0;
cs4231_chip->output_next_dma_size = 0;
}
@@ -1589,7 +1603,8 @@ static void cs4231_stop_output(struct sparcaudio_driver *drv)
if (cs4231_chip->output_dma_handle) {
sbus_unmap_single(drv->dev,
cs4231_chip->output_dma_handle,
- cs4231_chip->output_dma_size);
+ cs4231_chip->output_dma_size,
+ SBUS_DMA_TODEVICE);
cs4231_chip->output_dma_handle = 0;
cs4231_chip->output_dma_size = 0;
}
@@ -1597,7 +1612,8 @@ static void cs4231_stop_output(struct sparcaudio_driver *drv)
if (cs4231_chip->output_next_dma_handle) {
sbus_unmap_single(drv->dev,
cs4231_chip->output_next_dma_handle,
- cs4231_chip->output_next_dma_size);
+ cs4231_chip->output_next_dma_size,
+ SBUS_DMA_TODEVICE);
cs4231_chip->output_next_dma_handle = 0;
cs4231_chip->output_next_dma_size = 0;
}
@@ -1699,7 +1715,8 @@ static void cs4231_stop_input(struct sparcaudio_driver *drv)
if (cs4231_chip->input_dma_handle) {
sbus_unmap_single(drv->dev,
cs4231_chip->input_dma_handle,
- cs4231_chip->input_dma_size);
+ cs4231_chip->input_dma_size,
+ SBUS_DMA_FROMDEVICE);
cs4231_chip->input_dma_handle = 0;
cs4231_chip->input_dma_size = 0;
}
@@ -1707,7 +1724,8 @@ static void cs4231_stop_input(struct sparcaudio_driver *drv)
if (cs4231_chip->input_next_dma_handle) {
sbus_unmap_single(drv->dev,
cs4231_chip->input_next_dma_handle,
- cs4231_chip->input_next_dma_size);
+ cs4231_chip->input_next_dma_size,
+ SBUS_DMA_FROMDEVICE);
cs4231_chip->input_next_dma_handle = 0;
cs4231_chip->input_next_dma_size = 0;
}
@@ -1765,7 +1783,8 @@ static void eb4231_stop_input(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_size,
+ PCI_DMA_FROMDEVICE);
cs4231_chip->input_dma_handle = 0;
cs4231_chip->input_dma_size = 0;
}
@@ -1773,7 +1792,8 @@ static void eb4231_stop_input(struct sparcaudio_driver *drv)
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_size,
+ PCI_DMA_FROMDEVICE);
cs4231_chip->input_next_dma_handle = 0;
cs4231_chip->input_next_dma_size = 0;
}
diff --git a/drivers/sbus/audio/dbri.c b/drivers/sbus/audio/dbri.c
index a3f083ead..45ee9dd1b 100644
--- a/drivers/sbus/audio/dbri.c
+++ b/drivers/sbus/audio/dbri.c
@@ -1,4 +1,4 @@
-/* $Id: dbri.c,v 1.18 2000/01/28 13:42:50 jj Exp $
+/* $Id: dbri.c,v 1.19 2000/02/18 13:49:42 davem Exp $
* drivers/sbus/audio/dbri.c
*
* Copyright (C) 1997 Rudolf Koenig (rfkoenig@immd4.informatik.uni-erlangen.de)
@@ -356,7 +356,8 @@ static void transmission_complete_intr(struct dbri *dbri, int pipe)
if (buffer)
sbus_unmap_single(dbri->sdev,
dbri->descs[td].buffer_dvma,
- dbri->descs[td].len);
+ dbri->descs[td].len,
+ SBUS_DMA_TODEVICE);
callback = dbri->descs[td].output_callback;
callback_arg = dbri->descs[td].output_callback_arg;
@@ -391,7 +392,8 @@ static void reception_complete_intr(struct dbri *dbri, int pipe)
if (buffer)
sbus_unmap_single(dbri->sdev,
dbri->descs[rd].buffer_dvma,
- dbri->descs[rd].len);
+ dbri->descs[rd].len,
+ SBUS_DMA_FROMDEVICE);
callback = dbri->descs[rd].input_callback;
if (callback != NULL)
@@ -592,7 +594,9 @@ static void reset_pipe(struct dbri *dbri, int pipe)
if (buffer)
sbus_unmap_single(dbri->sdev,
dbri->descs[desc].buffer_dvma,
- dbri->descs[desc].len);
+ dbri->descs[desc].len,
+ output_callback != NULL ? SBUS_DMA_TODEVICE
+ : SBUS_DMA_FROMDEVICE);
dbri->descs[desc].inuse = 0;
desc = dbri->descs[desc].next;
@@ -863,7 +867,8 @@ static void xmit_on_pipe(struct dbri *dbri, int pipe,
return;
}
- dvma_buffer_base = dvma_buffer = sbus_map_single(dbri->sdev, buffer, len);
+ dvma_buffer_base = dvma_buffer = sbus_map_single(dbri->sdev, buffer, len,
+ SBUS_DMA_TODEVICE);
while (len > 0) {
int mylen;
@@ -907,6 +912,9 @@ static void xmit_on_pipe(struct dbri *dbri, int pipe,
}
if (first_td == -1 || last_td == -1) {
+ sbus_unmap_single(dbri->sdev, dvma_buffer_base,
+ dvma_buffer - dvma_buffer_base + len,
+ SBUS_DMA_TODEVICE);
return;
}
@@ -914,7 +922,7 @@ static void xmit_on_pipe(struct dbri *dbri, int pipe,
dbri->descs[last_td].buffer = buffer;
dbri->descs[last_td].buffer_dvma = dvma_buffer_base;
- dbri->descs[last_td].len = len;
+ dbri->descs[last_td].len = dvma_buffer - dvma_buffer_base + len;
dbri->descs[last_td].output_callback = callback;
dbri->descs[last_td].output_callback_arg = callback_arg;
@@ -999,7 +1007,8 @@ static void recv_on_pipe(struct dbri *dbri, int pipe,
/* Make sure buffer size is multiple of four */
len &= ~3;
- bus_buffer_base = bus_buffer = sbus_map_single(dbri->sdev, buffer, len);
+ bus_buffer_base = bus_buffer = sbus_map_single(dbri->sdev, buffer, len,
+ SBUS_DMA_FROMDEVICE);
while (len > 0) {
int rd, mylen;
@@ -1043,8 +1052,12 @@ static void recv_on_pipe(struct dbri *dbri, int pipe,
len -= mylen;
}
- if (last_rd == -1 || first_rd == -1)
+ if (last_rd == -1 || first_rd == -1) {
+ sbus_unmap_single(dbri->sdev, bus_buffer_base,
+ bus_buffer - bus_buffer_base + len,
+ SBUS_DMA_FROMDEVICE);
return;
+ }
for (rd=first_rd; rd != -1; rd = dbri->descs[rd].next) {
dprintk(D_DESC, ("DBRI RD %d: %08x %08x %08x %08x\n",
@@ -1057,7 +1070,7 @@ static void recv_on_pipe(struct dbri *dbri, int pipe,
dbri->descs[last_rd].buffer = buffer;
dbri->descs[last_rd].buffer_dvma = bus_buffer_base;
- dbri->descs[last_rd].len = len;
+ dbri->descs[last_rd].len = bus_buffer - bus_buffer_base + len;
dbri->descs[last_rd].input_callback = callback;
dbri->descs[last_rd].input_callback_arg = callback_arg;
diff --git a/drivers/sbus/char/bpp.c b/drivers/sbus/char/bpp.c
index 1d2bee01a..fb18a63c1 100644
--- a/drivers/sbus/char/bpp.c
+++ b/drivers/sbus/char/bpp.c
@@ -19,6 +19,7 @@
#include <linux/timer.h>
#include <linux/ioport.h>
#include <linux/major.h>
+#include <linux/devfs_fs_kernel.h>
#include <asm/uaccess.h>
#include <asm/io.h>
@@ -1004,6 +1005,8 @@ static inline void freeLptPort(int idx)
#endif
+static devfs_handle_t devfs_handle = NULL;
+
#ifdef MODULE
int init_module(void)
#else
@@ -1017,7 +1020,7 @@ int __init bpp_init(void)
if (rc == 0)
return -ENODEV;
- rc = register_chrdev(BPP_MAJOR, dev_name, &bpp_fops);
+ rc = devfs_register_chrdev(BPP_MAJOR, dev_name, &bpp_fops);
if (rc < 0)
return rc;
@@ -1025,6 +1028,10 @@ int __init bpp_init(void)
instances[idx].opened = 0;
probeLptPort(idx);
}
+ devfs_handle = devfs_mk_dir (NULL, "bpp", 3, NULL);
+ devfs_register_series (devfs_handle, "%u", BPP_NO, DEVFS_FL_DEFAULT,
+ BPP_MAJOR, 0, S_IFCHR | S_IRUSR | S_IWUSR, 0, 0,
+ &bpp_fops, NULL);
return 0;
}
@@ -1034,7 +1041,8 @@ void cleanup_module(void)
{
unsigned idx;
- unregister_chrdev(BPP_MAJOR, dev_name);
+ devfs_unregister (devfs_handle);
+ devfs_unregister_chrdev(BPP_MAJOR, dev_name);
for (idx = 0 ; idx < BPP_NO ; idx += 1) {
if (instances[idx].present)
diff --git a/drivers/sbus/char/pcikbd.c b/drivers/sbus/char/pcikbd.c
index 97ebda430..76b83eacb 100644
--- a/drivers/sbus/char/pcikbd.c
+++ b/drivers/sbus/char/pcikbd.c
@@ -1,4 +1,4 @@
-/* $Id: pcikbd.c,v 1.43 2000/02/09 22:33:25 davem Exp $
+/* $Id: pcikbd.c,v 1.44 2000/02/11 04:49:13 davem Exp $
* pcikbd.c: Ultra/AX PC keyboard support.
*
* Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be)
@@ -1024,9 +1024,6 @@ int __init ps2kbd_probe(void)
goto found;
}
#endif
- if (!pci_present())
- goto do_enodev;
-
/*
* Get the nodes for keyboard and mouse from aliases on normal systems.
*/
diff --git a/drivers/sbus/char/sunkbd.c b/drivers/sbus/char/sunkbd.c
index 7e26f3491..91bf24a18 100644
--- a/drivers/sbus/char/sunkbd.c
+++ b/drivers/sbus/char/sunkbd.c
@@ -24,6 +24,7 @@
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/sysrq.h>
+#include <linux/devfs_fs_kernel.h>
#include <asm/kbio.h>
#include <asm/vuid_event.h>
@@ -507,7 +508,7 @@ void sunkbd_inchar(unsigned char ch, struct pt_regs *regs)
}
do_poke_blanked_console = 1;
- mark_bh(CONSOLE_BH);
+ tasklet_schedule(&console_tasklet);
add_keyboard_randomness(keycode);
tty = ttytab? ttytab[fg_console]: NULL;
@@ -616,7 +617,7 @@ static void put_queue(int ch)
wake_up(&keypress_wait);
if (tty) {
tty_insert_flip_char(tty, ch, 0);
- tty_schedule_flip(tty);
+ con_schedule_flip(tty);
}
}
@@ -630,7 +631,7 @@ static void puts_queue(char *cp)
tty_insert_flip_char(tty, *cp, 0);
cp++;
}
- tty_schedule_flip(tty);
+ con_schedule_flip(tty);
}
static void applkey(int key, char mode)
@@ -742,7 +743,7 @@ static void send_intr(void)
if (!tty)
return;
tty_insert_flip_char(tty, 0, TTY_BREAK);
- tty_schedule_flip(tty);
+ con_schedule_flip(tty);
}
static void scroll_forw(void)
@@ -1549,7 +1550,11 @@ void __init keyboard_zsinit(void (*put_char)(unsigned char))
send_cmd(SKBDCMD_SETLED); send_cmd(0x0); /* All off */
/* Register the /dev/kbd interface */
- if (register_chrdev (KBD_MAJOR, "kbd", &kbd_fops)){
+ devfs_register (NULL, "kbd", 0, DEVFS_FL_NONE,
+ KBD_MAJOR, 0,
+ S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH, 0, 0,
+ &kbd_fops, NULL);
+ if (devfs_register_chrdev (KBD_MAJOR, "kbd", &kbd_fops)){
printk ("Could not register /dev/kbd device\n");
return;
}
diff --git a/drivers/sbus/char/vfc.h b/drivers/sbus/char/vfc.h
index b9ed039ce..c22f835c0 100644
--- a/drivers/sbus/char/vfc.h
+++ b/drivers/sbus/char/vfc.h
@@ -1,6 +1,8 @@
#ifndef _LINUX_VFC_H_
#define _LINUX_VFC_H_
+#include <linux/devfs_fs_kernel.h>
+
/*
* The control register for the vfc is at offset 0x4000
* The first field ram bank is located at offset 0x5000
@@ -126,6 +128,7 @@ struct vfc_dev {
volatile struct vfc_regs *regs;
struct vfc_regs *phys_regs;
unsigned int control_reg;
+ devfs_handle_t de;
struct semaphore device_lock_sem;
struct timer_list poll_timer;
wait_queue_head_t poll_wait;
diff --git a/drivers/sbus/char/vfc_dev.c b/drivers/sbus/char/vfc_dev.c
index 5f7af8642..a5e61bb9a 100644
--- a/drivers/sbus/char/vfc_dev.c
+++ b/drivers/sbus/char/vfc_dev.c
@@ -41,6 +41,7 @@
#include "vfc.h"
#include <asm/vfc_ioctls.h>
+static devfs_handle_t devfs_handle = NULL; /* For the directory */
struct vfc_dev **vfc_dev_lst;
static char vfcstr[]="vfc";
static unsigned char saa9051_init_array[VFC_SAA9051_NR] = {
@@ -140,6 +141,8 @@ int init_vfc_devstruct(struct vfc_dev *dev, int instance)
int init_vfc_device(struct sbus_dev *sdev,struct vfc_dev *dev, int instance)
{
+ char devname[8];
+
if(dev == NULL) {
printk(KERN_ERR "VFC: Bogus pointer passed\n");
return -ENOMEM;
@@ -162,6 +165,11 @@ int init_vfc_device(struct sbus_dev *sdev,struct vfc_dev *dev, int instance)
if (init_vfc_hw(dev))
return -EIO;
+ sprintf (devname, "%d", instance);
+ dev->de = devfs_register (devfs_handle, devname, 0, DEVFS_FL_DEFAULT,
+ VFC_MAJOR, instance,
+ S_IFCHR | S_IRUSR | S_IWUSR, 0, 0,
+ &vfc_fops, NULL);
return 0;
}
@@ -659,12 +667,13 @@ static int vfc_probe(void)
memset(vfc_dev_lst, 0, sizeof(struct vfc_dev *) * (cards + 1));
vfc_dev_lst[cards] = NULL;
- ret = register_chrdev(VFC_MAJOR, vfcstr, &vfc_fops);
+ ret = devfs_register_chrdev(VFC_MAJOR, vfcstr, &vfc_fops);
if(ret) {
printk(KERN_ERR "Unable to get major number %d\n", VFC_MAJOR);
kfree(vfc_dev_lst);
return -EIO;
}
+ devfs_handle = devfs_mk_dir (NULL, "vfc", 3, NULL);
instance = 0;
for_all_sbusdev(sdev, sbus) {
@@ -705,6 +714,7 @@ static void deinit_vfc_device(struct vfc_dev *dev)
{
if(dev == NULL)
return;
+ devfs_unregister (dev->de);
sbus_iounmap((unsigned long)dev->regs, sizeof(struct vfc_regs));
kfree(dev);
}
@@ -713,11 +723,12 @@ void cleanup_module(void)
{
struct vfc_dev **devp;
- unregister_chrdev(VFC_MAJOR,vfcstr);
+ devfs_unregister_chrdev(VFC_MAJOR,vfcstr);
for (devp = vfc_dev_lst; *devp; devp++)
deinit_vfc_device(*devp);
+ devfs_unregister (devfs_handle);
kfree(vfc_dev_lst);
return;
}
diff --git a/drivers/sbus/dvma.c b/drivers/sbus/dvma.c
index be31441ad..bb522768d 100644
--- a/drivers/sbus/dvma.c
+++ b/drivers/sbus/dvma.c
@@ -105,7 +105,8 @@ void __init dvma_init(struct sbus_bus *sbus)
}
dma->regs = sbus_ioremap(&dma->sdev->resource[0], 0,
- PAGE_SIZE, "dma");
+ dma->sdev->resource[0].end - dma->sdev->resource[0].start + 1,
+ "dma");
dma->node = dma->sdev->prom_node;