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.

TLV320AIC3106: AM43xx Linux reference integration for SPI

Part Number: TLV320AIC3106


Hi,

Is there any sample code available for a plain Linux integration (dts) of TLV320AIC3106 into an AM 3/4/5 based Linux system via SPI?

Sorry for the direct question, but based on https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/sound/tlv320aic3x.txt, we get some errors and - as we are not experts in Linux audio - I may be easier to start from an existing reference.

Regards and THANK YOU
Peter

  • Hello Peter, 

    Can you share the errors that you are getting? 

    Also, we have more information about drivers on our support FAQ page. 

    Best Regards, 

    Justin Beigel

  • Hi Justin,

    These are my settings based on your FAQ and driver documentation:

    	sound {
    		compatible = "simple-audio-card";
    		simple-audio-card,name = "SMaWay Audio";
    		simple-audio-card,widgets =
    			"Headphone", "Headphone Jack",
    			"Line", "Line In";
    		simple-audio-card,routing =
    			"Headphone Jack",	"HPLOUT",
    			"Headphone Jack",	"HPROUT",
    			"LINE1L",		"Line In",
    			"LINE1R",		"Line In";
    		simple-audio-card,format = "dsp_b";
    		simple-audio-card,bitclock-master = <&sound_master>;
    		simple-audio-card,frame-master = <&sound_master>;
    		simple-audio-card,bitclock-inversion;
    
    		simple-audio-card,cpu {
    			sound-dai = <&mcasp1>;
    		};
    
    		sound_master: simple-audio-card,codec {
    			sound-dai = <&tlv320aic3x>;
    			system-clock-frequency = <12000000>;
    		};
    		
    	...
    	
    	&spi4 {
    	#address-cells = <1>;
        #size-cells = <0>;
    
    	status = "okay";
    	pinctrl-names = "default";
    	pinctrl-0 = <&spi4_pins>;
    
    	tlv320aic3x: codec@0 {
    		compatible = "ti,tlv320aic3x";
    		reg = <0>; // CS number
    		#sound-dai-cells = <0>;
    		spi-max-frequency = <1000000>;
    		AVDD-supply = <&dcdc4>;
    		DRVDD-supply = <&dcdc4>;
    		DVDD-supply = <&ldo1>;
    		ai3x-ocmv = <0>;
    	};
    };
    
    &mcasp0 {
    	#sound-dai-cells = <0>;
    	pinctrl-names = "default", "sleep";
    	pinctrl-0 = <&mcasp0_pins>;
    
    	status = "okay";
    
    	op-mode = <0>;          /* MCASP_IIS_MODE */
    	tdm-slots = <2>;
    	/* 4 serializers */
    	serial-dir = <  /* 0: INACTIVE, 1: TX, 2: RX */
    		0 0 1 2
    	>;
    	tx-num-evt = <32>;
    	rx-num-evt = <32>;
    };
    

    After some changes, I actually only get this warning anymore:

    arch/arm/boot/dts/am437x-smaway.dtb: Warning (sound_dai_property): /sound/simple-audio-card,cpu: Missing property '#sound-dai-cells' in node /ocp@44000000/mcasp@4803c000 or bad phandle (referred from sound-dai[0])

    Can I ignore that or do you have further suggestions on how to optimize the dts?

    Regards
    Peter

  • Hi Peter,

    If these are warnings only you most likely can ignore for now.
    Unfortunately the support on the drivers for audio converters is going through a transition right now, so there is not much further support we can provide on things that are not related to hardware or the device itself.

    Best regards,
    -Ivan Salazar
    Applications Engineer

  • Hi Ivan,

    Unfortunately it is not only the warnings, the module is not detected by the kernel.

    This is my dts:

    	sound {
    		compatible = "simple-audio-card";
    		simple-audio-card,name = "SMaWay Audio";
    		simple-audio-card,widgets =
    			"Headphone", "Headphone Jack",
    			"Line", "Line In";
    		simple-audio-card,routing =
    			"Headphone Jack",	"HPLOUT",
    			"Headphone Jack",	"HPROUT",
    			"LINE1L",		"Line In",
    			"LINE1R",		"Line In";
    		simple-audio-card,format = "dsp_b";
    		simple-audio-card,bitclock-master = <&sound_master>;
    		simple-audio-card,frame-master = <&sound_master>;
    		simple-audio-card,bitclock-inversion;
    
    		simple-audio-card,cpu {
    			sound-dai = <&mcasp1>;
    		};
    
    		sound_master: simple-audio-card,codec {
    			sound-dai = <&tlv320aic3x>;
    			system-clock-frequency = <12000000>;
    		};
    		
    ...
    
    	spi4_pins: spi4_pins {
    		pinctrl-single,pins = <
    			AM4372_IOPAD(0xa50, PIN_OUTPUT | MUX_MODE0) // (P25) spi4_sclk.spi4_sclk 
    			AM4372_IOPAD(0xa54, PIN_OUTPUT | MUX_MODE0) // (R24) spi4_d0.spi4_d0 
    			AM4372_IOPAD(0xa58, PIN_OUTPUT | MUX_MODE0) // (P24) spi4_d1.spi4_d1 
    			AM4372_IOPAD(0xa5c, PIN_OUTPUT | MUX_MODE0) // (N25) spi4_cs0.spi4_cs0 
    		>;
    	};
    
    ...
    
    &spi4 {
    	#address-cells = <1>;
        #size-cells = <0>;
    
    	status = "okay";
    	pinctrl-names = "default";
    	pinctrl-0 = <&spi4_pins>;
    
    	tlv320aic3x: codec@0 {
    		compatible = "ti,tlv320aic3x";
    		reg = <0>; // CS number
    		#sound-dai-cells = <0>;
    		spi-max-frequency = <1000000>;
    		AVDD-supply = <&dcdc4>;
    		DRVDD-supply = <&dcdc4>;
    		DVDD-supply = <&ldo1>;
    		ai3x-ocmv = <0>;
    	};
    };
    
    &mcasp0 {
    	#sound-dai-cells = <0>;
    	pinctrl-names = "default", "sleep";
    	pinctrl-0 = <&mcasp0_pins>;
    
    	status = "okay";
    
    	op-mode = <0>;          /* MCASP_IIS_MODE */
    	tdm-slots = <2>;
    	/* 4 serializers */
    	serial-dir = <  /* 0: INACTIVE, 1: TX, 2: RX */
    		0 0 1 2
    	>;
    	tx-num-evt = <32>;
    	rx-num-evt = <32>;
    };

    Given that the spi4 pinout is correct, do you have any ideas what we may have done wrong?

    Regards
    Peter

  • Hi Peter,

    I'll take a look at this and see if I can be of any help, although I'm not an expert on the driver/software side, and as mentioned the support for these kind of tools not directly related to the chip itself is limited at this moment. I'll get back to you by the end of the week in case I can provide any inputs.

    Best regards,
    -Ivan Salazar
    Applications Engineer

  • Thank you for your effort. Does "transition" mean that you are abandoning this product line and that we should refrain from using that module for new designs?

  • Peter,

    Not actually, the transition I mean is just the support of the product. The device will keep its production as usual but it's being assigned to a different team in terms of support and development.

    Best regards,
    -Ivan Salazar
    Applications Engineer 

  • How long is this transition to last and when can expect to receive support from you?
    This is creating a critical situation for us as testing and production schedules are getting disrupted.

  • I am sorry but at this moment we are not able to provide support on the drivers.

    I apologize for this.