From patchwork Tue Feb 14 22:38:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Machek X-Patchwork-Id: 39415 X-Patchwork-Delegate: sakari.ailus@iki.fi Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cdlkq-0003oA-7E; Tue, 14 Feb 2017 22:39:24 +0000 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.84_2/mailfrontend-8) with esmtp id 1cdlkn-0008LE-mC; Tue, 14 Feb 2017 23:39:23 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751530AbdBNWi5 (ORCPT + 1 other); Tue, 14 Feb 2017 17:38:57 -0500 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:44790 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751518AbdBNWi4 (ORCPT ); Tue, 14 Feb 2017 17:38:56 -0500 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 553FF81860; Tue, 14 Feb 2017 23:38:54 +0100 (CET) Date: Tue, 14 Feb 2017 23:38:53 +0100 From: Pavel Machek To: sakari.ailus@iki.fi Cc: sre@kernel.org, pali.rohar@gmail.com, pavel@ucw.cz, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, laurent.pinchart@ideasonboard.com, mchehab@kernel.org, ivo.g.dimitrov.75@gmail.com Subject: [PATCH 2/4] Core changes for CCP2/CSI1 support. Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 6.0.0.2142326, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2017.2.14.223316 X-PMX-Spam: Gauge=IIIIIIIII, Probability=9%, Report=' BODY_PARA_IS_SENTENCE_URL 0.1, MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, KNOWN_FREEWEB_URI 0.05, 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, IN_REP_TO 0, LEGITIMATE_SIGNS 0, MSG_THREAD 0, MULTIPLE_REAL_RCPTS 0, NO_URI_HTTPS 0, REFERENCES 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __ATTACHMENT_SIZE_0_10K 0, __CD 0, __CP_URI_IN_BODY 0, __CT 0, __CTYPE_HAS_BOUNDARY 0, __CTYPE_MULTIPART 0, __FRAUD_BODY_WEBMAIL 0, __FRAUD_WEBMAIL 0, __FROM_DOMAIN_IN_ANY_CC2 0, __FROM_DOMAIN_IN_RCPT 0, __HAS_ATTACHMENT 0, __HAS_ATTACHMENT1 0, __HAS_ATTACHMENT2 0, __HAS_CC_HDR 0, __HAS_FROM 0, __HAS_LIST_ID 0, __HAS_MSGID 0, __HAS_X_MAILING_LIST 0, __IN_REP_TO 0, __KNOWN_FREEWEB_URI2 0, __MIME_TEXT_P 0, __MIME_TEXT_P1 0, __MIME_TEXT_P2 0, __MIME_VERSION 0, __MULTIPLE_RCPTS_CC_X2 0, __MULTIPLE_URI_TEXT 0, __NO_HTML_TAG_RAW 0, __REFERENCES 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_IN_BODY 0, __URI_NS , __URI_WITH_PATH 0, __USER_AGENT 0' From: Sakari Ailus CCP2, or CSI-1, is an older single data lane serial bus. Add core support neccessary for it. Signed-off-by: Sakari Ailus Signed-off-by: Ivaylo Dimitrov Signed-off-by: Pavel Machek --- include/media/v4l2-mediabus.h | 4 ++++ include/media/v4l2-of.h | 17 +++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/include/media/v4l2-mediabus.h b/include/media/v4l2-mediabus.h index 34cc99e..315c167 100644 --- a/include/media/v4l2-mediabus.h +++ b/include/media/v4l2-mediabus.h @@ -69,11 +69,15 @@ * @V4L2_MBUS_PARALLEL: parallel interface with hsync and vsync * @V4L2_MBUS_BT656: parallel interface with embedded synchronisation, can * also be used for BT.1120 + * @V4L2_MBUS_CSI1: MIPI CSI-1 serial interface + * @V4L2_MBUS_CCP2: CCP2 (Compact Camera Port 2) * @V4L2_MBUS_CSI2: MIPI CSI-2 serial interface */ enum v4l2_mbus_type { V4L2_MBUS_PARALLEL, V4L2_MBUS_BT656, + V4L2_MBUS_CSI1, + V4L2_MBUS_CCP2, V4L2_MBUS_CSI2, }; diff --git a/include/media/v4l2-of.h b/include/media/v4l2-of.h index 4dc34b2..63a52ee 100644 --- a/include/media/v4l2-of.h +++ b/include/media/v4l2-of.h @@ -53,6 +53,22 @@ struct v4l2_of_bus_parallel { }; /** + * struct v4l2_of_bus_csi1 - CSI-1/CCP2 data bus structure + * @clock_inv: polarity of clock/strobe signal + * false - not inverted, true - inverted + * @strobe: false - data/clock, true - data/strobe + * @data_lane: the number of the data lane + * @clock_lane: the number of the clock lane + */ +struct v4l2_of_bus_mipi_csi1 { + bool clock_inv; + bool strobe; + bool lane_polarity[2]; + unsigned char data_lane; + unsigned char clock_lane; +}; + +/** * struct v4l2_of_endpoint - the endpoint data structure * @base: struct of_endpoint containing port, id, and local of_node * @bus_type: bus type @@ -66,6 +82,7 @@ struct v4l2_of_endpoint { enum v4l2_mbus_type bus_type; union { struct v4l2_of_bus_parallel parallel; + struct v4l2_of_bus_mipi_csi1 mipi_csi1; struct v4l2_of_bus_mipi_csi2 mipi_csi2; } bus; u64 *link_frequencies;