aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2012-10-22 09:35:41 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-11-05 04:14:05 -0500
commit13a1a2b2a68d00d8d81417606571e004e10f6d91 (patch)
tree47b01970008649de6f7a6dec5aff327fc9c9e0bd
parent930b027eb41e31e86618ecd06cf4acf1e44c136b (diff)
OMAPDSS: setup default dss fck
We don't currently set the dss fck when starting up. This is not a problem, as we setup the fck later when configuring the pixel clocks. Or this is how it was for omap2, for the rest of the omaps this may not be so. For DSI, HDMI and also for DPI when using DSI PLL, we don't need to change the dss fck, and thus it may be left unconfigured. Usually the dss fck is already setup fine by default, but we can't trust this. This patch sets the dss fck to maximum at probe time. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r--drivers/video/omap2/dss/dss.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index d40653bf7a6c..844bb1fda911 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -485,6 +485,36 @@ unsigned long dss_get_dpll4_rate(void)
485 return 0; 485 return 0;
486} 486}
487 487
488static int dss_setup_default_clock(void)
489{
490 unsigned long max_dss_fck, prate;
491 unsigned fck_div;
492 struct dss_clock_info dss_cinfo = { 0 };
493 int r;
494
495 if (dss.dpll4_m4_ck == NULL)
496 return 0;
497
498 max_dss_fck = dss_feat_get_param_max(FEAT_PARAM_DSS_FCK);
499
500 prate = dss_get_dpll4_rate();
501
502 fck_div = DIV_ROUND_UP(prate * dss.feat->dss_fck_multiplier,
503 max_dss_fck);
504
505 dss_cinfo.fck_div = fck_div;
506
507 r = dss_calc_clock_rates(&dss_cinfo);
508 if (r)
509 return r;
510
511 r = dss_set_clock_div(&dss_cinfo);
512 if (r)
513 return r;
514
515 return 0;
516}
517
488int dss_calc_clock_div(unsigned long req_pck, struct dss_clock_info *dss_cinfo, 518int dss_calc_clock_div(unsigned long req_pck, struct dss_clock_info *dss_cinfo,
489 struct dispc_clock_info *dispc_cinfo) 519 struct dispc_clock_info *dispc_cinfo)
490{ 520{
@@ -892,6 +922,10 @@ static int __init omap_dsshw_probe(struct platform_device *pdev)
892 if (r) 922 if (r)
893 return r; 923 return r;
894 924
925 r = dss_setup_default_clock();
926 if (r)
927 goto err_setup_clocks;
928
895 pm_runtime_enable(&pdev->dev); 929 pm_runtime_enable(&pdev->dev);
896 930
897 r = dss_runtime_get(); 931 r = dss_runtime_get();
@@ -924,6 +958,7 @@ static int __init omap_dsshw_probe(struct platform_device *pdev)
924 958
925err_runtime_get: 959err_runtime_get:
926 pm_runtime_disable(&pdev->dev); 960 pm_runtime_disable(&pdev->dev);
961err_setup_clocks:
927 dss_put_clocks(); 962 dss_put_clocks();
928 return r; 963 return r;
929} 964}