From nobody Mon Jun 15 01:41:28 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 36CE33A75A3; Tue, 7 Apr 2026 10:17:34 +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=1775557055; cv=none; b=fY5rpXyDkq9f/Z30Spy2J20cJUpx8pj1wprc4WhLTD0grsXkczYuEB4roM+yuvvI8Cr5Zqp4Zi1iK8TMEPuc6ptKnpKfTpUucqwQVhkCNVZrb6KTpZbd5Ey/MsGxMDQK3aG6u0NdB4pZX+dZRv0NIB7t9KjSeGdnO8XZv33F4/A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775557055; c=relaxed/simple; bh=uMBVP5OBK6uG/Pd+SUjLPSpudE52pFW69OnDCkcDDvg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=pzZOxoGCM6IApe0g6W9WPHYKvqUogK7CZHrYet2/+ju3GklGiH6ozhQf0V2OZsdPz3X+smxWdypMPK9bWbjpMKHqpZOZzK/Xi0quxXVRwo5AAkRzH5NdHBccJ41ZPi+PAPfNQdBYHr34hk9oqG1vtogFswcQFLrLKfeTRg3TkXw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=P1eA03bq; 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="P1eA03bq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4E2BBC116C6; Tue, 7 Apr 2026 10:17:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775557054; bh=uMBVP5OBK6uG/Pd+SUjLPSpudE52pFW69OnDCkcDDvg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=P1eA03bqzbZZOHkKKiPvI+z3ZTuEoxFTTytPrzI6akxNnUG8hCyvF1f2N0S9ykkUW JQYq6ZQ9/xgNxnvgPfIi3XMwmuR76pcljflkVF3/8Xd9sJHJ9p6cQQSLF6DKHHuENV FY76SlqJgXUOltMDjRSug3MrdR/VYCg6apNFCFIRFSFE6md4PyX4VJ8kyPWRWBDRvA FTke1NyGSRL2l18x6CYnJ227v9XdsD9JzqSy93Ud+0C+K110a3iqg679M3LRz3WP3S 2qsthDDHNO3uCy2wUWx7k4Pa4DnRhELuxaPDFIHFU0zjiRutXOEUCSGNaVR4Tui629 53hckoh65rVEA== From: bod@kernel.org Date: Tue, 07 Apr 2026 11:17:22 +0100 Subject: [PATCH v2 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: <20260407-camss-rdi-fix-v2-1-66f6c600fcff@kernel.org> References: <20260407-camss-rdi-fix-v2-0-66f6c600fcff@kernel.org> In-Reply-To: <20260407-camss-rdi-fix-v2-0-66f6c600fcff@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=5186; i=bod@kernel.org; h=from:subject:message-id; bh=fd5whevjCZt8/WbhOku3Zl8KLKS9/LPSs38n4+PRT/8=; b=owEBbQKS/ZANAwAKASJxO7Ohjcg6AcsmYgBp1Nm1aJXjrxNHv5Gzntzzzlk3ikjB+wwog0anm M6gU70oH2GJAjMEAAEKAB0WIQTmk/sqq6Nt4Rerb7QicTuzoY3IOgUCadTZtQAKCRAicTuzoY3I Ogr0D/9aKngQ+mZpQp9HM+I4G4bgdgF571nBspswwrfVTyT0kPRHzIafDnIMNm2NhtM+2BJmFsP jMgApgoooOFIseHYKgFggaPpO8IJ7K5FTv6ftXHGTq7xtX+2IKG6VjNukbBR7B287B9hb4KJ6X/ 4/1tMpstw0okjW10HYnFuSnH8CJLAEog2lLJVuTA2nSXjlXS9LCAj5NjDfmiR2eg0tdOZv/r97Z mCCJLPQjOmMLJso81U+bH/7zZMW4YyWLBpWDQGKNLU/RfqlJWsC46ERhJ+nOANINr27w4tfssGA OUm6Nc982BzBOR4c+uopAXAcO5IExVW00PgG4vDOjsSWuKmklZXY/YgsmiZeDYXIMveRH4+9Z4P YuUdeYkN4WnhikKojAv8OmOvz82LXDYsWkQsiW6vLPAfEoXouc4jpasxpNcZBTyYuPJN352C228 If2IwN6d6tFJX41PuYK5J1jBliofN9xiQD6aTg7dm3Skeq2tHcj5cFoClwH7bOly89qJdcnHOIy tiEFV1cUcEJP/2wOJO9iHmcaIwUuTGfruk0e7cVivoIbUMiKZr2ClhnGj9Cu4z+n0eS1TTPllnK dzr4oVlpazaLlJMZ78UaqPwLGK/9sguXSqBEXcJyJEy1ur72T/AwfM2Zo8vOuWXhlOiI4vhPY2s atChhHzbdM/eazQ== 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. Another way the current model breaks is the DT field. A sensor driving different data-types on the same VC would not be able to separate the VC:DT pair to separate RDI outputs, thus breaking another feature of VCs in the MIPI data-stream. 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 | 28 +++++++++++-------= ---- 1 file changed, 14 insertions(+), 14 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..0fc908096a99b 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) @@ -290,11 +290,11 @@ static void csid_configure_stream(struct csid_device = *csid, u8 enable) =20 __csid_configure_top(csid); =20 - /* Loop through all enabled VCs and configure stream for each */ + /* Loop through all enabled ports and configure a 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 Mon Jun 15 01:41:28 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 2627F3A7F6E; Tue, 7 Apr 2026 10:17:38 +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=1775557059; cv=none; b=G/qHT2Ufk2TjlMfMf6Qcon9W7P5mlMiRNtC3WskW6ciVtPb+tl/aUNRft9ZO0v3Ac2AXKZCdv6/U0mR2jrJ277noOigUF4tS4QyX3BwatXIwYjVK/msjU9VsAo1dgsfTVzGxp0ha6PW2HjHg38xiCprl2F/0CGqrFGBVYxGfgrI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775557059; c=relaxed/simple; bh=iGNN6cyVlrCn+rzyffG5AjbdAvQJ2IO3zK1LCu07b+E=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=D823MMDXY6cUNBU0+XDjVzV4R8hvpqN3FXjI48i9N+cf4O9NkvbrgbHk9RqooCMJStmkVYuYExfH3jVsPjEANa7FBJGQt2x8yV+rH1V7MGOcTjsiS/Cy3SpMdou1EafLQdzPZ7j7zq3KJKCvx63Z4x04DHNPo61hjpaH5UDQSaA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=eaLmMRiL; 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="eaLmMRiL" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 497FEC19421; Tue, 7 Apr 2026 10:17:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775557058; bh=iGNN6cyVlrCn+rzyffG5AjbdAvQJ2IO3zK1LCu07b+E=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=eaLmMRiL76BQ7j4k75wNmJWHz+3jTuuC2oODer9QJJYGsPhXDP4KUEttNMQmMJ4AK JGqiHaLAOzd5yCq2VgQRBma18WWr2PNN4nxUgbkS1x1lbwpOPevs8hsprodG9ArP/i qqCgY8ne387gbdLLqxSlx4tXDIb7XJYH696vidGDElDbZJzBg2Vq3bO4ONrAEtdW72 t1UaIHnuzQ4VLWd2ySqQREULj8L/P61Y003vxfRPDtGS0PCVXOcVVO+Lw5YhX6Q/7p 3i4tU9t/Sh11aYdOXleB+EIE1X7YqqZoGyJGMYwjgAsMkp6wLAKhICDgtGGK6Vxdss F4d1AfBuyhnEg== From: bod@kernel.org Date: Tue, 07 Apr 2026 11:17:23 +0100 Subject: [PATCH v2 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: <20260407-camss-rdi-fix-v2-2-66f6c600fcff@kernel.org> References: <20260407-camss-rdi-fix-v2-0-66f6c600fcff@kernel.org> In-Reply-To: <20260407-camss-rdi-fix-v2-0-66f6c600fcff@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=3124; i=bod@kernel.org; h=from:subject:message-id; bh=nCVa+/CKp/Mh7Y8L5xBma/Z9tOxi6qSOh9nYPtwRTa4=; b=owEBbQKS/ZANAwAKASJxO7Ohjcg6AcsmYgBp1Nm1jvdp+olkOODHF5FkjSoPjF4hlBXUYCvxb w5DheEmmT2JAjMEAAEKAB0WIQTmk/sqq6Nt4Rerb7QicTuzoY3IOgUCadTZtQAKCRAicTuzoY3I OjAlD/4n0iyIxrt0VUhSjX77T73wjPk/FymUJyvSiNwFonoY2YNrZXbbwgHyOj30xm+DXCtmQ1T AWhB1xAgREgvD4w1Y6QldjORpkFHuCoqY/yMUSND0SrpPo1a/A0zSwK5lfQohdxeW8T3mhEg54H XXpI8Ih3fWzkr0irHdfUdcf0XE/VHGiiXNIyJZJ4q81R3JXbBoIwJ/kh6G9vcde18JU/7mgVVoI 2gzcJ6E7+QqfvxKLZmT+4IdipsaTSC1B+RDK3g5iV52/Hhwcq/xA8uTQsrjxmlMK8tqkUvgZR4n 8rQdLU0hD/4QVGpBqE3r1cUlhk5b7Pf5FKRWWTPNfQkHSk4RZzjElF9HqPygfXGSH4Mladc/raj vcOk48oea3W9feZGFPnTQIuaBrq4cnKTD2215lVhtczjK46K1VGr/Zgm3sGM4FzYhyiev4mBszN hpP0CT3o9vDm5F7uNhfIRNV98FbrL9py7B2TpYeVnfIlfbJUuB121CjxU2K+KloJ4a0ggQUldSh PwccQ9DuGMoW3BNbjun6kkW9hSUjDgrw5CI3MKEHs/KI9AOM8fmM2xWcFsGyo/H91P9KtF3Ohyp Snkl3yenJMzDT96JFRcUBuZIsi12WFoqRF8JaL/waWSk8D6bzR7RKi3Xa1BhS/PIbctKrSk4ElE IPsrZDzpDERM6rA== 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 | 16 +++++++++------- 1 file changed, 9 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..2e189efef79c2 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) @@ -117,9 +118,10 @@ static void csid_configure_stream(struct csid_device *= csid, u8 enable) =20 __csid_configure_rx(csid, &csid->phy); =20 + /* Loop through all enabled ports and configure a 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_rdi_stream(csid, enable, i, 0); __csid_ctrl_rdi(csid, enable, i); } } --=20 2.52.0 From nobody Mon Jun 15 01:41:28 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 0F0BD3A7F6E; Tue, 7 Apr 2026 10:17:42 +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=1775557065; cv=none; b=TerZ/P56gZD7/ZiqjudBia/Sw0e3gpC6gLI06PP2KE+SrfmY+jw9Ve+jGO4sWGvTJnbbwK2oDnrBHoDO2l1clggfdLkAfSKVQd1nQCg2HzI74bXeshpMyIp0p/NKTjmgjNCL8FWfHjy+jjbfftK5dRqs+u8rNNYw6NlaIUqn9z0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775557065; c=relaxed/simple; bh=VX8Uug46LlSSH+i+14I1o4WqRRC22e9JL7NTJkdIL2o=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WREyero5hfuwDkIEoJ8igfiXzk5QVNV5ROoXZfoUnxGR/QAjtch5ucxjyPKw1CEaC3YZnyxlPOoFL80jl5Kw9RRPKEqUNsBpbAQz/P27BBEIYLrvBZ66dBUzX6EvqohundlUjy+yfAOP69xdgI6nPJsnYGgwbpiujDTW35mKig8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QvbnDydt; 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="QvbnDydt" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4B84CC116C6; Tue, 7 Apr 2026 10:17:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775557062; bh=VX8Uug46LlSSH+i+14I1o4WqRRC22e9JL7NTJkdIL2o=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=QvbnDydtrhnigh/X86uWSpHhP2Bn3QSgiei3kED9MoqwQvLvQ/gXC42oe8hTgweor p+Mef53BEblI8krUVvbpGh5/pVAQH3/X07hZUX2tqL1mWICTsYpu9jy7L5LCA8hHe7 A7hEMoeQz6d5r1sFK9vadmvgrc5/iC9YxM2iMoGB/ZW3cfd682xtaBMqV8ydu4dvBn sgvJgzmMWIPz4f23P2e2O0L42PUY+Zhas9UWxD2vrK55Qg7Yheu51kEM4DKX5wmWi4 lTzsUPFSQaOf0htiRCNcWZtMZ6j2rHsPJUSqsApZeXgzUiDT+lIc1ZShWQ8qIOE0EL qLx1psAWuNdzA== From: bod@kernel.org Date: Tue, 07 Apr 2026 11:17:24 +0100 Subject: [PATCH v2 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: <20260407-camss-rdi-fix-v2-3-66f6c600fcff@kernel.org> References: <20260407-camss-rdi-fix-v2-0-66f6c600fcff@kernel.org> In-Reply-To: <20260407-camss-rdi-fix-v2-0-66f6c600fcff@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=6024; i=bod@kernel.org; h=from:subject:message-id; bh=hrKeKKgc331oZFhBS+mM9op8nYbhOMvFpP8gYBgb9YU=; b=owEBbQKS/ZANAwAKASJxO7Ohjcg6AcsmYgBp1Nm1Mk43gLvmUt8Ba72f+MySXnQZLlBJfe5M3 omTWzWXxBqJAjMEAAEKAB0WIQTmk/sqq6Nt4Rerb7QicTuzoY3IOgUCadTZtQAKCRAicTuzoY3I OsDxD/sGjcNEIeq7OfYmvBoTIntoSWUcglhNNvbOPtQGUwvczB3Xdn5Lux8fH3MWhraxt5zQNHQ 4u4pqS37Rkb/dwryP5yeh29eAS8Kra44bg5mmjXhR/77yYLFrYPOEsLwYB3D9NglVuEk+ErIoF7 +x780a4lXZGZiC85bvoQki/6Ky3rhCtwSUGSjDYuoLSjibkuRNKOAn5glLGpuIsuEv8BbGlBtGI ub05+fIqTR7icxGpDA06yHZJzdJpOPjqNWVAoL2S73XDIGBjn6dusSJESqhLPkDM6iysMDB8bjF o/FKh/gJTzE3HjYMM/9tDeadxanuwoxjFWI/aIyZ8TUUYzobg0vZadaa9BQZ7qcX3leEhZB8tyc I1aiT4GjA8tLgWFCCpn9VR1FvjXGWkxowXx+55SLnP/FbnlT1utP4RvpTy7GRo18dvrPyiEjGbs D3b2CSgG55LeF1a+Mm83hPLAZKMznGddzGa6JpRpSbM52wqPAlY16Gs4GSzMJUI/zpUWYqGE0+C KtspjviN/TmOiBawYFjzsLP3RMIPIcP/UQrlcxL0sh//DnTIqNc3xnf9wjDbTv03ee32IHDMb6F 3Jh8GX6ImwYqCnPid3tGn4Lb/f2mWZVywIwCj464boDCp4t8aUCpmUxsn9QbqNyTQISO/aBAj3P vdJcPTG+yUGDNcw== 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 | 47 +++++++++++-------= ---- 1 file changed, 24 insertions(+), 23 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..eadcb2f7e3aaa 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,56 +284,57 @@ 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) { struct csid_testgen_config *tg =3D &csid->testgen; u8 i; - /* Loop through all enabled VCs and configure stream for each */ + + /* Loop through all enabled ports and configure a stream for each */ 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 Mon Jun 15 01:41:28 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 EE0193A9D8F; Tue, 7 Apr 2026 10:17:46 +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=1775557067; cv=none; b=HNEJMaoAXuPHkSmDReBImjUnRUOFVgDylVIHR09r+iO56GyYoSkyBHAmK2M1RFDajSAe5GwpwSJLD436UV6hNVjO8drYC06a3+l0Afk6jHOdzk6adw6GD90TZBJNLCTj0EEfkW+wybfRjsakD5zEbMsRmaXwi5KaqFnz29ynE5c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775557067; c=relaxed/simple; bh=Iw/0ZMUWO2zJVSR27I/5GetL9KxeKyvBcMMEYB7HZ5E=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=teoDI1DkzznotwyAYd/DoPxYygOt/kuGHNx2zVH2Vus9w7IXSscPT/wDjeSB8naIi3Tpo0WTANw4ovB30SVR7FJAYAGO8MSlgD/6kwp7Ocs5DJRoKiVLfEdT6iILzQbC+522A6SIAG+5iCARVr1R0As7bs5u114zs83zosdXgDA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=RRUZkc47; 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="RRUZkc47" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4EB3FC19421; Tue, 7 Apr 2026 10:17:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775557066; bh=Iw/0ZMUWO2zJVSR27I/5GetL9KxeKyvBcMMEYB7HZ5E=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=RRUZkc47egqJFCo1QFaNHI/D5lgf1HPJ/qcccStVUMJyKzXr6xxo65n1fq9qoT9G6 pmeufZaYN/Kw/U42UmgjOT490DYG/nOHqrYP/l12UIJk10FO2WqEammMDRqvROybSj q2sjHm7FaTdSfXXvEbvj0A7NDEOwrETU1LRvbFRCN+PNPs+phjmkT9J+1PbNX2ULPg iI3PWv8IZOE90pP2fli7uuoyAWllesJYFCZtt+Jy2EPk4pbYF7337Z0q2eeRucBZ6w Ai77OzSAXEhfueoF9NslRUlGCU98MVgi3dhAtz67lwLYAuLmHDfznIwJywo+DS9b20 EpaYRvuOSZVTQ== From: bod@kernel.org Date: Tue, 07 Apr 2026 11:17:25 +0100 Subject: [PATCH v2 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: <20260407-camss-rdi-fix-v2-4-66f6c600fcff@kernel.org> References: <20260407-camss-rdi-fix-v2-0-66f6c600fcff@kernel.org> In-Reply-To: <20260407-camss-rdi-fix-v2-0-66f6c600fcff@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=4312; i=bod@kernel.org; h=from:subject:message-id; bh=s60sIJaXGpdYqv090mjDLH9kxg4goK1KRKFRBCPJ730=; b=owEBbQKS/ZANAwAKASJxO7Ohjcg6AcsmYgBp1Nm27ukRGAGTENEjVQtuWZ30q1tltYwngdMyX 9ngbW8Gq56JAjMEAAEKAB0WIQTmk/sqq6Nt4Rerb7QicTuzoY3IOgUCadTZtgAKCRAicTuzoY3I OmV4D/0XwDqRUfVLkYHmr8oWLStUjCAZqdzQAaEeN9o3yFUexUzwZRm7gJwnePJpuZ/ZzJsss2d bp2EYfBFgpt/gq/331lV5BsXGm8Wt067IXFPO6SgSaYvoeXCGXfPxclNAvRacUlz9xJGNYrv2fS Lig93uQXgkRawZN/Y7nAA9DXJEObCGgVFZ69uVPIOM36cx5VIEIQabo99spPzyp77PSN/EuEOle rn6cRy0XvEb3QiNmV7NaMCY/125Bg7pGlCGAf9K4T2T5gbCDYPixlNAc8RGcjdA5Pvi9v3obOyW DnNB0TpXmTnPtWXbc0u69aRcsXALjZDp27DYf44Eixt3yjaZv/KLXAw1xW/tWvmk93o09TSXowF QHql0df+gHXyebA0OfxmTnwJCgKFcw4WeWOaUzZ4DpD1zT+LW2nms8Ax5Ykacdft1tdRS4EUf4t OXaqQNxMYBYamG83Tjr7ZJ/a3pHcmyizsWy5gJp0m252fZAA7LoSspI2nEPtWTVAlC4RIkIUIfC Hb6dNqWzYU8WjNFyndh2Wl0zgqdzkwoWu5ANH5XSOmF+uYENLbGV1ZibKDCJcjEKcdbyGsxEr+b I0OoYMvYInFVL4+FL7SnHq4OQtSA4vMfdKyeS/VHgikvcimvO+mL9ui5wxvGto+FfnTDQ2U/SRg /kJfl7LYuRnsm1g== 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 | 28 +++++++++++-------= ---- 1 file changed, 14 insertions(+), 14 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..ed5c5766efd36 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) @@ -213,11 +213,11 @@ static void csid_configure_stream(struct csid_device = *csid, u8 enable) =20 __csid_configure_wrapper(csid); =20 - /* Loop through all enabled VCs and configure stream for each */ + /* Loop through all enabled ports and configure a 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 Mon Jun 15 01:41:28 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 082083A9D8F; Tue, 7 Apr 2026 10:17:50 +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=1775557071; cv=none; b=ABnIBFfcLIZpdq8hK6R0dwQUklXpz4BtFqrNGhA9zIR9MrKlhvtXhd5qdLtrwSRZa8pZVGixREC/AKLuM39T2+wk2oE7HtXhOdklZ5c8HBoie/py8uAwHUDVF8XFAmbEBONdWGH7mgfxNG6ZT100XYA9nQ4NLkxL5EwUtSuoZ04= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775557071; c=relaxed/simple; bh=DGj3axpedAEnHJKp2yI1ceJxi/eU0z5cs7/iQ1HQVnQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ikNmE0OJEhxhhglqlG1dUDXXhk54NvOj/NN/umblH879Sk6W6Lhfe65Rv+Bvyyd1/PXuNaXpzJ24QWcUJs+D3S5W1rMJgQfC6rPdZ3bF1Bbxu63a0H1rKwasWVzTAUyJaT6VlfgBoo4foLArQJGSmrky9p6bA5Q97ySGeYFtsSc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SPWBr08J; 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="SPWBr08J" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5243AC19421; Tue, 7 Apr 2026 10:17:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775557070; bh=DGj3axpedAEnHJKp2yI1ceJxi/eU0z5cs7/iQ1HQVnQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=SPWBr08JZh2nLqYEjfES/B9eomNrZnB1BoAAydzZXrpT44jbb3fvUIJGZjqGWeLuW RUOcuBblEuuzozZfipz5mhzZjrUcptIbrfYDYPq9QQV56LL2sFKZsOEMpiiQ0518xo VVdKBeS0+2MrmfHe29IiMWdY2QKcY809fn+PdLxz/DatXp7NvaIyfS/t/2JiY36p6N fb5SfP05qBmFNEZ2uxuppk3PF8hv8fC9juysM3USdKdvxA/2HZVbZGnWbZCD7axdGC RhErR9AD3LS9krUTlvFLsLMwTkXCMkZtgpBAwOXYD7I3n3RM5zmY9Y7x3tx8K783wv hge6CyEEwFAiA== From: bod@kernel.org Date: Tue, 07 Apr 2026 11:17:26 +0100 Subject: [PATCH v2 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: <20260407-camss-rdi-fix-v2-5-66f6c600fcff@kernel.org> References: <20260407-camss-rdi-fix-v2-0-66f6c600fcff@kernel.org> In-Reply-To: <20260407-camss-rdi-fix-v2-0-66f6c600fcff@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=6522; i=bod@kernel.org; h=from:subject:message-id; bh=DjMHY5kEPdHmjL+rHzIUEVjRX9XhouTzisnS5c5xsQY=; b=owEBbQKS/ZANAwAKASJxO7Ohjcg6AcsmYgBp1Nm2JguINIfDhCsPzoOj0czA1j1oI15dN5+nW UzYXH2R4N2JAjMEAAEKAB0WIQTmk/sqq6Nt4Rerb7QicTuzoY3IOgUCadTZtgAKCRAicTuzoY3I OpgcD/48AYIaVYM1s7AXIRXAQRq7XopT5NO3olr0v/yKwYTI/+1joleWt2ATZ7Z9S3Pk7gYgjFA XR2LqVRcVnrpXGy5hF7WW6s+sagbDhCoQIR92DhSvNFnN7IdH/TzHcXuFIZGhOivhv+Nq6qp6ZL RVNAZiJWgFW7DrKL+07FKcBth/naxUacAj2FSexLboUmZzQzqgPVWhBkeV8WcrCOqac1uNuHP/1 BatU4/cmUNbdx9BMLVD4jrfOkRgqNrttPHAoQYWPySSMsUq4UjpAc9PWldGMFKwnqllKUgMGNCr yQMCqF4zX6sMeAnuYNJQ9Gx+hGohOIoMEw+CnVQ/f1Tk0sUZ0rzPZze+8AeNMfj7U6tRT8/A3bF JU7EUM2iiqYQsvCLr3pcqYYP8SrbH9lDy560P695W3l5peDYfe0Paae51TwcFpCqMNKKsHglSv+ S2yA4uYU3cJ4WV4/Hf8PayMO/3A0Nyj0BiitDvw6pvSQJkMb7ojF1+hzZaN/VdnoZgQ09tCxsnm RaR3uVDnDeLofjAOLEnM610tPF3+K2Pyme6cJSF/FOHRKJD/tHQoEte76mEqIZ50lpn5f2r/AYq TSYd1SbRB+RFF9JmdZcaQX2wED453c3MppkNDm9vDdHS0VB+MCdO6ftBZEd1oEzk6i+tIpMT2mH LOq0YhKwNT4EC/w== 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 2e189efef79c2..cc6133dc8613a 100644 --- a/drivers/media/platform/qcom/camss/camss-csid-340.c +++ b/drivers/media/platform/qcom/camss/camss-csid-340.c @@ -120,7 +120,7 @@ static void csid_configure_stream(struct csid_device *c= sid, u8 enable) =20 /* Loop through all enabled ports and configure a 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_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 0fc908096a99b..b95659af9d297 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 ports and configure a 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 eadcb2f7e3aaa..0e0c44d118a59 100644 --- a/drivers/media/platform/qcom/camss/camss-csid-gen2.c +++ b/drivers/media/platform/qcom/camss/camss-csid-gen2.c @@ -329,7 +329,7 @@ static void csid_configure_stream(struct csid_device *c= sid, u8 enable) =20 /* Loop through all enabled ports and configure a 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 @@ -370,7 +370,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 ed5c5766efd36..cb6ca470dafa8 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 ports and configure a 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