Device Tree Overlay for McASP0 Configuration

Hi Benedict. Thank you for your reply.

Most of the sound card examples I reviewed use an external codec, such as the one you refer (tda9988) that apparently is used for the HDMI unit. I’ve found the pcm5102a dummy codec configuration in this TI Application Report. Is that the only way to enable a sound card to use the McASP unit? So far, I’ve been using the Device Tree Compiler (dtc) in the command window. In the /boot/uEnv.txt file, I added the address of the .dtbo file, which rests in the /lib/firmware folder.

Here is a third fragment where I declare the clock that I’ll be using as AUXCLK/AHCKLR. However, it’s still not clear for me if I can select 24.576MHz, or should I take an existing clock like the sys_clk that runs at 24MHz. Following the McASP reference manual, I expect to declare the division within this node to define the bit clock (ACLKR) and frame sync (FSR). Does that make sense?

fragment@3 {
	target-path = "/";
	__overlay__ {
		clocks {
			mcasp0_ahclkr: mcasp0_ahclkr {
				compatible = "fixed-clock";
				clock-frequency = <24576000>;
				#clock-cells = <0>;
			};
			clk_mcasp1: clk_mcasp1 {
				#clock-cells = <0>;
				compatible = "gpio-gate-clock";
				clocks = <&mcasp0_ahclkr>;
				enable-gpios = <&gpio1 27 0>; /* BeagleBone Black Clk enable on GPIO1_27 */
			};
		};
		pcm5102a: pcm5102a {
			#sound-dai-cells = <0>;
			compatible = "ti,pcm5102a";
			status = "okay";
		};
		sound {
			compatible = "simple-audio-card";
			simple-audio-card,name = "TDM_16mics";
			simple-audio-card,format = "i2s";
			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 = <&mcasp0>;
				#sound-dai-cells = <0>;
				system-clock-direction = "out";
				system-clock-frequency = <24576000>;
				clocks = <&clk_mcasp1>;
			};
			simple-audio-card,codec {
				sound-dai = <&pcm5102a>;
				#sound-dai-cells = <0>;
			};
		};
        };
};

Drawbacks

  • Sound cards are not detected.
  • I’m still getting a warning that says “IRQ common not found”, and this is why I declare tx and rx interrupts from the <&intc> node.
  • Pin assignation seems to be alright, but the assigned clock pin does not show any signal.