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.

TLV320AIC3110: Codec never goes into power down mode

Part Number: TLV320AIC3110

Hello,

We are using the TLV320AIC3110 codec and we have seen that it never appears to go into power down mode i.e. it never writes the value 0x80 to Page 1 Register 46 (0x2E). We only ever see it with value 0x00 or 0x01.

This is our device tree for the codec:

/ {
    sound0: sound@0 {
		compatible = "simple-audio-card";
		simple-audio-card,name = "MySound";
		simple-audio-card,widgets =
			"Microphone", "Microphone Jack",
			"Headphone", "Headphone Jack",
			"Speaker", "Speaker";
		simple-audio-card,routing =
			"MIC1LP", "Microphone Jack",
			"MIC1RP", "Microphone Jack",
			"MIC1LP", "MICBIAS",
			"MIC1RP", "MICBIAS",
			"Headphone Jack", "HPL",
			"Headphone Jack", "HPR",
			"Speaker", "SPL",
			"Speaker", "SPR";
		simple-audio-card,format = "i2s";
		simple-audio-card,bitclock-master = <&sound0_master>;
		simple-audio-card,frame-master = <&sound0_master>;
		simple-audio-card,bitclock-inversion;
		simple-audio-card,convert-rate = <48000>;

		sound0_master: simple-audio-card,cpu {
			sound-dai = <&i2s1>;
			system-clock-frequency = <12000000>;
		};

		simple-audio-card,codec {
			sound-dai = <&codec>;
			system-clock-frequency = <12000000>;
		};
	};
};

&pinctrl {
	codec_pins_a: codec_pins_a {
		pins1 {
			pinmux = <STM32_PINMUX('H', 2, GPIO)>; /* AUDIO_PWR_EN1 */
		};

		pins2 {
			pinmux = <STM32_PINMUX('C', 0, AF6)>,	/* CODEC_I2S1_SDO */
					 <STM32_PINMUX('A', 6, AF5)>,	/* CODEC_I2S1_SDI */
					 <STM32_PINMUX('B', 1, AF5)>,	/* CODEC_I2S1_BITCLK / I2S1_CK */
					 <STM32_PINMUX('B', 0, AF5)>,	/* I2S1_MCK */
					 <STM32_PINMUX('A', 4, AF5)>;	/* CODEC_I2S1_WORDCLK / I2S1_WS */
		};
	};

	codec_sleep_pins_a: codec_sleep_pins_a {
		pins {
			pinmux = <STM32_PINMUX('H', 2, ANALOG)>,	/* AUDIO_PWR_EN1 */
					 <STM32_PINMUX('C', 0, ANALOG)>,	/* CODEC_I2S1_SDO */
					 <STM32_PINMUX('A', 6, ANALOG)>,	/* CODEC_I2S1_SDI */
					 <STM32_PINMUX('B', 1, ANALOG)>,	/* CODEC_I2S1_BITCLK / I2S1_CK */
					 <STM32_PINMUX('B', 0, ANALOG)>,	/* I2S1_MCK */
					 <STM32_PINMUX('A', 4, ANALOG)>;	/* CODEC_I2S1_WORDCLK / I2S1_WS */
		};
	};
};

&i2s1 {
	status = "okay";
	pinctrl-names =  "default", "sleep";
	pinctrl-0 = <&codec_pins_a>;
	pinctrl-1 = <&codec_sleep_pins_a>;	/* Sleep pins */

	clock-names = "pclk", "i2sclk", "x8k", "x11k";
	clocks = <&rcc SPI1>,
			 <&rcc SPI1_K>,
			 <&scmi_clk CK_SCMI_PLL3_Q>,
			 <&scmi_clk CK_SCMI_PLL3_R>;
};

