From patchwork Tue Oct 13 05:49:24 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 53310 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9D5r9KW023998 for ; Tue, 13 Oct 2009 05:53:10 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755005AbZJMFuH (ORCPT ); Tue, 13 Oct 2009 01:50:07 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754863AbZJMFuH (ORCPT ); Tue, 13 Oct 2009 01:50:07 -0400 Received: from mail.renesas.com ([202.234.163.13]:33998 "EHLO mail02.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754576AbZJMFuG (ORCPT ); Tue, 13 Oct 2009 01:50:06 -0400 X-AuditID: ac140385-00000007000002de-cd-4ad414e4495a Received: from guardian02.idc.renesas.com ([172.20.8.201]) by mail02.idc.renesas.com (sendmail) with ESMTP id n9D5nOx0020425; Tue, 13 Oct 2009 14:49:24 +0900 (JST) Received: (from root@localhost) by guardian02.idc.renesas.com with id n9D5nOoO003926; Tue, 13 Oct 2009 14:49:24 +0900 (JST) Received: from mta02.idc.renesas.com (localhost [127.0.0.1]) by mta02.idc.renesas.com with ESMTP id n9D5nPpG006547; Tue, 13 Oct 2009 14:49:25 +0900 (JST) Received: from PG10870.renesas.com ([172.30.8.159]) by ims05.idc.renesas.com (Sendmail) with ESMTPA id <0KRF00H1YUUCSH@ims05.idc.renesas.com>; Tue, 13 Oct 2009 14:49:24 +0900 (JST) Date: Tue, 13 Oct 2009 14:49:24 +0900 From: Kuninori Morimoto Subject: [PATCH 2/5] soc-camera: tw9910: Add output signal control To: Guennadi Liakhovetski Cc: Linux Media Mailing List 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 diff --git a/drivers/media/video/tw9910.c b/drivers/media/video/tw9910.c index 5152d56..8bda689 100644 --- a/drivers/media/video/tw9910.c +++ b/drivers/media/video/tw9910.c @@ -152,7 +152,8 @@ /* 1 : non-auto */ #define VSCTL 0x08 /* 1 : Vertical out ctrl by DVALID */ /* 0 : Vertical out ctrl by HACTIVE and DVALID */ -#define OEN 0x04 /* Output Enable together with TRI_SEL. */ +#define OEN 0x00 /* Enable output */ +#define EN_TRI_SEL 0x04 /* TRI_SEL output */ /* OUTCTR1 */ #define VSP_LO 0x00 /* 0 : VS pin output polarity is active low */ @@ -236,7 +237,6 @@ struct tw9910_priv { static const struct regval_list tw9910_default_regs[] = { - { OPFORM, 0x00 }, { OUTCTR1, VSP_LO | VSSL_VVALID | HSP_HI | HSSL_HSYNC }, ENDMARKER, }; @@ -513,19 +513,32 @@ static int tw9910_s_stream(struct v4l2_subdev *sd, int enable) { struct i2c_client *client = sd->priv; struct tw9910_priv *priv = to_tw9910(client); + u8 val; - if (!enable) + if (!enable) { + switch (priv->rev) { + case 0: + val = EN_TRI_SEL | 0x2; + break; + case 1: + val = EN_TRI_SEL | 0x3; + break; + } return 0; + } else { - if (!priv->scale) { - dev_err(&client->dev, "norm select error\n"); - return -EPERM; + if (!priv->scale) { + dev_err(&client->dev, "norm select error\n"); + return -EPERM; + } + + dev_dbg(&client->dev, "%s %dx%d\n", + priv->scale->name, + priv->scale->width, + priv->scale->height); } - dev_dbg(&client->dev, "%s %dx%d\n", - priv->scale->name, - priv->scale->width, - priv->scale->height); + tw9910_mask_set(client, OPFORM, 0x7, val); return 0; }