From patchwork Tue Jun 9 20:54:51 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Murali Karicheri X-Patchwork-Id: 29089 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 n59Kt2Gj012686 for ; Tue, 9 Jun 2009 20:55:02 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751506AbZFIUy4 (ORCPT ); Tue, 9 Jun 2009 16:54:56 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755758AbZFIUy4 (ORCPT ); Tue, 9 Jun 2009 16:54:56 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:51972 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751506AbZFIUyz (ORCPT ); Tue, 9 Jun 2009 16:54:55 -0400 Received: from dlep36.itg.ti.com ([157.170.170.91]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id n59Ksr0Z027764 for ; Tue, 9 Jun 2009 15:54:58 -0500 Received: from legion.dal.design.ti.com (localhost [127.0.0.1]) by dlep36.itg.ti.com (8.13.8/8.13.8) with ESMTP id n59Ksq7W019826; Tue, 9 Jun 2009 15:54:52 -0500 (CDT) Received: from gt516km11.gt.design.ti.com (gt516km11.gt.design.ti.com [158.218.100.179]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id n59Ksq906388; Tue, 9 Jun 2009 15:54:52 -0500 (CDT) Received: from gt516km11.gt.design.ti.com (localhost.localdomain [127.0.0.1]) by gt516km11.gt.design.ti.com (8.13.1/8.13.1) with ESMTP id n59KspVX024178; Tue, 9 Jun 2009 16:54:51 -0400 Received: (from a0868495@localhost) by gt516km11.gt.design.ti.com (8.13.1/8.13.1/Submit) id n59KsptC024175; Tue, 9 Jun 2009 16:54:51 -0400 From: m-karicheri2@ti.com To: linux-media@vger.kernel.org Cc: davinci-linux-open-source@linux.davincidsp.com, Muralidharan Karicheri , Muralidharan Karicheri Subject: [PATCH] adding support for setting bus parameters in sub device Date: Tue, 9 Jun 2009 16:54:51 -0400 Message-Id: <1244580891-24153-1-git-send-email-m-karicheri2@ti.com> X-Mailer: git-send-email 1.6.0.4 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Muralidharan Karicheri This patch adds support for setting bus parameters such as bus type (BT.656, BT.1120 etc), width (example 10 bit raw image data bus) and polarities (vsync, hsync, field etc) in sub device. This allows bridge driver to configure the sub device for a specific set of bus parameters through s_bus() function call. Reviewed By "Hans Verkuil". Signed-off-by: Muralidharan Karicheri --- Applies to v4l-dvb repository include/media/v4l2-subdev.h | 36 ++++++++++++++++++++++++++++++++++++ 1 files changed, 36 insertions(+), 0 deletions(-) diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index 1785608..c1cfb3b 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h @@ -37,6 +37,41 @@ struct v4l2_decode_vbi_line { u32 type; /* VBI service type (V4L2_SLICED_*). 0 if no service found */ }; +/* + * Some sub-devices are connected to the bridge device through a bus that + * carries * the clock, vsync, hsync and data. Some interfaces such as BT.656 + * carries the sync embedded in the data where as others have separate line + * carrying the sync signals. The structure below is used by bridge driver to + * set the desired bus parameters in the sub device to work with it. + */ +enum v4l2_subdev_bus_type { + /* BT.656 interface. Embedded sync */ + V4L2_SUBDEV_BUS_BT_656, + /* BT.1120 interface. Embedded sync */ + V4L2_SUBDEV_BUS_BT_1120, + /* 8 bit muxed YCbCr bus, separate sync and field signals */ + V4L2_SUBDEV_BUS_YCBCR_8, + /* 16 bit YCbCr bus, separate sync and field signals */ + V4L2_SUBDEV_BUS_YCBCR_16, + /* Raw Bayer image data bus , 8 - 16 bit wide, sync signals */ + V4L2_SUBDEV_BUS_RAW_BAYER +}; + +struct v4l2_subdev_bus { + enum v4l2_subdev_bus_type type; + u8 width; + /* 0 - active low, 1 - active high */ + unsigned pol_vsync:1; + /* 0 - active low, 1 - active high */ + unsigned pol_hsync:1; + /* 0 - low to high , 1 - high to low */ + unsigned pol_field:1; + /* 0 - sample at falling edge , 1 - sample at rising edge */ + unsigned pol_pclock:1; + /* 0 - active low , 1 - active high */ + unsigned pol_data:1; +}; + /* Sub-devices are devices that are connected somehow to the main bridge device. These devices are usually audio/video muxers/encoders/decoders or sensors and webcam controllers. @@ -109,6 +144,7 @@ struct v4l2_subdev_core_ops { int (*querymenu)(struct v4l2_subdev *sd, struct v4l2_querymenu *qm); int (*s_std)(struct v4l2_subdev *sd, v4l2_std_id norm); long (*ioctl)(struct v4l2_subdev *sd, unsigned int cmd, void *arg); + int (*s_bus)(struct v4l2_subdev *sd, struct v4l2_subdev_bus *bus); #ifdef CONFIG_VIDEO_ADV_DEBUG int (*g_register)(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg); int (*s_register)(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg);