修改自网上广泛流传的一个CS42L52驱动。
// CS42L52 Codec Initialization Value
unsigned int CS42L52_Codec_Init_Table[][2] =
{
{ 0x01, 0x00 },// ---------------(read only!)-------------
{ 0x02, 0x1e },// adc power up 1 00 0011 0 pnd=1 //mic 0 00 0000 0
{ 0x03, 0x1f },// 000 0 0 11(mic amp up) 1 //mic 000 11 00 0
{ 0x04, 0x50 },// 10(hp on is h) 10 10(sp) 10 //mic 11 11 11 11
{ 0x05, 0xa0 },// 1(en Auto-Detect) 01 0 0 01(Internal MCLK/LRCK Ratio) 0
{ 0x06, 0x00 },// 0(slave=0 ) 0(single polrity) 0(1-iis) 1(dis dsp) 00(L_J) 11
{ 0x07, 0x00 },// 0 0 0 0 0 011
{ 0x08, 0x90 },// 100 10000 *******
{ 0x09, 0x90 },// *******
{ 0x0a, 0xa5 },// 1 0 1 0 0101
{ 0x0b, 0x00 },// 0000 0111
{ 0x0c, 0x00 },// 1 0 01 0 0 0 0
{ 0x0d, 0x60 },// 111 1 00 00
{ 0x0e, 0x00 },// 00 11 0(Register changes take effect immediately)1 0 0
{ 0x0f, 0x00 },// 11(hp unmuted) 11(sp unm) 1 0 1 1
{ 0x10, 0x2f },// 0 0(mic1) 1(differential ) 11111 *********
{ 0x11, 0x2f },// *********
{ 0x12, 0x00 },// 1 1 011111 (ALC) //00
{ 0x13, 0x00 },//
{ 0x14, 0x18 },// 0111 1111 (Passthru x Volume:) //18
{ 0x15, 0x18 },//
{ 0x16, 0xf6 },// 0111 1111(ADCx Volume)
{ 0x17, 0xfe },//
{ 0x18, 0x18 },// 1 001 1000
{ 0x19, 0x18 },//
{ 0x1a, 0x18 },// 1 001 1000(PCMx Mixer Volume: PCMA) //18
{ 0x1b, 0x18 },//
{ 0x1c, 0x00 },// 0010 0010 (Beep Frequency & On Time)
{ 0x1d, 0x00 },// 000 00101 (Beep Volume & Off Time)
{ 0x1e, 0x41 },// 01 0 01 01 1
{ 0x1f, 0x21 },// 0000 0000(Tone Control)
{ 0x20, 0x18 },// 0001 1000(Master Volume Control:)
{ 0x21, 0x18 },//
{ 0x22, 0x00 },// 0000 0000(Headphone Volume Control:)
{ 0x23, 0x00 },//
{ 0x24, 0x00 },// 0000 0000(Speaker Volume Control:)
{ 0x25, 0x00 },//
{ 0x26, 0x00 },// 01 01 01 01 (ADC & PCM Channel Mixer)
{ 0x27, 0x00 },// 010 010 1 1
{ 0x28, 0x7f },// 01 111111
{ 0x29, 0xc0 },// 11 000000
{ 0x2a, 0xc0 },// 11(alc enable)000000
{ 0x2b, 0x3f },//
{ 0x2c, 0x28 },//
{ 0x2d, 0x0c },// 1 1 0 100 00
{ 0x2e, 0x00 },// ---------------(read only)--------------
{ 0x2f, 0x00 },// 1 1 00 1000(Battery Compensation)
{ 0x30, 0x00 },// ---------------(read only)--------------
{ 0x31, 0x08 },// ---------------(read only)--------------
{ 0x32, 0x3b },// 0 0111011
{ 0x33, 0x00 },// 0000 1 001
{ 0x34, 0x5f },// 0101 1111
};