All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: linux-media@vger.kernel.org
Cc: Martin Hostettler <martin@neutronstar.dyndns.org>
Subject: Re: [PATCH 08/11] mt9m032: Compute PLL parameters at runtime
Date: Sun, 26 Feb 2012 15:26:44 +0100	[thread overview]
Message-ID: <70016605.2kkfsBtEIt@avalon> (raw)
In-Reply-To: <1330226857-8651-9-git-send-email-laurent.pinchart@ideasonboard.com>

Hi,

On Sunday 26 February 2012 04:27:34 Laurent Pinchart wrote:
> Remove the PLL parameters from platform data and pass the external clock
> and desired internal clock frequencies instead. The PLL parameters are
> now computed at runtime.

My bad, this was supposed to be squashed with patch 11/11. I'll resend the 
whole set.

> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  drivers/media/video/mt9m032.c |   16 ++++++----------
>  include/media/mt9m032.h       |    4 +---
>  2 files changed, 7 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/media/video/mt9m032.c b/drivers/media/video/mt9m032.c
> index 7b458d9..b636ad4 100644
> --- a/drivers/media/video/mt9m032.c
> +++ b/drivers/media/video/mt9m032.c
> @@ -221,21 +221,17 @@ static int mt9m032_setup_pll(struct mt9m032 *sensor)
>  	struct mt9m032_platform_data* pdata = sensor->pdata;
>  	u16 reg_pll1;
>  	unsigned int pre_div;
> +	unsigned int pll_out_div;
> +	unsigned int pll_mul;
>  	int res, ret;
> 
> -	/* TODO: also support other pre-div values */
> -	if (pdata->pll_pre_div != 6) {
> -		dev_warn(to_dev(sensor),
> -			"Unsupported PLL pre-divisor value %u, using default 6\n",
> -			pdata->pll_pre_div);
> -	}
>  	pre_div = 6;
> 
> -	sensor->pix_clock = pdata->ext_clock * pdata->pll_mul /
> -		(pre_div * pdata->pll_out_div);
> +	sensor->pix_clock = pdata->ext_clock * pll_mul /
> +		(pre_div * pll_out_div);
> 
> -	reg_pll1 = ((pdata->pll_out_div - 1) & MT9M032_PLL_CONFIG1_OUTDIV_MASK)
> -		   | pdata->pll_mul << MT9M032_PLL_CONFIG1_MUL_SHIFT;
> +	reg_pll1 = ((pll_out_div - 1) & MT9M032_PLL_CONFIG1_OUTDIV_MASK)
> +		 | (pll_mul << MT9M032_PLL_CONFIG1_MUL_SHIFT);
> 
>  	ret = mt9m032_write_reg(client, MT9M032_PLL_CONFIG1, reg_pll1);
>  	if (!ret)
> diff --git a/include/media/mt9m032.h b/include/media/mt9m032.h
> index 94cefc5..4e84840 100644
> --- a/include/media/mt9m032.h
> +++ b/include/media/mt9m032.h
> @@ -29,9 +29,7 @@
> 
>  struct mt9m032_platform_data {
>  	u32 ext_clock;
> -	u32 pll_pre_div;
> -	u32 pll_mul;
> -	u32 pll_out_div;
> +	u32 int_clock;
>  	int invert_pixclock;
> 
>  };
-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2012-02-26 14:26 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-26  3:27 [PATCH 00/11] MT9M032 sensor driver Laurent Pinchart
2012-02-26  3:27 ` [PATCH 01/11] v4l: Add driver for Micron MT9M032 camera sensor Laurent Pinchart
2012-02-26 14:16   ` Fabio Estevam
2012-02-26 14:28     ` Laurent Pinchart
2012-02-26 22:21       ` Laurent Pinchart
2012-02-26  3:27 ` [PATCH 02/11] mt9m032: Reorder code into section and whitespace cleanups Laurent Pinchart
2012-02-26  3:27 ` [PATCH 03/11] mt9m032: Make get/set format/crop operations consistent across drivers Laurent Pinchart
2012-02-26  3:27 ` [PATCH 04/11] mt9m032: Use module_i2c_driver() macro Laurent Pinchart
2012-02-26  3:27 ` [PATCH 05/11] mt9m032: Enclose to_dev() macro argument in brackets Laurent Pinchart
2012-02-26  3:27 ` [PATCH 06/11] mt9m032: Pass an i2c_client pointer to the register read/write functions Laurent Pinchart
2012-02-26  3:27 ` [PATCH 07/11] mt9m032: Put HFLIP and VFLIP controls in a cluster Laurent Pinchart
2012-02-26  3:27 ` [PATCH 08/11] mt9m032: Compute PLL parameters at runtime Laurent Pinchart
2012-02-26 14:26   ` Laurent Pinchart [this message]
2012-02-26  3:27 ` [PATCH 09/11] mt9m032: Remove unneeded register read Laurent Pinchart
2012-02-26  3:27 ` [PATCH 10/11] v4l: Aptina-style sensor PLL support Laurent Pinchart
2012-02-26  3:27 ` [PATCH 11/11] mt9m032: Use generic PLL setup code 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=70016605.2kkfsBtEIt@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=martin@neutronstar.dyndns.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.