Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp128784rdg; Tue, 10 Oct 2023 06:16:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEMtwONyR+jK+hspczCjisrN7cyhUJKBPdjc9sXBESkER3IZtcXMwqvqXrzhD0Lgw8As4SE X-Received: by 2002:a05:6a20:3213:b0:172:913c:ba37 with SMTP id hl19-20020a056a20321300b00172913cba37mr631844pzc.38.1696943780357; Tue, 10 Oct 2023 06:16:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696943780; cv=none; d=google.com; s=arc-20160816; b=UQMALGiSXz535gxbZAKg7UJaKhatLV2C8D7Nno+x3eyozgGTiqgwggYJimUz6Qx/+6 g4V9sGdfYcQfWD+7KoGgWmA+E3ihwOjfJFCt7cI9FJa/RIR+RnDGHYXOllvakC5448ev 1OXoEwP/xaHLlp3vGj/faRd/EUhwv73Oy/9tT8lmH+/ujmY3M+otG+V2KiPWshMQyCRw teAmvuot3cin0W/CqY3B6pI0UHMa1dZJBcHGkgFm1SlFZFUwHbTmoFAX/Vh9g9by6S3t uWNzhCEoyXqeYujDTEk/0BWihc/boDHZI5LxWY88idDcomWbCNvJ/djrEeiX2aFtIzS+ t2zg== 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=92wkF1+OZ59KpGfmZnu+Vkwq3nyi9bpMP5C9cBgIJ40=; fh=/ps7i0a5eTmc6YnKJAsVAP2Hb/L4Lzk0k1UNSKUlUHs=; b=rcjfujjjHuJ3SC6AhYL8S7de1dGXwAbpVDTeqeNgNQdaxSt0CEJlhvUXIjaWOGORoY J5atnFXfUFadecIrGD36WOesfnHb6+2kNxSi/vPGkSPGYbYyTSmJjvzw0A2XDIjjZ57+ cnxHv4I2zbbrVB5cD4r0Oy/a38yWHPW5m67sSWAhicfEmiyvLxdlK0YTpVgPQAhTOv44 2TvSZvyiKn2WTHrO9iEnaVXa6qwXmPd8s7PGUOtEtpmSFZF/oFJlnQYqo7T6TmN4u0F/ +cnoWGtpQtHijhV+j8epEwSyk5jx8sp/89h4QeM6EFANHqzR3B8ekNnP3OrEq5hx/yXz flqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=TDTcfbPR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id b6-20020a056a00114600b00690cd91cee7si9849723pfm.287.2023.10.10.06.16.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 06:16:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=TDTcfbPR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id A0DFB808E0FF; Tue, 10 Oct 2023 06:16:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229508AbjJJNPR (ORCPT + 99 others); Tue, 10 Oct 2023 09:15:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229887AbjJJNPQ (ORCPT ); Tue, 10 Oct 2023 09:15:16 -0400 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::223]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE738C4; Tue, 10 Oct 2023 06:15:12 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id 3411F60008; Tue, 10 Oct 2023 13:15:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1696943711; 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=92wkF1+OZ59KpGfmZnu+Vkwq3nyi9bpMP5C9cBgIJ40=; b=TDTcfbPRYcq2ABod+88AfBi7oWWhg5p1YVGQOEvORwmGW9xQrDB2jd9hwGqnSKOIuEbaKU xF9wFfCh5taO3Pln75Zb1vkAwMMUoEYjdflG60yoPNSj4MUsFvmBWsZP7IIDs3pOip1D5C CawgeuZKa9GL8mEtGB2qSLrimhfhLEJ17m9wvAox3aB7gtZp6Hqq6fyZM0DdDov8uOlKbK iH2z6ymK7/Q2m9HFckMTITx1DMxnWCbL4WaXsZE4/w/IFzk63SngqGKrUYCNBKlREvCFwP lOBGZcCir6K/u06MqP/dvAw/fGeQxHUHi4PTJbHpv8JhIFBICrc3ct8f5ZcHfg== 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 v7 0/3] media: rockchip: Add a driver for Rockchip's camera interface Date: Tue, 10 Oct 2023 15:15:03 +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=4.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, PDS_OTHER_BAD_TLD,RCVD_IN_SBL_CSS,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 howler.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 (howler.vger.email [0.0.0.0]); Tue, 10 Oct 2023 06:16:12 -0700 (PDT) X-Spam-Level: **** Hello everyone, V7 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 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 | 1211 +++++++++++++++++ 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, 2104 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