1 /* 2 * Copyright 2007-2008, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Ithamar Adema, ithamar AT unet DOT nl 7 */ 8 #ifndef HDA_CODEC_H 9 #define HDA_CODEC_H 10 11 typedef enum { 12 WT_AUDIO_OUTPUT = 0, 13 WT_AUDIO_INPUT = 1, 14 WT_AUDIO_MIXER = 2, 15 WT_AUDIO_SELECTOR = 3, 16 WT_PIN_COMPLEX = 4, 17 WT_POWER = 5, 18 WT_VOLUME_KNOB = 6, 19 WT_BEEP_GENERATOR = 7, 20 WT_VENDOR_DEFINED = 15 21 } hda_widget_type; 22 23 24 typedef enum { 25 PIN_DEV_LINE_OUT = 0, 26 PIN_DEV_SPEAKER, 27 PIN_DEV_HP_OUT, 28 PIN_DEV_CD, 29 PIN_DEV_SPDIF_OUT, 30 PIN_DEV_DIGITAL_OTHER_OUT, 31 PIN_DEV_MODEM_LINE_SIDE, 32 PIN_DEV_MODEM_HAND_SIDE, 33 PIN_DEV_LINE_IN, 34 PIN_DEV_AUX, 35 PIN_DEV_MIC_IN, 36 PIN_DEV_TELEPHONY, 37 PIN_DEV_SPDIF_IN, 38 PIN_DEV_DIGITAL_OTHER_IN, 39 PIN_DEV_RESERVED, 40 PIN_DEV_OTHER 41 } pin_dev_type; 42 43 44 /* Verb Helper Macro */ 45 #define MAKE_VERB(cad,nid,vid,payl) (((cad)<<28)|((nid)<<20)|(vid)|(payl)) 46 47 /* Verb IDs */ 48 #define VID_GET_PARAM 0xF0000 49 #define VID_GET_CONNSEL 0xF0100 50 #define VID_SET_CONNSEL 0x70100 51 #define VID_GET_CONNLENTRY 0xF0200 52 #define VID_GET_PROCSTATE 0xF0300 53 #define VID_SET_PROCSTATE 0x70300 54 #define VID_GET_COEFFIDX 0xD0000 55 #define VID_SET_COEFFIDX 0x50000 56 #define VID_GET_PROCCOEFF 0xC0000 57 #define VID_SET_PROCCOEFF 0x40000 58 #define VID_GET_AMPGAINMUTE 0xB0000 59 #define VID_SET_AMPGAINMUTE 0x30000 60 #define VID_GET_CONVFORMAT 0xA0000 61 #define VID_SET_CONVFORMAT 0x20000 62 #define VID_GET_DIGCVTCTRL 0xF0D00 63 #define VID_SET_DIGCVTCTRL1 0x70D00 64 #define VID_SET_DIGCVTCTRL2 0x70E00 65 #define VID_GET_POWERSTATE 0xF0500 66 #define VID_SET_POWERSTATE 0x70500 67 #define VID_GET_CVTSTRCHN 0xF0600 68 #define VID_SET_CVTSTRCHN 0x70600 69 #define VID_GET_SDISELECT 0xF0400 70 #define VID_SET_SDISELECT 0x70400 71 #define VID_GET_PINWCTRL 0xF0700 72 #define VID_SET_PINWCTRL 0x70700 73 #define VID_GET_UNSOLRESP 0xF0800 74 #define VID_SET_UNSOLRESP 0x70800 75 #define VID_GET_PINSENSE 0xF0900 76 #define VID_SET_PINSENSE 0x70900 77 #define VID_GET_EAPDBTL_EN 0xF0C00 78 #define VID_SET_EAPDBTL_EN 0x70C00 79 #define VID_GET_GPIDATA 0xF1000 80 #define VID_SET_GPIDATA 0x71000 81 #define VID_GET_GPIWAKE_EN 0xF1100 82 #define VID_SET_GPIWAKE_EN 0x71100 83 #define VID_GET_GPIUNSOL 0xF1200 84 #define VID_SET_GPIUNSOL 0x71200 85 #define VID_GET_GPISTICKY 0xF1300 86 #define VID_SET_GPISTICKY 0x71300 87 #define VID_GET_GPODATA 0xF1400 88 #define VID_SET_GPODATA 0x71400 89 #define VID_GET_GPIODATA 0xF1500 90 #define VID_SET_GPIODATA 0x71500 91 #define VID_GET_GPIO_EN 0xF1600 92 #define VID_SET_GPIO_EN 0x71600 93 #define VID_GET_GPIO_DIR 0xF1700 94 #define VID_SET_GPIO_DIR 0x71700 95 #define VID_GET_GPIOWAKE_EN 0xF1800 96 #define VID_SET_GPIOWAKE_EN 0x71800 97 #define VID_GET_GPIOUNSOL_EN 0xF1900 98 #define VID_SET_GPIOUNSOL_EN 0x71900 99 #define VID_GET_GPIOSTICKY 0xF1A00 100 #define VID_SET_GPIOSTICKY 0x71A00 101 #define VID_GET_BEEPGEN 0xF0A00 102 #define VID_SET_BEEPGEN 0x70A00 103 #define VID_GET_VOLUMEKNOB 0xF0F00 104 #define VID_SET_VOLUMEKNOB 0x70F00 105 #define VID_GET_SUBSYSTEMID 0xF2000 106 #define VID_SET_SUBSYSTEMID1 0x72000 107 #define VID_SET_SUBSYSTEMID2 0x72100 108 #define VID_SET_SUBSYSTEMID3 0x72200 109 #define VID_SET_SUBSYSTEMID4 0x72300 110 #define VID_GET_CFGDEFAULT 0xF1C00 111 #define VID_SET_CFGDEFAULT1 0x71C00 112 #define VID_SET_CFGDEFAULT2 0x71D00 113 #define VID_SET_CFGDEFAULT3 0x71E00 114 #define VID_SET_CFGDEFAULT4 0x71F00 115 #define VID_GET_STRIPECTRL 0xF2400 116 #define VID_SET_STRIPECTRL 0x72000 117 #define VID_FUNCTION_RESET 0x7FF00 118 119 /* Parameter IDs */ 120 #define PID_VENDORID 0x00 121 #define PID_REVISIONID 0x02 122 #define PID_SUBORD_NODE_COUNT 0x04 123 #define PID_FUNCGRP_TYPE 0x05 124 #define PID_AUDIO_FG_CAP 0x08 125 #define PID_AUDIO_WIDGET_CAP 0x09 126 #define PID_PCM_SUPPORT 0x0A 127 #define PID_STREAM_SUPPORT 0x0B 128 #define PID_PIN_CAP 0x0C 129 #define PID_INPUT_AMP_CAP 0x0D 130 #define PID_CONNLIST_LEN 0x0E 131 #define PID_POWERSTATE_SUPPORT 0x0F 132 #define PID_PROCESSING_CAP 0x10 133 #define PID_GPIO_COUNT 0x11 134 #define PID_OUTPUT_AMP_CAP 0x12 135 #define PID_VOLUMEKNOB_CAP 0x13 136 137 /* PCM support */ 138 #define PCM_8_BIT (1L << 16) 139 #define PCM_16_BIT (1L << 17) 140 #define PCM_20_BIT (1L << 18) 141 #define PCM_24_BIT (1L << 19) 142 #define PCM_32_BIT (1L << 20) 143 144 /* stream support */ 145 #define STREAM_AC3 0x00000004 146 #define STREAM_FLOAT 0x00000002 147 #define STREAM_PCM 0x00000001 148 149 #endif /* HDA_CODEC_H */ 150