public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH] [media] mt9p031: fixed calculation of clk_div
Date: Wed, 04 Feb 2015 19:19:45 +0200	[thread overview]
Message-ID: <2403470.jYcXEMRiZi@avalon> (raw)
In-Reply-To: <1423061612-12623-1-git-send-email-enrico.scholz@sigma-chemnitz.de>

Hi Enrico,

Thank you for the patch.

On Wednesday 04 February 2015 15:53:32 Enrico Scholz wrote:
> There must be used 'min_t', not 'max_t' for calculating the divider

That I agree with.

> and the upper limit is '63' (value uses 6:0 register bits).

And this I don't. You can encode numbers from 0 to 127 on 7 bits.

> Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  drivers/media/i2c/mt9p031.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/i2c/mt9p031.c b/drivers/media/i2c/mt9p031.c
> index 0cabf91..43ee299 100644
> --- a/drivers/media/i2c/mt9p031.c
> +++ b/drivers/media/i2c/mt9p031.c
> @@ -254,7 +254,7 @@ static int mt9p031_clk_setup(struct mt9p031 *mt9p031)
>  		div = DIV_ROUND_UP(ext_freq, pdata->target_freq);
>  		div = roundup_pow_of_two(div) / 2;
> 
> -		mt9p031->clk_div = max_t(unsigned int, div, 64);
> +		mt9p031->clk_div = min_t(unsigned int, div, 63);
>  		mt9p031->use_pll = false;
> 
>  		return 0;

-- 
Regards,

Laurent Pinchart


  reply	other threads:[~2015-02-04 17:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-04 14:53 [PATCH] [media] mt9p031: fixed calculation of clk_div Enrico Scholz
2015-02-04 17:19 ` Laurent Pinchart [this message]
2015-02-04 17:54   ` Enrico Scholz
2015-02-04 17:51 ` [PATCH v2] " Enrico Scholz
2015-02-05 12:01   ` Laurent Pinchart

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=2403470.jYcXEMRiZi@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=enrico.scholz@sigma-chemnitz.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox