From patchwork Tue Feb 3 00:00:36 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 489 Return-path: Envelope-to: mchehab@infradead.org Delivery-date: Thu, 05 Feb 2009 07:37:25 +0000 Received: from vger.kernel.org ([209.132.176.167]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1LUync-000704-RQ for mchehab@infradead.org; Thu, 05 Feb 2009 07:37:25 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752736AbZBEHhY (ORCPT ); Thu, 5 Feb 2009 02:37:24 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752853AbZBEHhY (ORCPT ); Thu, 5 Feb 2009 02:37:24 -0500 Received: from mail.renesas.com ([202.234.163.13]:59759 "EHLO mail05.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752736AbZBEHhX (ORCPT ); Thu, 5 Feb 2009 02:37:23 -0500 X-AuditID: ac140388-0000000900006b18-00-498a972b4a75 Received: from guardian03.idc.renesas.com ([172.20.8.202]) by mail05.idc.renesas.com (sendmail) with ESMTP id n157bExB021401; Thu, 5 Feb 2009 16:37:14 +0900 (JST) Received: (from root@localhost) by guardian03.idc.renesas.com with id n157bHY7015712; Thu, 5 Feb 2009 16:37:17 +0900 (JST) Received: from mta03.idc.renesas.com (localhost [127.0.0.1]) by mta03.idc.renesas.com with ESMTP id n157bGRr001238; Thu, 5 Feb 2009 16:37:16 +0900 (JST) Received: from PG10870.renesas.com ([172.30.8.159]) by ims05.idc.renesas.com (Sendmail) with ESMTPA id <0KEL000CY165OQ@ims05.idc.renesas.com>; Thu, 05 Feb 2009 16:37:17 +0900 (JST) Date: Tue, 03 Feb 2009 09:00:36 +0900 From: Kuninori Morimoto Subject: [PATCH v2 2/2] sh_mobile_ceu: Add field signal operation To: Guennadi Liakhovetski Cc: Magnus , Linux Media 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.1 (i386-mingw-nt5.1.2600) MULE/5.0 (SAKAKI) Meadow/3.00-dev (KIKU) X-Brightmail-Tracker: AAAAAA== Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org sh_mobile_ceu can support "field signal" from external module. To support this operation, SH_CEU_FLAG_USE_FLDID_{HIGH, LOW} are added to header. Signed-off-by: Kuninori Morimoto --- v1 -> v2 o field name fix drivers/media/video/sh_mobile_ceu_camera.c | 7 +++++++ include/media/sh_mobile_ceu.h | 2 ++ 2 files changed, 9 insertions(+), 0 deletions(-) diff --git a/drivers/media/video/sh_mobile_ceu_camera.c b/drivers/media/video/sh_mobile_ceu_camera.c index aa20745..1f746e1 100644 --- a/drivers/media/video/sh_mobile_ceu_camera.c +++ b/drivers/media/video/sh_mobile_ceu_camera.c @@ -118,6 +118,12 @@ static unsigned long make_bus_param(struct sh_mobile_ceu_dev *pcdev) if (pcdev->pdata->flags & SH_CEU_FLAG_USE_16BIT_BUS) flags |= SOCAM_DATAWIDTH_16; + if (pcdev->pdata->flags & SH_CEU_FLAG_USE_FLDID_HIGH) + flags |= SOCAM_FIELD_ID_ACTIVE_HIGH; + + if (pcdev->pdata->flags & SH_CEU_FLAG_USE_FLDID_LOW) + flags |= SOCAM_FIELD_ID_ACTIVE_LOW; + if (flags & SOCAM_DATAWIDTH_MASK) return flags; @@ -474,6 +480,7 @@ static int sh_mobile_ceu_set_bus_param(struct soc_camera_device *icd, icd->current_fmt->fourcc == V4L2_PIX_FMT_NV61) value ^= 0x00000100; /* swap U, V to change from NV1x->NVx1 */ + value |= common_flags & SOCAM_FIELD_ID_ACTIVE_LOW ? 1 << 16 : 0; value |= common_flags & SOCAM_VSYNC_ACTIVE_LOW ? 1 << 1 : 0; value |= common_flags & SOCAM_HSYNC_ACTIVE_LOW ? 1 << 0 : 0; value |= buswidth == 16 ? 1 << 12 : 0; diff --git a/include/media/sh_mobile_ceu.h b/include/media/sh_mobile_ceu.h index 0f3524c..8da9437 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_USE_FLDID_HIGH (1 << 2) /* top field if FLD is high */ +#define SH_CEU_FLAG_USE_FLDID_LOW (1 << 3) /* top field if FLD is low */ struct sh_mobile_ceu_info { unsigned long flags;