mt9t112 should always be initialized when camera start. Because current driver doesn't run this operation, it will be un-stable if user side player run open/close several times. Special thanks to Namiki-san Signed-off-by: Kuninori Morimoto <morimoto.kuninori@xxxxxxxxxxx> Reported-by: Takashi Namiki <Takashi.Namiki@xxxxxxxxxxx> --- drivers/media/video/mt9t112.c | 20 ++++++-------------- 1 files changed, 6 insertions(+), 14 deletions(-) diff --git a/drivers/media/video/mt9t112.c b/drivers/media/video/mt9t112.c index e581d8a..bd5ef62 100644 --- a/drivers/media/video/mt9t112.c +++ b/drivers/media/video/mt9t112.c @@ -106,9 +106,6 @@ struct mt9t112_priv { struct mt9t112_frame_size frame; const struct mt9t112_format *format; int model; - u32 flags; -/* for flags */ -#define INIT_DONE (1<<0) }; /************************************************************************ @@ -876,19 +873,14 @@ static int mt9t112_s_stream(struct v4l2_subdev *sd, int enable) return ret; } - if (!(priv->flags & INIT_DONE)) { - u16 param = (MT9T112_FLAG_PCLK_RISING_EDGE & - priv->info->flags) ? 0x0001 : 0x0000; + ECHECKER(ret, mt9t112_init_camera(client)); - ECHECKER(ret, mt9t112_init_camera(client)); + /* Invert PCLK (Data sampled on falling edge of pixclk) */ + mt9t112_reg_write(ret, client, 0x3C20, + (MT9T112_FLAG_PCLK_RISING_EDGE & priv->info->flags) ? + 0x0001 : 0x0000); - /* Invert PCLK (Data sampled on falling edge of pixclk) */ - mt9t112_reg_write(ret, client, 0x3C20, param); - - mdelay(100); - - priv->flags |= INIT_DONE; - } + mdelay(100); mt9t112_mcu_write(ret, client, VAR(26, 7), priv->format->fmt); mt9t112_mcu_write(ret, client, VAR(26, 9), priv->format->order); -- 1.6.3.3 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html