Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/x68k/dev Remove old obsolete audio driver.
details: https://anonhg.NetBSD.org/src/rev/ee6eacd89fe1
branches: trunk
changeset: 509368:ee6eacd89fe1
user: minoura <minoura%NetBSD.org@localhost>
date: Wed May 02 13:24:52 2001 +0000
description:
Remove old obsolete audio driver.
diffstat:
sys/arch/x68k/dev/adpcm.c | 93 --
sys/arch/x68k/dev/bsd_audio.c | 1419 --------------------------------------
sys/arch/x68k/dev/bsd_audioreg.h | 71 -
sys/arch/x68k/dev/bsd_audiovar.h | 42 -
4 files changed, 0 insertions(+), 1625 deletions(-)
diffs (truncated from 1641 to 300 lines):
diff -r d2114c991441 -r ee6eacd89fe1 sys/arch/x68k/dev/adpcm.c
--- a/sys/arch/x68k/dev/adpcm.c Wed May 02 13:24:42 2001 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,93 +0,0 @@
-/*
- * Copyright (c) 1991-1993 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the Computer Systems
- * Engineering Group at Lawrence Berkeley Laboratory.
- * 4. Neither the name of the University nor of the Laboratory may be used
- * to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $NetBSD: adpcm.c,v 1.2 1997/10/13 14:22:47 lukem Exp $
- */
-
-#include "bsdaudio.h"
-#if NBSDAUDIO > 0
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <x68k/dev/bsd_audiovar.h>
-#include <x68k/dev/bsd_audioreg.h>
-#include <x68k/dev/opmreg.h>
-#include <machine/bsd_audioio.h>
-#include <x68k/x68k/iodevice.h>
-
-#define RATE_15K 15625
-#define RATE_10K 10417
-#define RATE_7K 7813
-#define RATE_5K 5208
-#define RATE_3K 3906
-
-struct adpcm_l2r {
- u_int low;
- u_int rate;
- u_char clk;
- u_char den;
-} l2r[5] = {
- { 13021, RATE_15K, ADPCM_CLOCK_8MHZ, ADPCM_RATE_512},
- { 9115, RATE_10K, ADPCM_CLOCK_8MHZ, ADPCM_RATE_768},
- { 6510, RATE_7K, ADPCM_CLOCK_8MHZ, ADPCM_RATE_1024},
- { 4557, RATE_5K, ADPCM_CLOCK_4MHZ, ADPCM_RATE_768},
- { 0, RATE_3K, ADPCM_CLOCK_4MHZ, ADPCM_RATE_1024}
-};
-
-u_int
-adpcm_round_sr(rate)
- u_int rate;
-{
- int i;
- for (i = 0; i < 5; i++) {
- if (rate >= l2r[i].low)
- return (l2r[i].rate);
- }
- /*NOTREACHED*/
-}
-
-void
-adpcm_set_sr(rate)
- u_int rate;
-{
- int i;
- for (i = 0; i < 5; i++) {
- if (rate >= l2r[i].low) {
- PPI.portc = (PPI.portc & 0xf0) | l2r[i].den;
- adpcm_chgclk(l2r[i].clk);
- return;
- }
- }
- /*NOTREACHED*/
-}
-
-#endif
diff -r d2114c991441 -r ee6eacd89fe1 sys/arch/x68k/dev/bsd_audio.c
--- a/sys/arch/x68k/dev/bsd_audio.c Wed May 02 13:24:42 2001 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1419 +0,0 @@
-/* $NetBSD: bsd_audio.c,v 1.6 1998/05/24 19:32:48 is Exp $ */
-
-/*
- * Copyright (c) 1991-1993 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the Computer Systems
- * Engineering Group at Lawrence Berkeley Laboratory.
- * 4. Neither the name of the University nor of the Laboratory may be used
- * to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * This is a (partially) SunOS-compatible /dev/audio driver for NetBSD.
- *
- * This code assumes SoundBlaster type hardware, supported by the
- * code in isa/sb.c. A major problem with this hardware is that it
- * is half-duplex. E.g., you cannot simultaneously record and play
- * samples. Thus, it doesn't really make sense to allow O_RDWR access.
- * However, opening and closing the device to "turn around the line"
- * is relatively expensive and costs a card reset (which can take
- * some time). Instead, we allow O_RDWR access, and provide an
- * ioctl to set the "mode", e.g., playing or recording. If you
- * write to the device in record mode, the data is tossed. If you
- * read from the device in play mode, you get zero filled buffers
- * at the rate at which samples are naturally generated.
- */
-
-#include "audio.h"
-#if NAUDIO > 0
-
-#include <sys/param.h>
-#include <sys/ioctl.h>
-#include <sys/systm.h>
-#include <sys/vnode.h>
-#include <sys/select.h>
-#include <sys/malloc.h>
-#include <sys/file.h>
-#include <sys/proc.h>
-#include <sys/user.h>
-#include <sys/device.h>
-
-#include <machine/cpu.h>
-#include <machine/pte.h>
-
-extern u_int kvtop __P((register caddr_t addr));
-int uiomove __P((caddr_t cp, int n, struct uio *uio));
-
-#include <x68k/dev/bsd_audiovar.h>
-#include <x68k/dev/bsd_audioreg.h>
-#include <machine/bsd_audioio.h>
-#include <x68k/x68k/iodevice.h>
-
-#define AUDIODEBUG if (audiodebug) printf
-int audiodebug = 0;
-
-#define dma3 (IODEVbase->io_dma[3])
-
-/*
- * Initial/default block size is patchable.
- */
-int audio_blocksize = DEFBLKSIZE;
-int audio_backlog = 400; /* 50ms in samples */
-
-/*
- * Software state, per MSM6258V audio chip.
- */
-struct audio_softc {
- struct adpcm_softc sc_adpcm;
- u_char sc_open; /* single use device */
- u_char sc_mode; /* */
- u_char sc_rbus; /* input dma in progress */
- u_char sc_pbus; /* output dma in progress */
- u_char sc_rencoding;
- u_char sc_pencoding;
- u_char sc_pad[2];
- u_long sc_wseek; /* timestamp of last frame written */
- u_long sc_rseek; /* timestamp of last frame read */
- u_long sc_orate; /* input sampling rate */
- u_long sc_irate; /* output sampling rate */
- struct selinfo sc_wsel; /* write selector */
- struct selinfo sc_rsel; /* read selector */
-
- int sc_rlevel; /* record level */
- int sc_plevel; /* play level */
-
- /*
- * Sleep channels for reading and writing.
- */
- int sc_rchan;
- int sc_wchan;
- int sc_ochan;
-
- /*
- * Buffer management.
- */
- u_char *sc_hp; /* head */
- u_char *sc_tp; /* tail */
- u_char *sc_bp; /* start of buffer */
- u_char *sc_ep; /* end of buffer */
- u_char *sc_zp; /* block of silence */
-
- int sc_nblk;
- int sc_maxblk;
- int sc_lowat; /* xmit low water mark (for wakeup) */
- int sc_hiwat; /* xmit high water mark (for wakeup) */
- int sc_blksize; /* recv block (chunk) size */
- int sc_backlog; /* # blks of xmit backlog to gen. */
- int sc_finish;
-
- /* sc_au is special in that the hardware interrupt handler uses it */
- int sc_rblks; /* number of phantom record blocks */
-} audio_softc[NAUDIO];
-
-/* forward declarations */
-inline static int audio_sleep __P((int *));
-
-/* autoconfiguration driver */
-int audioattach();
-
-static int audio_default_level = 150;
-
-static void ausetrgain __P((struct audio_softc *, int));
-static void ausetpgain __P((struct audio_softc *, int));
-static int audiosetinfo __P((struct audio_softc *, struct audio_info *));
-static int audiogetinfo __P((struct audio_softc *, struct audio_info *));
-
-struct sun_audio_info;
-
-void audio_init_record __P((struct audio_softc *));
-void audio_init_play __P((struct audio_softc *));
-void audiostartr __P((struct audio_softc *));
-void audiostartp __P((struct audio_softc *));
-inline void audio_rint __P((struct audio_softc *));
-inline void audio_pint __P((struct audio_softc *));
-
-void audio_tomulaw __P((short *, register int));
-void audio_frommulaw __P((u_char *, register int));
-void audio_tolinear __P((struct audio_softc *, register u_char *, register int));
-void audio_fromlinear __P((struct audio_softc *, register u_char *, register int));
-
-
-void
-audio_initbuf(sc)
- struct audio_softc *sc;
-{
- register int nblk = NBPG / sc->sc_blksize;
-
- sc->sc_ep = sc->sc_bp + nblk * sc->sc_blksize;
- sc->sc_hp = sc->sc_tp = sc->sc_bp;
- sc->sc_maxblk = nblk;
- sc->sc_nblk = 0;
- sc->sc_lowat = 3;
- sc->sc_hiwat = nblk - 1;
-}
-
-static inline int
-audio_sleep(int *chan)
-{
- int st;
- *chan = 1;
- st = (tsleep((caddr_t)chan, PWAIT | PCATCH, "audio", 0));
- *chan = 0;
- return (st);
-}
-
-static inline void
-audio_wakeup(chan)
- int *chan;
-{
- if (*chan) {
- wakeup((caddr_t)chan);
- *chan = 0;
- }
-}
-
Home |
Main Index |
Thread Index |
Old Index