From patchwork Thu May 17 12:50:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Miguel Silva X-Patchwork-Id: 136156 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp155658lji; Thu, 17 May 2018 05:51:25 -0700 (PDT) X-Google-Smtp-Source: AB8JxZprLLhqOo9N4iNuxfh7HN5ki+3tUxjJnrcc+flEjwXq7EkuylpBx4iSqq66dy9e8d154I1b X-Received: by 2002:a63:7503:: with SMTP id q3-v6mr3512257pgc.401.1526561485335; Thu, 17 May 2018 05:51:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526561485; cv=none; d=google.com; s=arc-20160816; b=w8zncEWgrbBYJfPr/GAFbnDec+S0ORCHuUTwZDG3kh1P0XOGWxid8KE9rB1OStHLb9 7aLcuqHR5hau+dI6T7vYzsUikTcx0BcJA8pL06C5H8DsatkD9g5c29l/KGAckO4knrdw HJjGHZwEh7XxqKU++gveV+ic9jRJcDx5iScX5blY5ZmYsEpfd4m6/7E5gJKwf6mQ+9Hg anO/EKLVUD1T7naFVkYt5NDSw5dL3xcRwOfdSO5l73QRJNfwKBwusQaBlnGHJBcCj6Mx 8+Y/QRUYD2Jj7xO6KYo4k4rmzTWcZpWXJqhriKArtmeXqv4uEu/LffJnNo5P4d2ppThk eYPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=ANpJvAPtVV34YI8zUfMJnWQmyBNJviqar4VGV4zfV50=; b=Gd0rMZa9Mw8FS+vAsEVR6C8RLjdH4huAVx7+FqbQoZOv85QWkM5kqUKe/lgcTAElzm U//MaKCWHgL2gNVDOvYHtG9cwivWvaCpiXjIf+ehtddnhQNd6DT7f6K2w7EiLXz5vxnH 7JEvlkH0DuCCywftjaZSOEI8if42AYxxTESMqrHgSPdJuCQPXiCCV2lhR8AAm2Jxp71N T3gHHc/Fk74QyXNIZZZDKDz3Odsykb5saEOpa0JtYligzzc2kFJ3fYRQCvhNI3sqaiKI cxGBawCK0xz+ZrNssb/01K/ftDqAgEe80tMoF0gwOm7D0ShXWdCmLP3N1HXWgECvfIrs ye7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=PwWvaaNh; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z1-v6si4876508plb.558.2018.05.17.05.51.25; Thu, 17 May 2018 05:51:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=PwWvaaNh; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752056AbeEQMvX (ORCPT + 5 others); Thu, 17 May 2018 08:51:23 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:43428 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752014AbeEQMvU (ORCPT ); Thu, 17 May 2018 08:51:20 -0400 Received: by mail-wr0-f196.google.com with SMTP id v15-v6so5559920wrm.10 for ; Thu, 17 May 2018 05:51:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=JDDmg65L5DHLCUA/G3FLLjml3EUrlWA6ao9uKs0hGv0=; b=PwWvaaNhnwTCi+TOHXs74nhCPbYaozr875mO7uglHOsozTfVqtpun7zhwRGNMhX1BE /SpYjy9cvncesdP37P86lCbwACqNv/Gj5Zuyx1vbETvv0HHtl9NimMtQDSggLl7OTJRl C/Y4c3GAPlDtGtfHg4lfQpQQtyxA+uS6PEiBc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=JDDmg65L5DHLCUA/G3FLLjml3EUrlWA6ao9uKs0hGv0=; b=XDbuuq2Y2CvkOq1eaM4LYGu8f5+13YXpHCdwOaAMPBfmavYQp5niKpcwcOTpYD/okf I+kn3RQIvczf+PiHCx8+vtUVkHcKN8qkxLOm4LOprB95ABEpGWGxbtEXDfxvcKSjShti xirnwV9a+JIB4QfHMMK6C3tsbLn3ReS1Ke6nHQlgatv1AziWSktG3adp3e6EtBfO9evu 8faiofXLPwNqulaiMl6E6dipXRmq+43GcEPPyiFJLHF/Kl6QR1kh4SRIyNXbfn7I4/Vr 4+d7uyQARap/N+n2Ujrtseh7I1yqagaopxVoGbWcQkUOIl3XDls/m/MtrfmNJGnwQ+ob T11Q== X-Gm-Message-State: ALKqPwfgO0DAifuUdx18PEHZcfncO63cy6WxncMxW5CC6H8ARkh3HYdT dev0klGR2u0XeeuQ1+NGOoZj9w== X-Received: by 2002:adf:c4a6:: with SMTP id m35-v6mr4215372wrf.103.1526561479113; Thu, 17 May 2018 05:51:19 -0700 (PDT) Received: from localhost.localdomain ([2001:8a0:6606:9100:b159:5390:182d:7dce]) by smtp.gmail.com with ESMTPSA id 33-v6sm6077665wrs.5.2018.05.17.05.51.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 May 2018 05:51:18 -0700 (PDT) From: Rui Miguel Silva To: mchehab@kernel.org, sakari.ailus@linux.intel.com, Steve Longerbeam , Philipp Zabel , Rob Herring Cc: linux-media@vger.kernel.org, devel@driverdev.osuosl.org, Shawn Guo , Fabio Estevam , devicetree@vger.kernel.org, Greg Kroah-Hartman , Ryan Harkin , Rui Miguel Silva Subject: [PATCH v4 11/12] media: imx7.rst: add documentation for i.MX7 media driver Date: Thu, 17 May 2018 13:50:32 +0100 Message-Id: <20180517125033.18050-12-rui.silva@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180517125033.18050-1-rui.silva@linaro.org> References: <20180517125033.18050-1-rui.silva@linaro.org> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add rst document to describe the i.MX7 media driver and also a working example from the Warp7 board usage with a OV2680 sensor. Signed-off-by: Rui Miguel Silva --- .../devicetree/bindings/media/imx7.txt | 20 --- Documentation/media/v4l-drivers/imx7.rst | 157 ++++++++++++++++++ Documentation/media/v4l-drivers/index.rst | 1 + 3 files changed, 158 insertions(+), 20 deletions(-) create mode 100644 Documentation/media/v4l-drivers/imx7.rst -- 2.17.0 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/Documentation/devicetree/bindings/media/imx7.txt b/Documentation/devicetree/bindings/media/imx7.txt index 161cff8e6442..a26372630377 100644 --- a/Documentation/devicetree/bindings/media/imx7.txt +++ b/Documentation/devicetree/bindings/media/imx7.txt @@ -1,26 +1,6 @@ Freescale i.MX7 Media Video Device ================================== -Video Media Controller node ---------------------------- - -This is the media controller node for video capture support. It is a -virtual device that lists the camera serial interface nodes that the -media device will control. - -Required properties: -- compatible : "fsl,imx7-capture-subsystem"; -- ports : Should contain a list of phandles pointing to camera - sensor interface port of CSI - -example: - -capture-subsystem { - compatible = "fsl,imx7-capture-subsystem"; - ports = <&csi>; -}; - - mipi_csi2 node -------------- diff --git a/Documentation/media/v4l-drivers/imx7.rst b/Documentation/media/v4l-drivers/imx7.rst new file mode 100644 index 000000000000..cd1195d391c5 --- /dev/null +++ b/Documentation/media/v4l-drivers/imx7.rst @@ -0,0 +1,157 @@ +i.MX7 Video Capture Driver +========================== + +Introduction +------------ + +The i.MX7 contrary to the i.MX5/6 family does not contain an Image Processing +Unit (IPU); because of that the capabilities to perform operations or +manipulation of the capture frames are less feature rich. + +For image capture the i.MX7 has three units: +- CMOS Sensor Interface (CSI) +- Video Multiplexer +- MIPI CSI-2 Receiver + +:: + |\ + MIPI Camera Input ---> MIPI CSI-2 --- > | \ + | \ + | M | + | U | ------> CSI ---> Capture + | X | + | / + Parallel Camera Input ----------------> | / + |/ + +For additional information, please refer to the latest versions of the i.MX7 +reference manual [#f1]_. + +Entities +-------- + +imx7-mipi-csi2 +-------------- + +This is the MIPI CSI-2 receiver entity. It has one sink pad to receive the pixel +data from MIPI CSI-2 camera sensor. It has one source pad, corresponding to the +virtual channel 0. This module is compliant to previous version of Samsung +D-phy, and supports two D-PHY Rx Data lanes. + +csi_mux +------- + +This is the video multiplexer. It has two sink pads to select from either camera +sensor with a parallel interface or from MIPI CSI-2 virtual channel 0. It has +a single source pad that routes to the CSI. + +csi +--- + +The CSI enables the chip to connect directly to external CMOS image sensor. CSI +can interface directly with Parallel and MIPI CSI-2 buses. It has 256 x 64 FIFO +to store received image pixel data and embedded DMA controllers to transfer data +from the FIFO through AHB bus. + +This entity has one sink pad that receives from the csi_mux entity and a single +source pad that routes video frames directly to memory buffers. This pad is +routed to a capture device node. + +Usage Notes +----------- + +To aid in configuration and for backward compatibility with V4L2 applications +that access controls only from video device nodes, the capture device interfaces +inherit controls from the active entities in the current pipeline, so controls +can be accessed either directly from the subdev or from the active capture +device interface. For example, the sensor controls are available either from the +sensor subdevs or from the active capture device. + +Warp7 with OV2680 +----------------- + +On this platform an OV2680 MIPI CSI-2 module is connected to the internal MIPI +CSI-2 receiver. The following example configures a video capture pipeline with +an output of 800x600, and BGGR 10 bit bayer format: + +.. code-block:: none + # Setup links + media-ctl -l "'ov2680 1-0036':0 -> 'imx7-mipi-csis.0':0[1]" + media-ctl -l "'imx7-mipi-csis.0':1 -> 'csi_mux':1[1]" + media-ctl -l "'csi_mux':2 -> 'csi':0[1]" + media-ctl -l "'csi':1 -> 'csi capture':0[1]" + + # Configure pads for pipeline + media-ctl -V "'ov2680 1-0036':0 [fmt:SBGGR10_1X10/800x600 field:none]" + media-ctl -V "'csi_mux':1 [fmt:SBGGR10_1X10/800x600 field:none]" + media-ctl -V "'csi_mux':2 [fmt:SBGGR10_1X10/800x600 field:none]" + media-ctl -V "'imx7-mipi-csis.0':0 [fmt:SBGGR10_1X10/800x600 field:none]" + media-ctl -V "'csi':0 [fmt:SBGGR10_1X10/800x600 field:none]" + +After this streaming can start. The v4l2-ctl tool can be used to select any of +the resolutions supported by the sensor. + +.. code-block:: none + root@imx7s-warp:~# media-ctl -p + Media controller API version 4.17.0 + + Media device information + ------------------------ + driver imx-media + model imx-media + serial + bus info + hw revision 0x0 + driver version 4.17.0 + + Device topology + - entity 1: csi (2 pads, 2 links) + type V4L2 subdev subtype Unknown flags 0 + device node name /dev/v4l-subdev0 + pad0: Sink + [fmt:SBGGR10_1X10/800x600 field:none] + <- "csi_mux":2 [ENABLED] + pad1: Source + [fmt:SBGGR10_1X10/800x600 field:none] + -> "csi capture":0 [ENABLED] + + - entity 4: csi capture (1 pad, 1 link) + type Node subtype V4L flags 0 + device node name /dev/video0 + pad0: Sink + <- "csi":1 [ENABLED] + + - entity 10: csi_mux (3 pads, 2 links) + type V4L2 subdev subtype Unknown flags 0 + device node name /dev/v4l-subdev1 + pad0: Sink + [fmt:unknown/0x0] + pad1: Sink + [fmt:unknown/800x600 field:none] + <- "imx7-mipi-csis.0":1 [ENABLED] + pad2: Source + [fmt:unknown/800x600 field:none] + -> "csi":0 [ENABLED] + + - entity 14: imx7-mipi-csis.0 (2 pads, 2 links) + type V4L2 subdev subtype Unknown flags 0 + device node name /dev/v4l-subdev2 + pad0: Sink + [fmt:SBGGR10_1X10/800x600 field:none] + <- "ov2680 1-0036":0 [ENABLED] + pad1: Source + [fmt:SBGGR10_1X10/800x600 field:none] + -> "csi_mux":1 [ENABLED] + + - entity 17: ov2680 1-0036 (1 pad, 1 link) + type V4L2 subdev subtype Sensor flags 0 + device node name /dev/v4l-subdev3 + pad0: Source + [fmt:SBGGR10_1X10/800x600 field:none] + -> "imx7-mipi-csis.0":0 [ENABLED] + + +References +---------- + +.. [#f1] https://www.nxp.com/docs/en/reference-manual/IMX7SRM.pdf diff --git a/Documentation/media/v4l-drivers/index.rst b/Documentation/media/v4l-drivers/index.rst index 679238e786a7..693295bbc53f 100644 --- a/Documentation/media/v4l-drivers/index.rst +++ b/Documentation/media/v4l-drivers/index.rst @@ -44,6 +44,7 @@ For more details see the file COPYING in the source distribution of Linux. davinci-vpbe fimc imx + imx7 ivtv max2175 meye