Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ee95258e authored by Javier Martin's avatar Javier Martin Committed by Mauro Carvalho Chehab
Browse files

[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: default avatarJonathan Corbet <corbet@lwn.net>
Signed-off-by: default avatarJavier Martin <javier.martin@vista-silicon.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 04ee6d92
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -231,6 +231,7 @@ struct ov7670_info {
	u8 clkrc;			/* Clock divider value */
	u8 clkrc;			/* Clock divider value */
	bool use_smbus;			/* Use smbus I/O instead of I2C */
	bool use_smbus;			/* Use smbus I/O instead of I2C */
	bool pll_bypass;
	bool pll_bypass;
	bool pclk_hb_disable;
	const struct ov7670_devtype *devtype; /* Device specifics */
	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)
		if (config->pll_bypass && id->driver_data != MODEL_OV7670)
			info->pll_bypass = true;
			info->pll_bypass = true;

		if (config->pclk_hb_disable)
			info->pclk_hb_disable = true;
	}
	}


	/* Make sure it's an ov7670 */
	/* Make sure it's an ov7670 */
@@ -1736,6 +1740,9 @@ static int ov7670_probe(struct i2c_client *client,
	tpf.denominator = 30;
	tpf.denominator = 30;
	info->devtype->set_framerate(sd, &tpf);
	info->devtype->set_framerate(sd, &tpf);


	if (info->pclk_hb_disable)
		ov7670_write(sd, REG_COM10, COM10_PCLK_HB);

	return 0;
	return 0;
}
}


+1 −0
Original line number Original line Diff line number Diff line
@@ -16,6 +16,7 @@ struct ov7670_config {
	int clock_speed;		/* External clock speed (MHz) */
	int clock_speed;		/* External clock speed (MHz) */
	bool use_smbus;			/* Use smbus I/O instead of I2C */
	bool use_smbus;			/* Use smbus I/O instead of I2C */
	bool pll_bypass;		/* Choose whether to bypass the PLL */
	bool pll_bypass;		/* Choose whether to bypass the PLL */
	bool pclk_hb_disable;		/* Disable toggling pixclk during horizontal blanking */
};
};


#endif
#endif