aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@maxwell.research.nokia.com>2012-04-26 10:21:30 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-05-20 11:46:17 -0400
commit6f367993988720c86e863bb64db8a62a002d6d9d (patch)
treea2c69739d068a7ec2536551cc201d92e4a34e833 /drivers/media
parent98add8e80764f49219de354a867f4cf8ade94ba8 (diff)
[media] smiapp: Round minimum pre_pll up rather than down in ip_clk_freq check
The pre_pll divisor must be such that ext_clk / pre_pll divisor does not result in a frequency that is greater than pll_ip_clk_freq. Fix this. Signed-off-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/smiapp-pll.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/media/video/smiapp-pll.c b/drivers/media/video/smiapp-pll.c
index a416e27a4282..a2e41a21dc65 100644
--- a/drivers/media/video/smiapp-pll.c
+++ b/drivers/media/video/smiapp-pll.c
@@ -124,8 +124,9 @@ int smiapp_pll_calculate(struct device *dev, struct smiapp_pll_limits *limits,
124 limits->min_pll_ip_freq_hz)); 124 limits->min_pll_ip_freq_hz));
125 limits->min_pre_pll_clk_div = 125 limits->min_pre_pll_clk_div =
126 max_t(uint16_t, limits->min_pre_pll_clk_div, 126 max_t(uint16_t, limits->min_pre_pll_clk_div,
127 clk_div_even(pll->ext_clk_freq_hz / 127 clk_div_even_up(
128 limits->max_pll_ip_freq_hz)); 128 DIV_ROUND_UP(pll->ext_clk_freq_hz,
129 limits->max_pll_ip_freq_hz)));
129 dev_dbg(dev, "pre-pll check: min / max pre_pll_clk_div: %d / %d\n", 130 dev_dbg(dev, "pre-pll check: min / max pre_pll_clk_div: %d / %d\n",
130 limits->min_pre_pll_clk_div, limits->max_pre_pll_clk_div); 131 limits->min_pre_pll_clk_div, limits->max_pre_pll_clk_div);
131 132