Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/sparc/dev Hasn't been used for years.



details:   https://anonhg.NetBSD.org/src/rev/a637048f1cf4
branches:  trunk
changeset: 532717:a637048f1cf4
user:      gmcgarry <gmcgarry%NetBSD.org@localhost>
date:      Thu Jun 13 20:57:03 2002 +0000

description:
Hasn't been used for years.

diffstat:

 sys/arch/sparc/dev/am7930_sparc.c |  626 --------------------------------------
 1 files changed, 0 insertions(+), 626 deletions(-)

diffs (truncated from 630 to 300 lines):

diff -r c7cbe79cd6bd -r a637048f1cf4 sys/arch/sparc/dev/am7930_sparc.c
--- a/sys/arch/sparc/dev/am7930_sparc.c Thu Jun 13 20:49:00 2002 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,626 +0,0 @@
-/*     $NetBSD: am7930_sparc.c,v 1.49 2002/03/11 16:27:01 pk Exp $     */
-
-/*
- * Copyright (c) 1995 Rolf Grossmann
- * 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 Rolf Grossmann.
- * 4. The name of the author may not be used to endorse or promote products
- *    derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
- */
-
-#include "audio.h"
-#if NAUDIO > 0
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/errno.h>
-#include <sys/device.h>
-
-#include <machine/bus.h>
-#include <machine/intr.h>
-#include <machine/autoconf.h>
-
-#include <sys/audioio.h>
-#include <dev/audio_if.h>
-
-#include <dev/ic/am7930reg.h>
-#include <machine/am7930_machdep.h>
-#include <dev/ic/am7930var.h>
-
-#define AUDIO_ROM_NAME "audio"
-
-#ifdef AUDIO_DEBUG
-#define DPRINTF(x)      if (am7930debug) printf x
-#else
-#define DPRINTF(x)
-#endif /* AUDIO_DEBUG */
-
-
-/* interrupt interfaces */
-#ifdef AUDIO_C_HANDLER
-int    am7930hwintr __P((void *));
-#if defined(SUN4M)
-#define AUDIO_SET_SWINTR do {          \
-       if (CPU_ISSUN4M)                \
-               raise(0, 4);            \
-       else                            \
-               ienab_bis(IE_L4);       \
-} while(0);
-#else
-#define AUDIO_SET_SWINTR ienab_bis(IE_L4)
-#endif /* defined(SUN4M) */
-#else
-struct auio *auiop;
-#endif /* AUDIO_C_HANDLER */
-int    am7930swintr __P((void *));
-
-/* forward declarations */
-void   am7930_sparc_onopen __P((struct am7930_softc *sc));
-void   am7930_sparc_onclose __P((struct am7930_softc *sc));
-
-/* autoconfiguration driver */
-void   am7930attach_mainbus __P((struct device *, struct device *, void *));
-int    am7930match_mainbus __P((struct device *, struct cfdata *, void *));
-void   am7930attach_sbus __P((struct device *, struct device *, void *));
-int    am7930match_sbus __P((struct device *, struct cfdata *, void *));
-
-void   am7930_sparc_attach(struct am7930_softc *sc, int);
-
-
-struct cfattach audioamd_mainbus_ca = {
-       sizeof(struct am7930_softc), am7930match_mainbus, am7930attach_mainbus
-};
-
-struct cfattach audioamd_sbus_ca = {
-       sizeof(struct am7930_softc), am7930match_sbus, am7930attach_sbus
-};
-
-/*
- * Define our interface to the higher level audio driver.
- */
-int    am7930_start_output __P((void *, void *, int, void (*)(void *),
-                                 void *));
-int    am7930_start_input __P((void *, void *, int, void (*)(void *),
-                                void *));
-int    am7930_set_port __P((void *, mixer_ctrl_t *));
-int    am7930_get_port __P((void *, mixer_ctrl_t *));
-int    am7930_query_devinfo __P((void *, mixer_devinfo_t *));
-
-void   am7930_sparc_w16 __P((bus_space_tag_t bt, bus_space_handle_t bh, u_int16_t val));
-
-struct audio_hw_if sa_hw_if = {
-       am7930_open,
-       am7930_close,
-       0,
-       am7930_query_encoding,
-       am7930_set_params,
-       am7930_round_blocksize,         /* XXX md? */
-       am7930_commit_settings,
-       0,
-       0,
-       am7930_start_output,            /* XXX md? */
-       am7930_start_input,             /* XXX md? */
-       am7930_halt_output,             /* XXX md? */
-       am7930_halt_input,              /* XXX md? */
-       0,
-       am7930_getdev,
-       0,
-       am7930_set_port,
-       am7930_get_port,
-       am7930_query_devinfo,
-       0,
-       0,
-       0,
-        0,
-       am7930_get_props,
-       0,
-       0,
-        0,
-};
-
-/* autoconfig routines */
-
-
-int
-am7930match_mainbus(parent, cf, aux)
-       struct device *parent;
-       struct cfdata *cf;
-       void *aux;
-{
-       struct mainbus_attach_args *ma = aux;
-
-       if (CPU_ISSUN4)
-               return (0);
-       return (strcmp(AUDIO_ROM_NAME, ma->ma_name) == 0);
-}
-
-int
-am7930match_sbus(parent, cf, aux)
-       struct device *parent;
-       struct cfdata *cf;
-       void *aux;
-{
-       struct sbus_attach_args *sa = aux;
-
-       return (strcmp(AUDIO_ROM_NAME, sa->sa_name) == 0);
-}
-
-/*
- * Audio chip found.
- */
-void
-am7930attach_mainbus(parent, self, aux)
-       struct device *parent, *self;
-       void *aux;
-{
-       struct mainbus_attach_args *ma = aux;
-       struct am7930_softc *sc = (struct am7930_softc *)self;
-       bus_space_handle_t bh;
-
-       sc->sc_bustag = ma->ma_bustag;
-
-       if (bus_space_map(
-                       ma->ma_bustag,
-                       ma->ma_iospace, ma->ma_paddr, sizeof(struct am7930),
-                       BUS_SPACE_MAP_LINEAR, &bh) != 0) {
-               printf("%s: cannot map registers\n", self->dv_xname);
-               return;
-       }
-       sc->sc_bh = bh;
-       am7930_sparc_attach(sc, ma->ma_pri);
-}
-
-void
-am7930attach_sbus(parent, self, aux)
-       struct device *parent, *self;
-       void *aux;
-{
-       struct sbus_attach_args *sa = aux;
-       struct am7930_softc *sc = (struct am7930_softc *)self;
-       bus_space_handle_t bh;
-
-       sc->sc_bustag = sa->sa_bustag;
-
-       if (sbus_bus_map(sa->sa_bustag,
-                        sa->sa_slot, sa->sa_offset, sizeof(struct am7930),
-                        0, &bh) != 0) {
-               printf("%s: cannot map registers\n", self->dv_xname);
-               return;
-       }
-       sc->sc_bh = bh;
-       if (sa->sa_nintr != 0)
-               am7930_sparc_attach(sc, sa->sa_pri);
-}
-
-void
-am7930_sparc_attach(sc, pri)
-       struct am7930_softc *sc;
-       int pri;
-{
-
-       printf(" softpri %d\n", PIL_AUSOFT);
-
-       am7930_init(sc);
-
-       sc->sc_wam16  = am7930_sparc_w16;
-       sc->sc_onopen = am7930_sparc_onopen;
-       sc->sc_onclose = am7930_sparc_onclose;
-
-#ifndef AUDIO_C_HANDLER
-       auiop = &sc->sc_au;
-       (void)bus_intr_establish(sc->sc_bustag, pri, IPL_AUDIO,
-                                BUS_INTR_ESTABLISH_FASTTRAP,
-                                (int (*) __P((void *)))amd7930_trap, NULL);
-#else
-       (void)bus_intr_establish(sc->sc_bustag, pri, IPL_AUDIO, 0,
-                                am7930hwintr, &sc->sc_au);
-#endif
-       (void)bus_intr_establish(sc->sc_bustag, PIL_AUSOFT, IPL_AUDIO,
-                                BUS_INTR_ESTABLISH_SOFTINTR,
-                                am7930swintr, sc);
-
-       evcnt_attach_dynamic(&sc->sc_intrcnt, EVCNT_TYPE_INTR, NULL,
-           sc->sc_dev.dv_xname, "intr");
-
-       audio_attach_mi(&sa_hw_if, sc, &sc->sc_dev);
-}
-
-
-/*
- *  16-bit register write, big-endian mapping.
- */
-void
-am7930_sparc_w16(bt, bh, val)
-       bus_space_tag_t bt;
-       bus_space_handle_t bh;
-       u_int16_t val;
-{
-       AM7930_WRITE_REG(bt, bh, dr, val);
-       AM7930_WRITE_REG(bt, bh, dr, val >> 8);
-}
-
-
-/*
- * MD attach-dependent middle layer:
- * move bytes to/from MAP chip.
- */
-
-void
-am7930_sparc_onopen(sc)
-       struct am7930_softc *sc;
-{
-
-       /* reset pdma state */
-       sc->sc_rintr = 0;
-       sc->sc_rarg = 0;
-       sc->sc_pintr = 0;
-       sc->sc_parg = 0;
-
-       sc->sc_au.au_rdata = 0;
-       sc->sc_au.au_pdata = 0;
-}
-
-
-void
-am7930_sparc_onclose(sc)
-       struct am7930_softc *sc;
-{
-       /* On sparc, just do the chipset-level halt. */
-       am7930_halt_input(sc);
-       am7930_halt_output(sc);
-}
-
-int
-am7930_start_output(addr, p, cc, intr, arg)



Home | Main Index | Thread Index | Old Index