1 1.4 jmcneill /* $NetBSD: hdaudioreg.h,v 1.4 2022/03/21 09:12:10 jmcneill Exp $ */ 2 1.1 jmcneill 3 1.1 jmcneill /* 4 1.1 jmcneill * Copyright (c) 2009 Precedence Technologies Ltd <support (at) precedence.co.uk> 5 1.1 jmcneill * Copyright (c) 2009 Jared D. McNeill <jmcneill (at) invisible.ca> 6 1.1 jmcneill * All rights reserved. 7 1.1 jmcneill * 8 1.1 jmcneill * This code is derived from software contributed to The NetBSD Foundation 9 1.1 jmcneill * by Precedence Technologies Ltd 10 1.1 jmcneill * 11 1.1 jmcneill * Redistribution and use in source and binary forms, with or without 12 1.1 jmcneill * modification, are permitted provided that the following conditions 13 1.1 jmcneill * are met: 14 1.1 jmcneill * 1. Redistributions of source code must retain the above copyright 15 1.1 jmcneill * notice, this list of conditions and the following disclaimer. 16 1.1 jmcneill * 2. The name of the author may not be used to endorse or promote products 17 1.1 jmcneill * derived from this software without specific prior written permission. 18 1.1 jmcneill * 19 1.1 jmcneill * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 1.1 jmcneill * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 1.1 jmcneill * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 1.1 jmcneill * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 1.1 jmcneill * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 24 1.1 jmcneill * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 1.1 jmcneill * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 26 1.1 jmcneill * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 1.1 jmcneill * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 1.1 jmcneill * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 1.1 jmcneill * SUCH DAMAGE. 30 1.1 jmcneill */ 31 1.1 jmcneill 32 1.1 jmcneill #ifndef _HDAUDIOREG_H 33 1.1 jmcneill #define _HDAUDIOREG_H 34 1.1 jmcneill 35 1.2 riastrad #include <sys/cdefs.h> 36 1.2 riastrad #include <sys/types.h> 37 1.2 riastrad 38 1.1 jmcneill /* 39 1.1 jmcneill * High Definition Audio Memory Mapped Configuration Registers 40 1.1 jmcneill */ 41 1.1 jmcneill #define HDAUDIO_MMIO_GCAP 0x000 42 1.1 jmcneill #define HDAUDIO_GCAP_64OK(x) ((x) & 1) 43 1.1 jmcneill #define HDAUDIO_GCAP_NSDO(x) ((((x) & 6) != 0) ? ((x) & 6) : 1) 44 1.1 jmcneill #define HDAUDIO_GCAP_BSS(x) (((x) >> 3) & 0x1f) 45 1.1 jmcneill #define HDAUDIO_GCAP_ISS(x) (((x) >> 8) & 0x0f) 46 1.1 jmcneill #define HDAUDIO_GCAP_OSS(x) (((x) >> 12) & 0x0f) 47 1.1 jmcneill #define HDAUDIO_MMIO_VMIN 0x002 48 1.1 jmcneill #define HDAUDIO_MMIO_VMAJ 0x003 49 1.1 jmcneill #define HDAUDIO_MMIO_OUTPAY 0x004 50 1.1 jmcneill #define HDAUDIO_MMIO_INPAY 0x006 51 1.1 jmcneill #define HDAUDIO_MMIO_GCTL 0x008 52 1.1 jmcneill #define HDAUDIO_GCTL_UNSOL_EN (1 << 8) 53 1.1 jmcneill #define HDAUDIO_GCTL_FLUSH_CTL (1 << 1) 54 1.1 jmcneill #define HDAUDIO_GCTL_CRST (1 << 0) 55 1.1 jmcneill #define HDAUDIO_MMIO_WAKEEN 0x00c 56 1.1 jmcneill #define HDAUDIO_MMIO_STATESTS 0x00e 57 1.1 jmcneill #define HDAUDIO_STATESTS_SDIWAKE 0x7fff 58 1.1 jmcneill #define HDAUDIO_MMIO_GSTS 0x010 59 1.1 jmcneill #define HDAUDIO_MMIO_INTCTL 0x020 60 1.3 mrg #define HDAUDIO_INTCTL_GIE (1u << 31) 61 1.1 jmcneill #define HDAUDIO_INTCTL_CIE (1 << 30) 62 1.1 jmcneill #define HDAUDIO_MMIO_INTSTS 0x024 63 1.3 mrg #define HDAUDIO_INTSTS_GIS (1u << 31) 64 1.1 jmcneill #define HDAUDIO_INTSTS_CIS (1 << 30) 65 1.1 jmcneill #define HDAUDIO_INTSTS_SIS_MASK 0x3fffffff 66 1.1 jmcneill #define HDAUDIO_MMIO_WALCLK 0x030 67 1.1 jmcneill #define HDAUDIO_MMIO_SYNC 0x034 68 1.1 jmcneill #define HDAUDIO_MMIO_CORBLBASE 0x040 69 1.1 jmcneill #define HDAUDIO_MMIO_CORBUBASE 0x044 70 1.1 jmcneill #define HDAUDIO_MMIO_CORBWP 0x048 71 1.1 jmcneill #define HDAUDIO_MMIO_CORBRP 0x04a 72 1.1 jmcneill #define HDAUDIO_CORBRP_RP_RESET (1 << 15) 73 1.1 jmcneill #define HDAUDIO_MMIO_CORBCTL 0x04c 74 1.1 jmcneill #define HDAUDIO_CORBCTL_RUN (1 << 1) 75 1.1 jmcneill #define HDAUDIO_CORBCTL_CMEI_EN (1 << 0) 76 1.1 jmcneill #define HDAUDIO_MMIO_CORBST 0x04d 77 1.1 jmcneill #define HDAUDIO_MMIO_CORBSIZE 0x04e 78 1.1 jmcneill #define HDAUDIO_MMIO_RIRBLBASE 0x050 79 1.1 jmcneill #define HDAUDIO_MMIO_RIRBUBASE 0x054 80 1.1 jmcneill #define HDAUDIO_MMIO_RIRBWP 0x058 81 1.1 jmcneill #define HDAUDIO_RIRBWP_WP_RESET (1 << 15) 82 1.1 jmcneill #define HDAUDIO_MMIO_RINTCNT 0x05a 83 1.1 jmcneill #define HDAUDIO_MMIO_RIRBCTL 0x05c 84 1.1 jmcneill #define HDAUDIO_RIRBCTL_ROI_EN (1 << 2) 85 1.1 jmcneill #define HDAUDIO_RIRBCTL_RUN (1 << 1) 86 1.1 jmcneill #define HDAUDIO_RIRBCTL_INT_EN (1 << 0) 87 1.1 jmcneill #define HDAUDIO_MMIO_RIRBSTS 0x05d 88 1.1 jmcneill #define HDAUDIO_RIRBSTS_RIRBOIS (1 << 2) 89 1.1 jmcneill #define HDAUDIO_RIRBSTS_RINTFL (1 << 0) 90 1.1 jmcneill #define HDAUDIO_MMIO_RIRBSIZE 0x05e 91 1.1 jmcneill #define HDAUDIO_MMIO_IC 0x060 92 1.1 jmcneill #define HDAUDIO_MMIO_IR 0x064 93 1.1 jmcneill #define HDAUDIO_MMIO_IRS 0x068 94 1.1 jmcneill #define HDAUDIO_MMIO_DPLBASE 0x070 95 1.1 jmcneill #define HDAUDIO_MMIO_DPUBASE 0x074 96 1.1 jmcneill 97 1.1 jmcneill #define HDAUDIO_MMIO_SD_SIZE 0x20 98 1.1 jmcneill #define HDAUDIO_MMIO_SD_BASE 0x080 99 1.1 jmcneill 100 1.1 jmcneill #define HDAUDIO_SD_REG(off, x) \ 101 1.1 jmcneill (HDAUDIO_MMIO_SD_BASE + ((x) * HDAUDIO_MMIO_SD_SIZE) + (off)) 102 1.1 jmcneill #define HDAUDIO_SD_CTL0(x) HDAUDIO_SD_REG(0x00, x) 103 1.1 jmcneill #define HDAUDIO_CTL_SRST (1 << 0) 104 1.1 jmcneill #define HDAUDIO_CTL_RUN (1 << 1) 105 1.1 jmcneill #define HDAUDIO_CTL_IOCE (1 << 2) 106 1.1 jmcneill #define HDAUDIO_CTL_FEIE (1 << 3) 107 1.1 jmcneill #define HDAUDIO_CTL_DEIE (1 << 4) 108 1.1 jmcneill #define HDAUDIO_SD_CTL1(x) HDAUDIO_SD_REG(0x01, x) 109 1.1 jmcneill #define HDAUDIO_SD_CTL2(x) HDAUDIO_SD_REG(0x02, x) 110 1.1 jmcneill #define HDAUDIO_SD_STS(x) HDAUDIO_SD_REG(0x03, x) 111 1.1 jmcneill #define HDAUDIO_STS_FIFORDY (1 << 5) 112 1.1 jmcneill #define HDAUDIO_STS_DESE (1 << 4) 113 1.1 jmcneill #define HDAUDIO_STS_FIFOE (1 << 3) 114 1.1 jmcneill #define HDAUDIO_STS_BCIS (1 << 2) 115 1.1 jmcneill #define HDAUDIO_SD_LPIB(x) HDAUDIO_SD_REG(0x04, x) 116 1.1 jmcneill #define HDAUDIO_SD_CBL(x) HDAUDIO_SD_REG(0x08, x) 117 1.1 jmcneill #define HDAUDIO_SD_LVI(x) HDAUDIO_SD_REG(0x0c, x) 118 1.1 jmcneill #define HDAUDIO_SD_FIFOW(x) HDAUDIO_SD_REG(0x0e, x) 119 1.1 jmcneill #define HDAUDIO_SD_FIFOS(x) HDAUDIO_SD_REG(0x10, x) 120 1.1 jmcneill #define HDAUDIO_SD_FMT(x) HDAUDIO_SD_REG(0x12, x) 121 1.1 jmcneill #define HDAUDIO_FMT_TYPE_MASK 0x8000 122 1.1 jmcneill #define HDAUDIO_FMT_TYPE_PCM 0x0000 123 1.1 jmcneill #define HDAUDIO_FMT_TYPE_NONPCM 0x8000 124 1.1 jmcneill #define HDAUDIO_FMT_BASE_MASK 0x4000 125 1.1 jmcneill #define HDAUDIO_FMT_BASE_48 0x0000 126 1.1 jmcneill #define HDAUDIO_FMT_BASE_44 0x4000 127 1.1 jmcneill #define HDAUDIO_FMT_MULT_MASK 0x3800 128 1.1 jmcneill #define HDAUDIO_FMT_MULT(x) ((((x) - 1) << 11) & HDAUDIO_FMT_MULT_MASK) 129 1.1 jmcneill #define HDAUDIO_FMT_DIV_MASK 0x0700 130 1.1 jmcneill #define HDAUDIO_FMT_DIV(x) ((((x) - 1) << 8) & HDAUDIO_FMT_DIV_MASK) 131 1.1 jmcneill #define HDAUDIO_FMT_BITS_MASK 0x0070 132 1.1 jmcneill #define HDAUDIO_FMT_BITS_8_16 (0 << 4) 133 1.1 jmcneill #define HDAUDIO_FMT_BITS_16_16 (1 << 4) 134 1.1 jmcneill #define HDAUDIO_FMT_BITS_20_32 (2 << 4) 135 1.1 jmcneill #define HDAUDIO_FMT_BITS_24_32 (3 << 4) 136 1.1 jmcneill #define HDAUDIO_FMT_BITS_32_32 (4 << 4) 137 1.1 jmcneill #define HDAUDIO_FMT_CHAN_MASK 0x000f 138 1.1 jmcneill #define HDAUDIO_FMT_CHAN(x) (((x) - 1) & HDAUDIO_FMT_CHAN_MASK) 139 1.1 jmcneill #define HDAUDIO_SD_BDPL(x) HDAUDIO_SD_REG(0x18, x) 140 1.1 jmcneill #define HDAUDIO_SD_BDPU(x) HDAUDIO_SD_REG(0x1c, x) 141 1.1 jmcneill 142 1.1 jmcneill /* 143 1.1 jmcneill * Codec Parameters and Controls 144 1.1 jmcneill */ 145 1.1 jmcneill #define CORB_GET_PARAMETER 0xf00 146 1.1 jmcneill #define COP_VENDOR_ID 0x00 147 1.1 jmcneill #define COP_REVISION_ID 0x02 148 1.1 jmcneill #define COP_SUBORDINATE_NODE_COUNT 0x04 149 1.1 jmcneill #define COP_NODECNT_STARTNODE(x) (((x) >> 16) & 0xff) 150 1.1 jmcneill #define COP_NODECNT_NUMNODES(x) (((x) >> 0) & 0xff) 151 1.1 jmcneill #define COP_FUNCTION_GROUP_TYPE 0x05 152 1.1 jmcneill #define COP_AUDIO_FUNCTION_GROUP_CAPABILITIES 0x08 153 1.1 jmcneill #define COP_AUDIO_WIDGET_CAPABILITIES 0x09 154 1.1 jmcneill #define COP_AWCAP_CHANNEL_COUNT(x) \ 155 1.1 jmcneill (((((x) & (0x7 << 13)) >> 12) | ((x) & 0x1)) + 1) 156 1.1 jmcneill #define COP_AWCAP_INAMP_PRESENT (1 << 1) 157 1.1 jmcneill #define COP_AWCAP_OUTAMP_PRESENT (1 << 2) 158 1.1 jmcneill #define COP_AWCAP_AMP_PARAM_OVERRIDE (1 << 3) 159 1.1 jmcneill #define COP_AWCAP_FORMAT_OVERRIDE (1 << 4) 160 1.1 jmcneill #define COP_AWCAP_STRIPE (1 << 5) 161 1.1 jmcneill #define COP_AWCAP_PROC_WIDGET (1 << 6) 162 1.1 jmcneill #define COP_AWCAP_UNSOL_CAPABLE (1 << 7) 163 1.1 jmcneill #define COP_AWCAP_CONN_LIST (1 << 8) 164 1.1 jmcneill #define COP_AWCAP_DIGITAL (1 << 9) 165 1.1 jmcneill #define COP_AWCAP_POWER_CNTRL (1 << 10) 166 1.1 jmcneill #define COP_AWCAP_LR_SWAP (1 << 11) 167 1.1 jmcneill #define COP_AWCAP_CP_CAPS (1 << 12) 168 1.1 jmcneill #define COP_AWCAP_CHAN_COUNT_EXT(x) (((x) >> 13) & 0x7) 169 1.1 jmcneill #define COP_AWCAP_DELAY(x) (((x) >> 16) & 0xf) 170 1.1 jmcneill #define COP_AWCAP_TYPE(x) (((x) >> 20) & 0xf) 171 1.1 jmcneill #define COP_AWCAP_TYPE_MASK 0x00f00000 172 1.1 jmcneill #define COP_AWCAP_TYPE_SHIFT 20 173 1.1 jmcneill #define COP_AWCAP_TYPE_AUDIO_OUTPUT 0x0 174 1.1 jmcneill #define COP_AWCAP_TYPE_AUDIO_INPUT 0x1 175 1.1 jmcneill #define COP_AWCAP_TYPE_AUDIO_MIXER 0x2 176 1.1 jmcneill #define COP_AWCAP_TYPE_AUDIO_SELECTOR 0x3 177 1.1 jmcneill #define COP_AWCAP_TYPE_PIN_COMPLEX 0x4 178 1.1 jmcneill #define COP_AWCAP_TYPE_POWER_WIDGET 0x5 179 1.1 jmcneill #define COP_AWCAP_TYPE_VOLUME_KNOB 0x6 180 1.1 jmcneill #define COP_AWCAP_TYPE_BEEP_GENERATOR 0x7 181 1.1 jmcneill #define COP_AWCAP_TYPE_VENDOR_DEFINED 0xf 182 1.1 jmcneill #define COP_SUPPORTED_PCM_SIZE_RATES 0x0a 183 1.1 jmcneill #define COP_SUPPORTED_STREAM_FORMATS 0x0b 184 1.1 jmcneill #define COP_STREAM_FORMAT_PCM (1 << 0) 185 1.1 jmcneill #define COP_STREAM_FORMAT_FLOAT32 (1 << 1) 186 1.1 jmcneill #define COP_STREAM_FORMAT_AC3 (1 << 2) 187 1.1 jmcneill #define COP_PIN_CAPABILITIES 0x0c 188 1.1 jmcneill #define COP_PINCAP_IMPEDANCE_SENSE_CAPABLE (1 << 0) 189 1.1 jmcneill #define COP_PINCAP_TRIGGER_REQD (1 << 1) 190 1.1 jmcneill #define COP_PINCAP_PRESENSE_DETECT_CAPABLE (1 << 2) 191 1.1 jmcneill #define COP_PINCAP_HEADPHONE_DRIVE_CAPABLE (1 << 3) 192 1.1 jmcneill #define COP_PINCAP_OUTPUT_CAPABLE (1 << 4) 193 1.1 jmcneill #define COP_PINCAP_INPUT_CAPABLE (1 << 5) 194 1.1 jmcneill #define COP_PINCAP_BALANCED_IO_PINS (1 << 6) 195 1.1 jmcneill #define COP_PINCAP_HDMI (1 << 7) 196 1.1 jmcneill #define COP_PINCAP_VREF_CONTROL(x) (((x) >> 8) & 0xff) 197 1.1 jmcneill #define COP_VREF_HIZ (1 << 0) 198 1.1 jmcneill #define COP_VREF_50 (1 << 1) 199 1.1 jmcneill #define COP_VREF_GROUND (1 << 2) 200 1.1 jmcneill #define COP_VREF_80 (1 << 4) 201 1.1 jmcneill #define COP_VREF_100 (1 << 5) 202 1.1 jmcneill #define COP_PINCAP_EAPD_CAPABLE (1 << 16) 203 1.1 jmcneill #define COP_PINCAP_DP (1 << 24) 204 1.1 jmcneill #define COP_PINCAP_HBR (1 << 27) 205 1.1 jmcneill #define COP_AMPLIFIER_CAPABILITIES_INAMP 0x0d 206 1.1 jmcneill #define COP_AMPLIFIER_CAPABILITIES_OUTAMP 0x12 207 1.1 jmcneill #define COP_AMPCAP_OFFSET(x) (((x) >> 0) & 0x7f) 208 1.1 jmcneill #define COP_AMPCAP_NUM_STEPS(x) (((x) >> 8) & 0x7f) 209 1.1 jmcneill #define COP_AMPCAP_STEP_SIZE(x) (((x) >> 16) & 0x7f) 210 1.1 jmcneill #define COP_AMPCAP_MUTE_CAPABLE(x) (((x) >> 31) & 0x1) 211 1.1 jmcneill #define COP_CONNECTION_LIST_LENGTH 0x0e 212 1.1 jmcneill #define COP_CONNECTION_LIST_LENGTH_LEN(x) ((x) & 0x7f) 213 1.1 jmcneill #define COP_CONNECTION_LIST_LENGTH_LONG_FORM (1 << 7) 214 1.1 jmcneill #define COP_SUPPORTED_POWER_STATES 0x0f 215 1.1 jmcneill #define COP_PROCESSING_CAPABILITIES 0x10 216 1.1 jmcneill #define COP_GPIO_COUNT 0x11 217 1.1 jmcneill #define COP_GPIO_COUNT_NUM_GPIO(x) ((x) & 0xff) 218 1.1 jmcneill #define COP_VOLUME_KNOB_CAPABILITIES 0x13 219 1.1 jmcneill #define COP_HDMI_LPCM_CAD 0x20 220 1.3 mrg #define COP_LPCM_CAD_44_1_MS (1u << 31) 221 1.1 jmcneill #define COP_LPCM_CAD_44_1 (1 << 30) 222 1.1 jmcneill #define COP_LPCM_CAD_192K_24BIT (1 << 29) 223 1.1 jmcneill #define COP_LPCM_CAD_192K_20BIT (1 << 28) 224 1.1 jmcneill #define COP_LPCM_CAD_192K_MAXCHAN(x) (((x) >> 24) & 0xf) 225 1.1 jmcneill #define COP_LPCM_CAD_192K_MAXCHAN_CP(x) (((x) >> 20) & 0xf) 226 1.1 jmcneill #define COP_LPCM_CAD_96K_24BIT (1 << 19) 227 1.1 jmcneill #define COP_LPCM_CAD_96K_20BIT (1 << 18) 228 1.1 jmcneill #define COP_LPCM_CAD_96K_MAXCHAN(x) (((x) >> 14) & 0xf) 229 1.1 jmcneill #define COP_LPCM_CAD_96K_MAXCHAN_CP(x) (((x) >> 10) & 0xf) 230 1.1 jmcneill #define COP_LPCM_CAD_48K_24BIT (1 << 9) 231 1.1 jmcneill #define COP_LPCM_CAD_48K_20BIT (1 << 8) 232 1.1 jmcneill #define COP_LPCM_CAD_48K_MAXCHAN(x) (((x) >> 4) & 0xf) 233 1.1 jmcneill #define COP_LPCM_CAD_48K_MAXCHAN_CP(x) (((x) >> 0) & 0xf) 234 1.1 jmcneill #define CORB_GET_CONNECTION_SELECT_CONTROL 0xf01 235 1.1 jmcneill #define CORB_SET_CONNECTION_SELECT_CONTROL 0x701 236 1.1 jmcneill #define CORB_GET_CONNECTION_LIST_ENTRY 0xf02 237 1.1 jmcneill #define CORB_GET_PROCESSING_STATE 0xf03 238 1.1 jmcneill #define CORB_SET_PROCESSING_STATE 0x703 239 1.1 jmcneill #define CORB_GET_COEFFICIENT_INDEX 0xd00 240 1.1 jmcneill #define CORB_SET_COEFFICIENT_INDEX 0x500 241 1.1 jmcneill #define CORB_GET_PROCESSING_COEFFICIENT 0xc00 242 1.1 jmcneill #define CORB_SET_PROCESSING_COEFFICIENT 0x400 243 1.1 jmcneill #define CORB_GET_AMPLIFIER_GAIN_MUTE 0xb00 244 1.1 jmcneill #define CORB_SET_AMPLIFIER_GAIN_MUTE 0x300 245 1.1 jmcneill #define CORB_GET_CONVERTER_FORMAT 0xa00 246 1.1 jmcneill #define CORB_SET_CONVERTER_FORMAT 0x200 247 1.1 jmcneill #define CORB_GET_DIGITAL_CONVERTER_CONTROL 0xf0d 248 1.1 jmcneill #define CORB_SET_DIGITAL_CONVERTER_CONTROL_1 0x70d 249 1.1 jmcneill #define COP_DIGITAL_CONVCTRL1_DIGEN (1 << 0) 250 1.1 jmcneill #define COP_DIGITAL_CONVCTRL1_V (1 << 1) 251 1.1 jmcneill #define COP_DIGITAL_CONVCTRL1_VCFG (1 << 2) 252 1.1 jmcneill #define COP_DIGITAL_CONVCTRL1_PRE (1 << 3) 253 1.1 jmcneill #define COP_DIGITAL_CONVCTRL1_COPY (1 << 4) 254 1.1 jmcneill #define COP_DIGITAL_CONVCTRL1_NAUDIO (1 << 5) 255 1.1 jmcneill #define COP_DIGITAL_CONVCTRL1_PRO (1 << 6) 256 1.1 jmcneill #define COP_DIGITAL_CONVCTRL1_L (1 << 7) 257 1.1 jmcneill #define CORB_SET_DIGITAL_CONVERTER_CONTROL_2 0x70e 258 1.1 jmcneill #define COP_DIGITAL_CONVCTRL2_CC_MASK 0x7f 259 1.1 jmcneill #define CORB_GET_POWER_STATE 0xf05 260 1.1 jmcneill #define CORB_SET_POWER_STATE 0x705 261 1.1 jmcneill #define COP_POWER_STATE_D0 0x00 262 1.1 jmcneill #define COP_POWER_STATE_D1 0x01 263 1.1 jmcneill #define COP_POWER_STATE_D2 0x02 264 1.1 jmcneill #define COP_POWER_STATE_D3 0x03 265 1.1 jmcneill #define CORB_GET_CONVERTER_STREAM_CHANNEL 0xf06 266 1.1 jmcneill #define CORB_SET_CONVERTER_STREAM_CHANNEL 0x706 267 1.1 jmcneill #define CORB_GET_INPUT_CONVERTER_SDI_SELECT 0xf04 268 1.1 jmcneill #define CORB_SET_INPUT_CONVERTER_SDI_SELECT 0x704 269 1.1 jmcneill #define CORB_GET_PIN_WIDGET_CONTROL 0xf07 270 1.1 jmcneill #define CORB_SET_PIN_WIDGET_CONTROL 0x707 271 1.1 jmcneill #define COP_PWC_VREF_ENABLE_MASK 0x7 272 1.1 jmcneill #define COP_PWC_VREF_HIZ 0x00 273 1.1 jmcneill #define COP_PWC_VREF_50 0x01 274 1.1 jmcneill #define COP_PWC_VREF_GND 0x02 275 1.1 jmcneill #define COP_PWC_VREF_80 0x04 276 1.1 jmcneill #define COP_PWC_VREF_100 0x05 277 1.1 jmcneill #define COP_PWC_IN_ENABLE (1 << 5) 278 1.1 jmcneill #define COP_PWC_OUT_ENABLE (1 << 6) 279 1.1 jmcneill #define COP_PWC_HPHN_ENABLE (1 << 7) 280 1.1 jmcneill #define COP_PWC_EPT_MASK 0x3 281 1.1 jmcneill #define COP_PWC_EPT_NATIVE 0x0 282 1.1 jmcneill #define COP_PWC_EPT_HIGH_BIT_RATE 0x3 283 1.1 jmcneill #define CORB_GET_UNSOLICITED_RESPONSE 0xf08 284 1.1 jmcneill #define CORB_SET_UNSOLICITED_RESPONSE 0x708 285 1.1 jmcneill #define COP_SET_UNSOLICITED_RESPONSE_ENABLE (1 << 7) 286 1.1 jmcneill #define CORB_GET_PIN_SENSE 0xf09 287 1.3 mrg #define COP_GET_PIN_SENSE_PRESENSE_DETECT (1u << 31) 288 1.1 jmcneill #define COP_GET_PIN_SENSE_ELD_VALID (1 << 30) /* digital */ 289 1.1 jmcneill #define COP_GET_PIN_SENSE_IMPEDENCE_SENSE(x) ((x) & 0x7fffffff) /* analog */ 290 1.1 jmcneill #define CORB_SET_PIN_SENSE 0x709 291 1.1 jmcneill #define CORB_GET_EAPD_BTL_ENABLE 0xf0c 292 1.1 jmcneill #define CORB_SET_EAPD_BTL_ENABLE 0x70c 293 1.1 jmcneill #define COP_EAPD_ENABLE_BTL (1 << 0) 294 1.1 jmcneill #define COP_EAPD_ENABLE_EAPD (1 << 1) 295 1.1 jmcneill #define COP_EAPD_ENABLE_LR_SWAP (1 << 2) 296 1.1 jmcneill #define CORB_GET_GPI_DATA 0xf10 297 1.1 jmcneill #define CORB_SET_GPI_DATA 0x710 298 1.1 jmcneill #define CORB_GET_GPI_WAKE_ENABLE_MASK 0xf11 299 1.1 jmcneill #define CORB_SET_GPI_WAKE_ENABLE_MASK 0x711 300 1.1 jmcneill #define CORB_GET_GPI_UNSOLICITED_ENABLE_MASK 0xf12 301 1.1 jmcneill #define CORB_SET_GPI_UNSOLICITED_ENABLE_MASK 0x712 302 1.1 jmcneill #define CORB_GET_GPI_STICKY_MASK 0xf13 303 1.1 jmcneill #define CORB_SET_GPI_STICKY_MASK 0x713 304 1.1 jmcneill #define CORB_GET_GPO_DATA 0xf14 305 1.1 jmcneill #define CORB_SET_GPO_DATA 0x714 306 1.1 jmcneill #define CORB_GET_GPIO_DATA 0xf15 307 1.1 jmcneill #define CORB_SET_GPIO_DATA 0x715 308 1.1 jmcneill #define CORB_GET_GPIO_ENABLE_MASK 0xf16 309 1.1 jmcneill #define CORB_SET_GPIO_ENABLE_MASK 0x716 310 1.1 jmcneill #define CORB_GET_GPIO_DIRECTION 0xf17 311 1.1 jmcneill #define CORB_SET_GPIO_DIRECTION 0x717 312 1.1 jmcneill #define CORB_GET_GPIO_WAKE_ENABLE_MASK 0xf18 313 1.1 jmcneill #define CORB_SET_GPIO_WAKE_ENABLE_MASK 0x718 314 1.1 jmcneill #define CORB_GET_GPIO_UNSOLICITED_ENABLE_MASK 0xf19 315 1.1 jmcneill #define CORB_SET_GPIO_UNSOLICITED_ENABLE_MASK 0x719 316 1.1 jmcneill #define CORB_GET_GPIO_STICKY_MASK 0xf1a 317 1.1 jmcneill #define CORB_SET_GPIO_STICKY_MASK 0x71a 318 1.1 jmcneill #define CORB_GET_BEEP_GENERATION 0xf0a 319 1.1 jmcneill #define CORB_SET_BEEP_GENERATION 0x70a 320 1.1 jmcneill #define CORB_GET_VOLUME_KNOB 0xf0f 321 1.1 jmcneill #define CORB_SET_VOLUME_KNOB 0x70f 322 1.1 jmcneill #define CORB_GET_SUBSYSTEM_ID 0xf20 323 1.1 jmcneill #define CORB_SET_SUBSYSTEM_ID_1 0x720 324 1.1 jmcneill #define CORB_SET_SUBSYSTEM_ID_2 0x721 325 1.1 jmcneill #define CORB_SET_SUBSYSTEM_ID_3 0x722 326 1.1 jmcneill #define CORB_SET_SUBSYSTEM_ID_4 0x723 327 1.1 jmcneill #define CORB_GET_CONFIGURATION_DEFAULT 0xf1c 328 1.1 jmcneill #define COP_CFG_SEQUENCE(x) (((x) >> 0) & 0xf) 329 1.1 jmcneill #define COP_CFG_DEFAULT_ASSOCIATION(x) (((x) >> 4) & 0xf) 330 1.1 jmcneill #define COP_CFG_MISC(x) (((x) >> 8) & 0xf) 331 1.1 jmcneill #define COP_CFG_COLOR(x) (((x) >> 12) & 0xf) 332 1.1 jmcneill #define COP_CFG_CONNECTION_TYPE(x) (((x) >> 16) & 0xf) 333 1.1 jmcneill #define COP_CONN_TYPE_UNKNOWN 0x0 334 1.1 jmcneill #define COP_CONN_TYPE_18INCH 0x1 335 1.1 jmcneill #define COP_CONN_TYPE_14INCH 0x2 336 1.1 jmcneill #define COP_CONN_TYPE_ATAPI_INTERNAL 0x3 337 1.1 jmcneill #define COP_CONN_TYPE_RCA 0x4 338 1.1 jmcneill #define COP_CONN_TYPE_OPTICAL 0x5 339 1.1 jmcneill #define COP_CONN_TYPE_OTHER_DIGITAL 0x6 340 1.1 jmcneill #define COP_CONN_TYPE_OTHER_ANALOG 0x7 341 1.1 jmcneill #define COP_CONN_TYPE_DIN 0x8 342 1.1 jmcneill #define COP_CONN_TYPE_XLR 0x9 343 1.1 jmcneill #define COP_CONN_TYPE_RJ11 0xa 344 1.1 jmcneill #define COP_CONN_TYPE_COMBINATION 0xb 345 1.1 jmcneill #define COP_CONN_TYPE_OTHER 0xf 346 1.1 jmcneill #define COP_CFG_DEFAULT_DEVICE(x) (((x) >> 20) & 0xf) 347 1.1 jmcneill #define COP_DEVICE_MASK 0x00f00000 348 1.1 jmcneill #define COP_DEVICE_SHIFT 20 349 1.1 jmcneill #define COP_DEVICE_LINE_OUT 0x0 350 1.1 jmcneill #define COP_DEVICE_SPEAKER 0x1 351 1.1 jmcneill #define COP_DEVICE_HP_OUT 0x2 352 1.1 jmcneill #define COP_DEVICE_CD 0x3 353 1.1 jmcneill #define COP_DEVICE_SPDIF_OUT 0x4 354 1.1 jmcneill #define COP_DEVICE_DIGITAL_OTHER_OUT 0x5 355 1.1 jmcneill #define COP_DEVICE_MODEM_LINE_SIDE 0x6 356 1.1 jmcneill #define COP_DEVICE_MODEM_HANDSET_SIDE 0x7 357 1.1 jmcneill #define COP_DEVICE_LINE_IN 0x8 358 1.1 jmcneill #define COP_DEVICE_AUX 0x9 359 1.1 jmcneill #define COP_DEVICE_MIC_IN 0xa 360 1.1 jmcneill #define COP_DEVICE_TELEPHONY 0xb 361 1.1 jmcneill #define COP_DEVICE_SPDIF_IN 0xc 362 1.1 jmcneill #define COP_DEVICE_DIGITAL_OTHER_IN 0xd 363 1.1 jmcneill #define COP_DEVICE_OTHER 0xf 364 1.1 jmcneill #define COP_CFG_LOCATION(x) (((x) >> 24) & 0x3f) 365 1.1 jmcneill #define COP_CFG_PORT_CONNECTIVITY(x) (((x) >> 30) & 0x3) 366 1.1 jmcneill #define COP_PORT_JACK 0x0 367 1.1 jmcneill #define COP_PORT_NONE 0x1 368 1.1 jmcneill #define COP_PORT_FIXED_FUNCTION 0x2 369 1.1 jmcneill #define COP_PORT_BOTH 0x3 370 1.1 jmcneill #define CORB_SET_CONFIGURATION_DEFAULT_1 0x71c 371 1.1 jmcneill #define CORB_SET_CONFIGURATION_DEFAULT_2 0x71d 372 1.1 jmcneill #define CORB_SET_CONFIGURATION_DEFAULT_3 0x71e 373 1.1 jmcneill #define CORB_SET_CONFIGURATION_DEFAULT_4 0x71f 374 1.1 jmcneill #define CORB_GET_STRIPE_CONTROL 0xf24 375 1.1 jmcneill #define CORB_SET_STRIPE_CONTROL 0x720 376 1.1 jmcneill #define CORB_EXECUTE_RESET 0x7ff 377 1.1 jmcneill #define CORB_GET_CONVERTER_CHANNEL_COUNT 0xf2d 378 1.1 jmcneill #define CORB_SET_CONVERTER_CHANNEL_COUNT 0x72d 379 1.1 jmcneill #define CORB_GET_HDMI_DIP_SIZE 0xf2e 380 1.1 jmcneill #define COP_DIP_ELD_SIZE (1 << 3) 381 1.1 jmcneill #define COP_DIP_PI_GP(x) ((x) & 0x7) 382 1.1 jmcneill #define COP_DIP_PI_AUDIO_INFO COP_DIP_PI_GP(0) 383 1.1 jmcneill #define COP_DIP_BUFFER_SIZE(x) ((x) & 0xff) 384 1.1 jmcneill #define CORB_GET_HDMI_ELD_DATA 0xf2f 385 1.3 mrg #define COP_ELD_VALID (1u << 31) 386 1.1 jmcneill #define COP_ELD_DATA(x) (((x) >> 0) & 0xff) 387 1.1 jmcneill #define CORB_GET_HDMI_DIP_INDEX 0xf30 388 1.1 jmcneill #define CORB_SET_HDMI_DIP_INDEX 0x730 389 1.1 jmcneill #define COP_DIP_INDEX_BYTE_SHIFT 0 390 1.1 jmcneill #define COP_DIP_INDEX_BYTE_MASK 0xf 391 1.1 jmcneill #define COP_DIP_INDEX_PACKET_INDEX_SHIFT 4 392 1.1 jmcneill #define COP_DIP_INDEX_PACKET_INDEX_MASK 0xf 393 1.1 jmcneill #define CORB_GET_HDMI_DIP_DATA 0xf31 394 1.1 jmcneill #define CORB_SET_HDMI_DIP_DATA 0x731 395 1.1 jmcneill #define CORB_GET_HDMI_DIP_XMIT_CTRL 0xf32 396 1.1 jmcneill #define CORB_SET_HDMI_DIP_XMIT_CTRL 0x732 397 1.1 jmcneill #define COP_DIP_XMIT_CTRL_DISABLE (0x0 << 6) 398 1.1 jmcneill #define COP_DIP_XMIT_CTRL_ONCE (0x2 << 6) 399 1.1 jmcneill #define COP_DIP_XMIT_CTRL_BEST_EFFORT (0x3 << 6) 400 1.1 jmcneill #define CORB_GET_PROTECTION_CONTROL 0xf33 401 1.1 jmcneill #define CORB_SET_PROTECTION_CONTROL 0x733 402 1.1 jmcneill #define COP_PROTECTION_CONTROL_CES_ON (1 << 9) 403 1.1 jmcneill #define COP_PROTECTION_CONTROL_READY (1 << 8) 404 1.1 jmcneill #define COP_PROTECTION_CONTROL_URSUBTAG_SHIFT 3 405 1.1 jmcneill #define COP_PROTECTION_CONTROL_URSUBTAG_MASK 0x1f 406 1.1 jmcneill #define COP_PROTECTION_CONTROL_CPSTATE_MASK 0x3 407 1.1 jmcneill #define COP_PROTECTION_CONTROL_CPSTATE_DONTCARE (0 << 0) 408 1.1 jmcneill #define COP_PROTECTION_CONTROL_CPSTATE_OFF (2 << 0) 409 1.1 jmcneill #define COP_PROTECTION_CONTROL_CPSTATE_ON (3 << 0) 410 1.1 jmcneill #define CORB_ASP_GET_CHANNEL_MAPPING 0xf34 411 1.1 jmcneill #define CORB_ASP_SET_CHANNEL_MAPPING 0x734 412 1.1 jmcneill 413 1.1 jmcneill 414 1.1 jmcneill /* 415 1.1 jmcneill * RIRB Entry Format 416 1.1 jmcneill */ 417 1.1 jmcneill struct rirb_entry { 418 1.1 jmcneill uint32_t resp; 419 1.1 jmcneill uint32_t resp_ex; 420 1.1 jmcneill #define RIRB_CODEC_ID(entry) ((entry)->resp_ex & 0xf) 421 1.1 jmcneill #define RIRB_UNSOL(entry) ((entry)->resp_ex & 0x10) 422 1.1 jmcneill } __packed; 423 1.1 jmcneill 424 1.1 jmcneill #endif /* !_HDAUDIOREG_H */ 425