Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10434096ybi; Thu, 11 Jul 2019 05:17:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqz6rLk+99jJlRY0zNKi2N5kZqqE+jFDGlE9Qpkgni/hMdeP87X4sfL/U+EAb18QtZWt9IBf X-Received: by 2002:a63:d4c:: with SMTP id 12mr4254892pgn.30.1562847429396; Thu, 11 Jul 2019 05:17:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562847429; cv=none; d=google.com; s=arc-20160816; b=tUIfodBixzYNmOzP3O1Zz62qJFMAkoo97DEN2XwsO/WcKeydhNnKyTLw8Hf/W2qv0B T6DQfLlBt2oYo7iHDhA2DEbJrphLjKcyFUjY8Ok40TXjTrPE5xpG60qvuHgliwXcG4Tr cL+qhI/MYvQZbnTKeYciADY6UUas9vAPtO8x94QFqpHG/CMu51ZBSWufpcU5cadSh+K0 3hEeRah+3PLF557rBGwLUDJP9Pb+fwGJf6AVmsZdCuzV/gB31gzpHllRLKnfSVDZ7Jps Shabf3da1PTVFXXxkxb/RtexLjRKW3XVSk4XiiUBLJ2hk2dV0nVATbSLAMYqI3sDiILX bhow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=89VX47cC+g8Eouilz/O7MRmyYnhZqPKJE7y8TErmoyo=; b=JvLp8EoJUjyq20V0bzmPBZudS4IiKdBw0sX0espWl/CrTBx6TAzWQAsXQumHck6W0R Hp5XyUdsnaBHRVkP7y36xb0aqSb3Ss1F1+0JKGGkPVGFlP8Mr5RFhsiwRW/pYuIIRGsI d48lGtm2pAZUlfLswnZpUj71A3xT8hzj5WPCXzgZ1mWbl6IobGZqcOPUz2kPOxVmeabk Waq7iTysTtdmHp+g0x89Z9zqy9auPVMlE/ZFu/VwfphwJIY9zHOZJhavJ4SXiYXYZJpI JUDK1yLkZfIw9/+Nw0ayFLDqX7FJ9NnJg5XHDEbY57mDGPk2TmTTLU9RhYyk43uMOggn 3d5w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id az12si4792363plb.5.2019.07.11.05.16.50; Thu, 11 Jul 2019 05:17:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727974AbfGKMPR (ORCPT + 99 others); Thu, 11 Jul 2019 08:15:17 -0400 Received: from relay12.mail.gandi.net ([217.70.178.232]:47167 "EHLO relay12.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725934AbfGKMPQ (ORCPT ); Thu, 11 Jul 2019 08:15:16 -0400 Received: from localhost (lfbn-1-17395-211.w86-250.abo.wanadoo.fr [86.250.200.211]) (Authenticated sender: maxime.ripard@bootlin.com) by relay12.mail.gandi.net (Postfix) with ESMTPSA id F105820000B; Thu, 11 Jul 2019 12:15:10 +0000 (UTC) From: Maxime Ripard To: Hans Verkuil , Sakari Ailus , Mauro Carvalho Chehab Cc: Thomas Petazzoni , Laurent Pinchart , linux-media@vger.kernel.org, Chen-Yu Tsai , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Mark Rutland , Rob Herring , Frank Rowand , Maxime Ripard Subject: [PATCH v6 0/5] media: Allwinner A10 CSI support Date: Thu, 11 Jul 2019 14:15:02 +0200 Message-Id: X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Here is a series introducing the support for the A10 (and SoCs of the same generation) CMOS Sensor Interface (called CSI, not to be confused with MIPI-CSI, which isn't support by that IP). That interface is pretty straightforward, but the driver has a few issues that I wanted to bring up: * The only board I've been testing this with has an ov5640 sensor attached, which doesn't work with the upstream driver. Copying the Allwinner init sequence works though, and this is how it has been tested. Testing with a second sensor would allow to see if it's an issue on the CSI side or the sensor side. * We don't have support for the ISP at the moment, but this can be added eventually. Here is the v4l2-compliance output (commit f61132e81d79 of v4l-utils), and after running media-ctl -d /dev/media1 -v --set-v4l2 "'ov5640 1-0021':0 [fmt:YUYV8_2X8/640x4 80 field:none]" Compliance test for device /dev/video1: Driver Info: Driver name : sun4i_csi Card type : sun4i-csi Bus info : platform:1c09000.csi Driver version : 5.2.0 Capabilities : 0x84201000 Video Capture Multiplanar Streaming Extended Pix Format Device Capabilities Device Caps : 0x04201000 Video Capture Multiplanar Streaming Extended Pix Format Media Driver Info: Driver name : sun4i-csi Model : Allwinner Video Capture Device Serial : Bus info : Media version : 5.2.0 Hardware revision: 0x00000000 (0) Driver version : 5.2.0 Interface Info: ID : 0x03000008 Type : V4L Video Entity Info: ID : 0x00000006 (6) Name : sun4i_csi Function : V4L2 I/O Pad 0x01000007 : 0: Sink, Must Connect Link 0x0200000a: from remote pad 0x1000005 of entity 'sun4i-csi-0': 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/video1 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 (Not Supported) 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 (Not Supported) test VIDIOC_QUERYCTRL: OK (Not Supported) test VIDIOC_G/S_CTRL: OK (Not Supported) test VIDIOC_G/S/TRY_EXT_CTRLS: OK (Not Supported) test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK (Not Supported) test VIDIOC_G/S_JPEGCOMP: OK (Not Supported) Standard Controls: 0 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 input 0: Streaming ioctls: test read/write: OK (Not Supported) test blocking wait: OK test MMAP: OK test USERPTR: OK (Not Supported) test DMABUF: OK (Not Supported) Total: 49, Succeeded: 49, Failed: 0, Warnings: 0 Let me know what you think, Maxime Changes from v5: - Add link_validate/get_fmt/set_fmt/enum_mbus_code to the subdevice - Create a device file for the subdevice - Add link_validate to the video device - Remove the storage of both the v4l2_pix_format_mplane structure and the sun4i_csi_format structure, since the latter can be retrieved easily from the former, and this is actually needed in a single place. - Fix the copyright year notice Changes from v4: - Created an intermediate sub-device Changes from v3: - Rebased on v5.1-rc - Fixed the YAML binding according to Rob's review Changes from v2: - Address a few minors comments on the error path, the return type of some functions, the type of some variables - Disable the device if the subdev call fails in start_streaming - Use __maybe_unused and SET_RUNTIME_PM_OPS for the runtime PM hooks - Call media_device_cleanup in the remove function - Add a dependency on the subdev API and the common clock framework - Fix the MAINTAINERS entry to point to the yaml file - Add the of graph bindings to the YAML schemas - Rebase on next Changes from v1: - Make sure it's compliant with a much newer v4l2-compliance - Conversion of the DT bindings to a JSON schema - Drop the vendor properties and use a separate compatible instead - Fix an issue on the last frame where we would not have any buffer queued and would report an error by using a scratch buffer - Fix the warnings reported by v4l2-compliance - Rebase on top of 5.0-rc1 - Added a MAINTAINERS entry - Switched to strscpy - Fixed SPDX header Maxime Ripard (5): dt-bindings: media: Add Allwinner A10 CSI binding media: sunxi: Refactor the Makefile and Kconfig media: sunxi: Add A10 CSI driver ARM: dts: sun7i: Add CSI0 controller DO NOT MERGE: ARM: dts: bananapi: Add Camera support Documentation/devicetree/bindings/media/allwinner,sun4i-a10-csi.yaml | 94 +++++++++++++++- MAINTAINERS | 8 +- arch/arm/boot/dts/sun7i-a20-bananapi.dts | 91 +++++++++++++++- arch/arm/boot/dts/sun7i-a20.dtsi | 11 ++- drivers/media/platform/Kconfig | 2 +- drivers/media/platform/Makefile | 2 +- drivers/media/platform/sunxi/Kconfig | 2 +- drivers/media/platform/sunxi/Makefile | 2 +- drivers/media/platform/sunxi/sun4i-csi/Kconfig | 11 ++- drivers/media/platform/sunxi/sun4i-csi/Makefile | 5 +- drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c | 358 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.h | 160 ++++++++++++++++++++++++++- drivers/media/platform/sunxi/sun4i-csi/sun4i_dma.c | 444 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- drivers/media/platform/sunxi/sun4i-csi/sun4i_v4l2.c | 374 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 14 files changed, 1562 insertions(+), 2 deletions(-) create mode 100644 Documentation/devicetree/bindings/media/allwinner,sun4i-a10-csi.yaml create mode 100644 drivers/media/platform/sunxi/Kconfig create mode 100644 drivers/media/platform/sunxi/Makefile create mode 100644 drivers/media/platform/sunxi/sun4i-csi/Kconfig create mode 100644 drivers/media/platform/sunxi/sun4i-csi/Makefile create mode 100644 drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c create mode 100644 drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.h create mode 100644 drivers/media/platform/sunxi/sun4i-csi/sun4i_dma.c create mode 100644 drivers/media/platform/sunxi/sun4i-csi/sun4i_v4l2.c base-commit: 954795a7a486911e6239af3f084f636bffe1d5a4 -- git-series 0.9.1