From patchwork Tue Feb 14 13:39:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Machek X-Patchwork-Id: 9572013 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id ADE606045F for ; Tue, 14 Feb 2017 13:42:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A059E27F4B for ; Tue, 14 Feb 2017 13:42:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 94A4527FA8; Tue, 14 Feb 2017 13:42:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4828027F4B for ; Tue, 14 Feb 2017 13:42:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753963AbdBNNj4 (ORCPT ); Tue, 14 Feb 2017 08:39:56 -0500 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:59061 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753078AbdBNNj3 (ORCPT ); Tue, 14 Feb 2017 08:39:29 -0500 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id BE363817C9; Tue, 14 Feb 2017 14:39:26 +0100 (CET) Date: Tue, 14 Feb 2017 14:39:25 +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: [RFC 01/13] Core changes for CCP2/CSI1 support. Message-ID: <20170214133925.GA8421@amd> MIME-Version: 1.0 Content-Disposition: inline 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-Virus-Scanned: ClamAV using ClamSMTP 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;