From patchwork Thu Dec 1 00:14:52 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aguirre Rodriguez, Sergio Alberto" X-Patchwork-Id: 8689 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1RVuJe-0006yz-JP; Thu, 01 Dec 2011 01:15:55 +0100 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.75/mailfrontend-3) with esmtp id 1RVuJd-0004Yh-ER; Thu, 01 Dec 2011 01:15:54 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753320Ab1LAAPo (ORCPT + 4 others); Wed, 30 Nov 2011 19:15:44 -0500 Received: from devils.ext.ti.com ([198.47.26.153]:45618 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753223Ab1LAAPR (ORCPT ); Wed, 30 Nov 2011 19:15:17 -0500 Received: from dlep34.itg.ti.com ([157.170.170.115]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id pB10F4b6031946 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 30 Nov 2011 18:15:04 -0600 Received: from dlep26.itg.ti.com (smtp-le.itg.ti.com [157.170.170.27]) by dlep34.itg.ti.com (8.13.7/8.13.8) with ESMTP id pB10F3r2002641; Wed, 30 Nov 2011 18:15:03 -0600 (CST) Received: from DLEE74.ent.ti.com (localhost [127.0.0.1]) by dlep26.itg.ti.com (8.13.8/8.13.8) with ESMTP id pB10F3nc029517; Wed, 30 Nov 2011 18:15:03 -0600 (CST) Received: from dlelxv23.itg.ti.com (172.17.1.198) by DLEE74.ent.ti.com (157.170.170.8) with Microsoft SMTP Server id 14.1.323.3; Wed, 30 Nov 2011 18:15:03 -0600 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dlelxv23.itg.ti.com (8.13.8/8.13.8) with ESMTP id pB10F3RU013168; Wed, 30 Nov 2011 18:15:03 -0600 Received: from localhost (dtx0091359-ubuntu-2.am.dhcp.ti.com [10.247.19.253]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id pB10F3028916; Wed, 30 Nov 2011 18:15:03 -0600 (CST) From: Sergio Aguirre To: CC: , , , Stanimir Varbanov Subject: [PATCH v2 03/11] v4l: Introduce sensor operation for getting interface configuration Date: Wed, 30 Nov 2011 18:14:52 -0600 Message-ID: <1322698500-29924-4-git-send-email-saaguirre@ti.com> X-Mailer: git-send-email 1.7.7.4 In-Reply-To: <1322698500-29924-1-git-send-email-saaguirre@ti.com> References: <1322698500-29924-1-git-send-email-saaguirre@ti.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2011.12.1.619 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MULTIPLE_RCPTS 0.1, MSGID_ADDED_BY_MTA 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_2000_2999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, DATE_TZ_NA 0, __ANY_URI 0, __CP_MEDIA_BODY 0, __CP_URI_IN_BODY 0, __CT 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __MULTIPLE_RCPTS_CC_X2 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS ' X-LSpam-Score: -6.9 (------) X-LSpam-Report: No, score=-6.9 required=5.0 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5 autolearn=ham From: Stanimir Varbanov Introduce g_interface_parms sensor operation for getting sensor interface parameters. These parameters are needed from the host side to determine it's own configuration. Signed-off-by: Stanimir Varbanov --- include/media/v4l2-subdev.h | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 42 insertions(+), 0 deletions(-) diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index f0f3358..0d322ed 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h @@ -362,6 +362,42 @@ struct v4l2_subdev_vbi_ops { int (*s_sliced_fmt)(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_format *fmt); }; +/* Which interface the sensor use to provide it's image data */ +enum v4l2_subdev_sensor_iface { + V4L2_SUBDEV_SENSOR_PARALLEL, + V4L2_SUBDEV_SENSOR_SERIAL, +}; + +/* Each interface could use the following modes */ +/* Image sensor provides horizontal and vertical sync signals */ +#define V4L2_SUBDEV_SENSOR_MODE_PARALLEL_SYNC 0 +/* BT.656 interface. Embedded sync */ +#define V4L2_SUBDEV_SENSOR_MODE_PARALLEL_ITU 1 +/* MIPI CSI1 */ +#define V4L2_SUBDEV_SENSOR_MODE_SERIAL_CSI1 2 +/* MIPI CSI2 */ +#define V4L2_SUBDEV_SENSOR_MODE_SERIAL_CSI2 3 + +struct v4l2_subdev_sensor_serial_parms { + unsigned char lanes; /* number of lanes used */ + unsigned char channel; /* virtual channel */ + unsigned int phy_rate; /* output rate at CSI phy in bps */ + unsigned int pix_clk; /* pixel clock in Hz */ +}; + +struct v4l2_subdev_sensor_parallel_parms { + unsigned int pix_clk; /* pixel clock in Hz */ +}; + +struct v4l2_subdev_sensor_interface_parms { + enum v4l2_subdev_sensor_iface if_type; + unsigned int if_mode; + union { + struct v4l2_subdev_sensor_serial_parms serial; + struct v4l2_subdev_sensor_parallel_parms parallel; + } parms; +}; + /** * struct v4l2_subdev_sensor_ops - v4l2-subdev sensor operations * @g_skip_top_lines: number of lines at the top of the image to be skipped. @@ -371,10 +407,16 @@ struct v4l2_subdev_vbi_ops { * @g_skip_frames: number of frames to skip at stream start. This is needed for * buggy sensors that generate faulty frames when they are * turned on. + * @g_interface_parms: get sensor interface parameters. The sensor subdev should + * fill this structure with current interface params. These + * interface parameters are needed on host side to configure + * it's own hardware receivers. */ struct v4l2_subdev_sensor_ops { int (*g_skip_top_lines)(struct v4l2_subdev *sd, u32 *lines); int (*g_skip_frames)(struct v4l2_subdev *sd, u32 *frames); + int (*g_interface_parms)(struct v4l2_subdev *sd, + struct v4l2_subdev_sensor_interface_parms *parms); }; /*