[alsa-devel] DT soundcard driver with special clock routing

Sylwester Nawrocki s.nawrocki at samsung.com
Wed Dec 23 13:43:01 CET 2015


(Adding ASoC maintainer at Cc).

On 16/12/15 08:54, Petr Kulhavy wrote:
> Currently I'm struggling with the clocks on the DaVinci platform as the 
> clock tree is defined in the platform driver and not in DT.
> Is there a way to reference the clocks by names from DT, or does the 
> DaVinci clock driver need to be rewritten for DT support?

I don't think so, you need a clock provider to reference clocks in DT.
You may want to ask such question on linux-arm-kernel at lists.infradead.org
mailing list and Cc relevant maintainer(s).

> There is one more thing I came across using the simple soundcard driver. 
> The codec needs to be set to generate the clock via PLL.
> Unfortunately the simple soundcard always passes clock ID 0 to 
> snd_soc_dai_set_sysclk() - I need a different value for the internal PLL.
>
> What is the preferred approach here? On one hand the simple soundcard 
> driver could be extended with a DT parameter "clock ID".
> Or does a dedicated soundcard driver need to be written?

I'm not sure what is the preference here, I guess a dedicated soundcard
driver could be a way to go in your case.

> On 14.12.2015 13:28, Sylwester Nawrocki wrote:
>> Yes, you need the clock provider somewhere. In my case it was the I2S 
>> driver that registered a clock provider. Probably you can add your 
>> output clock provider to your SoC's main clock controller driver, and 
>> perhaps use pinctrl API for the pin function mux setup. You can place 
>> assigned-clock* DT properties in the clock provider node and the PLL's 
>> will be configured by the kernel's clk subsystem. Grep for 
>> of_clk_set_defaults or see last chapter of 
>> Documentation/devicetree/bindings/clock/clock-bindings.txt. 

-- 
Regards,
Sylwester


More information about the Alsa-devel mailing list