cancel
Showing results for 
Search instead for 
Did you mean: 

sgtl5000 codec dsi i2c

Ara.1
Senior

Hi All,

i am using stm32mp1 with i2c on sgtl5000 codec and control lines are over carrier i2s

i am getting kernel soc sgtl5000.c error

sgtl5000 0-000a: Error reading chip id -6

<STM32_PINMUX('A', 15, AF5)>; /* I2S1_WS */

<STM32_PINMUX('Z', 0, AF5)>, /* I2S1_CK */

                  <STM32_PINMUX('Z', 1, AF5)>, /* I2S1_SDI */

                  <STM32_PINMUX('Z', 2, AF5)>, /* I2S1_SDO */

                  <STM32_PINMUX('Z', 6, AF5)>; /* I2S1_MCK */

Any reference dts on i2s1 would be helpful.. and suggest on kernel error .

52 REPLIES 52
Bernard PUEL
ST Employee

The issue seams to be in the parent clocks of mclk. Can you provided the full trace of the clock summary ? Could you had some trace around  mkoe enable (dynamic traces or get parent traces ?

   clocks = <&rcc SPI1>, <&rcc SPI1_K>, <&rcc PLL3_Q>, <&rcc PLL3_R>;

   clock-names = "pclk", "i2sclk", "x8k", "x11k";

i am seeing i2s clk is zero rest i am getting clk info on mkoe enable

can i get any idea/patch suggestion for our board to generate always i2s_mclk on ? as the same carrier card is working in imx28 and imx6 controller as a som, all uses same signal design for sgtl5000.

Bernard PUEL
ST Employee

with clock dynamic traces, you don't see any information about I2s clock. I assume the clock framework will fail to enable it ....

The driver is not targeted to support this use case, this is why it is painfull.

We are trying to find a workaround but your kernel version is not supported anymore on our side so it is not easy.

Ara.1
Senior

you can test in new kernel, 5.XX.*** as i have used new i2s driver changes , i see no clk at begin at new i2s driver changes

Bernard PUEL
ST Employee

Yes for sure but this use case is not supported by the driver so we will probably have the same result.

The question is more to help you to find a workaround to unblock the situation on your side. And for this, being on an "old" Kernel version does not help.

Bernard PUEL
ST Employee

Hello,

On current I2S driver the I2S clock is activated only when you want to do a playback , then the mclk will be also generated.

So the workaround in your case would be to enable the I2S clock when the I2S driver is probed. You may give a trial ...

Cf: clk_prepare_enable() dans stm32_i2s_startup().

Then you will need also to avoid to stop it when the playback is stopped.

Bernard PUEL
ST Employee

IF this workaround can fit your use case, as I said you will need also to patch the stop of the clock after the playback:

cf: clk_disable_unprepare() in stm32_i2s_shutdown() callback function.

Ara.1
Senior

Bernard, Yes thanks i was deviated in other, will come back on findings,

stm32_i2s_startup() is not that straight forward. to run from probe,

Bernard PUEL
ST Employee

you only need the clock prepare_enable (not the full fonction):

ret = clk_prepare_enable(i2s->i2sclk);

if (ret < 0) {

dev_err(cpu_dai->dev, "Failed to enable clock: %d\n", ret);

return ret;

}

Bernard PUEL
ST Employee

any update ?