This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM5728: Configuring CLKOUT3 for McASP MCLK

Part Number: AM5728
Other Parts Discussed in Thread: BEAGLEBOARD-X15, TLV320AIC3104

Tool/software: Linux

Hi

In order to use CLKOUT3 as the MCLK of MCASP2, I set it as follows.

I checked mux_data.h to map xref_clk3 to clkout3 as above documented.

It was set to mode9, so I did not modify it.

And I set mcasp2_pins in the am57xx-beagle-x15-common.dtsi file.

&dra7_pmx_core {
    mcasp2_pins:mcasp2_pins {
        pinctrl-single,pins = <
            DRA7XX_CORE_IOPAD(0x36A0, (PIN_OUTPUT_PULLDOWN | MUX_MODE9)) /* xref_clk3 */

    ....

};

&mcasp2 {

#sound-dai-cells = <0>;
assigned-clocks = <&mcasp2_ahclkx_mux>;
assigned-clock-parents = <&sys_clkin2>;

pinctrl-names = "default";
pinctrl-0 = <&mcasp2_pins>;
status = "okay";

op-mode = <0>; /* MCASP_IIS_MODE */
tdm-slots = <2>;
/* 4 serializers */
serial-dir = < /* 0: INACTIVE, 1: TX, 2: RX */
2 1 0 0
0 0 0 0
0 0 0 0
0 0 0 0
>;
tx-num-evt = <32>;
rx-num-evt = <32>;

};

And I changed the codec clock source.

But I'm not sure if this is the right way.

sound1: sound@1 {

compatible = "simple-audio-card";
simple-audio-card,name = "BeagleBoard-X15";
simple-audio-card,widgets =
"Line", "Line Out",
"Line", "Line In";
simple-audio-card,routing =
"Line Out", "LLOUT",
"Line Out", "RLOUT",
"MIC2L", "Line In",
"MIC2R", "Line In";
simple-audio-card,format = "dsp_b";
simple-audio-card,bitclock-master = <&sound1_master>;
simple-audio-card,frame-master = <&sound1_master>;
simple-audio-card,bitclock-inversion;

simple-audio-card,cpu {

sound-dai = <&mcasp3>;

};

sound1_master: simple-audio-card,codec {

sound-dai = <&tlv320aic3104>;
clocks = <&clkout3_clk>;

};

};

To define clkout3_clk, I added the following to dra7xx-clocks.dtsi file.

clkout3_clk: clkout3_clk {

#clock-cells = <0>;
compatible = "ti,gate-clock";
clocks = <&clkoutmux3_clk_mux>;
ti,bit-shift = <8>;
reg = <0x06b0>;

};

If this is correct, I think I need to change the reg address corresponding to clkout2_clk, but I do not know which document to look at.

Can you give me a guide to using mcasp2's MCLK clock as CLKOUT3?

Best Regards

Dohun