Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

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>

authored by

Javier Martin and committed by
Mauro Carvalho Chehab
ee95258e 04ee6d92

+8
+7
drivers/media/i2c/ov7670.c
··· 231 231 u8 clkrc; /* Clock divider value */ 232 232 bool use_smbus; /* Use smbus I/O instead of I2C */ 233 233 bool pll_bypass; 234 + bool pclk_hb_disable; 234 235 const struct ov7670_devtype *devtype; /* Device specifics */ 235 236 }; 236 237 ··· 1713 1712 */ 1714 1713 if (config->pll_bypass && id->driver_data != MODEL_OV7670) 1715 1714 info->pll_bypass = true; 1715 + 1716 + if (config->pclk_hb_disable) 1717 + info->pclk_hb_disable = true; 1716 1718 } 1717 1719 1718 1720 /* Make sure it's an ov7670 */ ··· 1739 1735 tpf.numerator = 1; 1740 1736 tpf.denominator = 30; 1741 1737 info->devtype->set_framerate(sd, &tpf); 1738 + 1739 + if (info->pclk_hb_disable) 1740 + ov7670_write(sd, REG_COM10, COM10_PCLK_HB); 1742 1741 1743 1742 return 0; 1744 1743 }
+1
include/media/ov7670.h
··· 16 16 int clock_speed; /* External clock speed (MHz) */ 17 17 bool use_smbus; /* Use smbus I/O instead of I2C */ 18 18 bool pll_bypass; /* Choose whether to bypass the PLL */ 19 + bool pclk_hb_disable; /* Disable toggling pixclk during horizontal blanking */ 19 20 }; 20 21 21 22 #endif