Home | History | Annotate | Line # | Download | only in pci
esovar.h revision 1.2
      1  1.2  augustss /*	$NetBSD: esovar.h,v 1.2 1999/08/02 17:37:43 augustss 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.1    kleink #define ESO_DAC_PLAY_VOL	0
     44  1.1    kleink #define ESO_MIC_PLAY_VOL	1
     45  1.1    kleink #define ESO_LINE_PLAY_VOL	2
     46  1.1    kleink #define ESO_SYNTH_PLAY_VOL	3
     47  1.1    kleink #define ESO_MONO_PLAY_VOL	4
     48  1.1    kleink #define ESO_CD_PLAY_VOL		5	/* AuxA */
     49  1.1    kleink #define ESO_AUXB_PLAY_VOL	6
     50  1.1    kleink 
     51  1.1    kleink #define ESO_MASTER_VOL		7
     52  1.1    kleink #define ESO_PCSPEAKER_VOL	8
     53  1.1    kleink #define ESO_SPATIALIZER		9
     54  1.1    kleink 
     55  1.1    kleink #define ESO_RECORD_VOL		10
     56  1.1    kleink #define ESO_DAC_REC_VOL		11
     57  1.1    kleink #define ESO_MIC_REC_VOL		12
     58  1.1    kleink #define ESO_LINE_REC_VOL	13
     59  1.1    kleink #define ESO_SYNTH_REC_VOL	14
     60  1.1    kleink #define ESO_MONO_REC_VOL	15
     61  1.1    kleink #define ESO_CD_REC_VOL		16
     62  1.1    kleink #define ESO_AUXB_REC_VOL	17
     63  1.1    kleink /* Used to keep software state */
     64  1.1    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.1    kleink #define ESO_RECORD_SOURCE	18
     68  1.1    kleink #define ESO_MONOOUT_SOURCE	19
     69  1.1    kleink #define ESO_RECORD_MONITOR	20
     70  1.1    kleink #define ESO_MIC_PREAMP		21
     71  1.1    kleink #define ESO_SPATIALIZER_ENABLE	22
     72  1.1    kleink 
     73  1.1    kleink /* Classes of the above */
     74  1.1    kleink #define ESO_INPUT_CLASS		23
     75  1.1    kleink #define ESO_OUTPUT_CLASS	24
     76  1.1    kleink #define ESO_MICROPHONE_CLASS	25
     77  1.1    kleink #define ESO_MONITOR_CLASS	26
     78  1.1    kleink #define ESO_RECORD_CLASS	27
     79  1.1    kleink 
     80  1.1    kleink 
     81  1.1    kleink /*
     82  1.1    kleink  * Software state
     83  1.1    kleink  */
     84  1.1    kleink struct eso_softc {
     85  1.1    kleink 	struct device		sc_dev;
     86  1.1    kleink 	pci_intr_handle_t *	sc_ih;
     87  1.1    kleink 	unsigned int		sc_revision;	/* PCI Revision ID */
     88  1.1    kleink 
     89  1.1    kleink 	/* Optionally deferred configuration of Audio 1 DMAC I/O space */
     90  1.1    kleink 	struct pci_attach_args	sc_pa;
     91  1.1    kleink 	bus_size_t		sc_vcsize;	/* original size of mapping */
     92  1.1    kleink 
     93  1.1    kleink 	/* DMA */
     94  1.1    kleink 	bus_dma_tag_t		sc_dmat;
     95  1.1    kleink 	struct eso_dma *	sc_dmas;
     96  1.1    kleink 
     97  1.1    kleink 	/* I/O Base device */
     98  1.1    kleink 	bus_space_tag_t		sc_iot;
     99  1.1    kleink 	bus_space_handle_t	sc_ioh;
    100  1.1    kleink 
    101  1.1    kleink 	/* Audio/FM device */
    102  1.1    kleink 	bus_space_tag_t		sc_sb_iot;
    103  1.1    kleink 	bus_space_handle_t	sc_sb_ioh;
    104  1.1    kleink 
    105  1.1    kleink 	/* Audio 1 DMAC device */
    106  1.1    kleink 	unsigned int		sc_dmac_configured;
    107  1.1    kleink 	bus_space_tag_t		sc_dmac_iot;
    108  1.1    kleink 	bus_space_handle_t	sc_dmac_ioh;
    109  1.1    kleink 
    110  1.1    kleink 	/* MPU-401 device */
    111  1.2  augustss 	bus_space_tag_t		sc_mpu_iot;
    112  1.2  augustss 	bus_space_handle_t	sc_mpu_ioh;
    113  1.2  augustss 	struct device		*sc_mpudev;
    114  1.1    kleink 
    115  1.1    kleink 	/* Game device */
    116  1.1    kleink 	bus_space_tag_t		sc_game_iot;
    117  1.1    kleink 	bus_space_handle_t	sc_game_ioh;
    118  1.1    kleink 
    119  1.1    kleink 	/* MI audio interface: play/record interrupt callbacks and arguments */
    120  1.1    kleink 	void			(*sc_pintr) __P((void *));
    121  1.1    kleink 	void *			sc_parg;
    122  1.1    kleink 	void			(*sc_rintr) __P((void *));
    123  1.1    kleink 	void *			sc_rarg;
    124  1.1    kleink 
    125  1.1    kleink 	/* Audio 2 state */
    126  1.1    kleink 	uint8_t			sc_a2c2;	/* Audio 2 Control 2 */
    127  1.1    kleink 
    128  1.1    kleink 	/* Mixer state */
    129  1.1    kleink 	uint8_t			sc_gain[ESO_NGAINDEVS][2];
    130  1.1    kleink #define ESO_LEFT		0
    131  1.1    kleink #define ESO_RIGHT		1
    132  1.1    kleink 	unsigned int		sc_recsrc;	/* record source selection */
    133  1.1    kleink 	unsigned int		sc_monooutsrc;	/* MONO_OUT source selection */
    134  1.1    kleink 	unsigned int		sc_recmon;	/* record monitor setting */
    135  1.1    kleink 	unsigned int		sc_preamp;	/* microphone preamp */
    136  1.1    kleink 	unsigned int		sc_spatializer;	/* spatializer enable */
    137  1.1    kleink };
    138  1.1    kleink 
    139  1.1    kleink #endif /* !_DEV_PCI_ESOVAR_H_ */
    140