xref: /netbsd/sys/dev/isa/ad1848var.h (revision bf9ec67e)
1 /*	$NetBSD: ad1848var.h,v 1.35 2000/12/18 21:31:32 thorpej 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_pintr)(void *);	/* play dma completion intr handler */
93 	void	*sc_parg;		/* arg for sc_pintr() */
94 	void	(*sc_rintr)(void *);	/* rec. dma completion intr handler */
95 	void	*sc_rarg;		/* arg for sc_rintr() */
96 
97 	/* Only used by pss XXX */
98 	int	sc_iobase;
99 
100 #ifndef AUDIO_NO_POWER_CTL
101 	int	(*powerctl)(void *, int);
102 	void	*powerarg;
103 #endif
104 };
105 
106 #ifdef _KERNEL
107 int	ad1848_isa_mapprobe (struct ad1848_isa_softc *, int);
108 int	ad1848_isa_probe (struct ad1848_isa_softc *);
109 void	ad1848_isa_unmap (struct ad1848_isa_softc *);
110 void	ad1848_isa_attach (struct ad1848_isa_softc *);
111 
112 int	ad1848_isa_open (void *, int);
113 void	ad1848_isa_close (void *);
114 
115 int	ad1848_isa_trigger_output (void *, void *, void *, int,
116 	    void (*)(void *), void *, struct audio_params *);
117 int	ad1848_isa_trigger_input (void *, void *, void *, int,
118 	    void (*)(void *), void *, struct audio_params *);
119 int	ad1848_isa_halt_output (void *);
120 int	ad1848_isa_halt_input (void *);
121 
122 int	ad1848_isa_intr (void *);
123 
124 void   *ad1848_isa_malloc (void *, int, size_t, int, int);
125 void	ad1848_isa_free (void *, void *, int);
126 size_t	ad1848_isa_round_buffersize (void *, int, size_t);
127 paddr_t	ad1848_isa_mappage (void *, void *, off_t, int);
128 int	ad1848_isa_get_props (void *);
129 #endif
130