From nobody Tue Dec 2 02:44:14 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DD7FD34E768; Tue, 18 Nov 2025 11:12:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763464348; cv=none; b=ZIG2TOQps5SY87gmZv/fcJPl5nN819B0YogXvB1hw/cxEUxp040ZTQHPWirMYL1L/UnkxcmrYtuoCavZkiKP9RJ/BRcwmtha79OmDIZPA/lLGSSyRCVreKmEKbQZ/h8Dec5nINZhzUpmcY/wQqKtG3MqBUsfsMtGo2FR7lP09sM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763464348; c=relaxed/simple; bh=fqhmxL9dyO2H5AXbU6GS7SV3x6jSuvCcqK6ZUai8aqA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MfdhuYNN2AFAeznt36VpOWcbCWUbEzI6qZH2N85bjWwf5K7U9nCQOuWEabh6JO2SGx+1ySCcz3qgfAQRD/9vHx2webCfVpdkVF/oWJ8hKJQGgxx4KgxIzn8yKuCmaL2AzTOr6uhpYOWgGZ5HbMi+a4exdp3Z9c+1ItXOKGKFi4E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=DbusYKHB; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="DbusYKHB" Received: by smtp.kernel.org (Postfix) with ESMTPS id 2954AC4CEF5; Tue, 18 Nov 2025 11:12:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763464347; bh=fqhmxL9dyO2H5AXbU6GS7SV3x6jSuvCcqK6ZUai8aqA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=DbusYKHBysUd3cyTICWacc3H291FO/MLvXFsEbymRDpeuOl1/tPXgIt/DQ+uLfP01 C6s4S7eGUB3DJIhTFjr1xN0o5GJno8+ZhNgpR8OrxqYgsDSm1pWvQFsbL7mXNWiWBa bAh/RVMQeTpLtimM7x+VtbFW2gEv0vC+jCfJLALtQcmN+CR9YFsaP5oA2P+iQyHZfH as8bUlp/Yla2PHhtXV6Up9TbL2Bwj5bv4Pywggop/F3KiFP7bdEx6Rkb2Ne5DDfi3H T7Lq/b8VdV61TNPArtuLpmI/1fBDSMr4wR273rIa2ck9K/TNopgksFijflxFtuyhOk 1JLCvcVDTGNOQ== 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 D9867CED60F; Tue, 18 Nov 2025 11:12:26 +0000 (UTC) From: Michael Riesch via B4 Relay Date: Tue, 18 Nov 2025 12:12:25 +0100 Subject: [PATCH v2 1/3] media: dt-bindings: add rockchip mipi csi-2 receiver Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251114-rockchip-mipi-receiver-v2-1-eb9b43377fc4@collabora.com> References: <20251114-rockchip-mipi-receiver-v2-0-eb9b43377fc4@collabora.com> In-Reply-To: <20251114-rockchip-mipi-receiver-v2-0-eb9b43377fc4@collabora.com> To: Michael Riesch , Mehdi Djait , Bryan O'Donoghue , Laurent Pinchart , Hans Verkuil , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner , Philipp Zabel , Sebastian Reichel , Nicolas Dufresne , Collabora Kernel Team , Sakari Ailus Cc: linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Michael Riesch X-Mailer: b4 0.12.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1763464345; l=5373; i=michael.riesch@collabora.com; s=20250410; h=from:subject:message-id; bh=J13dmuMcF1GCfHhAObupJL+M9i8EbDNBW/sOBtnzDBg=; b=fAOL2bTwc9aWqdBq16IhiZ8zdLSRSSR7L2i8yyMp6aLXTJlqiJ2GRFn5Cb3DRPlBRL4Od1j2E GPrqmscK/tcBJ681Eizwj3riN/988LVP1pFeZX+wpJY0BjpAHcO9ovH 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 Reply-To: michael.riesch@collabora.com From: Michael Riesch Add documentation for the Rockchip MIPI CSI-2 Receiver. Signed-off-by: Michael Riesch Reviewed-by: Rob Herring (Arm) Reviewed-by: Bryan O'Donoghue Signed-off-by: Michael Riesch --- .../bindings/media/rockchip,rk3568-mipi-csi.yaml | 146 +++++++++++++++++= ++++ MAINTAINERS | 6 + 2 files changed, 152 insertions(+) diff --git a/Documentation/devicetree/bindings/media/rockchip,rk3568-mipi-c= si.yaml b/Documentation/devicetree/bindings/media/rockchip,rk3568-mipi-csi.= yaml new file mode 100644 index 000000000000..52fe959af8f9 --- /dev/null +++ b/Documentation/devicetree/bindings/media/rockchip,rk3568-mipi-csi.yaml @@ -0,0 +1,146 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/rockchip,rk3568-mipi-csi.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Rockchip MIPI CSI-2 Receiver + +maintainers: + - Michael Riesch + +description: + The Rockchip MIPI CSI-2 Receiver is a CSI-2 bridge with one input port a= nd + one output port. It receives the data with the help of an external MIPI = PHY + (C-PHY or D-PHY) and passes it to the Rockchip RK3568 Video Capture (VIC= AP) + block. + +properties: + compatible: + oneOf: + - items: + - enum: + - rockchip,rk3588-mipi-csi + - const: rockchip,rk3568-mipi-csi + - const: rockchip,rk3568-mipi-csi + + reg: + maxItems: 1 + + interrupts: + items: + - description: Interrupt that signals changes in CSI2HOST_ERR1. + - description: Interrupt that signals changes in CSI2HOST_ERR2. + + interrupt-names: + items: + - const: err1 + - const: err2 + + clocks: + maxItems: 1 + + phys: + maxItems: 1 + description: MIPI C-PHY or D-PHY. + + ports: + $ref: /schemas/graph.yaml#/properties/ports + + properties: + port@0: + $ref: /schemas/graph.yaml#/$defs/port-base + unevaluatedProperties: false + description: Input port node. Connect to e.g., a MIPI CSI-2 image = sensor. + + properties: + endpoint: + $ref: video-interfaces.yaml# + unevaluatedProperties: false + + properties: + bus-type: + enum: + - 1 # MEDIA_BUS_TYPE_CSI2_CPHY + - 4 # MEDIA_BUS_TYPE_CSI2_DPHY + + data-lanes: + minItems: 1 + maxItems: 4 + + required: + - bus-type + - data-lanes + + port@1: + $ref: /schemas/graph.yaml#/properties/port + description: Output port connected to a RK3568 VICAP port. + + required: + - port@0 + - port@1 + + power-domains: + maxItems: 1 + + resets: + maxItems: 1 + +required: + - compatible + - reg + - clocks + - phys + - ports + - power-domains + - resets + +additionalProperties: false + +examples: + - | + #include + #include + #include + #include + + soc { + interrupt-parent =3D <&gic>; + #address-cells =3D <2>; + #size-cells =3D <2>; + + csi: csi@fdfb0000 { + compatible =3D "rockchip,rk3568-mipi-csi"; + reg =3D <0x0 0xfdfb0000 0x0 0x10000>; + interrupts =3D , + ; + interrupt-names =3D "err1", "err2"; + clocks =3D <&cru PCLK_CSI2HOST1>; + phys =3D <&csi_dphy>; + power-domains =3D <&power RK3568_PD_VI>; + resets =3D <&cru SRST_P_CSI2HOST1>; + + ports { + #address-cells =3D <1>; + #size-cells =3D <0>; + + csi_in: port@0 { + reg =3D <0>; + + csi_input: endpoint { + bus-type =3D ; + data-lanes =3D <1 2 3 4>; + remote-endpoint =3D <&imx415_output>; + }; + }; + + csi_out: port@1 { + reg =3D <1>; + + csi_output: endpoint { + remote-endpoint =3D <&vicap_mipi_input>; + }; + }; + }; + }; + }; diff --git a/MAINTAINERS b/MAINTAINERS index 4205ca007e07..145473671a4a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -22299,6 +22299,12 @@ F: Documentation/userspace-api/media/v4l/metafmt-r= kisp1.rst F: drivers/media/platform/rockchip/rkisp1 F: include/uapi/linux/rkisp1-config.h =20 +ROCKCHIP MIPI CSI-2 RECEIVER DRIVER +M: Michael Riesch +L: linux-media@vger.kernel.org +S: Maintained +F: Documentation/devicetree/bindings/media/rockchip,rk3568-mipi-csi.yaml + ROCKCHIP RK3568 RANDOM NUMBER GENERATOR SUPPORT M: Daniel Golle M: Aurelien Jarno --=20 2.39.5 From nobody Tue Dec 2 02:44:14 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5D2523502B0; Tue, 18 Nov 2025 11:12:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763464349; cv=none; b=ddAP/ZdK8RkFMbXTGFT05AuQ9iQU9shavQlMDsqvl3UyC+7Ra8X0rxItm7UseTJdY8naNZeoSH4weq17zfYi+19ibs/nSfyCje0Nv2p7M/ZF4YRN0/uS2DX1xdBFNQx3CZuy/nSl/6quXu3zHYH85sz+qZDH1A05SC1UpmzbqfQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763464349; c=relaxed/simple; bh=AWi+DvRqbFpKZsx8CmHQtN5L2q3uL5tdRdCuZMs9jBk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=JPqyEz3pNPO/pPQJ2BRuZLz+lVX34OVgQDdCehQ4SKwnCZU6V/42RySpY4RNKTHavfoptRsOSfRjZyqJgqrv8XxV0ueUBsdhlXA7vOKbymDWKkmKRR+Vc+hwaU8tqw/3sJHyBgwYwhAyaUE2d7Alz86EBN2LQ6DU9xnAVwBLW1E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=rTHAS0JT; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="rTHAS0JT" Received: by smtp.kernel.org (Postfix) with ESMTPS id 783FEC19421; Tue, 18 Nov 2025 11:12:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763464348; bh=AWi+DvRqbFpKZsx8CmHQtN5L2q3uL5tdRdCuZMs9jBk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=rTHAS0JTJksjLzvesNaUkodKeg+21P7hwtrLKTBC3ZGS7m2GbgD+chwDCnYYCFsyP KO/2+xyluKmOs8IkYEoRMwdZrRmq6+ySKrH/hAT5Q9L5HUyiabxBwx2MWH5sA0338D 7bGYIx7IBPfGefJSA7SxCJ5XStMsimi+555/tv8etxCDzQ1kzbqko0EhwrmWk2SFGW LF+3vCm1qnHP/THUjFPoQ/fLWgU990jp1WoQTip7YevmcsEY1xjlC+mSp/aZrwVx3M R7UwpX0cW6evj9LluJhwm9GcKSkWZigNxL723waCP42nUvTsomG/VliKLyUdlv+j1A HSfgJ39yJgh/w== 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 EAC9BCED617; Tue, 18 Nov 2025 11:12:26 +0000 (UTC) From: Michael Riesch via B4 Relay Date: Tue, 18 Nov 2025 12:12:26 +0100 Subject: [PATCH v2 2/3] media: rockchip: add driver for the rockchip mipi csi-2 receiver Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251114-rockchip-mipi-receiver-v2-2-eb9b43377fc4@collabora.com> References: <20251114-rockchip-mipi-receiver-v2-0-eb9b43377fc4@collabora.com> In-Reply-To: <20251114-rockchip-mipi-receiver-v2-0-eb9b43377fc4@collabora.com> To: Michael Riesch , Mehdi Djait , Bryan O'Donoghue , Laurent Pinchart , Hans Verkuil , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner , Philipp Zabel , Sebastian Reichel , Nicolas Dufresne , Collabora Kernel Team , Sakari Ailus Cc: linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Michael Riesch X-Mailer: b4 0.12.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1763464345; l=22767; i=michael.riesch@collabora.com; s=20250410; h=from:subject:message-id; bh=T8jrou1b8whJb5CNE1ITQbk2dSRxTk+Xb4UcarEXs08=; b=azS4Z3VzoYkxrKg2AJGM/VXfmE2PnPNVWEzVs305HVyvs381cIKhUVTikpgaQnqi+p0fso0Er 6ed4vKS4S7PDEJvto1lTZaUGukRvzv9Sno7iJ6YftCyNSDI/H24YYKf 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 Reply-To: michael.riesch@collabora.com From: Michael Riesch The Rockchip MIPI CSI-2 Receiver is a CSI-2 bridge with one input port and one output port. It receives the data with the help of an external MIPI PHY (C-PHY or D-PHY) and passes it to the Rockchip Video Capture (VICAP) block. Add a V4L2 subdevice driver for this unit. Signed-off-by: Michael Riesch Reviewed-by: Bryan O'Donoghue Reviewed-by: Mehdi Djait Signed-off-by: Michael Riesch --- MAINTAINERS | 1 + drivers/media/platform/rockchip/Kconfig | 1 + drivers/media/platform/rockchip/Makefile | 1 + drivers/media/platform/rockchip/rkcsi/Kconfig | 16 + drivers/media/platform/rockchip/rkcsi/Makefile | 3 + drivers/media/platform/rockchip/rkcsi/rkcsi.c | 742 +++++++++++++++++++++= ++++ 6 files changed, 764 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 145473671a4a..b389f2e631ce 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -22304,6 +22304,7 @@ M: Michael Riesch L: linux-media@vger.kernel.org S: Maintained F: Documentation/devicetree/bindings/media/rockchip,rk3568-mipi-csi.yaml +F: drivers/media/platform/rockchip/rkcsi/ =20 ROCKCHIP RK3568 RANDOM NUMBER GENERATOR SUPPORT M: Daniel Golle diff --git a/drivers/media/platform/rockchip/Kconfig b/drivers/media/platfo= rm/rockchip/Kconfig index ba401d32f01b..54b698c4cd2c 100644 --- a/drivers/media/platform/rockchip/Kconfig +++ b/drivers/media/platform/rockchip/Kconfig @@ -4,5 +4,6 @@ comment "Rockchip media platform drivers" =20 source "drivers/media/platform/rockchip/rga/Kconfig" source "drivers/media/platform/rockchip/rkcif/Kconfig" +source "drivers/media/platform/rockchip/rkcsi/Kconfig" source "drivers/media/platform/rockchip/rkisp1/Kconfig" source "drivers/media/platform/rockchip/rkvdec/Kconfig" diff --git a/drivers/media/platform/rockchip/Makefile b/drivers/media/platf= orm/rockchip/Makefile index 0e0b2cbbd4bd..522a7d3e30b0 100644 --- a/drivers/media/platform/rockchip/Makefile +++ b/drivers/media/platform/rockchip/Makefile @@ -1,5 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only obj-y +=3D rga/ obj-y +=3D rkcif/ +obj-y +=3D rkcsi/ obj-y +=3D rkisp1/ obj-y +=3D rkvdec/ diff --git a/drivers/media/platform/rockchip/rkcsi/Kconfig b/drivers/media/= platform/rockchip/rkcsi/Kconfig new file mode 100644 index 000000000000..d8004198c386 --- /dev/null +++ b/drivers/media/platform/rockchip/rkcsi/Kconfig @@ -0,0 +1,16 @@ +config VIDEO_ROCKCHIP_CSI + tristate "Rockchip MIPI CSI-2 Receiver" + depends on VIDEO_DEV + depends on ARCH_ROCKCHIP || COMPILE_TEST + depends on V4L_PLATFORM_DRIVERS + depends on PM && COMMON_CLK + select MEDIA_CONTROLLER + select V4L2_FWNODE + select VIDEO_V4L2_SUBDEV_API + help + This is a driver for Rockchip MIPI CSI-2 Receiver. It is featured + in various Rockchips SoCs, usually in combination with a Video + Capture (VICAP) unit (see Rockchip Camera Interface (CIF) driver). + + To compile this driver as a module, choose M here: the module + will be called rockchip-mipi-csi. diff --git a/drivers/media/platform/rockchip/rkcsi/Makefile b/drivers/media= /platform/rockchip/rkcsi/Makefile new file mode 100644 index 000000000000..147712cbb68a --- /dev/null +++ b/drivers/media/platform/rockchip/rkcsi/Makefile @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0 +obj-$(CONFIG_VIDEO_ROCKCHIP_CSI) +=3D rockchip-mipi-csi.o +rockchip-mipi-csi-objs +=3D rkcsi.o diff --git a/drivers/media/platform/rockchip/rkcsi/rkcsi.c b/drivers/media/= platform/rockchip/rkcsi/rkcsi.c new file mode 100644 index 000000000000..d4108ce5bbf9 --- /dev/null +++ b/drivers/media/platform/rockchip/rkcsi/rkcsi.c @@ -0,0 +1,742 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Rockchip MIPI CSI-2 Receiver Driver + * + * Copyright (C) 2019 Rockchip Electronics Co., Ltd. + * Copyright (C) 2025 Michael Riesch + * Copyright (C) 2025 Collabora, Ltd. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#define CSI2HOST_N_LANES 0x04 +#define CSI2HOST_CSI2_RESETN 0x10 +#define CSI2HOST_PHY_STATE 0x14 +#define CSI2HOST_ERR1 0x20 +#define CSI2HOST_ERR2 0x24 +#define CSI2HOST_MSK1 0x28 +#define CSI2HOST_MSK2 0x2c +#define CSI2HOST_CONTROL 0x40 + +#define SW_CPHY_EN(x) ((x) << 0) +#define SW_DSI_EN(x) ((x) << 4) +#define SW_DATATYPE_FS(x) ((x) << 8) +#define SW_DATATYPE_FE(x) ((x) << 14) +#define SW_DATATYPE_LS(x) ((x) << 20) +#define SW_DATATYPE_LE(x) ((x) << 26) + +#define RKCSI_CLKS_MAX 1 + +enum { + RKCSI_PAD_SINK, + RKCSI_PAD_SRC, + RKCSI_PAD_MAX, +}; + +struct rkcsi_format { + u32 code; + u8 depth; + u8 csi_dt; +}; + +struct rkcsi_device { + struct device *dev; + + void __iomem *base_addr; + struct clk_bulk_data *clks; + unsigned int clks_num; + struct phy *phy; + struct reset_control *reset; + + const struct rkcsi_format *formats; + unsigned int formats_num; + + struct media_pad pads[RKCSI_PAD_MAX]; + struct v4l2_async_notifier notifier; + struct v4l2_fwnode_endpoint vep; + struct v4l2_subdev sd; + + struct v4l2_subdev *source_sd; + u32 source_pad; +}; + +static const struct v4l2_mbus_framefmt default_format =3D { + .width =3D 3840, + .height =3D 2160, + .code =3D MEDIA_BUS_FMT_SRGGB10_1X10, + .field =3D V4L2_FIELD_NONE, + .colorspace =3D V4L2_COLORSPACE_RAW, + .ycbcr_enc =3D V4L2_YCBCR_ENC_601, + .quantization =3D V4L2_QUANTIZATION_FULL_RANGE, + .xfer_func =3D V4L2_XFER_FUNC_NONE, +}; + +static const struct rkcsi_format formats[] =3D { + /* YUV formats */ + { + .code =3D MEDIA_BUS_FMT_YUYV8_1X16, + .depth =3D 16, + .csi_dt =3D MIPI_CSI2_DT_YUV422_8B, + }, + { + .code =3D MEDIA_BUS_FMT_UYVY8_1X16, + .depth =3D 16, + .csi_dt =3D MIPI_CSI2_DT_YUV422_8B, + }, + { + .code =3D MEDIA_BUS_FMT_YVYU8_1X16, + .depth =3D 16, + .csi_dt =3D MIPI_CSI2_DT_YUV422_8B, + }, + { + .code =3D MEDIA_BUS_FMT_VYUY8_1X16, + .depth =3D 16, + .csi_dt =3D MIPI_CSI2_DT_YUV422_8B, + }, + /* RGB formats */ + { + .code =3D MEDIA_BUS_FMT_RGB888_1X24, + .depth =3D 24, + .csi_dt =3D MIPI_CSI2_DT_RGB888, + }, + { + .code =3D MEDIA_BUS_FMT_BGR888_1X24, + .depth =3D 24, + .csi_dt =3D MIPI_CSI2_DT_RGB888, + }, + /* Bayer formats */ + { + .code =3D MEDIA_BUS_FMT_SBGGR8_1X8, + .depth =3D 8, + .csi_dt =3D MIPI_CSI2_DT_RAW8, + }, + { + .code =3D MEDIA_BUS_FMT_SGBRG8_1X8, + .depth =3D 8, + .csi_dt =3D MIPI_CSI2_DT_RAW8, + }, + { + .code =3D MEDIA_BUS_FMT_SGRBG8_1X8, + .depth =3D 8, + .csi_dt =3D MIPI_CSI2_DT_RAW8, + }, + { + .code =3D MEDIA_BUS_FMT_SRGGB8_1X8, + .depth =3D 8, + .csi_dt =3D MIPI_CSI2_DT_RAW8, + }, + { + .code =3D MEDIA_BUS_FMT_SBGGR10_1X10, + .depth =3D 10, + .csi_dt =3D MIPI_CSI2_DT_RAW10, + }, + { + .code =3D MEDIA_BUS_FMT_SGBRG10_1X10, + .depth =3D 10, + .csi_dt =3D MIPI_CSI2_DT_RAW10, + }, + { + .code =3D MEDIA_BUS_FMT_SGRBG10_1X10, + .depth =3D 10, + .csi_dt =3D MIPI_CSI2_DT_RAW10, + }, + { + .code =3D MEDIA_BUS_FMT_SRGGB10_1X10, + .depth =3D 10, + .csi_dt =3D MIPI_CSI2_DT_RAW10, + }, + { + .code =3D MEDIA_BUS_FMT_SBGGR12_1X12, + .depth =3D 12, + .csi_dt =3D MIPI_CSI2_DT_RAW12, + }, + { + .code =3D MEDIA_BUS_FMT_SGBRG12_1X12, + .depth =3D 12, + .csi_dt =3D MIPI_CSI2_DT_RAW12, + }, + { + .code =3D MEDIA_BUS_FMT_SGRBG12_1X12, + .depth =3D 12, + .csi_dt =3D MIPI_CSI2_DT_RAW12, + }, + { + .code =3D MEDIA_BUS_FMT_SRGGB12_1X12, + .depth =3D 12, + .csi_dt =3D MIPI_CSI2_DT_RAW12, + }, +}; + +static inline struct rkcsi_device *to_rkcsi(struct v4l2_subdev *sd) +{ + return container_of(sd, struct rkcsi_device, sd); +} + +static inline __maybe_unused void rkcsi_write(struct rkcsi_device *csi_dev, + unsigned int addr, u32 val) +{ + writel(val, csi_dev->base_addr + addr); +} + +static inline __maybe_unused u32 rkcsi_read(struct rkcsi_device *csi_dev, + unsigned int addr) +{ + return readl(csi_dev->base_addr + addr); +} + +static const struct rkcsi_format * +rkcsi_find_format(struct rkcsi_device *csi_dev, u32 mbus_code) +{ + const struct rkcsi_format *format; + + WARN_ON(csi_dev->formats_num =3D=3D 0); + + for (int i =3D 0; i < csi_dev->formats_num; i++) { + format =3D &csi_dev->formats[i]; + if (format->code =3D=3D mbus_code) + return format; + } + + return NULL; +} + +static int rkcsi_start(struct rkcsi_device *csi_dev) +{ + struct media_pad *source_pad =3D + &csi_dev->source_sd->entity.pads[csi_dev->source_pad]; + enum v4l2_mbus_type bus_type =3D csi_dev->vep.bus_type; + union phy_configure_opts opts; + s64 link_freq; + u32 lanes =3D csi_dev->vep.bus.mipi_csi2.num_data_lanes; + u32 control =3D 0; + int ret; + + if (lanes < 1 || lanes > 4) + return -EINVAL; + + /* set mult and div to 0, thus completely rely on V4L2_CID_LINK_FREQ */ + link_freq =3D v4l2_get_link_freq(source_pad, 0, 0); + if (link_freq <=3D 0) + return -EINVAL; + + if (bus_type =3D=3D V4L2_MBUS_CSI2_DPHY) { + struct phy_configure_opts_mipi_dphy *cfg =3D &opts.mipi_dphy; + + ret =3D phy_mipi_dphy_get_default_config_for_hsclk(link_freq * 2, + lanes, cfg); + if (ret) + return ret; + + ret =3D phy_set_mode(csi_dev->phy, PHY_MODE_MIPI_DPHY); + if (ret) + return ret; + + ret =3D phy_configure(csi_dev->phy, &opts); + if (ret) + return ret; + + control |=3D SW_CPHY_EN(0); + + } else if (bus_type =3D=3D V4L2_MBUS_CSI2_CPHY) { + /* TODO: implement CPHY configuration */ + return -EOPNOTSUPP; + } else { + return -EINVAL; + } + + control |=3D SW_DATATYPE_FS(0x00) | SW_DATATYPE_FE(0x01) | + SW_DATATYPE_LS(0x02) | SW_DATATYPE_LE(0x03); + + rkcsi_write(csi_dev, CSI2HOST_N_LANES, lanes - 1); + rkcsi_write(csi_dev, CSI2HOST_CONTROL, control); + rkcsi_write(csi_dev, CSI2HOST_CSI2_RESETN, 1); + + ret =3D phy_power_on(csi_dev->phy); + if (ret) + return ret; + + return 0; +} + +static void rkcsi_stop(struct rkcsi_device *csi_dev) +{ + phy_power_off(csi_dev->phy); + + rkcsi_write(csi_dev, CSI2HOST_CSI2_RESETN, 0); + rkcsi_write(csi_dev, CSI2HOST_MSK1, ~0); + rkcsi_write(csi_dev, CSI2HOST_MSK2, ~0); +} + +static const struct media_entity_operations rkcsi_media_ops =3D { + .link_validate =3D v4l2_subdev_link_validate, +}; + +static int rkcsi_enum_mbus_code(struct v4l2_subdev *sd, + struct v4l2_subdev_state *sd_state, + struct v4l2_subdev_mbus_code_enum *code) +{ + struct rkcsi_device *csi_dev =3D to_rkcsi(sd); + + if (code->pad =3D=3D RKCSI_PAD_SRC) { + const struct v4l2_mbus_framefmt *sink_fmt; + + if (code->index) + return -EINVAL; + + sink_fmt =3D v4l2_subdev_state_get_format(sd_state, + RKCSI_PAD_SINK); + code->code =3D sink_fmt->code; + + return 0; + } else if (code->pad =3D=3D RKCSI_PAD_SINK) { + if (code->index > csi_dev->formats_num) + return -EINVAL; + + code->code =3D csi_dev->formats[code->index].code; + return 0; + } + + return -EINVAL; +} + +static int rkcsi_set_fmt(struct v4l2_subdev *sd, + struct v4l2_subdev_state *state, + struct v4l2_subdev_format *format) +{ + struct rkcsi_device *csi_dev =3D to_rkcsi(sd); + const struct rkcsi_format *fmt; + struct v4l2_mbus_framefmt *sink, *src; + + /* the format on the source pad always matches the sink pad */ + if (format->pad =3D=3D RKCSI_PAD_SRC) + return v4l2_subdev_get_fmt(sd, state, format); + + sink =3D v4l2_subdev_state_get_format(state, format->pad, format->stream); + if (!sink) + return -EINVAL; + + fmt =3D rkcsi_find_format(csi_dev, format->format.code); + if (!fmt) + format->format =3D default_format; + + *sink =3D format->format; + + /* propagate the format to the source pad */ + src =3D v4l2_subdev_state_get_opposite_stream_format(state, format->pad, + format->stream); + if (!src) + return -EINVAL; + + *src =3D *sink; + + return 0; +} + +static int rkcsi_set_routing(struct v4l2_subdev *sd, + struct v4l2_subdev_state *state, + enum v4l2_subdev_format_whence which, + struct v4l2_subdev_krouting *routing) +{ + int ret; + + ret =3D v4l2_subdev_routing_validate(sd, routing, + V4L2_SUBDEV_ROUTING_ONLY_1_TO_1); + if (ret) + return ret; + + ret =3D v4l2_subdev_set_routing_with_fmt(sd, state, routing, + &default_format); + if (ret) + return ret; + + return 0; +} + +static int rkcsi_enable_streams(struct v4l2_subdev *sd, + struct v4l2_subdev_state *state, u32 pad, + u64 streams_mask) +{ + struct rkcsi_device *csi_dev =3D to_rkcsi(sd); + struct v4l2_subdev *remote_sd; + struct media_pad *sink_pad, *remote_pad; + struct device *dev =3D csi_dev->dev; + u64 mask; + int ret; + + sink_pad =3D &sd->entity.pads[RKCSI_PAD_SINK]; + remote_pad =3D media_pad_remote_pad_first(sink_pad); + remote_sd =3D media_entity_to_v4l2_subdev(remote_pad->entity); + + mask =3D v4l2_subdev_state_xlate_streams(state, RKCSI_PAD_SINK, + RKCSI_PAD_SRC, &streams_mask); + + ret =3D pm_runtime_resume_and_get(dev); + if (ret) + goto err; + + ret =3D rkcsi_start(csi_dev); + if (ret) { + dev_err(dev, "failed to enable CSI hardware\n"); + goto err_pm_runtime_put; + } + + ret =3D v4l2_subdev_enable_streams(remote_sd, remote_pad->index, mask); + if (ret) + goto err_csi_stop; + + return 0; + +err_csi_stop: + rkcsi_stop(csi_dev); +err_pm_runtime_put: + pm_runtime_put_sync(dev); +err: + return ret; +} + +static int rkcsi_disable_streams(struct v4l2_subdev *sd, + struct v4l2_subdev_state *state, u32 pad, + u64 streams_mask) +{ + struct rkcsi_device *csi_dev =3D to_rkcsi(sd); + struct v4l2_subdev *remote_sd; + struct media_pad *sink_pad, *remote_pad; + struct device *dev =3D csi_dev->dev; + u64 mask; + int ret; + + sink_pad =3D &sd->entity.pads[RKCSI_PAD_SINK]; + remote_pad =3D media_pad_remote_pad_first(sink_pad); + remote_sd =3D media_entity_to_v4l2_subdev(remote_pad->entity); + + mask =3D v4l2_subdev_state_xlate_streams(state, RKCSI_PAD_SINK, + RKCSI_PAD_SRC, &streams_mask); + + ret =3D v4l2_subdev_disable_streams(remote_sd, remote_pad->index, mask); + + rkcsi_stop(csi_dev); + + pm_runtime_mark_last_busy(dev); + pm_runtime_put_autosuspend(dev); + + return ret; +} + +static const struct v4l2_subdev_pad_ops rkcsi_pad_ops =3D { + .enum_mbus_code =3D rkcsi_enum_mbus_code, + .get_fmt =3D v4l2_subdev_get_fmt, + .set_fmt =3D rkcsi_set_fmt, + .set_routing =3D rkcsi_set_routing, + .enable_streams =3D rkcsi_enable_streams, + .disable_streams =3D rkcsi_disable_streams, +}; + +static const struct v4l2_subdev_ops rkcsi_ops =3D { + .pad =3D &rkcsi_pad_ops, +}; + +static int rkcsi_init_state(struct v4l2_subdev *sd, + struct v4l2_subdev_state *state) +{ + struct v4l2_subdev_route routes[] =3D { + { + .sink_pad =3D RKCSI_PAD_SINK, + .sink_stream =3D 0, + .source_pad =3D RKCSI_PAD_SRC, + .source_stream =3D 0, + .flags =3D V4L2_SUBDEV_ROUTE_FL_ACTIVE, + }, + }; + struct v4l2_subdev_krouting routing =3D { + .len_routes =3D ARRAY_SIZE(routes), + .num_routes =3D ARRAY_SIZE(routes), + .routes =3D routes, + }; + int ret; + + ret =3D v4l2_subdev_set_routing_with_fmt(sd, state, &routing, + &default_format); + + return ret; +} + +static const struct v4l2_subdev_internal_ops rkcsi_internal_ops =3D { + .init_state =3D rkcsi_init_state, +}; + +static int rkcsi_notifier_bound(struct v4l2_async_notifier *notifier, + struct v4l2_subdev *sd, + struct v4l2_async_connection *asd) +{ + struct rkcsi_device *csi_dev =3D + container_of(notifier, struct rkcsi_device, notifier); + int source_pad; + + source_pad =3D media_entity_get_fwnode_pad(&sd->entity, sd->fwnode, + MEDIA_PAD_FL_SOURCE); + if (source_pad < 0) { + dev_err(csi_dev->dev, "failed to find source pad for %s\n", + sd->name); + return source_pad; + } + + csi_dev->source_sd =3D sd; + csi_dev->source_pad =3D source_pad; + + return media_create_pad_link(&sd->entity, source_pad, + &csi_dev->sd.entity, RKCSI_PAD_SINK, + MEDIA_LNK_FL_ENABLED); +} + +static const struct v4l2_async_notifier_operations rkcsi_notifier_ops =3D { + .bound =3D rkcsi_notifier_bound, +}; + +static int rkcsi_register_notifier(struct rkcsi_device *csi_dev) +{ + struct v4l2_async_connection *asd; + struct v4l2_async_notifier *ntf =3D &csi_dev->notifier; + struct v4l2_fwnode_endpoint *vep =3D &csi_dev->vep; + struct v4l2_subdev *sd =3D &csi_dev->sd; + struct device *dev =3D csi_dev->dev; + struct fwnode_handle *ep; + int ret =3D 0; + + ep =3D fwnode_graph_get_endpoint_by_id(dev_fwnode(dev), 0, 0, 0); + if (!ep) + return dev_err_probe(dev, -ENODEV, "failed to get endpoint\n"); + + vep->bus_type =3D V4L2_MBUS_UNKNOWN; + ret =3D v4l2_fwnode_endpoint_parse(ep, vep); + if (ret) { + ret =3D dev_err_probe(dev, ret, "failed to parse endpoint\n"); + goto out; + } + + if (vep->bus_type !=3D V4L2_MBUS_CSI2_DPHY && + vep->bus_type !=3D V4L2_MBUS_CSI2_CPHY) { + ret =3D dev_err_probe(dev, -EINVAL, + "invalid bus type of endpoint\n"); + goto out; + } + + v4l2_async_subdev_nf_init(ntf, sd); + ntf->ops =3D &rkcsi_notifier_ops; + + asd =3D v4l2_async_nf_add_fwnode_remote(ntf, ep, + struct v4l2_async_connection); + if (IS_ERR(asd)) { + ret =3D PTR_ERR(asd); + goto err_nf_cleanup; + } + + ret =3D v4l2_async_nf_register(ntf); + if (ret) { + ret =3D dev_err_probe(dev, ret, "failed to register notifier\n"); + goto err_nf_cleanup; + } + + goto out; + +err_nf_cleanup: + v4l2_async_nf_cleanup(ntf); +out: + fwnode_handle_put(ep); + return ret; +} + +static int rkcsi_register(struct rkcsi_device *csi_dev) +{ + struct media_pad *pads =3D csi_dev->pads; + struct v4l2_subdev *sd =3D &csi_dev->sd; + int ret; + + ret =3D rkcsi_register_notifier(csi_dev); + if (ret) + goto err; + + v4l2_subdev_init(sd, &rkcsi_ops); + sd->dev =3D csi_dev->dev; + sd->entity.ops =3D &rkcsi_media_ops; + sd->entity.function =3D MEDIA_ENT_F_VID_IF_BRIDGE; + sd->flags |=3D V4L2_SUBDEV_FL_HAS_DEVNODE | V4L2_SUBDEV_FL_STREAMS; + sd->internal_ops =3D &rkcsi_internal_ops; + sd->owner =3D THIS_MODULE; + snprintf(sd->name, sizeof(sd->name), "rockchip-mipi-csi %s", + dev_name(csi_dev->dev)); + + pads[RKCSI_PAD_SINK].flags =3D MEDIA_PAD_FL_SINK | + MEDIA_PAD_FL_MUST_CONNECT; + pads[RKCSI_PAD_SRC].flags =3D MEDIA_PAD_FL_SOURCE; + ret =3D media_entity_pads_init(&sd->entity, RKCSI_PAD_MAX, pads); + if (ret) + goto err_notifier_unregister; + + ret =3D v4l2_subdev_init_finalize(sd); + if (ret) + goto err_entity_cleanup; + + ret =3D v4l2_async_register_subdev(sd); + if (ret) { + dev_err(sd->dev, "failed to register CSI subdev\n"); + goto err_subdev_cleanup; + } + + return 0; + +err_subdev_cleanup: + v4l2_subdev_cleanup(sd); +err_entity_cleanup: + media_entity_cleanup(&sd->entity); +err_notifier_unregister: + v4l2_async_nf_unregister(&csi_dev->notifier); + v4l2_async_nf_cleanup(&csi_dev->notifier); +err: + return ret; +} + +static void rkcsi_unregister(struct rkcsi_device *csi_dev) +{ + struct v4l2_subdev *sd =3D &csi_dev->sd; + + v4l2_async_unregister_subdev(sd); + v4l2_subdev_cleanup(sd); + media_entity_cleanup(&sd->entity); + v4l2_async_nf_unregister(&csi_dev->notifier); + v4l2_async_nf_cleanup(&csi_dev->notifier); +} + +static const struct of_device_id rkcsi_of_match[] =3D { + { + .compatible =3D "rockchip,rk3568-mipi-csi", + }, + {} +}; +MODULE_DEVICE_TABLE(of, rkcsi_of_match); + +static int rkcsi_probe(struct platform_device *pdev) +{ + struct device *dev =3D &pdev->dev; + struct rkcsi_device *csi_dev; + int ret; + + csi_dev =3D devm_kzalloc(dev, sizeof(*csi_dev), GFP_KERNEL); + if (!csi_dev) + return -ENOMEM; + csi_dev->dev =3D dev; + dev_set_drvdata(dev, csi_dev); + + csi_dev->base_addr =3D devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(csi_dev->base_addr)) + return PTR_ERR(csi_dev->base_addr); + + ret =3D devm_clk_bulk_get_all(dev, &csi_dev->clks); + if (ret !=3D RKCSI_CLKS_MAX) + return dev_err_probe(dev, -ENODEV, "failed to get clocks\n"); + csi_dev->clks_num =3D ret; + + csi_dev->phy =3D devm_phy_get(dev, NULL); + if (IS_ERR(csi_dev->phy)) + return dev_err_probe(dev, PTR_ERR(csi_dev->phy), + "failed to get MIPI CSI PHY\n"); + + csi_dev->reset =3D devm_reset_control_get_exclusive(dev, NULL); + if (IS_ERR(csi_dev->reset)) + return dev_err_probe(dev, PTR_ERR(csi_dev->reset), + "failed to get reset\n"); + + csi_dev->formats =3D formats; + csi_dev->formats_num =3D ARRAY_SIZE(formats); + + pm_runtime_enable(dev); + + ret =3D phy_init(csi_dev->phy); + if (ret) { + ret =3D dev_err_probe(dev, ret, + "failed to initialize MIPI CSI PHY\n"); + goto err_pm_runtime_disable; + } + + ret =3D rkcsi_register(csi_dev); + if (ret) + goto err_phy_exit; + + return 0; + +err_phy_exit: + phy_exit(csi_dev->phy); +err_pm_runtime_disable: + pm_runtime_disable(dev); + return ret; +} + +static void rkcsi_remove(struct platform_device *pdev) +{ + struct rkcsi_device *csi_dev =3D platform_get_drvdata(pdev); + struct device *dev =3D &pdev->dev; + + rkcsi_unregister(csi_dev); + phy_exit(csi_dev->phy); + pm_runtime_disable(dev); +} + +static int rkcsi_runtime_suspend(struct device *dev) +{ + struct rkcsi_device *csi_dev =3D dev_get_drvdata(dev); + + clk_bulk_disable_unprepare(csi_dev->clks_num, csi_dev->clks); + + return 0; +} + +static int rkcsi_runtime_resume(struct device *dev) +{ + struct rkcsi_device *csi_dev =3D dev_get_drvdata(dev); + int ret; + + reset_control_assert(csi_dev->reset); + udelay(5); + reset_control_deassert(csi_dev->reset); + + ret =3D clk_bulk_prepare_enable(csi_dev->clks_num, csi_dev->clks); + if (ret) { + dev_err(dev, "failed to enable clocks\n"); + return ret; + } + + return 0; +} + +static const struct dev_pm_ops rkcsi_pm_ops =3D { + .runtime_suspend =3D rkcsi_runtime_suspend, + .runtime_resume =3D rkcsi_runtime_resume, +}; + +static struct platform_driver rkcsi_drv =3D { + .driver =3D { + .name =3D "rockchip-mipi-csi", + .of_match_table =3D rkcsi_of_match, + .pm =3D &rkcsi_pm_ops, + }, + .probe =3D rkcsi_probe, + .remove =3D rkcsi_remove, +}; +module_platform_driver(rkcsi_drv); + +MODULE_DESCRIPTION("Rockchip MIPI CSI-2 Receiver platform driver"); +MODULE_LICENSE("GPL"); --=20 2.39.5 From nobody Tue Dec 2 02:44:14 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DD77034E764; Tue, 18 Nov 2025 11:12:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763464348; cv=none; b=Ji0+w5MUjBuz9uW+bmrJfjPUqLDV/xy4qHWlQ9Q2JPd8RafWsvuBMw5LlHxn6SgJwGd90VDMs8V86gTGZba8e3Y23akYEbE78SKQtQk7syZStBdeutOpT7AwpBXS2CCVSkWjjkMkTSRe6GAsCn13HxjbgxtIAcr9V4kgwW027sI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763464348; c=relaxed/simple; bh=xnocN+UVtEWIR/5avN8SC34bZiIurYSuuufPbeT/3Uc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Vu+fUdHmMTMRG1jFkIdCN6KbVRWrBGU1DKgI4Fn6a2Y6nB5iwq8UpP5TbFrfjlAJPnF+nyKt/aJjarQgA8oL/UjT8qIKT4PidFxmiwoOrUqFT1XBmaoCo4fAmemj9fCDlb/Gm+tbz6GtAll8qavmlY9/j0p5TPvYAsLuLNmKEg4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BGoYB7uq; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="BGoYB7uq" Received: by smtp.kernel.org (Postfix) with ESMTPS id 51285C2BCB6; Tue, 18 Nov 2025 11:12:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763464347; bh=xnocN+UVtEWIR/5avN8SC34bZiIurYSuuufPbeT/3Uc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=BGoYB7uqZrvv90OkHLoOlaRiBuZQ6Izgj98yvwZdyvUzmNpuTettRuXSf11pBDm1l Lmd3u8rc6e8ImbthAa9crlxbKpeLTi3yGsoV13dT3C2NzcFd34nIP4L6EDtdrbvmt6 QUHZfxcFn8Ptd1Qk+oICiL/2NVgbMNaZBWzyMl8pectX6gHoo5H7CQMhcN9rUJLtau xHyXJBFQ4/aLco+NF16aGx645y1cEnAT3e+onhSlBDo2oCcXx1wDDoflFVUvYOzuHX j5rMVKS1VzxdnHn6hoV+la0fiAt+Idci3ExEF8Cf7zfIvmcH9R1roA48xpJrWAH97x PUGwp3pzqowrg== 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 065E9CED61A; Tue, 18 Nov 2025 11:12:27 +0000 (UTC) From: Michael Riesch via B4 Relay Date: Tue, 18 Nov 2025 12:12:27 +0100 Subject: [PATCH v2 3/3] arm64: defconfig: enable rockchip mipi csi-2 receiver Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251114-rockchip-mipi-receiver-v2-3-eb9b43377fc4@collabora.com> References: <20251114-rockchip-mipi-receiver-v2-0-eb9b43377fc4@collabora.com> In-Reply-To: <20251114-rockchip-mipi-receiver-v2-0-eb9b43377fc4@collabora.com> To: Michael Riesch , Mehdi Djait , Bryan O'Donoghue , Laurent Pinchart , Hans Verkuil , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner , Philipp Zabel , Sebastian Reichel , Nicolas Dufresne , Collabora Kernel Team , Sakari Ailus Cc: linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.12.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1763464345; l=775; i=michael.riesch@collabora.com; s=20250410; h=from:subject:message-id; bh=QnSDQN2WWfjs2EWe+e6kdAB9fFyLYhe37xUo+h6vPgM=; b=XeLsfJxVtIS8ozuzcmT1zTnkjSz5Yf2qGGwwLGRIxHjZ6cBA6BS/mf738D8ICgTQWu15nX4ss J0UOq+plGVWAC5GU1WU4jPL5DUd3E/asiExml3igaqeZAZ1EtAiKboF 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 Reply-To: michael.riesch@collabora.com From: Michael Riesch The Rockchip MIPI CSI-2 Receiver is integrated into recent Rockchip SoCs, such as the RK3568 and the RK3588. Enable the driver for it in the default configuration. Signed-off-by: Michael Riesch --- arch/arm64/configs/defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig index e3a2d37bd104..a161666f2894 100644 --- a/arch/arm64/configs/defconfig +++ b/arch/arm64/configs/defconfig @@ -883,6 +883,7 @@ CONFIG_VIDEO_RENESAS_FCP=3Dm CONFIG_VIDEO_RENESAS_FDP1=3Dm CONFIG_VIDEO_RENESAS_VSP1=3Dm CONFIG_VIDEO_RCAR_DRIF=3Dm +CONFIG_VIDEO_ROCKCHIP_CSI=3Dm CONFIG_VIDEO_ROCKCHIP_RGA=3Dm CONFIG_VIDEO_SAMSUNG_EXYNOS_GSC=3Dm CONFIG_VIDEO_SAMSUNG_S5P_JPEG=3Dm --=20 2.39.5