]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - drivers/video/fbdev/da8xx-fb.c
video: da8xx-fb: set upstream clock rate (if reqd)
authorDarren Etheridge <detheridge@ti.com>
Mon, 5 Aug 2013 22:02:36 +0000 (17:02 -0500)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Fri, 9 Aug 2013 11:02:43 +0000 (14:02 +0300)
commit2dfa77a2010fc65de131ef7f7454844df9182735
tree5a6aceac93f0d55147a47a9e31716dbc77b6ea8a
parent2bdff0680f00ef4d2448b8d20d61a3554b368c24
video: da8xx-fb: set upstream clock rate (if reqd)

Based on original patch by: Afzal Mohammed <afzal@ti.com>

LCDC IP has a clock divider to adjust pixel clock, this limits pixel
clock range to fck/255 - fck/2(fck - rate of input clock to LCDC IP).
In the case of AM335x, where this IP is present, default fck is not
sufficient to provide normal pixel clock rates, hence rendering this
driver unusable on AM335x.

If input clock too is configurable, allowable range of pixel clock
would increase. Here initially it is checked whether with present fck,
divider in IP could be configured to obtain required rate, if not,
fck is adjusted. This makes it usable on AM335x.

Note:
Another solution would be to model an inherited basic clock divider of
CCF, an advantage would be a better possible resolution for pixel clk.
And trying to instantiate a CCF clock would mean that to be consistent,
3 bits being turned on to enable clocks of LCDC IP would have to be
modeled as gate clocks. Now that would bring in a total of 4 clocks,
including necessity to create a new inherited divider clock, and that
mean a branch of clock tree would be present in LCDC driver. This
would add complexity to LCDC driver bringing in considerable amount
of clock handling code, and this would not bring in much advantage
for existing use cases other than providing a higher resolution of
pixel clock. And existing use cases work without relying on clock
modeling. Another fact is that out of the two platform's using this
driver DaVinci is not yet converted to CCF. In future if higher
resolution of pixel clock is required, and probably after DaVinci is
CCF'ed, modeling clock nodes inside driver may be considered.

v2: purely cosmetic changes to try and clarify what variables are
being used for in the clock rate / divider calculations

Signed-off-by: Darren Etheridge <detheridge@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/video/da8xx-fb.c