]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[media] media: ov7670: Add possibility to disable pixclk during hblank
authorJavier Martin <javier.martin@vista-silicon.com>
Tue, 29 Jan 2013 10:26:38 +0000 (07:26 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 8 Feb 2013 16:35:06 +0000 (14:35 -0200)
Some bridge drivers capture pixels during blanking periods if
pixclk is enabled. In order to avoid capturing bogus data we need to
disable pixclk in the sensor during those blanking periods.

Acked-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/i2c/ov7670.c
include/media/ov7670.h

index 3e503396aaa4ca3efa907042949dbf167226f136..52c024a334df3febd1c942bc28a07a8b7f355f73 100644 (file)
@@ -231,6 +231,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;
        const struct ov7670_devtype *devtype; /* Device specifics */
 };
 
@@ -1712,6 +1713,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 */
@@ -1736,6 +1740,9 @@ static int ov7670_probe(struct i2c_client *client,
        tpf.denominator = 30;
        info->devtype->set_framerate(sd, &tpf);
 
+       if (info->pclk_hb_disable)
+               ov7670_write(sd, REG_COM10, COM10_PCLK_HB);
+
        return 0;
 }
 
index a68c8bb3ceba345382efcba24da21d6a47e60fff..1913d5123072f0375632082f6b6d981f55ce40a4 100644 (file)
@@ -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