Home | History | Annotate | Line # | Download | only in pci
esovar.h revision 1.8
      1  1.8    kleink /*	$NetBSD: esovar.h,v 1.8 2007/01/12 00:47:51 kleink Exp $	*/
      2  1.1    kleink 
      3  1.1    kleink /*
      4  1.5    kleink  * Copyright (c) 1999, 2000, 2004 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.5    kleink #define	ESO_MONOIN_BYPASS	20
     70  1.5    kleink #define	ESO_RECORD_MONITOR	21
     71  1.5    kleink #define	ESO_MIC_PREAMP		22
     72  1.5    kleink #define	ESO_SPATIALIZER_ENABLE	23
     73  1.5    kleink #define	ESO_MASTER_MUTE		24
     74  1.1    kleink 
     75  1.1    kleink /* Classes of the above */
     76  1.5    kleink #define	ESO_INPUT_CLASS		25
     77  1.5    kleink #define	ESO_OUTPUT_CLASS	26
     78  1.5    kleink #define	ESO_MICROPHONE_CLASS	27
     79  1.5    kleink #define	ESO_MONITOR_CLASS	28
     80  1.5    kleink #define	ESO_RECORD_CLASS	29
     81  1.5    kleink #define	ESO_MONOIN_CLASS	30
     82  1.1    kleink 
     83  1.1    kleink 
     84  1.1    kleink /*
     85  1.1    kleink  * Software state
     86  1.1    kleink  */
     87  1.1    kleink struct eso_softc {
     88  1.1    kleink 	struct device		sc_dev;
     89  1.1    kleink 	pci_intr_handle_t *	sc_ih;
     90  1.1    kleink 	unsigned int		sc_revision;	/* PCI Revision ID */
     91  1.1    kleink 
     92  1.1    kleink 	/* Optionally deferred configuration of Audio 1 DMAC I/O space */
     93  1.1    kleink 	struct pci_attach_args	sc_pa;
     94  1.1    kleink 	bus_size_t		sc_vcsize;	/* original size of mapping */
     95  1.1    kleink 
     96  1.1    kleink 	/* DMA */
     97  1.1    kleink 	bus_dma_tag_t		sc_dmat;
     98  1.8    kleink 	SLIST_HEAD(, eso_dma)	sc_dmas;
     99  1.1    kleink 
    100  1.1    kleink 	/* I/O Base device */
    101  1.1    kleink 	bus_space_tag_t		sc_iot;
    102  1.1    kleink 	bus_space_handle_t	sc_ioh;
    103  1.1    kleink 
    104  1.1    kleink 	/* Audio/FM device */
    105  1.1    kleink 	bus_space_tag_t		sc_sb_iot;
    106  1.1    kleink 	bus_space_handle_t	sc_sb_ioh;
    107  1.1    kleink 
    108  1.1    kleink 	/* Audio 1 DMAC device */
    109  1.1    kleink 	unsigned int		sc_dmac_configured;
    110  1.1    kleink 	bus_space_tag_t		sc_dmac_iot;
    111  1.1    kleink 	bus_space_handle_t	sc_dmac_ioh;
    112  1.1    kleink 
    113  1.1    kleink 	/* MPU-401 device */
    114  1.2  augustss 	bus_space_tag_t		sc_mpu_iot;
    115  1.2  augustss 	bus_space_handle_t	sc_mpu_ioh;
    116  1.3    kleink 	struct device *		sc_mpudev;
    117  1.1    kleink 
    118  1.1    kleink 	/* Game device */
    119  1.1    kleink 	bus_space_tag_t		sc_game_iot;
    120  1.1    kleink 	bus_space_handle_t	sc_game_ioh;
    121  1.1    kleink 
    122  1.1    kleink 	/* MI audio interface: play/record interrupt callbacks and arguments */
    123  1.6      kent 	void			(*sc_pintr)(void *);
    124  1.1    kleink 	void *			sc_parg;
    125  1.6      kent 	void			(*sc_rintr)(void *);
    126  1.1    kleink 	void *			sc_rarg;
    127  1.4    kleink 
    128  1.4    kleink 	/* Auto-initialize DMA transfer block drain timeouts, in ticks */
    129  1.4    kleink 	int			sc_pdrain;
    130  1.4    kleink 	int			sc_rdrain;
    131  1.1    kleink 
    132  1.1    kleink 	/* Audio 2 state */
    133  1.1    kleink 	uint8_t			sc_a2c2;	/* Audio 2 Control 2 */
    134  1.6      kent 
    135  1.1    kleink 	/* Mixer state */
    136  1.1    kleink 	uint8_t			sc_gain[ESO_NGAINDEVS][2];
    137  1.3    kleink #define	ESO_LEFT		0
    138  1.3    kleink #define	ESO_RIGHT		1
    139  1.1    kleink 	unsigned int		sc_recsrc;	/* record source selection */
    140  1.1    kleink 	unsigned int		sc_monooutsrc;	/* MONO_OUT source selection */
    141  1.5    kleink 	unsigned int		sc_monoinbypass;/* MONO_IN bypass enable */
    142  1.1    kleink 	unsigned int		sc_recmon;	/* record monitor setting */
    143  1.1    kleink 	unsigned int		sc_preamp;	/* microphone preamp */
    144  1.1    kleink 	unsigned int		sc_spatializer;	/* spatializer enable */
    145  1.3    kleink 	unsigned int		sc_mvmute;	/* master volume mute */
    146  1.1    kleink };
    147  1.1    kleink 
    148  1.1    kleink #endif /* !_DEV_PCI_ESOVAR_H_ */
    149