Other Parts Discussed in Thread: PCM5122, PCM1862
Tool/software: Linux
I'm trying to output i2s audio to a tas5782 from an am4378. There isn't a Linux driver for the tas5782 but the pcm512x looks to be register compatible. Also, at this point I'm just trying to get the i2s bus to work with mcasp1 as master. So far I haven't been able to get the clocks running (LRCK or BCK).
Here are the relevant entries from the dts file:
sound {
compatible = "simple-audio-card";
simple-audio-card,name = "TAS5782";
simple-audio-card,format = "i2s";
simple-audio-card,bitclock-master = <&cpu_dia>;
simple-audio-card,frame-master = <&cpu_dia>;
cpu_dia: simple-audio-card,cpu {
sound-dai = <&mcasp1>;
//system-clock-frequency = <24000000>;
//system-clock-id = <0>;
};
codec_dia: simple-audio-card,codec {
sound-dai = <&tas5782>;
system-clock-frequency = <12288000>;
};
};
mcasp1_tas5782_pins_default: mcasp1_tas5782_pins_default {
pinctrl-single,pins = <
0x10c ( PIN_INPUT | MUX_MODE4 ) /* (B14) mii1_crs.mcasp1_aclkx */
0x110 ( PIN_INPUT | MUX_MODE4 ) /* (B13) mii1_rx_er.mcasp1_fsx */
0x108 ( PIN_OUTPUT | MUX_MODE4 ) /* (D16) mii1_col.mcasp1_axr2 */
>;
};
i2c2_tas5782_pins_default: i2c2_tas5782_pins_default {
pinctrl-single,pins = <
0x17c ( PIN_INPUT | MUX_MODE3 ) /* (L22) uart1_rtsn.I2C2_SCL */
0x178 ( PIN_INPUT | MUX_MODE3 ) /* (K22) uart1_ctsn.I2C2_SDA */
>;
};
&i2c2 {
pinctrl-names = "default";
pinctrl-0 = <&i2c2_tas5782_pins_default>;
status = "okay";
clock-frequency = <100000>;
tas5782: tas5782@48 {
compatible = "ti,pcm5122";
#sound-dai-cells = <0>;
reg = <0x48>;
status = "okay";
AVDD-supply = <&dcdc4>;
DVDD-supply = <&dcdc4>;
CPVDD-supply = <&dcdc4>;
};
};
&mcasp1 {
#sound-dai-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&mcasp1_tas5782_pins_default>;
status = "okay";
op-mode = <0>; /* TARG - I2S */
tdm-slots = <2>; /* TARG - I2S setting */
serial-dir = < /* TARG ??? 0: INACTIVE, 1: TX, 2: RX */
0 0 1 0
>;
tx-num-evt = <1>;
rx-num-evt = <1>;
};
Here is the contents of the pinmux registers for mcasp1:
Here is the contents of some of the mcasp resgisters after mcasp_start_tx and mcasp_stop_tx after a call to aplay.
When I set the mcasp1 clock pins to output the driver winds up setting bit 15 of AHCLKXCTL = 0. This doesn't make sense to me if I understand things correctly. For master mode it seems to me that the mcasp clock pins should be outputs and AHCLKXCTL bit 15 should be 1 for internal clocks. I have tried forcing this but the system hangs when I call aplay. I must have something misconfigured.
Any help would be appreciated.
PS:
When I change the pin mux entries to this:
mcasp1_tas5782_pins_default: mcasp1_tas5782_pins_default {
pinctrl-single,pins = <
0x10c ( PIN_INPUT_PULLUP | MUX_MODE4 ) /* (B14) mii1_crs.mcasp1_aclkx */
0x110 ( PIN_INPUT_PULLUP | MUX_MODE4 ) /* (B13) mii1_rx_er.mcasp1_fsx */
0x108 ( PIN_OUTPUT | MUX_MODE4 ) /* (D16) mii1_col.mcasp1_axr2 */
>;
};
I see a clock on LRCK (fsk) of 751.9kHz and activity axr2. I don't have easy access to aclkx.