Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 31ed29f9 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Mauro Carvalho Chehab
Browse files

[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: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: default avatarSakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 433f75ab
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -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));