&i2c1 {
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&i2c1_pins_a>;
	pinctrl-1 = <&i2c1_sleep_pins_a>;
	i2c-scl-rising-time-ns = <96>;
	i2c-scl-falling-time-ns = <3>;
	clock-frequency = <100000>;
	status = "okay";
	/* spare dmas for other usage */
	/delete-property/dmas;
	/delete-property/dma-names;

	codec: codec@18 {
		compatible = "ti,tlv320aic3110";
		reg = <0x18>;
		#sound-dai-cells = <0>;
		status = "okay";

		reset-gpios = <&gpiof 6 GPIO_ACTIVE_LOW>;

		ai31xx-micbias-vg = <MICBIAS_2_0V>;
		// ai31xx-ocmv = <3>;

		/* Regulators */
		HPVDD-supply = <&scmi_v3v3_sw>;	/* 3V3_CODEC */
		SPRVDD-supply = <&v5v0_ao>;	/* 5V0_CODEC */
		SPLVDD-supply = <&v5v0_ao>;	/* 5V0_CODEC */
		AVDD-supply = <&scmi_v3v3_sw>;	/* 3V3_CODEC */
		IOVDD-supply = <&scmi_v3v3_sw>;	/* 3V3_CODEC */
		DVDD-supply = <&scmi_v1v8_periph>;	/* 1V8_CODEC */
	};
};

Do you know what could be the problem here and what I could do to fix this?

Presumably, the codec should be in Power Down mode until there is a request to play some audio,right?

Thank you.

  • Hi,

    What are the I2C commands that you're sending to have the device software power down?

    Also the codec will not automatically wake up when there is a request for audio. It will need to be woken up by the I2C host when the request comes in.

    Best regards,
    Jeff McPherson

  • Hello,

    I'm not using any I2C commands for this. I've only used them for testing (i2cset for trying to set the register to 0x80) but nothing in the code.

    I'm using the sound/soc/codecs/tlv320aic31xx.c driver without modifications. Is this not handled by the driver?

    The command I've tried for testing is this one:

    i2cset -f -y 0 0x18 0x2E 0x80

    But it doesn't have any effect.

  • Hi Jesus,

    Understood. I'll loop you in with our driver expert to address this. I did do a quick test with direct I2C control and was able to get the register to write and read back the correct value, which is why I'm curious on the I2C commands that are being sent.

    Thanks,
    Jeff McPherson

  • Kindly dump all the register with i2cdump, thanks.

  • Hello,

    This is the i2cdump output of the codec right after powering on the terminal:

    root@verifone-vegas:~# i2cdump -f -y 0 0x18
    No size specified (using byte-data access)
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
    00: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ?...............
    10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 94    ...............?
    20: 86 3e 00 76 80 00 05 05 4a 4a 05 04 20 86 01 80    ?>.v?.??JJ?? ???
    30: 94 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ??..............
    40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
    50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
    60: 00 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    ................
    

    Please, let me know if you need anything else.

  • Hi 

    The register you dump is at page 1. 

    Kindly use following commands.

    # switch the page 0 first

     i2cset -f -y 0 18 0 0

     i2cdump -f -y 0 18

  • Hello,

    This is the output:

    root@verifone-vegas:~# i2cdump -f -y 0 0x18
    No size specified (using byte-data access)
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
    00: 00 00 01 56 00 91 04 00 00 00 00 81 81 00 80 80    ..?V.??....??.??
    10: 08 00 81 81 80 80 04 00 00 00 01 00 00 08 81 00    ?.?????...?..??.
    20: 00 00 00 00 80 30 00 00 00 00 00 00 00 00 00 00    ....?0..........
    30: 00 00 00 02 32 12 03 02 02 11 10 00 01 04 00 14    ...?2??????.??.?
    40: 0c 1a 1a 00 6f 38 00 00 00 00 00 ee 10 d8 7e e3    ???.o8.....???~?
    50: 00 00 80 00 00 00 00 00 7f 00 00 00 00 00 00 00    ..?.....?.......
    60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
    70: 00 00 00 00 00 10 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    ................
    

  • You can add the power down isable and enable in aic31xx_dac_mute.

  • This fixed it. I added a write to the register in that function and it's now going into power down I also added a "disable power down" write somewhere else).

    Thank you very much.

  • Enjoy Linux programming.