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