OSDN Git Service

drm/tilcdc: Fix setting clock divider for omap-l138
authorDavid Lechner <david@lechnology.com>
Wed, 14 Mar 2018 22:58:45 +0000 (17:58 -0500)
committerJyri Sarha <jsarha@ti.com>
Wed, 9 May 2018 16:55:18 +0000 (19:55 +0300)
commita88ad3ded15daa0389106779c60b8a5e76d4b20a
treed941c50c93599c3b8dc747781c6c0705db22f294
parent6d08b06e67cd117f6992c46611dfb4ce267cd71e
drm/tilcdc: Fix setting clock divider for omap-l138

This fixes setting the clock divider on the TI OMAP-L138 LCDK board.

The clock drivers for OMAP-L138 are being covernted to the common clock
framework. When this happens, clk_set_rate() will no longer return an
error. However, on this SoC, the clock rate cannot actually be changed
because the clock has to maintain a fixed ratio to the ARM clock. So
after attempting to set the clock rate, we need to check to see if the
new rate is actually close enough. If not, then follow the previous
error path to adjust the divider in LCDC IP block to compensate for not
being able to change the parent clock rate.

Tested working on a TI OMAP-L138 LCDK board.

Signed-off-by: David Lechner <david@lechnology.com>
Signed-off-by: Jyri Sarha <jsarha@ti.com>
drivers/gpu/drm/tilcdc/tilcdc_crtc.c