diff mbox

[5/5] media: ov7670: Add possibility to disable pixclk during hblank.

Message ID 1348652877-25816-6-git-send-email-javier.martin@vista-silicon.com (mailing list archive)
State New, archived
Headers show

Commit Message

Javier Martin Sept. 26, 2012, 9:47 a.m. UTC
Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
---
 drivers/media/i2c/ov7670.c |    8 ++++++++
 include/media/ov7670.h     |    1 +
 2 files changed, 9 insertions(+)

Comments

Jonathan Corbet Sept. 26, 2012, 4:52 p.m. UTC | #1
On Wed, 26 Sep 2012 11:47:57 +0200
Javier Martin <javier.martin@vista-silicon.com> wrote:

> Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
> ---
>  drivers/media/i2c/ov7670.c |    8 ++++++++
>  include/media/ov7670.h     |    1 +
>  2 files changed, 9 insertions(+)

Again, needs a changelog.  Otherwise

Acked-by: Jonathan Corbet <corbet@lwn.net>

jon
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Javier Martin Sept. 27, 2012, 7:41 a.m. UTC | #2
On 26 September 2012 18:52, Jonathan Corbet <corbet@lwn.net> wrote:
> On Wed, 26 Sep 2012 11:47:57 +0200
> Javier Martin <javier.martin@vista-silicon.com> wrote:
>
>> Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
>> ---
>>  drivers/media/i2c/ov7670.c |    8 ++++++++
>>  include/media/ov7670.h     |    1 +
>>  2 files changed, 9 insertions(+)
>
> Again, needs a changelog.  Otherwise

Our soc-camera host driver captures pixels during blanking periods if
pixclk is enabled. In order to avoid capturing bogus data we need to
disable pixclk during those blanking periods

I'll add it to v2.

> Acked-by: Jonathan Corbet <corbet@lwn.net>
>

Thank you.
diff mbox

Patch

diff --git a/drivers/media/i2c/ov7670.c b/drivers/media/i2c/ov7670.c
index 54fb535..f7e4341 100644
--- a/drivers/media/i2c/ov7670.c
+++ b/drivers/media/i2c/ov7670.c
@@ -211,6 +211,7 @@  struct ov7670_info {
 	u8 clkrc;			/* Clock divider value */
 	bool use_smbus;			/* Use smbus I/O instead of I2C */
 	bool pll_bypass;
+	bool pclk_hb_disable;
 	enum ov7670_model model;
 };
 
@@ -1709,6 +1710,9 @@  static int ov7670_probe(struct i2c_client *client,
 
 		if (config->pll_bypass && id->driver_data != MODEL_OV7670)
 			info->pll_bypass = true;
+
+		if (config->pclk_hb_disable)
+			info->pclk_hb_disable = true;
 	}
 
 	/* Make sure it's an ov7670 */
@@ -1735,6 +1739,10 @@  static int ov7670_probe(struct i2c_client *client,
 		tpf.denominator = 30;
 		ov7670_set_framerate(sd, &tpf);
 	}
+
+	if (info->pclk_hb_disable)
+		ov7670_write(sd, REG_COM10, COM10_PCLK_HB);
+
 	return 0;
 }
 
diff --git a/include/media/ov7670.h b/include/media/ov7670.h
index a68c8bb..1913d51 100644
--- a/include/media/ov7670.h
+++ b/include/media/ov7670.h
@@ -16,6 +16,7 @@  struct ov7670_config {
 	int clock_speed;		/* External clock speed (MHz) */
 	bool use_smbus;			/* Use smbus I/O instead of I2C */
 	bool pll_bypass;		/* Choose whether to bypass the PLL */
+	bool pclk_hb_disable;		/* Disable toggling pixclk during horizontal blanking */
 };
 
 #endif