From ee144e645a081daad5de1ccac77f0a0e98e6a67b Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Fri, 10 Aug 2012 16:50:51 +0300 Subject: OMAPDSS: DSI: calculate dsi clock Currently the way to configure clocks related to DSI (both DSI and DISPC clocks) happens via omapdss platform data. The reason for this is that configuring the DSS clocks is a very complex problem, and it's impossible for the SW to know requirements about things like interference. However, for general cases it should be fine to calculate the dividers for clocks in the SW. The calculated clocks are probably not perfect, but should work. This patch adds support to calculate the dividers when using DSI command mode panels. The panel gives the required DDR clock rate and LP clock rate, and the DSI driver configures itself and DISPC accordingly. This patch is somewhat ugly, though. The code does its job by modifying the platform data where the clock dividers would be if the board file gave them. This is not how it's going to be in the future, but allows us to have quite simple patch and keep the backward compatibility. It also allows the developer to still give the exact dividers from the board file when there's need for that, as long as the panel driver does not override them. There are also other areas for improvement. For example, it would be better if the panel driver could ask for a DSI clock in a certain range, as, at least command mode panels, the panel can work fine with many different clock speeds. While the patch is not perfect, it allows us to remove the hardcoded clock dividers from the board file, making it easier to bring up a new panel and to use device tree from omapdss. Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/displays/panel-taal.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'drivers/video/omap2/displays/panel-taal.c') diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c index 77aed0e51f9b..ddda96a52d06 100644 --- a/drivers/video/omap2/displays/panel-taal.c +++ b/drivers/video/omap2/displays/panel-taal.c @@ -1065,6 +1065,12 @@ static int taal_power_on(struct omap_dss_device *dssdev) omapdss_dsi_set_pixel_format(dssdev, OMAP_DSS_DSI_FMT_RGB888); omapdss_dsi_set_operation_mode(dssdev, OMAP_DSS_DSI_CMD_MODE); + r = omapdss_dsi_set_clocks(dssdev, 216000000, 10000000); + if (r) { + dev_err(&dssdev->dev, "failed to set HS and LP clocks\n"); + goto err0; + } + r = omapdss_dsi_display_enable(dssdev); if (r) { dev_err(&dssdev->dev, "failed to enable DSI\n"); -- cgit v1.2.3