All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Mauro Carvalho Chehab <m.chehab@samsung.com>,
	linux-media@vger.kernel.org, kernel@pengutronix.de
Subject: Re: [PATCH v2 1/5] [media] mt9v032: reset is self clearing
Date: Wed, 04 Jun 2014 16:49:37 +0200	[thread overview]
Message-ID: <2378157.AyxZjdgtXs@avalon> (raw)
In-Reply-To: <1401788155-3690-2-git-send-email-p.zabel@pengutronix.de>

Hi Philipp,

Thank you for the patch.

On Tuesday 03 June 2014 11:35:51 Philipp Zabel wrote:
> According to the publicly available MT9V032 data sheet, the reset bits are
> self clearing and the reset register always reads 0. The reset will be
> asserted for 15 SYSCLK cycles. Instead of writing 0 to the register, wait
> using ndelay.

On the other hand, revision D of the datasheet states on page 71 ("Appendix A 
- Serial Configurations, Figure 46: Stand-Alone Topology") that the typical 
configuration of the sensor includes issuing a soft reset with 

4. Issue a soft reset (set R0x0C[0] = 1 followed by R0x0C[0] = 0.

I wonder whether it wouldn't be safer to keep the register write. Do you see 
any adverse effect of keeping it ?

> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
> ---
>  drivers/media/i2c/mt9v032.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/media/i2c/mt9v032.c b/drivers/media/i2c/mt9v032.c
> index f04d0bb..29d8d8f 100644
> --- a/drivers/media/i2c/mt9v032.c
> +++ b/drivers/media/i2c/mt9v032.c
> @@ -315,6 +315,7 @@ mt9v032_update_hblank(struct mt9v032 *mt9v032)
>  static int mt9v032_power_on(struct mt9v032 *mt9v032)
>  {
>  	struct i2c_client *client = v4l2_get_subdevdata(&mt9v032->subdev);
> +	unsigned long rate;
>  	int ret;
> 
>  	ret = clk_set_rate(mt9v032->clk, mt9v032->sysclk);
> @@ -332,9 +333,9 @@ static int mt9v032_power_on(struct mt9v032 *mt9v032)
>  	if (ret < 0)
>  		return ret;
> 
> -	ret = mt9v032_write(client, MT9V032_RESET, 0);
> -	if (ret < 0)
> -		return ret;
> +	/* Wait 15 SYSCLK cycles, 564 ns @ 26.6 MHz */
> +	rate = clk_get_rate(mt9v032->clk);
> +	ndelay(DIV_ROUND_UP(15 * 125000000, rate >> 3));
> 
>  	return mt9v032_write(client, MT9V032_CHIP_CONTROL, 0);
>  }

-- 
Regards,

Laurent Pinchart


  reply	other threads:[~2014-06-04 14:49 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-03  9:35 [PATCH v2 0/5] mt9v032: add support for v4l2-async, mt9v02x, and regmap Philipp Zabel
2014-06-03  9:35 ` [PATCH v2 1/5] [media] mt9v032: reset is self clearing Philipp Zabel
2014-06-04 14:49   ` Laurent Pinchart [this message]
2014-06-04 15:03     ` Philipp Zabel
2014-06-03  9:35 ` [PATCH v2 2/5] [media] mt9v032: register v4l2 asynchronous subdevice Philipp Zabel
2014-06-04 14:16   ` Laurent Pinchart
2014-06-04 15:04     ` Philipp Zabel
2014-06-03  9:35 ` [PATCH v2 3/5] [media] mt9v032: do not clear reserved bits in read mode register Philipp Zabel
2014-06-04 14:50   ` Laurent Pinchart
2014-06-03  9:35 ` [PATCH v2 4/5] [media] mt9v032: add support for mt9v022 and mt9v024 Philipp Zabel
2014-06-04 14:54   ` Laurent Pinchart
2014-06-03  9:35 ` [PATCH v2 5/5] [media] mt9v032: use regmap Philipp Zabel
2014-06-04 15:44   ` Laurent Pinchart
2014-06-04 16:45     ` Philipp Zabel
2014-06-04 23:46       ` 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=2378157.AyxZjdgtXs@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-media@vger.kernel.org \
    --cc=m.chehab@samsung.com \
    --cc=p.zabel@pengutronix.de \
    /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.