1 1.11 chs /* $NetBSD: esovar.h,v 1.11 2012/10/27 17:18:32 chs 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.11 chs device_t sc_dev; 89 1.10 jmcneill kmutex_t sc_lock; 90 1.10 jmcneill kmutex_t sc_intr_lock; 91 1.10 jmcneill 92 1.1 kleink pci_intr_handle_t * sc_ih; 93 1.1 kleink unsigned int sc_revision; /* PCI Revision ID */ 94 1.1 kleink 95 1.1 kleink /* Optionally deferred configuration of Audio 1 DMAC I/O space */ 96 1.1 kleink struct pci_attach_args sc_pa; 97 1.1 kleink bus_size_t sc_vcsize; /* original size of mapping */ 98 1.1 kleink 99 1.1 kleink /* DMA */ 100 1.1 kleink bus_dma_tag_t sc_dmat; 101 1.8 kleink SLIST_HEAD(, eso_dma) sc_dmas; 102 1.1 kleink 103 1.1 kleink /* I/O Base device */ 104 1.1 kleink bus_space_tag_t sc_iot; 105 1.1 kleink bus_space_handle_t sc_ioh; 106 1.1 kleink 107 1.1 kleink /* Audio/FM device */ 108 1.1 kleink bus_space_tag_t sc_sb_iot; 109 1.1 kleink bus_space_handle_t sc_sb_ioh; 110 1.1 kleink 111 1.1 kleink /* Audio 1 DMAC device */ 112 1.1 kleink unsigned int sc_dmac_configured; 113 1.1 kleink bus_space_tag_t sc_dmac_iot; 114 1.1 kleink bus_space_handle_t sc_dmac_ioh; 115 1.1 kleink 116 1.1 kleink /* MPU-401 device */ 117 1.2 augustss bus_space_tag_t sc_mpu_iot; 118 1.2 augustss bus_space_handle_t sc_mpu_ioh; 119 1.9 cegger device_t sc_mpudev; 120 1.1 kleink 121 1.1 kleink /* Game device */ 122 1.1 kleink bus_space_tag_t sc_game_iot; 123 1.1 kleink bus_space_handle_t sc_game_ioh; 124 1.1 kleink 125 1.1 kleink /* MI audio interface: play/record interrupt callbacks and arguments */ 126 1.6 kent void (*sc_pintr)(void *); 127 1.1 kleink void * sc_parg; 128 1.6 kent void (*sc_rintr)(void *); 129 1.1 kleink void * sc_rarg; 130 1.10 jmcneill kcondvar_t sc_pcv; 131 1.10 jmcneill kcondvar_t sc_rcv; 132 1.4 kleink 133 1.4 kleink /* Auto-initialize DMA transfer block drain timeouts, in ticks */ 134 1.4 kleink int sc_pdrain; 135 1.4 kleink int sc_rdrain; 136 1.1 kleink 137 1.1 kleink /* Audio 2 state */ 138 1.1 kleink uint8_t sc_a2c2; /* Audio 2 Control 2 */ 139 1.6 kent 140 1.1 kleink /* Mixer state */ 141 1.1 kleink uint8_t sc_gain[ESO_NGAINDEVS][2]; 142 1.3 kleink #define ESO_LEFT 0 143 1.3 kleink #define ESO_RIGHT 1 144 1.1 kleink unsigned int sc_recsrc; /* record source selection */ 145 1.1 kleink unsigned int sc_monooutsrc; /* MONO_OUT source selection */ 146 1.5 kleink unsigned int sc_monoinbypass;/* MONO_IN bypass enable */ 147 1.1 kleink unsigned int sc_recmon; /* record monitor setting */ 148 1.1 kleink unsigned int sc_preamp; /* microphone preamp */ 149 1.1 kleink unsigned int sc_spatializer; /* spatializer enable */ 150 1.3 kleink unsigned int sc_mvmute; /* master volume mute */ 151 1.1 kleink }; 152 1.1 kleink 153 1.1 kleink #endif /* !_DEV_PCI_ESOVAR_H_ */ 154