大家好,我现在在海思3536c上使用TLV320AIC3100这个芯片,遇到以下几个问题:
1.sdk里面的驱动,是TLV320AIC31,这个驱动是否适用于300.这个驱动应该是海思自己编写的,没有使用alsa框架
2.ti官网提供的是基于alsa,设备树的驱动,而我的系统 采用gpio模拟i2c。所以是否有相应的,适合我使用的驱动。
海思sdk中驱动类似如下:
void soft_reset(unsigned int chip_num)
{
/*soft reset*/
tlv320aic31_write(IIC_device_addr[chip_num], 0x1, 0x80);
msleep(10);
/*CLKDIV_IN uses MCLK*/
tlv320aic31_write(IIC_device_addr[chip_num], 102, 0x32);
#if 1
/*PLL disable and select Q value*/
tlv320aic31_write(IIC_device_addr[chip_num], 3, 0x10);
#else
/*PLL enable */
tlv320aic31_write(IIC_device_addr[chip_num], 3, 0x82);/* P=2 */
tlv320aic31_write(IIC_device_addr[chip_num], 4, 0x1c);/* J=28 */
tlv320aic31_write(IIC_device_addr[chip_num], 5, 0x2c);
tlv320aic31_write(IIC_device_addr[chip_num], 6, 0x8);/* reg 5 and 6 set D=2818*/
tlv320aic31_write(IIC_device_addr[chip_num], 11, 0x1);/* R=1 */
#endif
/*left and right DAC open*/
tlv320aic31_write(IIC_device_addr[chip_num], 7, 0xa);/* FSref = 48 kHz */
/*sample*/
tlv320aic31_write(IIC_device_addr[chip_num], 2, 0xaa);/* FS = FSref/6 */
/*ctrl mode*/
tlv320aic31_write(IIC_device_addr[chip_num], 8, 0xf0);/* master mode */
/*Audio Serial Data Interface Control*/
tlv320aic31_write(IIC_device_addr[chip_num], 9, 0x7);/* I2S mode,16bit */
/*Audio Codec Digital Filter Control Register*/
tlv320aic31_write(IIC_device_addr[chip_num], 12, 0x50);
//tlv320aic31_write(IIC_device_addr[chip_num], 25, 0x0);
tlv320aic31_write(IIC_device_addr[chip_num], 25, 0x40);
tlv320aic31_write(IIC_device_addr[chip_num], 17, 0xf);
tlv320aic31_write(IIC_device_addr[chip_num], 18, 0xf0);
tlv320aic31_write(IIC_device_addr[chip_num], 15, 0x0);
tlv320aic31_write(IIC_device_addr[chip_num], 16, 0x0);
//tlv320aic31_write(IIC_device_addr[chip_num], 19, 0x7c);
//tlv320aic31_write(IIC_device_addr[chip_num], 22, 0x7c);
tlv320aic31_write(IIC_device_addr[chip_num], 19, 0x04);
tlv320aic31_write(IIC_device_addr[chip_num], 22, 0x04);
tlv320aic31_write(IIC_device_addr[chip_num], 28, 0x0);
tlv320aic31_write(IIC_device_addr[chip_num], 31, 0x0);
/*out ac-coupled*/
tlv320aic31_write(IIC_device_addr[chip_num], 14, 0x80);
/*left and right DAC power on*/
tlv320aic31_write(IIC_device_addr[chip_num], 37, 0xc0);
/*out common-mode voltage, DTS2014123002762*/
//tlv320aic31_write(IIC_device_addr[chip_num], 40, 0x80);
/*out path select*/
tlv320aic31_write(IIC_device_addr[chip_num], 41, 0x1);
/*out path select DTS2014123002762 change delay time from 2s to 200ms*/
tlv320aic31_write(IIC_device_addr[chip_num], 42, 0x78);
/*left DAC not muted*/
tlv320aic31_write(IIC_device_addr[chip_num], 43, 0x0);
/*right DAC not muted*/
tlv320aic31_write(IIC_device_addr[chip_num], 44, 0x0);
tlv320aic31_write(IIC_device_addr[chip_num], 47, 0x80);
/*HPLOUT is not muted*/
//tlv320aic31_write(IIC_device_addr[chip_num], 51, 0x04);
tlv320aic31_write(IIC_device_addr[chip_num], 64, 0x80);
/*HPROUT is not muted*/
//tlv320aic31_write(IIC_device_addr[chip_num], 65, 0x9f);
/*out short circuit protection*/
tlv320aic31_write(IIC_device_addr[chip_num], 38, 0x3e);
}
Mickey Zhang:
这里有一个linux驱动,您可以参考下:www.ti.com/…/tlv320aic31xxsw-linux
liu liu45:
回复 Mickey Zhang:
谢谢。我最早也看到这个。3100和3101是不一样的吧。我对比驱动,发现差别好大。另外我这边场景比较特殊,没有走alsa,还是软件模拟,照这种情况,应该是要自己参考驱动来写写吧。