tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: clk_set_parent() by name ?





On Mon, 19 Mar 2018, Manuel Bouyer wrote:

On Mon, Mar 19, 2018 at 05:20:45PM -0300, Jared McNeill wrote:
I see what you mean now. The issue I have with clk_set_parent_byname is that
it pushes internals of the clk provider into device drivers. The names are
arbitrary and not consistent across ccu drivers, only really meant for
printing/debugging etc.

Yes I understant that.
On the other hand, the clock hierarchy knowledge in the display's driver
is also quise soc-specific.

There are 5 different families of SoCs that share this DE implementation (sun4i, sun5i, sun6i, sun7i, sun9i). I don't really want to have SoC specific clock code in there..

If you're using static clock parents, you can just initialize them in your
ccu driver's attach function.

If you need to dynamically adjust clock parents, do you have enough context
in the ccu driver on a clk_set_rate call to auto-select the correct parent?

unfortunably no, not in all case.
In allwinner/, the debe clocks are hardcoded to use pll5 as parent,
we could probably do the same in sunxi.

Yeah I think that's reasonable.

the video0/video1 clocks depends on the video mode, they will have to be setup
either in the hdmi when we're using hdmi (this is where we know the video
mode), or directly in the tcon when using the LCD outputs.
But when using tcon without hdmi we have to reference to the video0/video1
clocks in the device tree.

In Linux the TCON uses the two declared clocks (tcon-ch0 and tcon-ch1), and the clk framework automatically reparents. I think we can do the same without breaking abstractions here.

Cheers,
Jared


Home | Main Index | Thread Index | Old Index