]> git.baikalelectronics.ru Git - kernel.git/commit
drm/tilcdc: add a workaround for failed clk_set_rate()
authorBartosz Golaszewski <bgolaszewski@baylibre.com>
Thu, 29 Sep 2016 16:43:57 +0000 (18:43 +0200)
committerJyri Sarha <jsarha@ti.com>
Tue, 29 Nov 2016 19:03:15 +0000 (21:03 +0200)
commit9621d483644a4c6523a5ee7b184bdce0ba204b34
treeebdf4755ae055eefb24812329b13118807349661
parent47c1f689b90b442dad192e8b09bf96eadbab5d0c
drm/tilcdc: add a workaround for failed clk_set_rate()

Some architectures don't use the common clock framework and don't
implement all the clk interfaces for every clock. This is the case
for da850-lcdk where clk_set_rate() only works for PLL0 and PLL1.

Trying to set the clock rate for the LCDC clock results in -EINVAL
being returned.

As a workaround for that: if the call to clk_set_rate() fails, fall
back to adjusting the clock divider instead. Proper divider value is
calculated by dividing the current clock rate by the required pixel
clock rate in HZ.

This code is based on a hack initially developed internally for
baylibre by Karl Beldan <kbeldan@baylibre.com>.

Tested with a da850-lcdk with an LCD display connected over VGA.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Jyri Sarha <jsarha@ti.com>
drivers/gpu/drm/tilcdc/tilcdc_crtc.c