Home | History | Annotate | Line # | Download | only in isa
ad1848var.h revision 1.29
      1 /*	$NetBSD: ad1848var.h,v 1.29 1999/02/19 16:15:06 mycroft Exp $	*/
      2 
      3 /*-
      4  * Copyright (c) 1999 The NetBSD Foundation, Inc.
      5  * All rights reserved.
      6  *
      7  * This code is derived from software contributed to The NetBSD Foundation
      8  * by Ken Hornstein and John Kohl.
      9  *
     10  * Redistribution and use in source and binary forms, with or without
     11  * modification, are permitted provided that the following conditions
     12  * are met:
     13  * 1. Redistributions of source code must retain the above copyright
     14  *    notice, this list of conditions and the following disclaimer.
     15  * 2. Redistributions in binary form must reproduce the above copyright
     16  *    notice, this list of conditions and the following disclaimer in the
     17  *    documentation and/or other materials provided with the distribution.
     18  * 3. All advertising materials mentioning features or use of this software
     19  *    must display the following acknowledgement:
     20  *        This product includes software developed by the NetBSD
     21  *	  Foundation, Inc. and its contributors.
     22  * 4. Neither the name of The NetBSD Foundation nor the names of its
     23  *    contributors may be used to endorse or promote products derived
     24  *    from this software without specific prior written permission.
     25  *
     26  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     27  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     28  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     29  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     30  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     31  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     32  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     33  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     34  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     35  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     36  * POSSIBILITY OF SUCH DAMAGE.
     37  */
     38 /*
     39  * Copyright (c) 1994 John Brezak
     40  * Copyright (c) 1991-1993 Regents of the University of California.
     41  * All rights reserved.
     42  *
     43  * Redistribution and use in source and binary forms, with or without
     44  * modification, are permitted provided that the following conditions
     45  * are met:
     46  * 1. Redistributions of source code must retain the above copyright
     47  *    notice, this list of conditions and the following disclaimer.
     48  * 2. Redistributions in binary form must reproduce the above copyright
     49  *    notice, this list of conditions and the following disclaimer in the
     50  *    documentation and/or other materials provided with the distribution.
     51  * 3. All advertising materials mentioning features or use of this software
     52  *    must display the following acknowledgement:
     53  *	This product includes software developed by the Computer Systems
     54  *	Engineering Group at Lawrence Berkeley Laboratory.
     55  * 4. Neither the name of the University nor of the Laboratory may be used
     56  *    to endorse or promote products derived from this software without
     57  *    specific prior written permission.
     58  *
     59  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     60  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     61  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     62  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     63  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     64  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     65  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     66  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     67  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     68  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     69  * SUCH DAMAGE.
     70  *
     71  */
     72 
     73 #define AD1848_NPORT	4
     74 
     75 #include <dev/ic/ad1848var.h>
     76 
     77 struct ad1848_isa_softc {
     78 	struct	ad1848_softc sc_ad1848;	/* AD1848 device */
     79 	void	*sc_ih;			/* interrupt vectoring */
     80 	isa_chipset_tag_t sc_ic;	/* ISA chipset info */
     81 	int	sc_iooffs;		/* offset from handle */
     82 
     83 	char	sc_playrun;		/* running in continuous mode */
     84 	char	sc_recrun;		/* running in continuous mode */
     85 
     86 	int	sc_irq;			/* interrupt */
     87 	int	sc_playdrq;		/* playback DMA */
     88 	int	sc_recdrq;		/* record/capture DMA */
     89 
     90 	u_long	sc_interrupts;		/* number of interrupts taken */
     91 	void	(*sc_intr)(void *);	/* dma completion intr handler */
     92 	void	*sc_arg;		/* arg for sc_intr() */
     93 
     94 	/* Only used by pss XXX */
     95 	int	sc_iobase;
     96 };
     97 
     98 #ifdef _KERNEL
     99 int	ad1848_isa_mapprobe __P((struct ad1848_isa_softc *, int));
    100 int	ad1848_isa_probe __P((struct ad1848_isa_softc *));
    101 void	ad1848_isa_unmap __P((struct ad1848_isa_softc *));
    102 void	ad1848_isa_attach __P((struct ad1848_isa_softc *));
    103 
    104 int	ad1848_isa_open __P((void *, int));
    105 void	ad1848_isa_close __P((void *));
    106 
    107 int	ad1848_isa_trigger_output __P((void *, void *, void *, int,
    108 	    void (*)(void *), void *, struct audio_params *));
    109 int	ad1848_isa_trigger_input __P((void *, void *, void *, int,
    110 	    void (*)(void *), void *, struct audio_params *));
    111 int	ad1848_isa_halt_output __P((void *));
    112 int	ad1848_isa_halt_input __P((void *));
    113 
    114 int	ad1848_isa_intr __P((void *));
    115 
    116 void   *ad1848_isa_malloc __P((void *, int, size_t, int, int));
    117 void	ad1848_isa_free __P((void *, void *, int));
    118 size_t	ad1848_isa_round_buffersize __P((void *, int, size_t));
    119 int	ad1848_isa_mappage __P((void *, void *, int, int));
    120 int	ad1848_isa_get_props __P((void *));
    121 #endif
    122