Tool/software:
Dear TI
We are using TLV320AIC3204 like below which shows the MFP1 , MFP2 , MFP3 , MFP4 and MFP5 configuration
Based on this and Application note TLV320AIC3204 Application Reference Guide we set the register with following value
we have 2 problem :-
1. When we run arecord -D hw:0,0 -r 96000 -c 2 -f s32_le /userdata/audio_test.wav we dont see any output in the Sout codec in oscilloscope
2. When we run the aplay -D plughw:0,0 file_example_WAV_1MG_test.wav we see output in oscilloscope but our speaker does not give any sound
3. With the below configuration we are getting below error as well
root@rk3576-buildroot:/userdata# alsamixer
cannot load mixer controls: Operation not permitted
root@rk3576-buildroot:/userdata#
&i2c3 {
+ pinctrl-0 = <&i2c3m0_xfer>;
+ status = "okay";
+ clock-frequency = <400000>;
+ status = "okay";
+ #sound-dai-cells = <0>;
+ compatible = "ti,tlv320aic32x4";
+ reg = <0x18>;
+ clocks = <&mclkout_sai0>;
+ clock-names = "mclk";
+ assigned-clocks = <&mclkout_sai0>;
+ assigned-clock-rates = <6140000>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&sai0m2_mclk>;
+ reset-gpios = <&gpio3 RK_PA0 GPIO_ACTIVE_HIGH>;
+ aic32x4-gpio-func= <
+ 0x02 /* MFP1 AIC32X4_MFPX_DEFAULT_VALUE */
+ 0x12 /* MFP2 AIC32X4_MFPX_DEFAULT_VALUE */
+ 0x02 /* MFP3 AIC32X4_MFP3_GPIO_ENABLED */
+ 0x0E /* AIC32X4_MFPX_DEFAULT_VALUE */
+ 0x00 /* MFP5 AIC32X4_MFP5_GPIO_INPUT */
+ >;
+ };
+};
4. If I keep below configuration Alsa mixer command works fine but still we see issue 1 and 2
aaic32x4-gpio-func= <
0xff /* AIC32X4_MFPX_DEFAULT_VALUE /
0xff / AIC32X4_MFPX_DEFAULT_VALUE /
0x04 / MFP3 AIC32X4_MFP3_GPIO_ENABLED /
0xff / AIC32X4_MFPX_DEFAULT_VALUE /
0x08 / MFP5 AIC32X4_MFP5_GPIO_INPUT */
5. I have done the register dump of all possible register please review and let me know what should be correct configuration
[ 326.612580] {0x1,0},
[ 326.613014] {0x4,3},
[ 326.613385] {0x5,11},
[ 326.613780] {0x6,4},
[ 326.614148] {0x7,0},
[ 326.614548] {0x8,0},
[ 326.614953] {0xb,1},
[ 326.615323] {0xc,1},
[ 326.615691] {0xd,0},
[ 326.616060] {0xe,80},
[ 326.616455] {0x12,1},
[ 326.616823] {0x13,1},
[ 326.617191] {0x14,80},
[ 326.617561] {0x19,0},
[ 326.617929] {0x1a,1},
[ 326.618298] {0x1b,0},
[ 326.618675] {0x1c,0},
[ 326.619044] {0x1d,1},
[ 326.619413] {0x1e,1},
[ 326.619800] {0x1f,0},
[ 326.620169] {0x20,0},
[ 326.620541] {0x21,0},
[ 326.620939] {0x22,0},
[ 326.621308] {0x24,44},
[ 326.621689] {0x25,0},
[ 326.622086] {0x26,0},
[ 326.622489] {0x2a,0},
[ 326.622876] {0x2b,0},
[ 326.623246] {0x2c,0},
[ 326.623637] {0x2d,0},
[ 326.624005] {0x2e,0},
[ 326.624273] {0x2f,0},
[ 326.624542] {0x30,0},
[ 326.624812] {0x31,0},
[ 326.625082] {0x34,0},
[ 326.625351] {0x35,12},
[ 326.625620] {0x36,3},
[ 326.625890] {0x37,e},
[ 326.626184] {0x38,2},
[ 326.626462] {0x3c,1},
[ 326.626786] {0x3d,1},
[ 326.627056] {0x3f,14},
[ 326.627325] {0x40,c},
[ 326.627631] {0x41,0},
[ 326.627902] {0x42,0},
[ 326.628170] {0x43,0},
[ 326.628462] {0x44,6f},
[ 326.628731] {0x45,38},
[ 326.629000] {0x46,0},
[ 326.629268] {0x47,0},
[ 326.629566] {0x48,0},
[ 326.629835] {0x49,0},
[ 326.630105] {0x4a,0},
[ 326.630397] {0x4b,ee},
[ 326.630680] {0x4c,10},
[ 326.630953] {0x4d,d8},
[ 326.631223] {0x4e,7e},
[ 326.631502] {0x4f,e3},
[ 326.631773] {0x51,0},
[ 326.632043] {0x52,88},
[ 326.632334] {0x53,0},
[ 326.632605] {0x54,0},
[ 326.632875] {0x55,0},
[ 326.633146] {0x56,0},
[ 326.633436] {0x57,0},
[ 326.633706] {0x58,7f},
[ 326.633976] {0x59,0},
[ 326.634266] {0x5a,0},
[ 326.634538] {0x5b,0},
[ 326.634812] {0x5c,0},
[ 326.635083] {0x5d,0},
[ 326.635371] {0x5e,0},
[ 326.635640] {0x5f,0},
[ 326.635908] {0x60,7f},
[ 326.636202] {0x61,0},
[ 326.636473] {0x62,0},
[ 326.636743] {0x63,0},
[ 326.637012] {0x64,0},
[ 326.637305] {0x65,0},
[ 326.637574] {0x66,0},
[ 326.637844] {0x67,0},
[ 326.638133] {0x68,0},
[ 326.638405] {0x69,0},
[ 326.638704] {0x6a,0},
[ 326.639079] {0x6b,0},
[ 326.639349] {0x6c,0},
[ 326.639621] {0x6d,0},
6. Also I am getting below log in Linux kernel which says that my regmap is getting failed , i commented it so that my driver can further load .. but i2cdump command works file and device can be detected in address 0x18
Please find the i2cdump attached
..
root@rk3576-buildroot:~# i2cdump -f -y 3 0x18 b
0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
00: 00 00 60 00 00 11 04 00 00 00 00 01 01 00 80 02 ..`..??....??.??
10: 00 08 01 01 80 01 00 04 00 00 01 00 00 00 01 00 .?????.?..?...?.
20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
30: 00 00 00 00 00 12 03 02 02 00 00 00 01 01 00 14 .....????...??.?
40: 0c 00 00 00 6f 38 00 00 00 00 00 ee 10 d8 7e e3 ?...o8.....???~?
50: 00 00 88 00 00 00 00 00 7f 00 00 00 00 00 00 00 ..?.....?.......
60: 7f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ?...............
70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
Problem Log from I2c in driver probe