Return-path: 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 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 Sender: linux-media-owner@vger.kernel.org List-ID: Signed-off-by: Kuninori Morimoto --- v1 -> v2 o remove pclock field o rename macro drivers/media/video/sh_mobile_ceu_camera.c | 17 +++++++++++++++++ include/media/sh_mobile_ceu.h | 2 ++ 2 files changed, 19 insertions(+), 0 deletions(-) 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; -- 1.6.3.3