From patchwork Fri Aug 28 13:17:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?S8OpdmluIEwnaMO0cGl0YWw=?= X-Patchwork-Id: 11742789 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BBD5D913 for ; Fri, 28 Aug 2020 13:19:47 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 84787207DF for ; Fri, 28 Aug 2020 13:19:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="USAMJUwD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 84787207DF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=pLif3+7vNmrahdZOJlnZGMS1E2QkXGX6fFhuq7bSLns=; b=USAMJUwDn3GzCc+vcILeAt0878 esv3SqP+C4HO7sipBc2pvSudtY+mJZSwSFk8co4ZCDTXdQruv7lTYgMq2jR2SpxChmvb7QFTOA0AR A91Tcmta4nkHv5CoOjUaRpcSUsQYrmwxloAc/x3Sz+HIKGF1/AUWzbH6mLxAsvO0o2zOs0ko/1y+o ItsIAb70Ix2gmSnY7oItHLaiJf18fyoZnq2buuFFbZrm8QQtZqs+x2+qbqESEFpzv9ex3QD4uTzJH sDKVSpIQPLMQFi+2sGxXv5xJjJlNqdW+XMZY6/c5PPmMtyrlTcwNQWnW+gZEeK9GHHPRlYgerOJSU GbkioDfQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBeGK-0004bT-AP; Fri, 28 Aug 2020 13:17:48 +0000 Received: from relay9-d.mail.gandi.net ([217.70.183.199]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBeGG-0004Ye-U3 for linux-arm-kernel@lists.infradead.org; Fri, 28 Aug 2020 13:17:46 +0000 X-Originating-IP: 90.89.180.255 Received: from lhopital-XPS-13-9360.home (lfbn-tou-1-1372-bdcst.w90-89.abo.wanadoo.fr [90.89.180.255]) (Authenticated sender: kevin.lhopital@bootlin.com) by relay9-d.mail.gandi.net (Postfix) with ESMTPA id D82D9FF80B; Fri, 28 Aug 2020 13:17:38 +0000 (UTC) From: =?utf-8?b?S8OpdmluIEwnaMO0cGl0YWw=?= To: linux-media@vger.kernel.org Subject: [PATCH v2 0/4] Support of MIPI CSI-2 for A83T Date: Fri, 28 Aug 2020 15:17:32 +0200 Message-Id: <20200828131737.12483-1-kevin.lhopital@bootlin.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200828_091745_220792_68928647 X-CRM114-Status: GOOD ( 13.84 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [217.70.183.199 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [217.70.183.199 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, devicetree@vger.kernel.org, p.zabel@pengutronix.de, thomas.petazzoni@bootlin.com, =?utf-8?b?S8OpdmluIEwnaMO0cGl0YWw=?= , linux-kernel@vger.kernel.org, mripard@kernel.org, sakari.ailus@linux.intel.com, paul.kocialkowski@bootlin.com, wens@csie.org, robh+dt@kernel.org, hans.verkuil@cisco.com, yong.deng@magewell.com, mchehab+samsung@kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org This series adds the support for the MIPI CSI-2 controller for the A83T SoC. The CSI controller is the same as the V3s SoC that's why I put the A83T MIPI CSI-2 driver in sun6i-csi. My work is based on the Allwinner BSP for A83T and also on MIPI CSI-2 specification for the A83T given by Allwinner. v4l2-compliance SHA: not available, 32 bits Compliance test for sun6i-video device /dev/video0: Driver Info: Driver name : sun6i-video Card type : sun6i-csi Bus info : platform:camera Driver version : 5.5.0 Capabilities : 0x84200001 Video Capture Streaming Extended Pix Format Device Capabilities Device Caps : 0x04200001 Video Capture Streaming Extended Pix Format Media Driver Info: Driver name : sun6i-csi Model : Allwinner Video Capture Device Serial : Bus info : Media version : 5.5.0 Hardware revision: 0x00000000 (0) Driver version : 5.5.0 Interface Info: ID : 0x03000003 Type : V4L Video Entity Info: ID : 0x00000001 (1) Name : sun6i-csi Function : V4L2 I/O Pad 0x01000002 : 0: Sink, Must Connect Link 0x02000007: from remote pad 0x1000006 of entity 'ov8865 1-0036': Data, Enabled, Immutable Required ioctls: test MC information (see 'Media Driver Info' above): OK test VIDIOC_QUERYCAP: OK Allow for multiple opens: test second /dev/video0 open: OK test VIDIOC_QUERYCAP: OK test VIDIOC_G/S_PRIORITY: OK test for unlimited opens: OK Debug ioctls: test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported) test VIDIOC_LOG_STATUS: OK Input ioctls: test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported) test VIDIOC_G/S_FREQUENCY: OK (Not Supported) test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported) test VIDIOC_ENUMAUDIO: OK (Not Supported) test VIDIOC_G/S/ENUMINPUT: OK test VIDIOC_G/S_AUDIO: OK (Not Supported) Inputs: 1 Audio Inputs: 0 Tuners: 0 Output ioctls: test VIDIOC_G/S_MODULATOR: OK (Not Supported) test VIDIOC_G/S_FREQUENCY: OK (Not Supported) test VIDIOC_ENUMAUDOUT: OK (Not Supported) test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported) test VIDIOC_G/S_AUDOUT: OK (Not Supported) Outputs: 0 Audio Outputs: 0 Modulators: 0 Input/Output configuration ioctls: test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported) test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported) test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported) test VIDIOC_G/S_EDID: OK (Not Supported) Control ioctls (Input 0): test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK test VIDIOC_QUERYCTRL: OK test VIDIOC_G/S_CTRL: OK test VIDIOC_G/S/TRY_EXT_CTRLS: OK test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK test VIDIOC_G/S_JPEGCOMP: OK (Not Supported) Standard Controls: 7 Private Controls: 0 Format ioctls (Input 0): test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK test VIDIOC_G/S_PARM: OK (Not Supported) test VIDIOC_G_FBUF: OK (Not Supported) test VIDIOC_G_FMT: OK test VIDIOC_TRY_FMT: OK test VIDIOC_S_FMT: OK test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported) test Cropping: OK (Not Supported) test Composing: OK (Not Supported) test Scaling: OK Codec ioctls (Input 0): test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported) test VIDIOC_G_ENC_INDEX: OK (Not Supported) test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported) Buffer ioctls (Input 0): test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK test VIDIOC_EXPBUF: OK test Requests: OK (Not Supported) Total for sun6i-video device /dev/video0: 45, Succeeded: 45, Failed: 0, Warnings: 0 Changes since V1: - Add more details in the cover letter. - Add a test to get the clocks to avoid an error for the platform without MIPI CSI-2. - Add more details in the register assignations. - Removed the support of multiple virtual channels because there is only one channel support in the CSI driver. Kévin L'hôpital (4): media: sun6i-csi: Fix the bpp for 10-bit bayer formats media: sunxi: sun6i-csi: Move the sun6i_csi_dev structure to the common header media: sunxi: sun6i-csi: Add support of MIPI CSI-2 for A83T ARM: dts: sun8i: a83t: Add support for the MIPI CSI-2 in CSI node arch/arm/boot/dts/sun8i-a83t.dtsi | 11 +- .../media/platform/sunxi/sun6i-csi/Makefile | 2 +- .../platform/sunxi/sun6i-csi/sun6i_csi.c | 96 +++++--- .../platform/sunxi/sun6i-csi/sun6i_csi.h | 14 +- .../sunxi/sun6i-csi/sun8i_a83t_dphy.c | 39 ++++ .../sunxi/sun6i-csi/sun8i_a83t_dphy.h | 16 ++ .../sunxi/sun6i-csi/sun8i_a83t_dphy_reg.h | 39 ++++ .../sunxi/sun6i-csi/sun8i_a83t_mipi_csi2.c | 217 ++++++++++++++++++ .../sunxi/sun6i-csi/sun8i_a83t_mipi_csi2.h | 16 ++ .../sun6i-csi/sun8i_a83t_mipi_csi2_reg.h | 179 +++++++++++++++ 10 files changed, 595 insertions(+), 34 deletions(-) create mode 100644 drivers/media/platform/sunxi/sun6i-csi/sun8i_a83t_dphy.c create mode 100644 drivers/media/platform/sunxi/sun6i-csi/sun8i_a83t_dphy.h create mode 100644 drivers/media/platform/sunxi/sun6i-csi/sun8i_a83t_dphy_reg.h create mode 100644 drivers/media/platform/sunxi/sun6i-csi/sun8i_a83t_mipi_csi2.c create mode 100644 drivers/media/platform/sunxi/sun6i-csi/sun8i_a83t_mipi_csi2.h create mode 100644 drivers/media/platform/sunxi/sun6i-csi/sun8i_a83t_mipi_csi2_reg.h