Home | History | Annotate | Line # | Download | only in isa
ad1848var.h revision 1.33
      1 /*	$NetBSD: ad1848var.h,v 1.33 2000/06/26 04:56:20 simonb 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 
     82 	char	sc_playrun;		/* running in continuous mode */
     83 	char	sc_recrun;		/* running in continuous mode */
     84 
     85 	int	sc_irq;			/* interrupt */
     86 	int	sc_playdrq;		/* playback DMA */
     87 	bus_size_t sc_play_maxsize;	/* playback DMA size */
     88 	int	sc_recdrq;		/* record/capture DMA */
     89 	bus_size_t sc_rec_maxsize;	/* record/capture DMA size */
     90 
     91 	u_long	sc_interrupts;		/* number of interrupts taken */
     92 	void	(*sc_intr)(void *);	/* dma completion intr handler */
     93 	void	*sc_arg;		/* arg for sc_intr() */
     94 
     95 	/* Only used by pss XXX */
     96 	int	sc_iobase;
     97 
     98 #ifndef AUDIO_NO_POWER_CTL
     99 	int	(*powerctl)__P((void *, int));
    100 	void	*powerarg;
    101 #endif
    102 };
    103 
    104 #ifdef _KERNEL
    105 int	ad1848_isa_mapprobe __P((struct ad1848_isa_softc *, int));
    106 int	ad1848_isa_probe __P((struct ad1848_isa_softc *));
    107 void	ad1848_isa_unmap __P((struct ad1848_isa_softc *));
    108 void	ad1848_isa_attach __P((struct ad1848_isa_softc *));
    109 
    110 int	ad1848_isa_open __P((void *, int));
    111 void	ad1848_isa_close __P((void *));
    112 
    113 int	ad1848_isa_trigger_output __P((void *, void *, void *, int,
    114 	    void (*)(void *), void *, struct audio_params *));
    115 int	ad1848_isa_trigger_input __P((void *, void *, void *, int,
    116 	    void (*)(void *), void *, struct audio_params *));
    117 int	ad1848_isa_halt_output __P((void *));
    118 int	ad1848_isa_halt_input __P((void *));
    119 
    120 int	ad1848_isa_intr __P((void *));
    121 
    122 void   *ad1848_isa_malloc __P((void *, int, size_t, int, int));
    123 void	ad1848_isa_free __P((void *, void *, int));
    124 size_t	ad1848_isa_round_buffersize __P((void *, int, size_t));
    125 paddr_t	ad1848_isa_mappage __P((void *, void *, off_t, int));
    126 int	ad1848_isa_get_props __P((void *));
    127 #endif
    128