Home | History | Annotate | Line # | Download | only in pci
esovar.h revision 1.3
      1  1.3    kleink /*	$NetBSD: esovar.h,v 1.3 1999/11/02 12:11:43 kleink Exp $	*/
      2  1.1    kleink 
      3  1.1    kleink /*
      4  1.1    kleink  * Copyright (c) 1999 Klaus J. Klein
      5  1.1    kleink  * All rights reserved.
      6  1.1    kleink  *
      7  1.1    kleink  * Redistribution and use in source and binary forms, with or without
      8  1.1    kleink  * modification, are permitted provided that the following conditions
      9  1.1    kleink  * are met:
     10  1.1    kleink  * 1. Redistributions of source code must retain the above copyright
     11  1.1    kleink  *    notice, this list of conditions and the following disclaimer.
     12  1.1    kleink  * 2. Redistributions in binary form must reproduce the above copyright
     13  1.1    kleink  *    notice, this list of conditions and the following disclaimer in the
     14  1.1    kleink  *    documentation and/or other materials provided with the distribution.
     15  1.1    kleink  * 3. The name of the author may not be used to endorse or promote products
     16  1.1    kleink  *    derived from this software without specific prior written permission.
     17  1.1    kleink  *
     18  1.1    kleink  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     19  1.1    kleink  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     20  1.1    kleink  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     21  1.1    kleink  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     22  1.1    kleink  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
     23  1.1    kleink  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
     24  1.1    kleink  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
     25  1.1    kleink  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
     26  1.1    kleink  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     27  1.1    kleink  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     28  1.1    kleink  * SUCH DAMAGE.
     29  1.1    kleink  */
     30  1.1    kleink 
     31  1.1    kleink #ifndef _DEV_PCI_ESOVAR_H_
     32  1.1    kleink #define _DEV_PCI_ESOVAR_H_
     33  1.1    kleink 
     34  1.1    kleink /*
     35  1.1    kleink  * Definitions exported for the purpose of sharing with attached
     36  1.1    kleink  * device drivers.
     37  1.1    kleink  */
     38  1.1    kleink 
     39  1.1    kleink /*
     40  1.1    kleink  * Mixer identifiers
     41  1.1    kleink  */
     42  1.1    kleink /* Identifiers that have a gain value associated with them */
     43  1.3    kleink #define	ESO_DAC_PLAY_VOL	0
     44  1.3    kleink #define	ESO_MIC_PLAY_VOL	1
     45  1.3    kleink #define	ESO_LINE_PLAY_VOL	2
     46  1.3    kleink #define	ESO_SYNTH_PLAY_VOL	3
     47  1.3    kleink #define	ESO_MONO_PLAY_VOL	4
     48  1.3    kleink #define	ESO_CD_PLAY_VOL		5	/* AuxA */
     49  1.3    kleink #define	ESO_AUXB_PLAY_VOL	6
     50  1.3    kleink 
     51  1.3    kleink #define	ESO_MASTER_VOL		7
     52  1.3    kleink #define	ESO_PCSPEAKER_VOL	8
     53  1.3    kleink #define	ESO_SPATIALIZER		9
     54  1.3    kleink 
     55  1.3    kleink #define	ESO_RECORD_VOL		10
     56  1.3    kleink #define	ESO_DAC_REC_VOL		11
     57  1.3    kleink #define	ESO_MIC_REC_VOL		12
     58  1.3    kleink #define	ESO_LINE_REC_VOL	13
     59  1.3    kleink #define	ESO_SYNTH_REC_VOL	14
     60  1.3    kleink #define	ESO_MONO_REC_VOL	15
     61  1.3    kleink #define	ESO_CD_REC_VOL		16
     62  1.3    kleink #define	ESO_AUXB_REC_VOL	17
     63  1.1    kleink /* Used to keep software state */
     64  1.3    kleink #define	ESO_NGAINDEVS		(ESO_AUXB_REC_VOL + 1)
     65  1.1    kleink 
     66  1.1    kleink /* Other, non-gain related mixer identifiers */
     67  1.3    kleink #define	ESO_RECORD_SOURCE	18
     68  1.3    kleink #define	ESO_MONOOUT_SOURCE	19
     69  1.3    kleink #define	ESO_RECORD_MONITOR	20
     70  1.3    kleink #define	ESO_MIC_PREAMP		21
     71  1.3    kleink #define	ESO_SPATIALIZER_ENABLE	22
     72  1.3    kleink #define	ESO_MASTER_MUTE		23
     73  1.1    kleink 
     74  1.1    kleink /* Classes of the above */
     75  1.3    kleink #define	ESO_INPUT_CLASS		24
     76  1.3    kleink #define	ESO_OUTPUT_CLASS	25
     77  1.3    kleink #define	ESO_MICROPHONE_CLASS	26
     78  1.3    kleink #define	ESO_MONITOR_CLASS	27
     79  1.3    kleink #define	ESO_RECORD_CLASS	28
     80  1.1    kleink 
     81  1.1    kleink 
     82  1.1    kleink /*
     83  1.1    kleink  * Software state
     84  1.1    kleink  */
     85  1.1    kleink struct eso_softc {
     86  1.1    kleink 	struct device		sc_dev;
     87  1.1    kleink 	pci_intr_handle_t *	sc_ih;
     88  1.1    kleink 	unsigned int		sc_revision;	/* PCI Revision ID */
     89  1.1    kleink 
     90  1.1    kleink 	/* Optionally deferred configuration of Audio 1 DMAC I/O space */
     91  1.1    kleink 	struct pci_attach_args	sc_pa;
     92  1.1    kleink 	bus_size_t		sc_vcsize;	/* original size of mapping */
     93  1.1    kleink 
     94  1.1    kleink 	/* DMA */
     95  1.1    kleink 	bus_dma_tag_t		sc_dmat;
     96  1.1    kleink 	struct eso_dma *	sc_dmas;
     97  1.1    kleink 
     98  1.1    kleink 	/* I/O Base device */
     99  1.1    kleink 	bus_space_tag_t		sc_iot;
    100  1.1    kleink 	bus_space_handle_t	sc_ioh;
    101  1.1    kleink 
    102  1.1    kleink 	/* Audio/FM device */
    103  1.1    kleink 	bus_space_tag_t		sc_sb_iot;
    104  1.1    kleink 	bus_space_handle_t	sc_sb_ioh;
    105  1.1    kleink 
    106  1.1    kleink 	/* Audio 1 DMAC device */
    107  1.1    kleink 	unsigned int		sc_dmac_configured;
    108  1.1    kleink 	bus_space_tag_t		sc_dmac_iot;
    109  1.1    kleink 	bus_space_handle_t	sc_dmac_ioh;
    110  1.1    kleink 
    111  1.1    kleink 	/* MPU-401 device */
    112  1.2  augustss 	bus_space_tag_t		sc_mpu_iot;
    113  1.2  augustss 	bus_space_handle_t	sc_mpu_ioh;
    114  1.3    kleink 	struct device *		sc_mpudev;
    115  1.1    kleink 
    116  1.1    kleink 	/* Game device */
    117  1.1    kleink 	bus_space_tag_t		sc_game_iot;
    118  1.1    kleink 	bus_space_handle_t	sc_game_ioh;
    119  1.1    kleink 
    120  1.1    kleink 	/* MI audio interface: play/record interrupt callbacks and arguments */
    121  1.1    kleink 	void			(*sc_pintr) __P((void *));
    122  1.1    kleink 	void *			sc_parg;
    123  1.1    kleink 	void			(*sc_rintr) __P((void *));
    124  1.1    kleink 	void *			sc_rarg;
    125  1.1    kleink 
    126  1.1    kleink 	/* Audio 2 state */
    127  1.1    kleink 	uint8_t			sc_a2c2;	/* Audio 2 Control 2 */
    128  1.1    kleink 
    129  1.1    kleink 	/* Mixer state */
    130  1.1    kleink 	uint8_t			sc_gain[ESO_NGAINDEVS][2];
    131  1.3    kleink #define	ESO_LEFT		0
    132  1.3    kleink #define	ESO_RIGHT		1
    133  1.1    kleink 	unsigned int		sc_recsrc;	/* record source selection */
    134  1.1    kleink 	unsigned int		sc_monooutsrc;	/* MONO_OUT source selection */
    135  1.1    kleink 	unsigned int		sc_recmon;	/* record monitor setting */
    136  1.1    kleink 	unsigned int		sc_preamp;	/* microphone preamp */
    137  1.1    kleink 	unsigned int		sc_spatializer;	/* spatializer enable */
    138  1.3    kleink 	unsigned int		sc_mvmute;	/* master volume mute */
    139  1.1    kleink };
    140  1.1    kleink 
    141  1.1    kleink #endif /* !_DEV_PCI_ESOVAR_H_ */
    142