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.
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.
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.