summaryrefslogtreecommitdiff
path: root/drivers/video/fbdev/omap2/dss/dsi.c
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2014-08-07 15:29:24 +0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2014-11-12 14:40:23 +0300
commitdbb26e53e5a6eda5ee53fb36cdf3ca2517cfb135 (patch)
tree0215be4607f4d85776cc9adc469a382f74ea37bb /drivers/video/fbdev/omap2/dss/dsi.c
parentacf604b709e6b933638bd72d52c5b2e0ff37ff16 (diff)
downloadlinux-dbb26e53e5a6eda5ee53fb36cdf3ca2517cfb135.tar.xz
OMAPDSS: DSI: features: combine dsi & dispc hsdivs
The HSDIV outputs of DSI PLL (and also other PLLs) all have the same bit width for the divider value. Simplify the code by merging HSDIV divider widths into one width. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/fbdev/omap2/dss/dsi.c')
-rw-r--r--drivers/video/fbdev/omap2/dss/dsi.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/video/fbdev/omap2/dss/dsi.c b/drivers/video/fbdev/omap2/dss/dsi.c
index 406af309f8ff..22cc91851e94 100644
--- a/drivers/video/fbdev/omap2/dss/dsi.c
+++ b/drivers/video/fbdev/omap2/dss/dsi.c
@@ -374,7 +374,7 @@ struct dsi_data {
#endif
/* DSI PLL Parameter Ranges */
unsigned long regm_max, regn_max;
- unsigned long regm_dispc_max, regm_dsi_max;
+ unsigned long regm_hsdiv_max;
unsigned long fint_min, fint_max;
unsigned long lpdiv_max;
@@ -1414,7 +1414,7 @@ bool dsi_hsdiv_calc(struct platform_device *dsidev, unsigned long pll,
out_max = dss_feat_get_param_max(FEAT_PARAM_DSS_FCK);
regm_start = max(DIV_ROUND_UP(pll, out_max), 1ul);
- regm_stop = min(pll / out_min, dsi->regm_dispc_max);
+ regm_stop = min(pll / out_min, dsi->regm_hsdiv_max);
for (regm = regm_start; regm <= regm_stop; ++regm) {
out = pll / regm;
@@ -1477,10 +1477,10 @@ static int dsi_calc_clock_rates(struct platform_device *dsidev,
if (cinfo->regm == 0 || cinfo->regm > dsi->regm_max)
return -EINVAL;
- if (cinfo->regm_hsdiv[HSDIV_DISPC] > dsi->regm_dispc_max)
+ if (cinfo->regm_hsdiv[HSDIV_DISPC] > dsi->regm_hsdiv_max)
return -EINVAL;
- if (cinfo->regm_hsdiv[HSDIV_DSI] > dsi->regm_dsi_max)
+ if (cinfo->regm_hsdiv[HSDIV_DSI] > dsi->regm_hsdiv_max)
return -EINVAL;
cinfo->fint = clk_get_rate(dsi->sys_clk) / cinfo->regn;
@@ -5232,9 +5232,8 @@ static void dsi_calc_clock_param_ranges(struct platform_device *dsidev)
dsi->regn_max = dss_feat_get_param_max(FEAT_PARAM_DSIPLL_REGN);
dsi->regm_max = dss_feat_get_param_max(FEAT_PARAM_DSIPLL_REGM);
- dsi->regm_dispc_max =
- dss_feat_get_param_max(FEAT_PARAM_DSIPLL_REGM_DISPC);
- dsi->regm_dsi_max = dss_feat_get_param_max(FEAT_PARAM_DSIPLL_REGM_DSI);
+ dsi->regm_hsdiv_max =
+ dss_feat_get_param_max(FEAT_PARAM_DSIPLL_REGM_HSDIV);
dsi->fint_min = dss_feat_get_param_min(FEAT_PARAM_DSIPLL_FINT);
dsi->fint_max = dss_feat_get_param_max(FEAT_PARAM_DSIPLL_FINT);
dsi->lpdiv_max = dss_feat_get_param_max(FEAT_PARAM_DSIPLL_LPDIV);