00001 #ifndef _DEV_TLV320DAC_H_
00002 #define _DEV_TLV320DAC_H_
00003
00049 #define DAC_LLI_VOL 0x00
00050 #define DAC_LLI_VOL_LRS 0x0100
00051 #define DAC_LLI_VOL_LIM 0x0080
00052 #define DAC_LLI_VOL_LIV 0x001F
00056 #define DAC_LLI_VOL_LIV_LSB 0
00058
00059
00061 #define DAC_RLI_VOL 0x01
00062 #define DAC_RLI_VOL_RLS 0x0100
00063 #define DAC_RLI_VOL_RIM 0x0080
00064 #define DAC_RLI_VOL_RIV 0x001F
00068 #define DAC_RLI_VOL_RIV_LSB 0
00070
00071
00074 #define DAC_LHP_VOL 0x02
00075 #define DAC_LHP_VOL_LRS 0x0100
00076 #define DAC_LHP_VOL_LZC 0x0080
00077 #define DAC_LHP_VOL_LHV 0x007F
00081 #define DAC_LHP_VOL_LHV_LSB 0
00083
00084
00086 #define DAC_RHP_VOL 0x03
00087 #define DAC_RHP_VOL_RLS 0x0100
00088 #define DAC_RHP_VOL_LZC 0x0080
00089 #define DAC_RHP_VOL_LHV 0x007F
00093 #define DAC_RHP_VOL_LHV_LSB 0
00095
00096
00098 #define DAC_ANA_PATH 0x04
00099 #define DAC_ANA_PATH_STA 0x01C0
00100 #define DAC_ANA_PATH_STA_LSB 6
00101 #define DAC_ANA_PATH_STA_0DB 0x0100
00102 #define DAC_ANA_PATH_STA_M6DB 0x0000
00103 #define DAC_ANA_PATH_STA_M9DB 0x0040
00104 #define DAC_ANA_PATH_STA_M12DB 0x0080
00105 #define DAC_ANA_PATH_STA_M18DB 0x00C0
00106 #define DAC_ANA_PATH_STE 0x0020
00107 #define DAC_ANA_PATH_DAC 0x0010
00108 #define DAC_ANA_PATH_BYP 0x0008
00109 #define DAC_ANA_PATH_INSEL 0x0004
00110 #define DAC_ANA_PATH_MICM 0x0002
00111 #define DAC_ANA_PATH_MICB 0x0001
00113
00114
00116 #define DAC_DIG_PATH 0x05
00117 #define DAC_DIG_PATH_DACM 0x0008
00118 #define DAC_DIG_PATH_DEEMP 0x0006
00119 #define DAC_DIG_PATH_DEEMP_LSB 1
00120 #define DAC_DIG_PATH_DEEMP_NONE 0x0000
00121 #define DAC_DIG_PATH_DEEMP_32KHZ 0x0002
00122 #define DAC_DIG_PATH_DEEMP_44_1KHZ 0x0004
00123 #define DAC_DIG_PATH_DEEMP_48KHZ 0x0006
00124 #define DAC_DIG_PATH_ADCHP 0x0001
00126
00127
00129 #define DAC_PWRDN 0x06
00130 #define DAC_PWRDN_OFF 0x0080
00131 #define DAC_PWRDN_CLK 0x0040
00132 #define DAC_PWRDN_OSC 0x0020
00133 #define DAC_PWRDN_OUT 0x0010
00134 #define DAC_PWRDN_DAC 0x0008
00135 #define DAC_PWRDN_ADC 0x0004
00136 #define DAC_PWRDN_MIC 0x0002
00137 #define DAC_PWRDN_LINE 0x0001
00139
00140
00142 #define DAC_DAI_FMT 0x07
00143 #define DAC_DAI_FMT_MS 0x0040
00144 #define DAC_DAI_FMT_LRSWAP 0x0020
00145 #define DAC_DAI_FMT_LRP 0x0010
00146 #define DAC_DAI_FMT_IWL 0x000C
00147 #define DAC_DAI_FMT_IWL_LSB 2
00148 #define DAC_DAI_FMT_IWL_16 0x0000
00149 #define DAC_DAI_FMT_IWL_20 0x0004
00150 #define DAC_DAI_FMT_IWL_24 0x0008
00151 #define DAC_DAI_FMT_IWL_32 0x000C
00152 #define DAC_DAI_FMT_FOR 0x0003
00153 #define DAC_DAI_FMT_FOR_LSB 0
00154 #define DAC_DAI_FMT_FOR_RA 0x0000
00155 #define DAC_DAI_FMT_FOR_LA 0x0001
00156 #define DAC_DAI_FMT_FOR_I2S 0x0002
00157 #define DAC_DAI_FMT_FOR_DSP 0x0003
00159
00160
00162 #define DAC_SRATE 0x08
00163 #define DAC_SRATE_CLKOUT 0x0080
00164 #define DAC_SRATE_CLKIN 0x0040
00165 #define DAC_SRATE_SR 0x003C
00166 #define DAC_SRATE_SR_LSB 2
00167 #define DAC_SRATE_BOSR 0x0002
00172 #define DAC_SRATE_USB 0x0001
00174
00175
00177 #define DAC_DI_ACT 0x09
00178 #define DAC_DI_ACT_ACT 0x0001
00180
00181
00183 #define DAC_RESET 0x0F
00188
00189 #define DAC_MAX_VOLUME 6
00190 #define DAC_MIN_VOLUME -73
00191
00192 __BEGIN_DECLS
00193
00194
00195 extern int Tlv320DacInit(u_int rate);
00196 extern int Tlv320DacWrite(void *buf, int len);
00197 extern int Tlv320DacFlush(void);
00198
00199 extern u_char Tlv320DacReadReg(u_int reg);
00200 extern void Tlv320DacWriteReg(u_int reg, u_int val);
00201
00202 extern int Tlv320DacSetVolume(int left, int right);
00203 extern int Tlv320DacSetRate(u_int rate);
00204
00205 __END_DECLS
00206
00207
00208 #endif