From patchwork Tue Nov 24 01:04:12 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 62342 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 nAO1Tvnj022729 for ; Tue, 24 Nov 2009 01:29:57 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757740AbZKXB32 (ORCPT ); Mon, 23 Nov 2009 20:29:28 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757720AbZKXB32 (ORCPT ); Mon, 23 Nov 2009 20:29:28 -0500 Received: from mail.renesas.com ([202.234.163.13]:41646 "EHLO mail01.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1757710AbZKXB30 (ORCPT ); Mon, 23 Nov 2009 20:29:26 -0500 X-AuditID: ac140384-00000006000004f6-77-4b0b36f85562 Received: from guardian02.idc.renesas.com ([172.20.8.201]) by mail01.idc.renesas.com (sendmail) with ESMTP id nAO1TSAE003961; Tue, 24 Nov 2009 10:29:28 +0900 (JST) Received: (from root@localhost) by guardian02.idc.renesas.com with id nAO1TRHM007492; Tue, 24 Nov 2009 10:29:27 +0900 (JST) Received: from mta02.idc.renesas.com (localhost [127.0.0.1]) by mta02.idc.renesas.com with ESMTP id nAO1TTTM023331; Tue, 24 Nov 2009 10:29:29 +0900 (JST) Received: from PG10870.renesas.com ([172.30.8.159]) by ims05.idc.renesas.com (Sendmail) with ESMTPA id <0KTL00GZNAT3KU@ims05.idc.renesas.com>; Tue, 24 Nov 2009 10:29:28 +0900 (JST) Date: Tue, 24 Nov 2009 10:04:12 +0900 From: Kuninori Morimoto Subject: [PATCH v2] soc-camera: sh_mobile_ceu_camera: Add support sync polarity selection 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/sh_mobile_ceu_camera.c b/drivers/media/video/sh_mobile_ceu_camera.c index b259884..3980fcd 100644 --- a/drivers/media/video/sh_mobile_ceu_camera.c +++ b/drivers/media/video/sh_mobile_ceu_camera.c @@ -674,6 +674,23 @@ static int sh_mobile_ceu_set_bus_param(struct soc_camera_device *icd, if (!common_flags) return -EINVAL; + /* Make choises, based on platform preferences */ + if ((common_flags & SOCAM_HSYNC_ACTIVE_HIGH) && + (common_flags & SOCAM_HSYNC_ACTIVE_LOW)) { + if (pcdev->pdata->flags & SH_CEU_FLAG_HSYNC_LOW) + common_flags &= ~SOCAM_HSYNC_ACTIVE_HIGH; + else + common_flags &= ~SOCAM_HSYNC_ACTIVE_LOW; + } + + if ((common_flags & SOCAM_VSYNC_ACTIVE_HIGH) && + (common_flags & SOCAM_VSYNC_ACTIVE_LOW)) { + if (pcdev->pdata->flags & SH_CEU_FLAG_VSYNC_LOW) + common_flags &= ~SOCAM_VSYNC_ACTIVE_HIGH; + else + common_flags &= ~SOCAM_VSYNC_ACTIVE_LOW; + } + ret = icd->ops->set_bus_param(icd, common_flags); if (ret < 0) return ret; diff --git a/include/media/sh_mobile_ceu.h b/include/media/sh_mobile_ceu.h index 0f3524c..b677478 100644 --- a/include/media/sh_mobile_ceu.h +++ b/include/media/sh_mobile_ceu.h @@ -3,6 +3,8 @@ #define SH_CEU_FLAG_USE_8BIT_BUS (1 << 0) /* use 8bit bus width */ #define SH_CEU_FLAG_USE_16BIT_BUS (1 << 1) /* use 16bit bus width */ +#define SH_CEU_FLAG_HSYNC_LOW (1 << 2) /* default High if possible */ +#define SH_CEU_FLAG_VSYNC_LOW (1 << 3) /* default High if possible */ struct sh_mobile_ceu_info { unsigned long flags;