Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2367245rdg; Mon, 16 Oct 2023 02:02:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGvEyqCVLNTPFlwUFxVRjbDRMdo1DSgR4PpRi7B25SLMn71Dkle1/JoM7PBZazdOg+DsZiA X-Received: by 2002:a05:6a00:1f09:b0:69f:261:ae1e with SMTP id be9-20020a056a001f0900b0069f0261ae1emr10741867pfb.6.1697446934944; Mon, 16 Oct 2023 02:02:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697446934; cv=none; d=google.com; s=arc-20160816; b=AuxHHApDMj3cMKM20ZvQVy7SEGTTQOjieryTl45yTHbgVeo6jG0w8MovikFySyVoaY 5Ygg7KSTUGvswJEbmmdnPeb8KcTTWhSVz+PwL4S2897d0YOWQnL5TKy1Ya7oYbsMTf0o aSVkYOEnxGB2f47GRur10QfpGegrJCiz4Sn/QxxtsI3RVewQbQfOdVEHM4yqdOaiILXB 9OMVXl+CXbJWiBm4oGDm54KU/iAiiec8KsEeAuQn+mdsnHlBjvbeBCE8wa6adQeTucgK 42OjCXN/N2wedpx7piDP50q3Zckj5IEV7NOBkDMTgPkGCH/w1jqvtJ9Of7UVTE+nEx6r C8Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=R7Cz4gMkKtHSEbn9b4AaEiwai8L2LYY05rNv81sPeAU=; fh=/ps7i0a5eTmc6YnKJAsVAP2Hb/L4Lzk0k1UNSKUlUHs=; b=HMwEHPPiym7facny1uMg/XCE6EWuZ3cNE6Rf8GdDwhNUj+Z+ZV1IxsCt/vxMk+eYBA bgM88VAuEFAwcv+RxjJ+FxorM2r5XcU6H5Wdym18W3quR5HtFTZ6KDrI3Q9/8aqjsMXP KfRxMJdHDDhO8kuG/vtNc5fvL1a2CUFuJBGEKr5FfVZwVjQ4stqDGpSDv/vXTu5QYIpL jyIYI+WxbnHnm+GcpTIH3uAbvQAGGmti6Z1Uk2lGkWyXapvZ1z1eg3Hvc3wi30hhJXE6 FRB6h24qWWm5TZ/Kb3osLQ6Eo3pRCO9jlWITfOFO7irsxyR2hqsZkjznOl46hEnQooLS A8rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=C17z9Rr2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id l184-20020a6391c1000000b005ac13df150dsi6297529pge.384.2023.10.16.02.02.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 02:02:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=C17z9Rr2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 7CF95807BEF8; Mon, 16 Oct 2023 02:00:54 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232903AbjJPJAk (ORCPT + 99 others); Mon, 16 Oct 2023 05:00:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233112AbjJPJAi (ORCPT ); Mon, 16 Oct 2023 05:00:38 -0400 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 529E7F7; Mon, 16 Oct 2023 02:00:35 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id 77386FF821; Mon, 16 Oct 2023 09:00:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1697446833; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=R7Cz4gMkKtHSEbn9b4AaEiwai8L2LYY05rNv81sPeAU=; b=C17z9Rr2WN4k6+gn1+GPlFPBLsKWBEQ9EcaWIB7lDUVaeIzBU1RC8SEEyzxyPE2/D5Qnpu E7NCn8X7ALrMVgILvDtYu8syu1QDnbBQGNTxSoWJVGlGVgc92aO1+Vy6IwQg30R5ewJ0vA SVlpDEitLpIJQyv578V+VVnvXJWYvyntyrCT0V5oUmsxzsyV3vqoNHiaL4Pkb0xO6uiO7v FqhZh3ICd0wvCdKduZhGre9tsezq7UAmgi2wUSq3d8tjPNe+SdmCQaBwgLcm39Clb3Petd YkxDIrb8DsKtTvbmyqSFzpatWJSWN1yg75KFEq//pbkmEfKJNqyVyER3gz+alg== From: Mehdi Djait To: mchehab@kernel.org, heiko@sntech.de, hverkuil-cisco@xs4all.nl, krzysztof.kozlowski+dt@linaro.org, robh+dt@kernel.org, conor+dt@kernel.org, ezequiel@vanguardiasur.com.ar Cc: linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, alexandre.belloni@bootlin.com, maxime.chevallier@bootlin.com, paul.kocialkowski@bootlin.com, Mehdi Djait Subject: [PATCH v8 0/3] media: rockchip: Add a driver for Rockchip's camera interface Date: Mon, 16 Oct 2023 11:00:02 +0200 Message-ID: X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-GND-Sasl: mehdi.djait@bootlin.com X-Spam-Status: No, score=1.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, PDS_OTHER_BAD_TLD,SPF_HELO_NONE,SPF_PASS,URI_HEX autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 16 Oct 2023 02:00:54 -0700 (PDT) X-Spam-Level: * Hello everyone, V8 for basic support of the Video Input Processor found on the Rockchip PX30 SoC The v6 is based on the fifth iteration of the series introducing the driver: sent 29 Dec 2020 [1] Most of this driver was written following the BSP driver from rockchip, removing the parts that either didn't fit correctly the guidelines, or that couldn't be tested. In the BSP, this driver is known as the "cif" driver, but this was renamed to "vip" to better fit the controller denomination in the datasheet. This version of the driver supports ONLY the parallel interface BT656 and was tested/implemented using an SDTV video decoder media_tree, base-commit: 2c1bae27df787c9535e48cc27bbd11c3c3e0a235 V7 => V8: vip/capture.c: - fixed a warning: unused variable reported by the kernel test robot V6 => V7: vip/capture.c vip/dev.c vip/dev.h - renamed all struct rk_vip_dev dev => struct rk_vip_dev vip_dev - added some error when rk_vip_get_buffer() returns NULL - removed a WARN_ON - made the irq NOT shared - dropped of_match_ptr - added the rk_vip_get_resource() function rockchip,px30-vip.yaml: - changed filename to match the compatible - dropped the mention of the other rockchip SoC in the dt-binding description and added a more detailed description of VIP - removed unused labels in the example V5 [1] => V6: vip/capture.c vip/dev.c vip/dev.h - added a video g_input_status subdev call, V4L2_IN_CAP_STD and the supported stds in rk_vip_enum_input callback - added rk_vip_g_std, rk_vip_s_std and rk_vip_querystd callbacks - added the supported video_device->tvnorms - s_std will now update the format as this depends on the standard NTSC/PAL (as suggested by Hans in [1]) - removed STD_ATSC - moved the colorimetry information to come from the subdev - removed the core s_power subdev calls - dropped cropping in rk_vip_stream struct rockchip-vip.yaml: - fixed a mistake in the name of third clock plckin -> plck - changed the reg maxItems 2 -> 1 [1] https://lore.kernel.org/linux-media/20201229161724.511102-1-maxime.chevallier@bootlin.com/ I used v4l-utils with HEAD: commit 1ee258e5bb91a12df378e19eb255c5219d6bc36b # v4l2-compliance v4l2-compliance 1.25.0, 64 bits, 64-bit time_t Compliance test for rk_vip device /dev/video0: Driver Info: Driver name : rk_vip Card type : rk_vip Bus info : platform:ff490000.vip Driver version : 6.6.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 : rk_vip Model : rk_vip Serial : Bus info : platform:ff490000.vip Media version : 6.6.0 Hardware revision: 0x00000000 (0) Driver version : 6.6.0 Interface Info: ID : 0x03000002 Type : V4L Video Entity Info: ID : 0x00000001 (1) Name : video_rkvip Function : V4L2 I/O Pad 0x01000004 : 0: Sink Link 0x02000009: from remote pad 0x1000006 of entity 'tw9900 2-0044' (Digital Video Decoder): Data, Enabled Required ioctls: test MC information (see 'Media Driver Info' above): OK test VIDIOC_QUERYCAP: OK test invalid ioctls: 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 (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 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 (Not Supported) 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 rk_vip device /dev/video0: 46, Succeeded: 46, Failed: 0, Warnings: 0 Mehdi Djait (3): media: dt-bindings: media: add bindings for Rockchip VIP media: rockchip: Add a driver for Rockhip's camera interface arm64: dts: rockchip: Add the camera interface .../bindings/media/rockchip,px30-vip.yaml | 93 ++ arch/arm64/boot/dts/rockchip/px30.dtsi | 12 + drivers/media/platform/rockchip/Kconfig | 1 + drivers/media/platform/rockchip/Makefile | 1 + drivers/media/platform/rockchip/vip/Kconfig | 14 + drivers/media/platform/rockchip/vip/Makefile | 3 + drivers/media/platform/rockchip/vip/capture.c | 1210 +++++++++++++++++ drivers/media/platform/rockchip/vip/dev.c | 346 +++++ drivers/media/platform/rockchip/vip/dev.h | 163 +++ drivers/media/platform/rockchip/vip/regs.h | 260 ++++ 10 files changed, 2103 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/rockchip,px30-vip.yaml create mode 100644 drivers/media/platform/rockchip/vip/Kconfig create mode 100644 drivers/media/platform/rockchip/vip/Makefile create mode 100644 drivers/media/platform/rockchip/vip/capture.c create mode 100644 drivers/media/platform/rockchip/vip/dev.c create mode 100644 drivers/media/platform/rockchip/vip/dev.h create mode 100644 drivers/media/platform/rockchip/vip/regs.h -- 2.41.0