From patchwork Tue Nov 24 01:16:06 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 62343 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 nAO1Tvnk022729 for ; Tue, 24 Nov 2009 01:29:57 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757757AbZKXB3b (ORCPT ); Mon, 23 Nov 2009 20:29:31 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757750AbZKXB3b (ORCPT ); Mon, 23 Nov 2009 20:29:31 -0500 Received: from mail.renesas.com ([202.234.163.13]:41665 "EHLO mail01.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1757720AbZKXB33 (ORCPT ); Mon, 23 Nov 2009 20:29:29 -0500 X-AuditID: ac140384-00000007000004f6-7b-4b0b36fb748e Received: from guardian01.idc.renesas.com ([172.20.8.200]) by mail01.idc.renesas.com (sendmail) with ESMTP id nAO1TVvS003976; Tue, 24 Nov 2009 10:29:31 +0900 (JST) Received: (from root@localhost) by guardian01.idc.renesas.com with id nAO1TX6B020052; Tue, 24 Nov 2009 10:29:33 +0900 (JST) Received: from mta01.idc.renesas.com (localhost [127.0.0.1]) by mta01.idc.renesas.com with ESMTP id nAO1TUmS001580; Tue, 24 Nov 2009 10:29:31 +0900 (JST) Received: from PG10870.renesas.com ([172.30.8.159]) by ims05.idc.renesas.com (Sendmail) with ESMTPA id <0KTL00G0JAT6KU@ims05.idc.renesas.com>; Tue, 24 Nov 2009 10:29:31 +0900 (JST) Date: Tue, 24 Nov 2009 10:16:06 +0900 From: Kuninori Morimoto Subject: [PATCH v2] soc-camera: tw9910: Add sync polarity support To: Guennadi Cc: Linux-V4L2 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 a4ba720..fe46c2c 100644 --- a/drivers/media/video/tw9910.c +++ b/drivers/media/video/tw9910.c @@ -513,12 +513,21 @@ static int tw9910_set_bus_param(struct soc_camera_device *icd, { struct v4l2_subdev *sd = soc_camera_to_subdev(icd); struct i2c_client *client = sd->priv; + u8 val = VSSL_VVALID | HSSL_DVALID; /* * set OUTCTR1 + * + * We use VVALID and DVALID signals to control VSYNC and HSYNC + * outputs, in this mode their polarity is inverted. */ - return i2c_smbus_write_byte_data(client, OUTCTR1, - VSSL_VVALID | HSSL_DVALID); + if (flags & SOCAM_HSYNC_ACTIVE_LOW) + val |= HSP_HI; + + if (flags & SOCAM_VSYNC_ACTIVE_LOW) + val |= VSP_HI; + + return i2c_smbus_write_byte_data(client, OUTCTR1, val); } static unsigned long tw9910_query_bus_param(struct soc_camera_device *icd) @@ -528,6 +537,7 @@ static unsigned long tw9910_query_bus_param(struct soc_camera_device *icd) struct soc_camera_link *icl = to_soc_camera_link(icd); unsigned long flags = SOCAM_PCLK_SAMPLE_RISING | SOCAM_MASTER | SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_HSYNC_ACTIVE_HIGH | + SOCAM_VSYNC_ACTIVE_LOW | SOCAM_HSYNC_ACTIVE_LOW | SOCAM_DATA_ACTIVE_HIGH | priv->info->buswidth; return soc_camera_apply_sensor_flags(icl, flags);