Skip to content

Commit

Permalink
[media] v4l: aptina-pll: Round up minimum multiplier factor value pro…
Browse files Browse the repository at this point in the history
…perly

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>
  • Loading branch information
Laurent Pinchart authored and Mauro Carvalho Chehab committed May 8, 2012
1 parent 433f75a commit 31ed29f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/media/video/aptina-pll.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,8 @@ int aptina_pll_calculate(struct device *dev,
unsigned int mf_high;
unsigned int mf_low;

mf_low = max(roundup(mf_min, mf_inc),
DIV_ROUND_UP(pll->ext_clock * p1,
limits->int_clock_max * div));
mf_low = roundup(max(mf_min, DIV_ROUND_UP(pll->ext_clock * p1,
limits->int_clock_max * div)), mf_inc);
mf_high = min(mf_max, pll->ext_clock * p1 /
(limits->int_clock_min * div));

Expand Down

0 comments on commit 31ed29f

Please sign in to comment.