From nobody Sun Jun 21 05:18:50 2026 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 9B7FB274FDC; Mon, 6 Apr 2026 21:55:13 +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=1775512513; cv=none; b=VJuiURgump/MlkaDaeAeSwFbPu5iVsv8Nw5PXJ8Q1Le6o0h4+u4PHq2HWeBCEDp3gyVA8jUVxCSiJhkx1CuDRCiVeAMf7FrhpgifEfT604J7WzxNbNUOKcU7NUcF0ly6UdlzXsv7Fn+LbVXfTAk+6GNo5xMAUk4PlKg8B/9tJRQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775512513; c=relaxed/simple; bh=CBd0FlqYMyo+UihOndAv+LMaCgvCiK2xmy/EWQc5hMU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=IYV97aaIkE4zJkOlGc+4VzrB+3+2ENvf0KBO1yjA5yfoPuc7LVESSbecaJMZLbsQkupsVXHSnm9f+hYfMLoMmM+MAaUOsKNQ3wKo4NDqu0/H3CEbAMocvuWcpb5s2TGje3CST4S4Q/j7g7d/miecudOsFoFEzOZgG66+XBvCI3s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YjQC8uFx; 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="YjQC8uFx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 10479C2BC9E; Mon, 6 Apr 2026 21:55:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775512513; bh=CBd0FlqYMyo+UihOndAv+LMaCgvCiK2xmy/EWQc5hMU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=YjQC8uFxuZYehtC5TwqQ1mb/gGs0tWjDe+EhZWuZDpl7674xnkGEzI1kQW5B9+NeU 77vkZvnRBvxU6HY47/WsZV2lj9L3qdxbbMoHUb/j+Zrw/XwTb+O29Ee49Bz3kxBw6c SkVQ/JSrF3Q0h8LX1V+QLOp7yFpEeIBl7ikMV1/3Kx55UkRRzSMqt9DNpoCmoYx5Di ftO3uNYWvBlScpkFBfIsI8joa7zMNvFoho7CF5plgyplo4bP0H0ELgZPXQ7yGgaysE M5PNWQX/MGzh8k5WT/S88xocOFTvIM9cR9Hzkm/m1GW0HTw1u7julrWWe2NDoX8OTz YToKrqiyFhDLw== From: bod@kernel.org Date: Mon, 06 Apr 2026 22:55:01 +0100 Subject: [PATCH 1/5] media: qcom: camss: Fix RDI streaming for CSID 680 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: <20260406-camss-rdi-fix-v1-1-d3f8b12473d0@kernel.org> References: <20260406-camss-rdi-fix-v1-0-d3f8b12473d0@kernel.org> In-Reply-To: <20260406-camss-rdi-fix-v1-0-d3f8b12473d0@kernel.org> To: Robert Foss , Todor Tomov , Bryan O'Donoghue , Vladimir Zapolskiy , Mauro Carvalho Chehab , Hans Verkuil , Loic Poulain , Hans Verkuil , Gjorgji Rosikopulos , Milen Mitkov , Depeng Shao , Yongsheng Li Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Bryan O'Donoghue , stable@vger.kernel.org X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=4830; i=bod@kernel.org; h=from:subject:message-id; bh=oQbn1r82XFSxBh7iYyo5i/uVB0YKAqo8XeTYt3/N/IE=; b=owEBbQKS/ZANAwAKASJxO7Ohjcg6AcsmYgBp1Cu4XvkJJSJZ2L9tWr8jmA6QZJKdEIJ2PEpMz VqWbYif8lCJAjMEAAEKAB0WIQTmk/sqq6Nt4Rerb7QicTuzoY3IOgUCadQruAAKCRAicTuzoY3I Ou05EACQBerL/HWiXzNZRfqGRpBd/ETV/yr5/tdf6wVxBKgLsOXDBxzMBR/rp5GfMdQuD2RPX1K wXM1QiPEmk0hI9/Q2UR09DsOOxwm7t83woHHkGDlKCoFyxnz5r0eFOnXShTD+d3i0V9bbUqiIdS TefsC41ZPQIWxpINlOsvANCMcv2E2b5U46zIwaJPEfOSM/iCP8q61DO9KivcnXj9ay+zLkSv26X N2oBUpxMHSco9+VRzXvNljCSZy4tTHhXRwjo5vzisHYF1jc2kQNBAxwQmv4d+SopPRMEYvS31IL MQsQXLjQ/AmPbYhrt1CKhKa+WfSONYx12jt9WkNGpHFTNXV0q7UziGZD1j1Ac6a6B9+quPj6Vqs I1yJJT0SQsusKYI7GNOFf/tKYd1mH+x61+O4qbajBEKPc3NMiEFcpgLjQKQYxuIROpyN2be7CW1 Mdc1NSTl/KKieeR6U4+9hlPg8b6MdVgiNFB+71FwqVeSlYZuJlE6MKJ3NVSYxK2XYAQSJLH+bNP RwHR3e5Lj4wXknbJQYScniPDpDivUJW/EN+CeStNcRTWohPhFOvCGaxZWjYGjn2BbLNSaAP5GSX x29jHa91a5F2eyhAMh+kp9ByjcAB9lUcp3DgKpK6AE2weQdXQ1+5ZzeUS/FyOnBxW3XermN2vbm JwnyRE9yIfCoyEw== X-Developer-Key: i=bod@kernel.org; a=openpgp; fpr=E693FB2AABA36DE117AB6FB422713BB3A18DC83A From: Bryan O'Donoghue Fix streaming to RDI1 and RDI2. csid->phy.en_vc contains a bitmask of enabled CSID ports not virtual channels. We cycle through the number of available CSID ports and test this value against the vc_en bitmask. We then use the passed value both as an index to the port configuration macros and as a virtual channel index. This is a very broken pattern. Reviewing the initial introduction of VC support it states that you can only map one CSID to one VFE. This is true however each CSID has multiple sources which can sink inside of the VFE - for example there is a "pixel" path for bayer stats which sources @ CSID(x):3 and sinks on VFE(x):pix. That is CSID port # 3 should drive VFE port #3. With our current setup only a sensor which drives virtual channel number #3 could possibly enable that setup. This is deeply wrong the virtual channel has no relevance to hooking CSID to VFE, a fact that is proven after this patch is applied allowing RDI0,RDI1 and RDI2 to function with VC0 whereas before only RDI1 worked. Default the VC back to zero. A follow on series will implement subdev streams to actually enable VCs without breaking CSID source to VFE sink. Fixes: 253314b20408 ("media: qcom: camss: Add CSID 680 support") Cc: stable@vger.kernel.org Signed-off-by: Bryan O'Donoghue --- drivers/media/platform/qcom/camss/camss-csid-680.c | 26 +++++++++++-------= ---- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/media/platform/qcom/camss/camss-csid-680.c b/drivers/m= edia/platform/qcom/camss/camss-csid-680.c index 3ad3a174bcfb8..35a6bb209f97c 100644 --- a/drivers/media/platform/qcom/camss/camss-csid-680.c +++ b/drivers/media/platform/qcom/camss/camss-csid-680.c @@ -219,9 +219,9 @@ static void __csid_configure_top(struct csid_device *cs= id) CSID_TOP_IO_PATH_CFG0(csid->id)); } =20 -static void __csid_configure_rdi_stream(struct csid_device *csid, u8 enabl= e, u8 vc) +static void __csid_configure_rdi_stream(struct csid_device *csid, u8 enabl= e, u8 port, u8 vc) { - struct v4l2_mbus_framefmt *input_format =3D &csid->fmt[MSM_CSID_PAD_FIRST= _SRC + vc]; + struct v4l2_mbus_framefmt *input_format =3D &csid->fmt[MSM_CSID_PAD_FIRST= _SRC + port]; const struct csid_format_info *format =3D csid_get_fmt_entry(csid->res->f= ormats->formats, csid->res->formats->nformats, input_format->code); @@ -240,21 +240,21 @@ static void __csid_configure_rdi_stream(struct csid_d= evice *csid, u8 enable, u8 * the four least significant bits of the five bit VC * bitfield to generate an internal CID value. * - * CSID_RDI_CFG0(vc) + * CSID_RDI_CFG0(port) * DT_ID : 28:27 * VC : 26:22 * DT : 21:16 * * CID : VC 3:0 << 2 | DT_ID 1:0 */ - dt_id =3D vc & 0x03; + dt_id =3D port & 0x03; =20 /* note: for non-RDI path, this should be format->decode_format */ val |=3D DECODE_FORMAT_PAYLOAD_ONLY << RDI_CFG0_DECODE_FORMAT; val |=3D format->data_type << RDI_CFG0_DATA_TYPE; val |=3D vc << RDI_CFG0_VIRTUAL_CHANNEL; val |=3D dt_id << RDI_CFG0_DT_ID; - writel(val, csid->base + CSID_RDI_CFG0(vc)); + writel(val, csid->base + CSID_RDI_CFG0(port)); =20 val =3D RDI_CFG1_TIMESTAMP_STB_FRAME; val |=3D RDI_CFG1_BYTE_CNTR_EN; @@ -265,23 +265,23 @@ static void __csid_configure_rdi_stream(struct csid_d= evice *csid, u8 enable, u8 val |=3D RDI_CFG1_CROP_V_EN; val |=3D RDI_CFG1_PACKING_MIPI; =20 - writel(val, csid->base + CSID_RDI_CFG1(vc)); + writel(val, csid->base + CSID_RDI_CFG1(port)); =20 val =3D 0; - writel(val, csid->base + CSID_RDI_IRQ_SUBSAMPLE_PERIOD(vc)); + writel(val, csid->base + CSID_RDI_IRQ_SUBSAMPLE_PERIOD(port)); =20 val =3D 1; - writel(val, csid->base + CSID_RDI_IRQ_SUBSAMPLE_PATTERN(vc)); + writel(val, csid->base + CSID_RDI_IRQ_SUBSAMPLE_PATTERN(port)); =20 val =3D 0; - writel(val, csid->base + CSID_RDI_CTRL(vc)); + writel(val, csid->base + CSID_RDI_CTRL(port)); =20 - val =3D readl(csid->base + CSID_RDI_CFG0(vc)); + val =3D readl(csid->base + CSID_RDI_CFG0(port)); if (enable) val |=3D RDI_CFG0_ENABLE; else val &=3D ~RDI_CFG0_ENABLE; - writel(val, csid->base + CSID_RDI_CFG0(vc)); + writel(val, csid->base + CSID_RDI_CFG0(port)); } =20 static void csid_configure_stream(struct csid_device *csid, u8 enable) @@ -293,8 +293,8 @@ static void csid_configure_stream(struct csid_device *c= sid, u8 enable) /* Loop through all enabled VCs and configure stream for each */ for (i =3D 0; i < MSM_CSID_MAX_SRC_STREAMS; i++) { if (csid->phy.en_vc & BIT(i)) { - __csid_configure_rdi_stream(csid, enable, i); - __csid_configure_rx(csid, &csid->phy, i); + __csid_configure_rdi_stream(csid, enable, i, 0); + __csid_configure_rx(csid, &csid->phy, 0); __csid_ctrl_rdi(csid, enable, i); } } --=20 2.52.0 From nobody Sun Jun 21 05:18:50 2026 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 3EC23274FDC; Mon, 6 Apr 2026 21:55:17 +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=1775512517; cv=none; b=bu/xLtAjNETGpnLPlJ0mee9wxk+pQ7qgDlf9TNEmWmpmVo6R7YuQSmzdvZyyRnays+fd7nTI7s6LfiXJvoFqLs9yYjtLyWmPfu0iqbp9pRyX5FetoKy34VTqA+Kf7vK27uyDbwlus6jwSmzMgXVjoafBBdUDFU/wN4GlOhZgPuA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775512517; c=relaxed/simple; bh=Z9r0dbQzT/tJ52KABpH4UhKOxrTmTU6KUEpsWEpGA0I=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=s8vzoCgx4EOvy6rkPT3x9UEZg5Y2s5/RZSA7WorGiHL+xPYNJkERzrcpSms8aWPEm7BZZ8GYDPCLmXbCaMMU9jvsm6XwvYJZmkLQymyc7TWefc5Q8/Skwr3/vuy8QRFsyfvuSK98e7k3V82xGU8FZDwj1LPrOriAs0PtAWaKYP8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FRklpXtS; 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="FRklpXtS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AEF1BC2BCAF; Mon, 6 Apr 2026 21:55:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775512516; bh=Z9r0dbQzT/tJ52KABpH4UhKOxrTmTU6KUEpsWEpGA0I=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=FRklpXtSsr22QptRA6hS3vZmhCB1rEGjNmdhSCsyJzzqxTzRmU9tBwBTypfkqgM9U yJUBzk33GzaOqFHe1V7XlYJTIdaORU6f51I1zQo3/9yY62oELKNIW4avAGSwbHZ6o9 q0nTJe0v7kvzUnwwnXmfpGMCp3ogI/0mG2hPUDh6mlegHHe6AzvLC94Xx1xrAZf3vS AJ57NVqBUvmRC7NyXbpYGwQjjIZDjr7gtOmaB+X4QBvGtQR34u4m2/7xAJGRZtdvYi KqiO4scFjrmxcmRuoTQe19vZiZ5ab0jqIRsQgU1JM+UyD+V8HXUI7zZq98yd7nHIq8 D64PPzIPEfA8A== From: bod@kernel.org Date: Mon, 06 Apr 2026 22:55:02 +0100 Subject: [PATCH 2/5] media: qcom: camss: Fix RDI streaming for CSID 340 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: <20260406-camss-rdi-fix-v1-2-d3f8b12473d0@kernel.org> References: <20260406-camss-rdi-fix-v1-0-d3f8b12473d0@kernel.org> In-Reply-To: <20260406-camss-rdi-fix-v1-0-d3f8b12473d0@kernel.org> To: Robert Foss , Todor Tomov , Bryan O'Donoghue , Vladimir Zapolskiy , Mauro Carvalho Chehab , Hans Verkuil , Loic Poulain , Hans Verkuil , Gjorgji Rosikopulos , Milen Mitkov , Depeng Shao , Yongsheng Li Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Bryan O'Donoghue , stable@vger.kernel.org X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=3005; i=bod@kernel.org; h=from:subject:message-id; bh=rMMfBnojIW90eGYUR2SwkMLX8SQysFcHYJO9587rzoE=; b=owEBbQKS/ZANAwAKASJxO7Ohjcg6AcsmYgBp1Cu4LUWv55g2X9GC0Lw2/RJzlqoG1j+zqFmDC ViV7MAnOO2JAjMEAAEKAB0WIQTmk/sqq6Nt4Rerb7QicTuzoY3IOgUCadQruAAKCRAicTuzoY3I OspSEAC9J6UYQiVa10lMHM7gmeiaCrJ/G0f7RE7ZrZrufgcieRN6Z7bySTfFSLxEpN9CxeFGVOG qZ0X5/XYrsvq+x8APf9Jc207haHPHEojZUDxhkHuiLf9qtZMQmUzgW6GxhFHgRC9mgPMdrNjX31 Fo9zZA6mPpsuSdrxGD4dTawCAZ5e1LqK6g1SYLytOs3rV7LBaB4F5vZ7UsAQdM4ftjwDWBdjVoO 7+mLs0j/jNdzfs3oxwvtmfLidHAu3GoP39v6LPXztG7LZAzVHiSNwgHMsi3lT7bDld8n0zBp1ce BCPpzt2aPEkfRbjbGh4gC0kVZ2uJNOW7e3Ti5+swRKQO5Fn+3mKoWsfaCg2BTR0/Gabd4CEBSxx DX4wLc7Yl7zbbfO3i3gFDKr6tHzf1qlDQix2qRj7SUlvrDUA/P62h1cDjxji5TB/4z5o3ZR6ch5 9cSOv1gFcwnbb4sC0ZQa14NUJQhpJesuz3L2tycxB1uEvwMgochi8L49a9ISsY+Adu8EBmeUe9s TjerlS2TEjbbVBvrqi0XeBwm+dWYpJ55brZL5+CUCuTeKDPyuXRTqCH0sMqEkIe4639qCHG469Y HcWd/edNKThMdXlzIYp9EMM7UXBJEpSGhwyMPCasNK/fK5rs6hSxW+iUauyxDBQkSiZ+TxLx47M xBtX5AZYk1koCiw== X-Developer-Key: i=bod@kernel.org; a=openpgp; fpr=E693FB2AABA36DE117AB6FB422713BB3A18DC83A From: Bryan O'Donoghue Fix streaming from CSIDn RDI1 and RDI2 to VFEn RDI1 and RDI2. A pattern we have replicated throughout CAMSS where we use the VC number to populate both the VC fields and port fields of the CSID means that in practice only VC =3D 0 on CSIDn:RDI0 to VFEn:RDI0 works. Fix that for CSID 340 by separating VC and port. Fix to VC zero as a bugfix we will look to properly populate the VC field with follow on patches later. Fixes: f0fc808a466a ("media: qcom: camss: Add CSID 340 support") Cc: stable@vger.kernel.org Signed-off-by: Bryan O'Donoghue --- drivers/media/platform/qcom/camss/camss-csid-340.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/media/platform/qcom/camss/camss-csid-340.c b/drivers/m= edia/platform/qcom/camss/camss-csid-340.c index 2b50f9b96a34e..5a7271785ec7a 100644 --- a/drivers/media/platform/qcom/camss/camss-csid-340.c +++ b/drivers/media/platform/qcom/camss/camss-csid-340.c @@ -74,9 +74,9 @@ static void __csid_ctrl_rdi(struct csid_device *csid, int= enable, u8 rdi) writel_relaxed(!!enable, csid->base + CSID_RDI_CTRL(rdi)); } =20 -static void __csid_configure_rdi_stream(struct csid_device *csid, u8 enabl= e, u8 vc) +static void __csid_configure_rdi_stream(struct csid_device *csid, u8 enabl= e, u8 port, u8 vc) { - struct v4l2_mbus_framefmt *input_format =3D &csid->fmt[MSM_CSID_PAD_FIRST= _SRC + vc]; + struct v4l2_mbus_framefmt *input_format =3D &csid->fmt[MSM_CSID_PAD_FIRST= _SRC + port]; const struct csid_format_info *format =3D csid_get_fmt_entry(csid->res->f= ormats->formats, csid->res->formats->nformats, input_format->code); @@ -95,7 +95,7 @@ static void __csid_configure_rdi_stream(struct csid_devic= e *csid, u8 enable, u8 * * CID : VC 3:0 << 2 | DT_ID 1:0 */ - dt_id =3D vc & 0x03; + dt_id =3D port & 0x03; =20 val =3D CSID_RDI_CFG0_DECODE_FORMAT_NOP; /* only for RDI path */ val |=3D FIELD_PREP(CSID_RDI_CFG0_DT_MASK, format->data_type); @@ -105,10 +105,11 @@ static void __csid_configure_rdi_stream(struct csid_d= evice *csid, u8 enable, u8 if (enable) val |=3D CSID_RDI_CFG0_ENABLE; =20 - dev_dbg(csid->camss->dev, "CSID%u: Stream %s (dt:0x%x vc=3D%u)\n", - csid->id, enable ? "enable" : "disable", format->data_type, vc); + dev_dbg(csid->camss->dev, "CSID%u: Stream %s (dt:0x%x port=3D%u vc=3D%u)\= n", + csid->id, enable ? "enable" : "disable", format->data_type, + port, vc); =20 - writel_relaxed(val, csid->base + CSID_RDI_CFG0(vc)); + writel_relaxed(val, csid->base + CSID_RDI_CFG0(port)); } =20 static void csid_configure_stream(struct csid_device *csid, u8 enable) @@ -119,7 +120,7 @@ static void csid_configure_stream(struct csid_device *c= sid, u8 enable) =20 for (i =3D 0; i < MSM_CSID_MAX_SRC_STREAMS; i++) { if (csid->phy.en_vc & BIT(i)) { - __csid_configure_rdi_stream(csid, enable, i); + __csid_configure_rdi_stream(csid, enable, i, 0); __csid_ctrl_rdi(csid, enable, i); } } --=20 2.52.0 From nobody Sun Jun 21 05:18:50 2026 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 D98FE39D6DA; Mon, 6 Apr 2026 21:55:20 +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=1775512520; cv=none; b=FKOnq05RNCCusaYsFq6ZIoOEbBQOmrVPFcinf2KwarsrHaE9YAOVG0DVqdeJZQ32JBN3vo0IyCcXzCzzCMfnS5q2gF+fthSuXa/ciGDBe8p6leM+ZqKtO05IMwkNlXswvhnTLH5yDgp6UirbZSE9d0rxcvGHY/C7VExMKcchd9I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775512520; c=relaxed/simple; bh=MrnvUK5shL9SYgXgcz0i1EHmwlI+U/W+aO7zSEqzKPE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=JAn5+Wb/u8gQeTmpHTtHad6dwC4qWVp9lYBOZMZx739tH63GTPfT0f8rijBS9Pl7CZphgFWqk24cLOphv1qXW3xBfZPryqMRRQF4xS3U+X00qkMW4xc6cmB+lu4pSZ9tai/U1A9fika/boQT7zxq0IyVx4vqwUWb5mXHIyE5wdk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=NrYaAb8q; 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="NrYaAb8q" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 52C35C4CEF7; Mon, 6 Apr 2026 21:55:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775512520; bh=MrnvUK5shL9SYgXgcz0i1EHmwlI+U/W+aO7zSEqzKPE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=NrYaAb8qbjVS639TF9uo4HHxjwQMAWlbJ16VjrqHsqw3snfmuXSGgeO7l263SPOQ0 cmuPvjDFCZ01sv0dArOURT8CSwwMb8dFWFSXNq/pA8vuWJnMLZ+LyAB93GN1OvYYj6 +I2qsIIK6/7Uz04rOmDnSIdoEcaze8gB5NifJIQ2XYUBkHwdTXWHUVlKuTwiQxnZb0 jb56k18E1r7+fX+nOeTLqp4FBvwTiXSJSM/LR7pksSun7t8AF0tr2qO7ERfpbmS28w SczTz5z9iQLyM2wQs7Mgv6Qlplw4gCSBM25JXxfgTP+BYK8imFDP7MrQuNZ9PV2eKe Bjm+auFtVR0rQ== From: bod@kernel.org Date: Mon, 06 Apr 2026 22:55:03 +0100 Subject: [PATCH 3/5] media: qcom: camss: Fix RDI streaming for CSID GEN2 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: <20260406-camss-rdi-fix-v1-3-d3f8b12473d0@kernel.org> References: <20260406-camss-rdi-fix-v1-0-d3f8b12473d0@kernel.org> In-Reply-To: <20260406-camss-rdi-fix-v1-0-d3f8b12473d0@kernel.org> To: Robert Foss , Todor Tomov , Bryan O'Donoghue , Vladimir Zapolskiy , Mauro Carvalho Chehab , Hans Verkuil , Loic Poulain , Hans Verkuil , Gjorgji Rosikopulos , Milen Mitkov , Depeng Shao , Yongsheng Li Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Bryan O'Donoghue , stable@vger.kernel.org X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=5910; i=bod@kernel.org; h=from:subject:message-id; bh=25psnwdU17rckVWoD1M41gs44CnKjIvqGn+sDMda3Vo=; b=owEBbQKS/ZANAwAKASJxO7Ohjcg6AcsmYgBp1Cu5rdAIVpzJvy1RD3qAW7HYnKU4CmTsOrmXb g9edD0Xi1CJAjMEAAEKAB0WIQTmk/sqq6Nt4Rerb7QicTuzoY3IOgUCadQruQAKCRAicTuzoY3I OrIxD/kBsHKsKybcegzRzyeypf6rYSfFcv28nDTCLr0nVMAsKvzLGOrZLTca8kKyIK45LuQP9rE pEA842mzGaxsxC25pEKFfXDMSm7++QuFv2ATiNCA9GClPPst8Dg+891GmiHYR9CshFURYIJs2iI VMmOOu13ovJn2RCcthrzt0zYECw9wCOQHcDNyR0ajWobYi/GfYCo2ZGv+XYT57dm4iLCPZ/+3Lx YcZjmJA/Ew3x4CCqN0qz7HvvCoFP/5ECd9ETyFUd0ern2JRA5aeaU2rt8pvuBcvnQMxgF9JF6S+ 0Qtgm+HQmwSWk0/C77DWaDFBIeveNleSnjJp424c/+GPcPArRdWrl/csidVU38drnZ9w1AWT0sV MKKhHfl84oeRKthR7fpBYUTD6OOTMvO7CkzTOn8DiONoGDa6EU/NhrXurD49nrXcJB5FONg0rkV 1BIn9z2Bv0/LwYaXGplhhL0RmoCX8g2HMQK7u1DTZx1ZUuBSwPPw0z1anU1livXG81Jw+29w2eO hila10Y69bhFAThv2baQS3d5S2kuRDgl8JHGG7xbf4BTv/G5b0nIDMf4gI9ZDdI2WAn+BrmjDRr spIG1XQBKSfI4cCgTnU6L7BxJA/aWNruHmvYkDCsifSH1Eqv8whGqzBijeRViWMIPF1qFXVe11B xLa1WDb16XeJkLQ== X-Developer-Key: i=bod@kernel.org; a=openpgp; fpr=E693FB2AABA36DE117AB6FB422713BB3A18DC83A From: Bryan O'Donoghue Fix streaming from CSIDn RDI1 and RDI2 to VFEn RDI1 and RDI2. A pattern we have replicated throughout CAMSS where we use the VC number to populate both the VC fields and port fields of the CSID means that in practice only VC =3D 0 on CSIDn:RDI0 to VFEn:RDI0 works. Fix that for CSID gen2 by separating VC and port. Fix to VC zero as a bugfix we will look to properly populate the VC field with follow on patches later. Fixes: 729fc005c8e2 ("media: qcom: camss: Split testgen, RDI and RX for CSI= D 170") Cc: stable@vger.kernel.org Signed-off-by: Bryan O'Donoghue --- .../media/platform/qcom/camss/camss-csid-gen2.c | 44 +++++++++++-------= ---- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/drivers/media/platform/qcom/camss/camss-csid-gen2.c b/drivers/= media/platform/qcom/camss/camss-csid-gen2.c index 2a1746dcc1c5b..331feed199094 100644 --- a/drivers/media/platform/qcom/camss/camss-csid-gen2.c +++ b/drivers/media/platform/qcom/camss/camss-csid-gen2.c @@ -203,10 +203,10 @@ static void __csid_ctrl_rdi(struct csid_device *csid,= int enable, u8 rdi) writel_relaxed(val, csid->base + CSID_RDI_CTRL(rdi)); } =20 -static void __csid_configure_testgen(struct csid_device *csid, u8 enable, = u8 vc) +static void __csid_configure_testgen(struct csid_device *csid, u8 enable, = u8 port, u8 vc) { struct csid_testgen_config *tg =3D &csid->testgen; - struct v4l2_mbus_framefmt *input_format =3D &csid->fmt[MSM_CSID_PAD_FIRST= _SRC + vc]; + struct v4l2_mbus_framefmt *input_format =3D &csid->fmt[MSM_CSID_PAD_FIRST= _SRC + port]; const struct csid_format_info *format =3D csid_get_fmt_entry(csid->res->f= ormats->formats, csid->res->formats->nformats, input_format->code); @@ -253,10 +253,10 @@ static void __csid_configure_testgen(struct csid_devi= ce *csid, u8 enable, u8 vc) writel_relaxed(val, csid->base + CSID_TPG_CTRL); } =20 -static void __csid_configure_rdi_stream(struct csid_device *csid, u8 enabl= e, u8 vc) +static void __csid_configure_rdi_stream(struct csid_device *csid, u8 enabl= e, u8 port, u8 vc) { /* Source pads matching RDI channels on hardware. Pad 1 -> RDI0, Pad 2 ->= RDI1, etc. */ - struct v4l2_mbus_framefmt *input_format =3D &csid->fmt[MSM_CSID_PAD_FIRST= _SRC + vc]; + struct v4l2_mbus_framefmt *input_format =3D &csid->fmt[MSM_CSID_PAD_FIRST= _SRC + port]; const struct csid_format_info *format =3D csid_get_fmt_entry(csid->res->f= ormats->formats, csid->res->formats->nformats, input_format->code); @@ -267,14 +267,14 @@ static void __csid_configure_rdi_stream(struct csid_d= evice *csid, u8 enable, u8 * the four least significant bits of the five bit VC * bitfield to generate an internal CID value. * - * CSID_RDI_CFG0(vc) + * CSID_RDI_CFG0(port) * DT_ID : 28:27 * VC : 26:22 * DT : 21:16 * * CID : VC 3:0 << 2 | DT_ID 1:0 */ - u8 dt_id =3D vc & 0x03; + u8 dt_id =3D port & 0x03; =20 val =3D 1 << RDI_CFG0_BYTE_CNTR_EN; val |=3D 1 << RDI_CFG0_FORMAT_MEASURE_EN; @@ -284,42 +284,42 @@ static void __csid_configure_rdi_stream(struct csid_d= evice *csid, u8 enable, u8 val |=3D format->data_type << RDI_CFG0_DATA_TYPE; val |=3D vc << RDI_CFG0_VIRTUAL_CHANNEL; val |=3D dt_id << RDI_CFG0_DT_ID; - writel_relaxed(val, csid->base + CSID_RDI_CFG0(vc)); + writel_relaxed(val, csid->base + CSID_RDI_CFG0(port)); =20 /* CSID_TIMESTAMP_STB_POST_IRQ */ val =3D 2 << RDI_CFG1_TIMESTAMP_STB_SEL; - writel_relaxed(val, csid->base + CSID_RDI_CFG1(vc)); + writel_relaxed(val, csid->base + CSID_RDI_CFG1(port)); =20 val =3D 1; - writel_relaxed(val, csid->base + CSID_RDI_FRM_DROP_PERIOD(vc)); + writel_relaxed(val, csid->base + CSID_RDI_FRM_DROP_PERIOD(port)); =20 val =3D 0; - writel_relaxed(val, csid->base + CSID_RDI_FRM_DROP_PATTERN(vc)); + writel_relaxed(val, csid->base + CSID_RDI_FRM_DROP_PATTERN(port)); =20 val =3D 1; - writel_relaxed(val, csid->base + CSID_RDI_IRQ_SUBSAMPLE_PERIOD(vc)); + writel_relaxed(val, csid->base + CSID_RDI_IRQ_SUBSAMPLE_PERIOD(port)); =20 val =3D 0; - writel_relaxed(val, csid->base + CSID_RDI_IRQ_SUBSAMPLE_PATTERN(vc)); + writel_relaxed(val, csid->base + CSID_RDI_IRQ_SUBSAMPLE_PATTERN(port)); =20 val =3D 1; - writel_relaxed(val, csid->base + CSID_RDI_RPP_PIX_DROP_PERIOD(vc)); + writel_relaxed(val, csid->base + CSID_RDI_RPP_PIX_DROP_PERIOD(port)); =20 val =3D 0; - writel_relaxed(val, csid->base + CSID_RDI_RPP_PIX_DROP_PATTERN(vc)); + writel_relaxed(val, csid->base + CSID_RDI_RPP_PIX_DROP_PATTERN(port)); =20 val =3D 1; - writel_relaxed(val, csid->base + CSID_RDI_RPP_LINE_DROP_PERIOD(vc)); + writel_relaxed(val, csid->base + CSID_RDI_RPP_LINE_DROP_PERIOD(port)); =20 val =3D 0; - writel_relaxed(val, csid->base + CSID_RDI_RPP_LINE_DROP_PATTERN(vc)); + writel_relaxed(val, csid->base + CSID_RDI_RPP_LINE_DROP_PATTERN(port)); =20 val =3D 0; - writel_relaxed(val, csid->base + CSID_RDI_CTRL(vc)); + writel_relaxed(val, csid->base + CSID_RDI_CTRL(port)); =20 - val =3D readl_relaxed(csid->base + CSID_RDI_CFG0(vc)); + val =3D readl_relaxed(csid->base + CSID_RDI_CFG0(port)); val |=3D enable << RDI_CFG0_ENABLE; - writel_relaxed(val, csid->base + CSID_RDI_CFG0(vc)); + writel_relaxed(val, csid->base + CSID_RDI_CFG0(port)); } =20 static void csid_configure_stream(struct csid_device *csid, u8 enable) @@ -330,10 +330,10 @@ static void csid_configure_stream(struct csid_device = *csid, u8 enable) for (i =3D 0; i < MSM_CSID_MAX_SRC_STREAMS; i++) if (csid->phy.en_vc & BIT(i)) { if (tg->enabled) - __csid_configure_testgen(csid, enable, i); + __csid_configure_testgen(csid, enable, i, 0); =20 - __csid_configure_rdi_stream(csid, enable, i); - __csid_configure_rx(csid, &csid->phy, i); + __csid_configure_rdi_stream(csid, enable, i, 0); + __csid_configure_rx(csid, &csid->phy, 0); __csid_ctrl_rdi(csid, enable, i); } } --=20 2.52.0 From nobody Sun Jun 21 05:18:50 2026 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 71E572D5923; Mon, 6 Apr 2026 21:55:24 +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=1775512524; cv=none; b=kagtbxpuZ5vI1b9V0YDo24B9Syc+J96ZUSWH8Dz1VYoMieJQs7HgFqKK7PAn6K1/q8pzHtziZOso4q/Xweet3OZTf3SC65fzSCkl2O4zTYHqBKNAwoMRj+IarxnWrt6pfqNJ2VU/vbQRtFM6o6EuhRNIktFgAPicbJ36bTKImhw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775512524; c=relaxed/simple; bh=4lisSni6lGk1MIzF7sW1BD8o1POa+IS+ZTibgxJAOIw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jNY3QBbD578C8VzGPwvk8+Gkgds71H0bRR44t9llsXbU3Fe0M30AuPDv2gFupVC11T3U2+wBJSimuQXkmK/gZqPyGUcyymGAGUQgiE8AvuGDOQRN2XjCXY9nIZq0uhsogtElllvMz8gSlGcCAWf1SMeLGI2cKPysOQu4b4g2CeU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SSGn4Olf; 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="SSGn4Olf" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EAB04C2BC9E; Mon, 6 Apr 2026 21:55:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775512524; bh=4lisSni6lGk1MIzF7sW1BD8o1POa+IS+ZTibgxJAOIw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=SSGn4OlfPFP54kMQ5AKuV2XiDelw4PStMU4zYUzBpxXfNGuhOXDnkEMmTo/0PrtiQ iwPaDhyfrwFSoro6yvwUgTteONN2vp1qyVueR3jrGqMFQ30X3As6T9h8SdpF5uoJQ1 Y7hJbq/zx1GQcRUWs70/6pvqRmYVrwiPEz9X3m/13lMQqx76n3ag0xqJRGxd5QAGSj jogr9d895/P7TRoeoj4fp1WUUXflppz5Kh06we49nrR7KYTfgWmCbjcjbSumbvc8x0 15KFySgvNlF3XOSkzRXMPocQ+NWEd//9EqMJiu3razB6p7oVXSJItqde2GD0BRJybT eP5vxS0MNepvQ== From: bod@kernel.org Date: Mon, 06 Apr 2026 22:55:04 +0100 Subject: [PATCH 4/5] media: qcom: camss: Fix RDI streaming for CSID GEN3 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: <20260406-camss-rdi-fix-v1-4-d3f8b12473d0@kernel.org> References: <20260406-camss-rdi-fix-v1-0-d3f8b12473d0@kernel.org> In-Reply-To: <20260406-camss-rdi-fix-v1-0-d3f8b12473d0@kernel.org> To: Robert Foss , Todor Tomov , Bryan O'Donoghue , Vladimir Zapolskiy , Mauro Carvalho Chehab , Hans Verkuil , Loic Poulain , Hans Verkuil , Gjorgji Rosikopulos , Milen Mitkov , Depeng Shao , Yongsheng Li Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Bryan O'Donoghue , stable@vger.kernel.org X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=4197; i=bod@kernel.org; h=from:subject:message-id; bh=oAUZRh7lXLkkZV3ONvBHnnJtk/4iA0IrdUCuSBhihPk=; b=owEBbQKS/ZANAwAKASJxO7Ohjcg6AcsmYgBp1Cu5MXjR8orSix9wGGxWUT98y4UwY1oCWcf73 tuvgSo2K0aJAjMEAAEKAB0WIQTmk/sqq6Nt4Rerb7QicTuzoY3IOgUCadQruQAKCRAicTuzoY3I On//D/9cbT7pvq7GpIaL4A9ioke5VfrnkCj3CIxZ6s0lz+82GPOalTpCPUf4/UDvy5yFApujoa3 5Z3SH5o00jKAFkn/V3GKO9lo/0T8JN6YGcjkxl80f8IeFpLJ7zuZYRMQepI3lX42bgGi9K1+B8r zj/whpYfUrLIgBUnrOUVNqeuphhaA1JjfgaWL95fz7TVaRhrsxGf3BQmjnLzovF9byQUdel803X eYM621Qk1NbmPrJd91pSfcTnfNZBJfDFNUmNzSIltdo5zafmQy3UdK1JwDUW29maahBfAOmWy2h drU/6h8+Yw5bRIjyvnNQX99W+1LSUKBnnoEId5wcG6JeEmn0QHBy2T0QgusQyH/QRvyyREhQZyt QQElGjSwe1VXdE/hkNJpFFRwWZ/vwE4dwafNjJXLcJWNJBveQ9mv9Z2C33bqRz7enaVvunjxPB5 QFbEEzwiXrFnZ6pkkLzkkmxU7pzBySQpob2Obupk0u+fqNzylCA2/z5oWcveuzH9yxSYoCqra43 o2KTbQ6ho9p4u9torkfcvIEaIIKSXeB7OBypOeXXqAoEUwzfgqiNR5ROfzXnnbiTZRtURms1KbG 4rcYKk7jSQJ53vhe5cj7jKvcWEVHHpr6eSm1OuEe9CWrO2jYfsFa+WYJ7P1WmK6o0JE4sXZnTut ICLk0aDKQs9RfHg== X-Developer-Key: i=bod@kernel.org; a=openpgp; fpr=E693FB2AABA36DE117AB6FB422713BB3A18DC83A From: Bryan O'Donoghue Fix streaming from CSIDn RDI1 and RDI2 to VFEn RDI1 and RDI2. A pattern we have replicated throughout CAMSS where we use the VC number to populate both the VC fields and port fields of the CSID means that in practice only VC =3D 0 on CSIDn:RDI0 to VFEn:RDI0 works. Fix that for CSID gen3 by separating VC and port. Fix to VC zero as a bugfix we will look to properly populate the VC field with follow on patches later. Fixes: d96fe1808dcc ("media: qcom: camss: Add CSID 780 support") Cc: stable@vger.kernel.org Signed-off-by: Bryan O'Donoghue --- .../media/platform/qcom/camss/camss-csid-gen3.c | 26 +++++++++++-------= ---- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/media/platform/qcom/camss/camss-csid-gen3.c b/drivers/= media/platform/qcom/camss/camss-csid-gen3.c index bd059243790ed..73504c349fd0b 100644 --- a/drivers/media/platform/qcom/camss/camss-csid-gen3.c +++ b/drivers/media/platform/qcom/camss/camss-csid-gen3.c @@ -145,12 +145,12 @@ static void __csid_configure_wrapper(struct csid_devi= ce *csid) writel(val, csid->camss->csid_wrapper_base + CSID_IO_PATH_CFG0(csid->id)); } =20 -static void __csid_configure_rdi_stream(struct csid_device *csid, u8 enabl= e, u8 vc) +static void __csid_configure_rdi_stream(struct csid_device *csid, u8 enabl= e, u8 port, u8 vc) { u32 val; u8 lane_cnt =3D csid->phy.lane_cnt; /* Source pads matching RDI channels on hardware. Pad 1 -> RDI0, Pad 2 ->= RDI1, etc. */ - struct v4l2_mbus_framefmt *input_format =3D &csid->fmt[MSM_CSID_PAD_FIRST= _SRC + vc]; + struct v4l2_mbus_framefmt *input_format =3D &csid->fmt[MSM_CSID_PAD_FIRST= _SRC + port]; const struct csid_format_info *format =3D csid_get_fmt_entry(csid->res->f= ormats->formats, csid->res->formats->nformats, input_format->code); @@ -163,14 +163,14 @@ static void __csid_configure_rdi_stream(struct csid_d= evice *csid, u8 enable, u8 * the four least significant bits of the five bit VC * bitfield to generate an internal CID value. * - * CSID_RDI_CFG0(vc) + * CSID_RDI_CFG0(port) * DT_ID : 28:27 * VC : 26:22 * DT : 21:16 * * CID : VC 3:0 << 2 | DT_ID 1:0 */ - u8 dt_id =3D vc & 0x03; + u8 dt_id =3D port & 0x03; =20 val =3D RDI_CFG0_TIMESTAMP_EN; val |=3D RDI_CFG0_TIMESTAMP_STB_SEL; @@ -180,7 +180,7 @@ static void __csid_configure_rdi_stream(struct csid_dev= ice *csid, u8 enable, u8 val |=3D format->data_type << RDI_CFG0_DT; val |=3D dt_id << RDI_CFG0_DT_ID; =20 - writel(val, csid->base + CSID_RDI_CFG0(vc)); + writel(val, csid->base + CSID_RDI_CFG0(port)); =20 val =3D RDI_CFG1_PACKING_FORMAT_MIPI; val |=3D RDI_CFG1_PIX_STORE; @@ -189,22 +189,22 @@ static void __csid_configure_rdi_stream(struct csid_d= evice *csid, u8 enable, u8 val |=3D RDI_CFG1_CROP_H_EN; val |=3D RDI_CFG1_CROP_V_EN; =20 - writel(val, csid->base + CSID_RDI_CFG1(vc)); + writel(val, csid->base + CSID_RDI_CFG1(port)); =20 val =3D 0; - writel(val, csid->base + CSID_RDI_IRQ_SUBSAMPLE_PERIOD(vc)); + writel(val, csid->base + CSID_RDI_IRQ_SUBSAMPLE_PERIOD(port)); =20 val =3D 1; - writel(val, csid->base + CSID_RDI_IRQ_SUBSAMPLE_PATTERN(vc)); + writel(val, csid->base + CSID_RDI_IRQ_SUBSAMPLE_PATTERN(port)); =20 val =3D 0; - writel(val, csid->base + CSID_RDI_CTRL(vc)); + writel(val, csid->base + CSID_RDI_CTRL(port)); =20 - val =3D readl(csid->base + CSID_RDI_CFG0(vc)); + val =3D readl(csid->base + CSID_RDI_CFG0(port)); =20 if (enable) val |=3D RDI_CFG0_EN; - writel(val, csid->base + CSID_RDI_CFG0(vc)); + writel(val, csid->base + CSID_RDI_CFG0(port)); } =20 static void csid_configure_stream(struct csid_device *csid, u8 enable) @@ -216,8 +216,8 @@ static void csid_configure_stream(struct csid_device *c= sid, u8 enable) /* Loop through all enabled VCs and configure stream for each */ for (i =3D 0; i < MSM_CSID_MAX_SRC_STREAMS; i++) if (csid->phy.en_vc & BIT(i)) { - __csid_configure_rdi_stream(csid, enable, i); - __csid_configure_rx(csid, &csid->phy, i); + __csid_configure_rdi_stream(csid, enable, i, 0); + __csid_configure_rx(csid, &csid->phy, 0); __csid_ctrl_rdi(csid, enable, i); } } --=20 2.52.0 From nobody Sun Jun 21 05:18:50 2026 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 EB37F39DBE5; Mon, 6 Apr 2026 21:55: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=1775512528; cv=none; b=q0cja2iaLDM0bYLCd2Y3/ryir67C/Jt7D/U02ipYP/00dEr3u8UZ+IVpOT41vo8djuBq1tf3GYmMK+bfp9SBIOecgjz3/wJQlXuakRi+rtowEHgH8j6vDU1TsqF6LMZUx/2JXjLikhMNchHey3gwZRj5pDlEEIou4f1VHPb02CA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775512528; c=relaxed/simple; bh=0QxvyC1cn7tK46cplqZeg4qdzMokeBdIQRwpjkp4/PY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PN3OWLYjREKy5ORTMOnuTtcCqAGWosPBIQpkX+DYaTprQK+UVS9yvYgbIUXdA+oiLeB8e89aBBZzQfG0vIb5YjOxT+eK5V25/BuQ9AiQrosSQoom419ly3vgzQn1rQPgSnxqh7K9FrBwM90Ehkit02YAUD4n4drSKHtzDmvxTc8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=DZ0kM8Ov; 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="DZ0kM8Ov" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8DFB1C2BCB0; Mon, 6 Apr 2026 21:55:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775512527; bh=0QxvyC1cn7tK46cplqZeg4qdzMokeBdIQRwpjkp4/PY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=DZ0kM8OvzNV/Yyvll39n5LpB/qUD71OhtJ5INo4VPJKr4xsX4we57wmSQvIG+hgbD Ycyu1f3IUCziPde3SM6y0apNMf2Oyz7xP+EdKNFH8Asb4SnooITbwVPe3Qo9pJJtnG EUa87WVa7JjHNMfA1ZeqpJMnI+ChVGZ35u2t2yRTZLlpiHhOougDtBy+G5COPfbtln P1Jl19PI6a10GGX3IYgc+9c5uEsSzqKV12Z+vv6i6HwDmBLdkxbnH0Q19Eq0VVCDyB qUpaS3uuYZOGawzCkQHLz249b64vdtW2aBy1bYod7Q5FnJsJIIjBrfRDDKrWrld4Fo FG/FDmJ3fYYXg== From: bod@kernel.org Date: Mon, 06 Apr 2026 22:55:05 +0100 Subject: [PATCH 5/5] media: qcom: camss: csid: Rename en_vc to en_port 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: <20260406-camss-rdi-fix-v1-5-d3f8b12473d0@kernel.org> References: <20260406-camss-rdi-fix-v1-0-d3f8b12473d0@kernel.org> In-Reply-To: <20260406-camss-rdi-fix-v1-0-d3f8b12473d0@kernel.org> To: Robert Foss , Todor Tomov , Bryan O'Donoghue , Vladimir Zapolskiy , Mauro Carvalho Chehab , Hans Verkuil , Loic Poulain , Hans Verkuil , Gjorgji Rosikopulos , Milen Mitkov , Depeng Shao , Yongsheng Li Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Bryan O'Donoghue X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=6492; i=bod@kernel.org; h=from:subject:message-id; bh=xsT0Ris5mi9SRI4eg7YgmmflBFr6JlknESMVmg1quFo=; b=owEBbQKS/ZANAwAKASJxO7Ohjcg6AcsmYgBp1Cu5kDTL2DMit2Fr0OxlMcDFKm7dOkszYdbpc ZDg1XtBHXWJAjMEAAEKAB0WIQTmk/sqq6Nt4Rerb7QicTuzoY3IOgUCadQruQAKCRAicTuzoY3I Ort1EACL16ZwfQVG2NlCsqrfv3/hoQovZM7zC4FXU5MZjhC2lB3oMbuyb0deAYLV9+c+WwBBNkq FufBoDilKaUOED5StrjMUKvVvk2JFUzRkjO975IgafSPFU33khHWu0rYW084y9Q8QDpIndG4gAy VA6LBub1mV+nnNrYZSr/vwhedj2TyEMRJW4LU02y6ndMfi4EawlY7Z0nDAn8TkDHfuHA4oOxLsA kUvPrGJh1OmxPJaFq13isv52PLyZYoYDvzP7O0p93YOZTMdRDQRYug+CEKsTDHATROEG4wuM/4x LzvX9oQgPLvklOs9MXiyDYYWg5viwcWb7/cAFQrspL3yMTROv1fYnE8wDD8yum2cM80TFVTuOc/ cEYBfpcuYYYafq2a90i0l6ev2+nSiLJX8HcOqur5rpxoWLkBA/FYOC2VQqAYtkBYQ5H4hUmEuUf /W8vBhKDG3byzpgRy4/P3BfH+VN668f1TTMnqKGwSYmGkVYKFic0xGhAF8epmTYr9jyZlk8LzaU ffhF4f0pPjnbgAEt+VwGMNxVDBH+HguFIT/oY7/WuS3nTV6B+tqA4maJljVbHSODoBfJxlQzokM 35eiYIci+INRBXLBzmGXcDOrnHPGTrPMIlTFuUSGV1+MqyMqrd4G0nl3gpYSHu5ucMsG8qsTNBG 6I4Of+srKFEuXug== X-Developer-Key: i=bod@kernel.org; a=openpgp; fpr=E693FB2AABA36DE117AB6FB422713BB3A18DC83A From: Bryan O'Donoghue The en_vc mask has always also been an en_port mask. Name the variable for what it does a bitmask of ports. When implementing v4l2 subdev streams it probably makes more sense to have tuples for port/vc mappings. Such a change right now feels like putting the cart before the horse. Sanitise the name in the interregnum. Signed-off-by: Bryan O'Donoghue --- drivers/media/platform/qcom/camss/camss-csid-340.c | 2 +- drivers/media/platform/qcom/camss/camss-csid-680.c | 2 +- drivers/media/platform/qcom/camss/camss-csid-gen2.c | 4 ++-- drivers/media/platform/qcom/camss/camss-csid-gen3.c | 6 +++--- drivers/media/platform/qcom/camss/camss-csid.c | 10 +++++----- drivers/media/platform/qcom/camss/camss-csid.h | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/media/platform/qcom/camss/camss-csid-340.c b/drivers/m= edia/platform/qcom/camss/camss-csid-340.c index 5a7271785ec7a..da5e03b340bb7 100644 --- a/drivers/media/platform/qcom/camss/camss-csid-340.c +++ b/drivers/media/platform/qcom/camss/camss-csid-340.c @@ -119,7 +119,7 @@ static void csid_configure_stream(struct csid_device *c= sid, u8 enable) __csid_configure_rx(csid, &csid->phy); =20 for (i =3D 0; i < MSM_CSID_MAX_SRC_STREAMS; i++) { - if (csid->phy.en_vc & BIT(i)) { + if (csid->phy.en_port & BIT(i)) { __csid_configure_rdi_stream(csid, enable, i, 0); __csid_ctrl_rdi(csid, enable, i); } diff --git a/drivers/media/platform/qcom/camss/camss-csid-680.c b/drivers/m= edia/platform/qcom/camss/camss-csid-680.c index 35a6bb209f97c..80d8bcd6e0854 100644 --- a/drivers/media/platform/qcom/camss/camss-csid-680.c +++ b/drivers/media/platform/qcom/camss/camss-csid-680.c @@ -292,7 +292,7 @@ static void csid_configure_stream(struct csid_device *c= sid, u8 enable) =20 /* Loop through all enabled VCs and configure stream for each */ for (i =3D 0; i < MSM_CSID_MAX_SRC_STREAMS; i++) { - if (csid->phy.en_vc & BIT(i)) { + if (csid->phy.en_port & BIT(i)) { __csid_configure_rdi_stream(csid, enable, i, 0); __csid_configure_rx(csid, &csid->phy, 0); __csid_ctrl_rdi(csid, enable, i); diff --git a/drivers/media/platform/qcom/camss/camss-csid-gen2.c b/drivers/= media/platform/qcom/camss/camss-csid-gen2.c index 331feed199094..e2d14b25f8c85 100644 --- a/drivers/media/platform/qcom/camss/camss-csid-gen2.c +++ b/drivers/media/platform/qcom/camss/camss-csid-gen2.c @@ -328,7 +328,7 @@ static void csid_configure_stream(struct csid_device *c= sid, u8 enable) u8 i; /* Loop through all enabled VCs and configure stream for each */ for (i =3D 0; i < MSM_CSID_MAX_SRC_STREAMS; i++) - if (csid->phy.en_vc & BIT(i)) { + if (csid->phy.en_port & BIT(i)) { if (tg->enabled) __csid_configure_testgen(csid, enable, i, 0); =20 @@ -369,7 +369,7 @@ static irqreturn_t csid_isr(int irq, void *dev) =20 /* Read and clear IRQ status for each enabled RDI channel */ for (i =3D 0; i < MSM_CSID_MAX_SRC_STREAMS; i++) - if (csid->phy.en_vc & BIT(i)) { + if (csid->phy.en_port & BIT(i)) { val =3D readl_relaxed(csid->base + CSID_CSI2_RDIN_IRQ_STATUS(i)); writel_relaxed(val, csid->base + CSID_CSI2_RDIN_IRQ_CLEAR(i)); } diff --git a/drivers/media/platform/qcom/camss/camss-csid-gen3.c b/drivers/= media/platform/qcom/camss/camss-csid-gen3.c index 73504c349fd0b..b92234ba84efc 100644 --- a/drivers/media/platform/qcom/camss/camss-csid-gen3.c +++ b/drivers/media/platform/qcom/camss/camss-csid-gen3.c @@ -215,7 +215,7 @@ static void csid_configure_stream(struct csid_device *c= sid, u8 enable) =20 /* Loop through all enabled VCs and configure stream for each */ for (i =3D 0; i < MSM_CSID_MAX_SRC_STREAMS; i++) - if (csid->phy.en_vc & BIT(i)) { + if (csid->phy.en_port & BIT(i)) { __csid_configure_rdi_stream(csid, enable, i, 0); __csid_configure_rx(csid, &csid->phy, 0); __csid_ctrl_rdi(csid, enable, i); @@ -263,7 +263,7 @@ static irqreturn_t csid_isr(int irq, void *dev) =20 /* Read and clear IRQ status for each enabled RDI channel */ for (i =3D 0; i < MSM_CSID_MAX_SRC_STREAMS; i++) - if (csid->phy.en_vc & BIT(i)) { + if (csid->phy.en_port & BIT(i)) { val =3D readl(csid->base + CSID_CSI2_RDIN_IRQ_STATUS(i)); writel(val, csid->base + CSID_CSI2_RDIN_IRQ_CLEAR(i)); =20 @@ -309,7 +309,7 @@ static int csid_reset(struct csid_device *csid) writel(1, csid->base + CSID_TOP_IRQ_MASK); =20 for (i =3D 0; i < MSM_CSID_MAX_SRC_STREAMS; i++) - if (csid->phy.en_vc & BIT(i)) { + if (csid->phy.en_port & BIT(i)) { writel(BIT(BUF_DONE_IRQ_STATUS_RDI_OFFSET + i), csid->base + CSID_BUF_DONE_IRQ_CLEAR); writel(IRQ_CMD_CLEAR, csid->base + CSID_IRQ_CMD); diff --git a/drivers/media/platform/qcom/camss/camss-csid.c b/drivers/media= /platform/qcom/camss/camss-csid.c index ed1820488c987..71a40c2cb350b 100644 --- a/drivers/media/platform/qcom/camss/camss-csid.c +++ b/drivers/media/platform/qcom/camss/camss-csid.c @@ -1278,21 +1278,21 @@ static int csid_link_setup(struct media_entity *ent= ity, csid->phy.lane_cnt =3D lane_cfg->num_data; csid->phy.lane_assign =3D csid_get_lane_assign(lane_cfg); } - /* Decide which virtual channels to enable based on which source pads are= enabled */ + /* Decide which ports to enable based on which source pads are enabled */ if (local->flags & MEDIA_PAD_FL_SOURCE) { struct v4l2_subdev *sd =3D media_entity_to_v4l2_subdev(entity); struct csid_device *csid =3D v4l2_get_subdevdata(sd); struct device *dev =3D csid->camss->dev; =20 if (flags & MEDIA_LNK_FL_ENABLED) - csid->phy.en_vc |=3D BIT(local->index - 1); + csid->phy.en_port |=3D BIT(local->index - 1); else - csid->phy.en_vc &=3D ~BIT(local->index - 1); + csid->phy.en_port &=3D ~BIT(local->index - 1); =20 csid->phy.need_vc_update =3D true; =20 - dev_dbg(dev, "%s: Enabled CSID virtual channels mask 0x%x\n", - __func__, csid->phy.en_vc); + dev_dbg(dev, "%s: Enabled CSID ports mask 0x%x\n", + __func__, csid->phy.en_port); } =20 return 0; diff --git a/drivers/media/platform/qcom/camss/camss-csid.h b/drivers/media= /platform/qcom/camss/camss-csid.h index aedc96ed84b2f..b227923ca5c15 100644 --- a/drivers/media/platform/qcom/camss/camss-csid.h +++ b/drivers/media/platform/qcom/camss/camss-csid.h @@ -68,7 +68,7 @@ struct csid_phy_config { u8 csiphy_id; u8 lane_cnt; u32 lane_assign; - u32 en_vc; + u32 en_port; u8 need_vc_update; }; =20 --=20 2.52.0