From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 45D1ECCF9E0 for ; Fri, 24 Oct 2025 12:51:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Reply-To:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To: Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id:Date:Subject: From:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=EU6L3QlRGSLDSk4vuGnjxCt78ZTa+kZbGCDaYlMiYEw=; b=qnrBLjVOEkunNnkDW/PI0xIGY1 dnGrhDHCPkJZFxsZAlQX/7Pqm/ab2GFZwpS88YDpKmcxPrl+eQ2kjT5ihXh6XcZdRYpl2deDX9JBS BgR5Smgbxz2TBxrYqR81K6B9cxRjBQVbiAi5FXoQybyNwENfnMrwDVVOKTQDKrQ26bxvFzwQWlfwA LpZ/Z9zG2WOuZUP077qaX3j/3a3bo6SaAdsjfFAUl1VxsBbcgoBmUaOKIMjWfHR/csfR0CcjmwFRj MQdcc0mVOJAI35zFxdlg1qGIiImL0/pHb5nv/F6NhRwJ00rQ3c7KIhl3dtrZ9pIi5F4t8Z4Y4flw6 sVntD11g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vCHGc-00000009QIH-0bjO; Fri, 24 Oct 2025 12:51:38 +0000 Received: from tor.source.kernel.org ([172.105.4.254]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vCHGb-00000009QGp-16BP; Fri, 24 Oct 2025 12:51:37 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 4D440611FD; Fri, 24 Oct 2025 12:51:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id DA809C4CEFF; Fri, 24 Oct 2025 12:51:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1761310295; bh=PzY46h6D8GKq516oWnd/c/gcVF4boxSOUQ0m5tpCpbQ=; h=From:Subject:Date:To:Cc:Reply-To:From; b=ld84bBZkECcl4whQpEHZe2sWruCpDnUQqErxp69xlfAMmMa22FuQxefng7O1oVxb4 dpPUaa6lm5sJDYWCQCQXvCC5UTgTGvCJ3hMx/OILQfcxqtQ/fZPXy0dsIkfRxcz+B7 RdfjuSFZ6JZ5CW2pru4/tmv7ClfX8A5TIYH6+aAzQRuH7iPPHpKMjxTj4sPFuU4q2w hT+wmqTglICWKF54zDChKfDRdlIiT+dLzMbmGdY3wtbLKrd0zmpYnrpdd9nk7L0enX UnnSx9jV3W/BeiqaLR/rK8+PyEhaN8PZrSi5RK38Hsw+uoiNEW64HT3lMxYRBGL1AD pvLYnW01ETtRA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3651CCF9E0; Fri, 24 Oct 2025 12:51:35 +0000 (UTC) From: Michael Riesch via B4 Relay Subject: [PATCH v14 00/18] media: rockchip: add a driver for the rockchip camera interface Date: Fri, 24 Oct 2025 14:51:29 +0200 Message-Id: <20240220-rk3568-vicap-v14-0-b38b6da0fc80@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-B4-Tracking: v=1; b=H4sIAFJ2+2gC/33SwW4cIQwG4FeJ5lwibAwDPeU9qhwMmC7qZmc1s 5q0ivbdyyRq063YORrE9xvZb8Mic5Vl+PrwNsyy1qVOp1YAfXkY0oFP30XV3A4G1EgaUav5h7H Oq7UmPqsYoikhoC1EQ3sSeREVZz6lw/boRQ65qhXMdneepdSf71nfnlt9qMtlmn+9R6+wnX6Gr E55dZnONd3mraC0Quc1Q2FHOj69Tsfy0fbjSS7DBq/4FwOE8T6GDYuQyfuSks6mi5k/mNWo3X3 MNMyFDAWC2ES6i9E/GIT7GDVMgnZOaxYT+5j9xMxeZ7ZhpeVZtIaKSV3M3Q7gVnBNyFhsiSJgL Tyl6XjkOM38mKaXD2DcA8YGjNZDycGxMdwD/B7gGxBySDFRtEi5B4Q9IDSAk0CbTSL22ANA7wm gtwlj9jxG1CFSl4BdYltfLlo4syWx3W8A7hLb0iaXoyRxMQbfJcwusa1qZnAUKYAv8j9xvV5/A 6PiaRgZBAAA To: Mehdi Djait , Maxime Chevallier , =?utf-8?q?Th=C3=A9o_Lebrun?= , Thomas Petazzoni , Gerald Loacker , Bryan O'Donoghue , Markus Elfring , Laurent Pinchart , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner , Kever Yang , Nicolas Dufresne , Sebastian Reichel , Collabora Kernel Team , Paul Kocialkowski , Alexander Shiyan , Val Packett , Rob Herring , Philipp Zabel , Sakari Ailus Cc: linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, Michael Riesch , Michael Riesch , Mehdi Djait , Krzysztof Kozlowski , Bryan O'Donoghue , Chen-Yu Tsai X-Mailer: b4 0.12.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1761310293; l=12462; i=michael.riesch@collabora.com; s=20250410; h=from:subject:message-id; bh=PzY46h6D8GKq516oWnd/c/gcVF4boxSOUQ0m5tpCpbQ=; b=nR91rqIRZpjzjpEUMaNrKrvlloeGX4tnyN7UcFmsE1wrdR7Z2NbgdfGXpY5fv5UfTa5PSGZFQ fZKdoNqf1yoBOeRowAWgL9ENUXsPMzi8wo4FAGhr1KhgpEpUJnVKON1 X-Developer-Key: i=michael.riesch@collabora.com; a=ed25519; pk=+MWX1fffLFZtTPG/I6XdYm/+OSvpRE8D9evQaWbiN04= X-Endpoint-Received: by B4 Relay for michael.riesch@collabora.com/20250410 with auth_id=371 X-Original-From: Michael Riesch X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: michael.riesch@collabora.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Habidere, This series introduces support for the Rockchip Camera Interface (CIF), which is featured in many Rockchip SoCs in different variations. For example, the PX30 Video Input Processor (VIP) is able to receive video data via the Digital Video Port (DVP, a parallel data interface) and transfer it into system memory using a double-buffering mechanism called ping-pong mode. The RK3568 Video Capture (VICAP) unit, on the other hand, features a DVP and a MIPI CSI-2 receiver that can receive video data independently (both using the ping-pong scheme). The different variants may have additional features, such as scaling and/or cropping. Finally, the RK3588 VICAP unit constitutes an essential piece of the camera interface with one DVP, six MIPI CSI-2 receivers, scale/crop units, and a data path multiplexer (to scaler units, to ISP, ...). The v14 of the series adds a media controller centric V4L2 device driver for the Rockchip CIF with - support for the PX30 VIP (not tested, though, due to the lack of HW) - support for the RK3568 VICAP, including - capturing frames from the DVP - capturing frames from the MIPI CSI-2 receiver - abstraction for the ping-pong scheme to allow for future extensions - abstraction for the INTERFACE and CROP parts to allow for future extensions - initial support for different virtual channels (not tested, though, due to the lack of HW) and a V4L2 subdevice driver for the Rockchip MIPI CSI-2 Receiver. The RK3568 DVP has been tested by Gerald on a WolfVision PF5 hardware, the RK3568 MIPI CSI-2 have been tested by me on a Radxa ROCK 3A + Radxa Camera 8M. The driver can be readily extended to provide support for the RK3588 VICAP variant. In order to keep things simple, however, this extension shall be submitted separately. Looking forward to your comments! To: Mehdi Djait To: Maxime Chevallier To: Théo Lebrun To: Thomas Petazzoni To: Gerald Loacker To: Bryan O'Donoghue To: Markus Elfring To: Sakari Ailus To: Laurent Pinchart To: Mauro Carvalho Chehab To: Rob Herring To: Krzysztof Kozlowski To: Conor Dooley To: Heiko Stuebner To: Kever Yang To: Nicolas Dufresne To: Sebastian Reichel To: Collabora Kernel Team To: Paul Kocialkowski To: Alexander Shiyan To: Val Packett To: Rob Herring To: Philipp Zabel Cc: linux-media@vger.kernel.org Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-rockchip@lists.infradead.org Signed-off-by: Michael Riesch Signed-off-by: Michael Riesch Changes in v14: - rkcsi: fixed invalid format handling in _set_fmt() (v4l2-compliance) - rkcif-interface: fixed crop, reset crop at source when sink format is changed (v4l2-compliance) - rebased onto media-committers/next - Link to v13: https://lore.kernel.org/r/20240220-rk3568-vicap-v13-0-da164b4918fe@collabora.com Changes in v13: - fixed interrupt names in CSI-2 reciever bindings example (Rob's bot) - revised Radxa Camera 8M device tree overlay - Link to v12: https://lore.kernel.org/r/20240220-rk3568-vicap-v12-0-c6dbece6bb98@collabora.com Changes in v12: - added Radxa Camera 8M device tree overlay - rebased onto v6.18-rc1 - fixed IOMMU pagefaults caused by wrong VLW (Mehdi) - fixed indentation of register defines in -regs.h (Sakari) - renamed CSI-2 receiver interrupts (Rob) - added MEDIA_BUS_TYPE_* as comments in DT bindings (Bryan) - added newline in rkcif-dev.c (Bryan) - Link to v11: https://lore.kernel.org/r/20240220-rk3568-vicap-v11-0-af0eada54e5d@collabora.com Changes in v11: - rkcif: split large driver patch (6/13 of v10) into smaller patches (6-11/17 of v11) (Bryan) - rkcsi: replaced devm_reset_control_array_get_exclusive with devm_reset_control_get_exclusive (Philipp) - Link to v10: https://lore.kernel.org/r/20240220-rk3568-vicap-v10-0-62d8a7b209b4@collabora.com Changes in v10: - rkcsi: fixed error handling in rkcsi_start (Bryan) - rkcsi: fixed interrupt references in device tree and bindings (Rob's bot) - added missing call to rkcif_mipi_stop_streaming from rkcif_mipi_isr (Mehdi) - renamed remaining instances "cif_" -> "rkcif_" in functions - Link to v9: https://lore.kernel.org/r/20240220-rk3568-vicap-v9-0-ace1e5cc4a82@collabora.com Changes in v9: - added compatible for RK3588 MIPI CSI-2 receiver, thus dropped Krzysztof's R-b - added interrupts to rkcsi DT binding and RK356x DT - added variant specific callback to rkcif-capture-mipi that puts together the CTRL0 register content (which varies between RK3568 and RK3588) - fixed v4l2_fill_pixfmt_mp() return value handling (Mehdi) - Link to v8: https://lore.kernel.org/r/20240220-rk3568-vicap-v8-0-9d9cbc4b524d@collabora.com Changes in v8: - rebased onto v6.16-rc1 - fixed RKCIF_MIPI_MAX value in rkcif-common.h - fixed rkcsi Kconfig (kernel test robot) - sorted rkcsi DT bindings document properly, completed example (Krzysztof) - squashed the defconfig patches (Krzysztof), dropped Bryan's R-b - Link to v7: https://lore.kernel.org/r/20240220-rk3568-vicap-v7-0-7581fd96a33a@collabora.com Changes in v7: - moved MIPI CSI-2 receiver driver into separate directory (Laurent) - rkcsi: fixed return values (Bryan) - rkcsi: fixed v4l2_get_link_freq to use pad instead of control handler (Sakari) - rkcsi: added data-lanes property (Mehdi) - rkcif: fixed formatting (Bryan) - fixed "int" -> "unsigned int" in all for loops (Sakari) - rkcif-stream: fixed minimum number of required buffers (Mehdi) - rkcif-stream: used guards for the spinlock (Markus and Mehdi) - rkcif-stream: made driver less noisy with dev_dbg (Mehdi) - rkcif-stream: fixed issues detected by v4l2-compliance (Mehdi) - rkcif-dvp-capture: fixed return value propagation in _register() (Mehdi) - removed stray "phy-names" from required properties (Rob's bot) - Link to v6: https://lore.kernel.org/r/20240220-rk3568-vicap-v6-0-d2f5fbee1551@collabora.com Changes in v6: - rebased onto v6.15-rc1 - renamed "MIPI CSI HOST" -> "MIPI CSI RECEIVER" (Laurent) - s/@wolfvision.net/@collabora.com where appropriate - renamed DVP delay property and moved it to the endpoint (Sakari) - implemented DT review comments (Krzysztof and Sakari) - implemented driver review comments (Sakari) - fixed issues raised by media-ci (yet again) - added documentation including a RK3568 topology (new patch 1) (Sakari) - added patch that enables rkcif in the defconfig (new patch 9) - Link to v5: https://lore.kernel.org/r/20250306-v6-8-topic-rk3568-vicap-v5-0-f02152534f3c@wolfvision.net Changes in v5: - fixed issues raised by media-ci - fixed dt bindings (comments by Rob and Sakari) - fixed probe on systems with no DVP in DT (comment by Alexander) - fixed error path in register offset calculation - split off MIPI CSI host driver into separate module (comment by Mehdi) - added MODULE_DEVICE_TABLE() for both drivers (comment by Mehdi) - Link to v4: https://lore.kernel.org/r/20250219-v6-8-topic-rk3568-vicap-v4-0-e906600ae3b0@wolfvision.net Changes in v4: - added support for the MIPI CSI-2 receiver (new patches 4, 6, 7, 10) - fixed asserts on stream stop - fixed register address lookup - fixed link validiation callback - fixed issues raised by Rob's bot, kernel test robot, and media-ci - Link to v3: https://lore.kernel.org/r/20250206-v6-8-topic-rk3568-vicap-v3-0-69d1f19e5c40@wolfvision.net Changes in v3: - renamed the driver "cif" -> "rkcif" - rebased onto v6.14-rc1 - abstracted the generic INTERFACE+CROP part - addressed comments by Rob and Sakari - added V4L2 MPLANE formats to DVP - added patch that enables the RK3568 VICAP DVP on PF5 IO Expander - fixed formatting issues raised by media-ci bot - Link to v2: https://lore.kernel.org/r/20241217-v6-8-topic-rk3568-vicap-v2-0-b1d488fcc0d3@wolfvision.net Changes in v2: - merged with Mehdi's v13 - refactored the complete driver towards a media controller centric driver - abstracted the generic ping-pong stream (can be used for DVP as well as for CSI-2) - switched to MPLANE API - added support for notifications - Link to v1: https://lore.kernel.org/r/20240220-v6-8-topic-rk3568-vicap-v1-0-2680a1fa640b@wolfvision.net --- Mehdi Djait (2): media: dt-bindings: add rockchip px30 vip arm64: dts: rockchip: add the vip node to px30 Michael Riesch (16): Documentation: admin-guide: media: add rockchip camera interface media: dt-bindings: video-interfaces: add defines for sampling modes media: dt-bindings: add rockchip rk3568 vicap media: dt-bindings: add rockchip rk3568 mipi csi-2 receiver media: rockchip: add driver for the rockchip mipi csi-2 receiver media: rockchip: add driver for the rockchip camera interface media: rockchip: rkcif: add abstraction for interface and crop blocks media: rockchip: rkcif: add abstraction for dma blocks media: rockchip: rkcif: add support for px30 vip dvp capture media: rockchip: rkcif: add support for rk3568 vicap dvp capture media: rockchip: rkcif: add support for rk3568 vicap mipi capture arm64: defconfig: enable rockchip camera interface and mipi csi-2 receiver arm64: dts: rockchip: add vicap node to rk356x arm64: dts: rockchip: add mipi csi-2 receiver node to rk356x arm64: dts: rockchip: enable vicap dvp on wolfvision pf5 io expander arm64: dts: rockchip: add radxa camera 8m on rock 3a csi port .../admin-guide/media/rkcif-rk3568-vicap.dot | 21 + Documentation/admin-guide/media/rkcif.rst | 83 ++ Documentation/admin-guide/media/v4l-drivers.rst | 1 + .../bindings/media/rockchip,px30-vip.yaml | 124 +++ .../bindings/media/rockchip,rk3568-mipi-csi.yaml | 146 ++++ .../bindings/media/rockchip,rk3568-vicap.yaml | 172 ++++ MAINTAINERS | 17 + arch/arm64/boot/dts/rockchip/Makefile | 5 + arch/arm64/boot/dts/rockchip/px30.dtsi | 12 + .../dts/rockchip/rk3568-rock-3a-radxa-cam8m.dtso | 103 +++ .../rk3568-wolfvision-pf5-io-expander.dtso | 20 + arch/arm64/boot/dts/rockchip/rk356x-base.dtsi | 78 ++ arch/arm64/configs/defconfig | 2 + drivers/media/platform/rockchip/Kconfig | 2 + drivers/media/platform/rockchip/Makefile | 2 + drivers/media/platform/rockchip/rkcif/Kconfig | 18 + drivers/media/platform/rockchip/rkcif/Makefile | 8 + .../platform/rockchip/rkcif/rkcif-capture-dvp.c | 865 +++++++++++++++++++++ .../platform/rockchip/rkcif/rkcif-capture-dvp.h | 25 + .../platform/rockchip/rkcif/rkcif-capture-mipi.c | 777 ++++++++++++++++++ .../platform/rockchip/rkcif/rkcif-capture-mipi.h | 23 + .../media/platform/rockchip/rkcif/rkcif-common.h | 250 ++++++ drivers/media/platform/rockchip/rkcif/rkcif-dev.c | 303 ++++++++ .../platform/rockchip/rkcif/rkcif-interface.c | 442 +++++++++++ .../platform/rockchip/rkcif/rkcif-interface.h | 31 + drivers/media/platform/rockchip/rkcif/rkcif-regs.h | 153 ++++ .../media/platform/rockchip/rkcif/rkcif-stream.c | 638 +++++++++++++++ .../media/platform/rockchip/rkcif/rkcif-stream.h | 32 + drivers/media/platform/rockchip/rkcsi/Kconfig | 16 + drivers/media/platform/rockchip/rkcsi/Makefile | 3 + drivers/media/platform/rockchip/rkcsi/rkcsi.c | 742 ++++++++++++++++++ include/dt-bindings/media/video-interfaces.h | 4 + 32 files changed, 5118 insertions(+) --- base-commit: ea299a2164262ff787c9d33f46049acccd120672 change-id: 20240220-rk3568-vicap-b9b3f9925f44 Best regards, -- Michael Riesch