From patchwork Tue Feb 2 05:04:17 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 2554 Return-path: Envelope-to: mchehab@infradead.org Delivery-date: Tue, 02 Feb 2010 05:25:50 +0000 Received: from bombadil.infradead.org [18.85.46.34] by pedra with IMAP (fetchmail-6.3.6) for (single-drop); Tue, 02 Feb 2010 09:10:36 -0200 (BRST) Received: from vger.kernel.org ([209.132.180.67]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1NcBGn-0005dU-QI; Tue, 02 Feb 2010 05:25:50 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751714Ab0BBFZs (ORCPT + 1 other); Tue, 2 Feb 2010 00:25:48 -0500 Received: from mail.renesas.com ([202.234.163.13]:63825 "EHLO mail03.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751527Ab0BBFZr (ORCPT ); Tue, 2 Feb 2010 00:25:47 -0500 X-AuditID: ac140386-0000000500003037-ee-4b67b7500a41 Received: from guardian02.idc.renesas.com ([172.20.8.201]) by mail03.idc.renesas.com (sendmail) with ESMTP id o125PaEx023747; Tue, 2 Feb 2010 14:25:36 +0900 (JST) Received: (from root@localhost) by guardian02.idc.renesas.com with id o125Pahm029805; Tue, 2 Feb 2010 14:25:36 +0900 (JST) Received: from mta04.idc.renesas.com (localhost [127.0.0.1]) by mta04.idc.renesas.com with ESMTP id o125PZH1018963; Tue, 2 Feb 2010 14:25:35 +0900 (JST) Received: from PG10870.renesas.com ([172.30.8.159]) by ims05.idc.renesas.com (Sendmail) with ESMTPA id <0KX700EHO8EOS9@ims05.idc.renesas.com>; Tue, 02 Feb 2010 14:25:36 +0900 (JST) Date: Tue, 02 Feb 2010 14:04:17 +0900 From: Kuninori Morimoto Subject: [PATCH 3/3] soc-camera: mt9t112: The flag which control camera-init is removed To: Guennadi Cc: Linux-V4L2 , Phil.Edworthy@renesas.com, Takashi.Namiki@renesas.com Message-id: MIME-version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-type: text/plain; charset=US-ASCII User-Agent: SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.7 Emacs/22.3 (i386-msvc-nt5.1.2600) MULE/5.0 (SAKAKI) Meadow/3.02-dev (RINDOU) (2009-06-17 Rev.4261) X-Brightmail-Tracker: AAAAAA== Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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 Reported-by: Takashi Namiki --- 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);