[3/3] soc-camera: mt9t112: The flag which control camera-init is removed

Message ID umxzsky40.wl%morimoto.kuninori@renesas.com (mailing list archive)
State Superseded, archived
Headers

Commit Message

Kuninori Morimoto Feb. 2, 2010, 5:04 a.m. UTC
  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@renesas.com>
Reported-by: Takashi Namiki <Takashi.Namiki@renesas.com>
---
 drivers/media/video/mt9t112.c |   20 ++++++--------------
 1 files changed, 6 insertions(+), 14 deletions(-)
  

Patch

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);