From: Laurent Pinchart Date: Wed, 18 Jul 2012 13:58:26 +0000 (-0300) Subject: [media] ov772x: Stop sensor readout right after reset X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=dc5d598219ed5e914ec139d8c82d0866cdb7b8ce;p=linux-beck.git [media] ov772x: Stop sensor readout right after reset The sensor starts streaming video as soon as it gets powered or is reset. Disable the output in the reset function. Signed-off-by: Laurent Pinchart Signed-off-by: Guennadi Liakhovetski Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/i2c/soc_camera/ov772x.c b/drivers/media/i2c/soc_camera/ov772x.c index 76a80b652407..e4a10751894d 100644 --- a/drivers/media/i2c/soc_camera/ov772x.c +++ b/drivers/media/i2c/soc_camera/ov772x.c @@ -541,9 +541,15 @@ static int ov772x_mask_set(struct i2c_client *client, u8 command, u8 mask, static int ov772x_reset(struct i2c_client *client) { - int ret = ov772x_write(client, COM7, SCCB_RESET); + int ret; + + ret = ov772x_write(client, COM7, SCCB_RESET); + if (ret < 0) + return ret; + msleep(1); - return ret; + + return ov772x_mask_set(client, COM2, SOFT_SLEEP_MODE, SOFT_SLEEP_MODE); } /*