diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2012-04-23 08:59:25 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-05-08 13:26:41 -0400 |
commit | 31ed29f9812a9cb9a1c6d270ff4e19da60046da1 (patch) | |
tree | 43984b3b8419a8a1ee4352108557c5f188214924 /drivers | |
parent | 433f75ab3d09a666c745d4163e21e811582d8eda (diff) |
[media] v4l: aptina-pll: Round up minimum multiplier factor value properly
The mf_low value must be a multiple of mf_inc. Round it up to the
nearest mf_inc multiple after computing it.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/aptina-pll.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/media/video/aptina-pll.c b/drivers/media/video/aptina-pll.c index 0bd3813bb59d..8153a449846b 100644 --- a/drivers/media/video/aptina-pll.c +++ b/drivers/media/video/aptina-pll.c | |||
@@ -148,9 +148,8 @@ int aptina_pll_calculate(struct device *dev, | |||
148 | unsigned int mf_high; | 148 | unsigned int mf_high; |
149 | unsigned int mf_low; | 149 | unsigned int mf_low; |
150 | 150 | ||
151 | mf_low = max(roundup(mf_min, mf_inc), | 151 | mf_low = roundup(max(mf_min, DIV_ROUND_UP(pll->ext_clock * p1, |
152 | DIV_ROUND_UP(pll->ext_clock * p1, | 152 | limits->int_clock_max * div)), mf_inc); |
153 | limits->int_clock_max * div)); | ||
154 | mf_high = min(mf_max, pll->ext_clock * p1 / | 153 | mf_high = min(mf_max, pll->ext_clock * p1 / |
155 | (limits->int_clock_min * div)); | 154 | (limits->int_clock_min * div)); |
156 | 155 | ||