From: bryan.odonoghue@linaro.org
To: Bryan O'Donoghue <bryan.odonoghue@linaro.org>,
Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>,
Loic Poulain <loic.poulain@oss.qualcomm.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-kernel@vger.kernel.org, Bryan O'Donoghue <bod@kernel.org>
Subject: [PATCH v3 04/11] media: qcom: camss: csid-gen3: Enable RDI SOF driving
Date: Sat, 07 Nov 2026 01:01:47 +0000 [thread overview]
Message-ID: <20261107-v4l2-frame-sync-v3-4-e5bf7073a35d@kernel.org> (raw)
In-Reply-To: <20261107-v4l2-frame-sync-v3-0-e5bf7073a35d@kernel.org>
From: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Add in silicon enabling code to generate SOF and trigger the routine which
produces V4L2_EVENT_FRAME_SYNC based on SOF per standard v4l2 behaviour.
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Loic Poulain <loic.poulain@oss.qualcomm.com>
Signed-off-by: Bryan O'Donoghue <bod@kernel.org>
---
.../media/platform/qcom/camss/camss-csid-gen3.c | 27 ++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/drivers/media/platform/qcom/camss/camss-csid-gen3.c b/drivers/media/platform/qcom/camss/camss-csid-gen3.c
index 0fdbf75fb27db..6a538d825f78b 100644
--- a/drivers/media/platform/qcom/camss/camss-csid-gen3.c
+++ b/drivers/media/platform/qcom/camss/camss-csid-gen3.c
@@ -34,6 +34,7 @@
#define CSID_RUP_AUP_RDI(rdi) ((BIT(4) | BIT(20)) << (rdi))
#define CSID_TOP_IRQ_STATUS 0x7C
+#define TOP_IRQ_RDI(rdi) BIT(8 + (rdi))
#define TOP_IRQ_STATUS_RESET_DONE BIT(0)
#define CSID_TOP_IRQ_MASK 0x80
@@ -58,6 +59,9 @@
#define CSID_CSI2_RDIN_IRQ_STATUS(rdi) (0xEC + 0x10 * (rdi))
#define RUP_DONE_IRQ_STATUS BIT(23)
+#define CSID_CSI2_RDIN_IRQ_MASK(rdi) (0xF0 + 0x10 * (rdi))
+#define INFO_INPUT_SOF_IRQ BIT(12)
+
#define CSID_CSI2_RDIN_IRQ_CLEAR(rdi) (0xF4 + 0x10 * (rdi))
#define CSID_CSI2_RDIN_IRQ_SET(rdi) (0xF8 + 0x10 * (rdi))
@@ -219,6 +223,25 @@ static void __csid_configure_rdi_stream(struct csid_device *csid, u8 enable, u8
writel(val, csid->base + CSID_RDI_CFG0(port));
}
+static void __csid_configure_rdi_irq(struct csid_device *csid, u8 enable, u8 rdi)
+{
+ u32 val = 0;
+
+ if (enable)
+ val = INFO_INPUT_SOF_IRQ;
+
+ writel(val, csid->base + CSID_CSI2_RDIN_IRQ_MASK(rdi));
+
+ val = readl(csid->base + CSID_TOP_IRQ_MASK);
+
+ if (enable)
+ val |= TOP_IRQ_RDI(rdi);
+ else
+ val &= ~TOP_IRQ_RDI(rdi);
+
+ writel(val, csid->base + CSID_TOP_IRQ_MASK);
+}
+
static void csid_configure_stream(struct csid_device *csid, u8 enable)
{
u8 i;
@@ -230,6 +253,7 @@ static void csid_configure_stream(struct csid_device *csid, u8 enable)
if (csid->phy.en_vc & BIT(i)) {
__csid_configure_rdi_stream(csid, enable, i, 0);
__csid_configure_rx(csid, &csid->phy, 0);
+ __csid_configure_rdi_irq(csid, enable, i);
__csid_ctrl_rdi(csid, enable, i);
}
}
@@ -279,6 +303,9 @@ static irqreturn_t csid_isr(int irq, void *dev)
val = readl(csid->base + CSID_CSI2_RDIN_IRQ_STATUS(i));
writel(val, csid->base + CSID_CSI2_RDIN_IRQ_CLEAR(i));
+ if (val & INFO_INPUT_SOF_IRQ)
+ csid_sof_event(csid, i);
+
if (val & RUP_DONE_IRQ_STATUS)
/* clear the reg update bit */
csid_subdev_reg_update(csid, i, true);
--
2.56.0
next prev parent reply other threads:[~2026-11-07 1:02 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-07 1:01 [PATCH v3 00/11] Add SOF sequence logic bryan.odonoghue
2026-11-07 1:01 ` [PATCH v3 01/11] media: qcom: camss: Introduce CPU latency QoS during streaming bryan.odonoghue
2026-11-07 1:01 ` [PATCH v3 02/11] media: qcom: camss: Introduce SOF sequence tracking bryan.odonoghue
2026-11-09 9:35 ` Loic Poulain
2026-11-07 1:01 ` [PATCH v3 03/11] media: qcom: camss: Use SOF sequence tracking for vb.sequence bryan.odonoghue
2026-11-09 9:49 ` Loic Poulain
2026-11-09 15:50 ` Bryan O'Donoghue
2026-11-07 1:01 ` bryan.odonoghue [this message]
2026-11-07 1:01 ` [PATCH v3 05/11] media: qcom: camss: csid-680: Enable RDI SOF tracking bryan.odonoghue
2026-11-07 1:01 ` [PATCH v3 06/11] media: qcom: camss: csid-gen2: " bryan.odonoghue
2026-11-07 1:01 ` [PATCH v3 07/11] media: qcom: camss: csid-340: " bryan.odonoghue
2026-11-09 15:49 ` Bryan O'Donoghue
2026-11-07 1:01 ` [PATCH v3 08/11] media: qcom: camss: Switch on frame_sync_en logic for csid-gen3 bryan.odonoghue
2026-11-09 9:56 ` Loic Poulain
2026-11-10 6:38 ` Gjorgji Rosikopulos (Consultant)
2026-11-07 1:01 ` [PATCH v3 09/11] media: qcom: camss: Switch on frame_sync_en for x1e/x2e bryan.odonoghue
2026-11-07 1:01 ` [PATCH v3 10/11] media: qcom: camss: Switch on frame_sync_en for csid-gen2 bryan.odonoghue
2026-11-07 1:01 ` [PATCH v3 11/11] media: qcom: camss: Switch on frame_sync_en for csid-340 bryan.odonoghue
2026-11-09 15:49 ` Bryan O'Donoghue
2026-11-09 17:31 ` [PATCH v3 00/11] Add SOF sequence logic Gjorgji Rosikopulos (Consultant)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261107-v4l2-frame-sync-v3-4-e5bf7073a35d@kernel.org \
--to=bryan.odonoghue@linaro.org \
--cc=bod@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=loic.poulain@oss.qualcomm.com \
--cc=mchehab@kernel.org \
--cc=vladimir.zapolskiy@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.