All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@iki.fi>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH] v4l: aptina-pll: Round up minimum multiplier factor value properly
Date: Tue, 24 Apr 2012 01:01:48 +0300	[thread overview]
Message-ID: <4F95D14C.4020801@iki.fi> (raw)
In-Reply-To: <1335189565-23617-1-git-send-email-laurent.pinchart@ideasonboard.com>

Hi Laurent,

Laurent Pinchart wrote:
> 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>

Thanks!

Acked-by: Sakari Ailus <sakari.ailus@iki.fi>

> ---
>   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 0bd3813..8153a44 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,
>   		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));
>


-- 
Sakari Ailus
sakari.ailus@iki.fi

      reply	other threads:[~2012-04-23 22:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-23 13:59 [PATCH] v4l: aptina-pll: Round up minimum multiplier factor value properly Laurent Pinchart
2012-04-23 22:01 ` Sakari Ailus [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F95D14C.4020801@iki.fi \
    --to=sakari.ailus@iki.fi \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.