[PATCH v6 2/3] media: qcom: camss: csid-680: Use HW CSID index for wrapper IO path config
From: Wenmeng Liu
Date: Thu Nov 26 2026 - 06:18:17 EST
The CSID_TOP_IO_PATH_CFG0 registers are per hardware CSID, but they are
indexed with csid->id, which is the index into csid_res[]. On X1E80100
the two no longer match since CSID2 was removed from the resources, so
the lite CSIDs program the wrong register and never output to the IFE.
Add a hw_id to the CSID resources and use it to index the wrapper
registers.
Signed-off-by: Wenmeng Liu <wenmeng.liu@xxxxxxxxxxxxxxxx>
---
drivers/media/platform/qcom/camss/camss-csid-680.c | 2 +-
drivers/media/platform/qcom/camss/camss-csid.h | 1 +
drivers/media/platform/qcom/camss/camss.c | 4 ++++
3 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/media/platform/qcom/camss/camss-csid-680.c b/drivers/media/platform/qcom/camss/camss-csid-680.c
index 452640e72f6d5f5e2271945d97764c62b630da6c..383032f8f4e785b8390fd8856bce4628fafc20a5 100644
--- a/drivers/media/platform/qcom/camss/camss-csid-680.c
+++ b/drivers/media/platform/qcom/camss/camss-csid-680.c
@@ -228,7 +228,7 @@ static void __csid_configure_top(struct csid_device *csid)
val = CSID_TOP_IO_PATH_CFG0_OUTPUT_IFE_EN | CSID_TOP_IO_PATH_CFG0_INTERNAL_CSID;
writel(val, csid->camss->csid_wrapper_base +
- CSID_TOP_IO_PATH_CFG0(csid->id));
+ CSID_TOP_IO_PATH_CFG0(csid->res->hw_id));
}
static void __csid_configure_rdi_stream(struct csid_device *csid, u8 enable, u8 port, u8 vc)
diff --git a/drivers/media/platform/qcom/camss/camss-csid.h b/drivers/media/platform/qcom/camss/camss-csid.h
index ccafdbf3a9fe0c282da68ccdd04661b3fab81ff5..dd75c8c0cf3da7bea2c4de589dcd64a099a3a724 100644
--- a/drivers/media/platform/qcom/camss/camss-csid.h
+++ b/drivers/media/platform/qcom/camss/camss-csid.h
@@ -150,6 +150,7 @@ struct csid_hw_ops {
struct csid_subdev_resources {
bool is_lite;
bool frame_sync_en;
+ u8 hw_id;
const struct csid_hw_ops *hw_ops;
const struct parent_dev_ops *parent_dev_ops;
const struct csid_formats *formats;
diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c
index d3d27205af0dd49599fe0717dc8dde68a9afa638..fbf7be44d8fa2947f3c68c6d467ce0aeaebc39ff 100644
--- a/drivers/media/platform/qcom/camss/camss.c
+++ b/drivers/media/platform/qcom/camss/camss.c
@@ -4536,6 +4536,7 @@ static const struct camss_subdev_resources csid_res_x1e80100[] = {
.reg = { "csid0" },
.interrupt = { "csid0" },
.csid = {
+ .hw_id = 0,
.frame_sync_en = true,
.hw_ops = &csid_ops_680,
.parent_dev_ops = &vfe_parent_dev_ops,
@@ -4557,6 +4558,7 @@ static const struct camss_subdev_resources csid_res_x1e80100[] = {
.reg = { "csid1" },
.interrupt = { "csid1" },
.csid = {
+ .hw_id = 1,
.frame_sync_en = true,
.hw_ops = &csid_ops_680,
.parent_dev_ops = &vfe_parent_dev_ops,
@@ -4578,6 +4580,7 @@ static const struct camss_subdev_resources csid_res_x1e80100[] = {
.reg = { "csid_lite0" },
.interrupt = { "csid_lite0" },
.csid = {
+ .hw_id = 3,
.is_lite = true,
.frame_sync_en = true,
.hw_ops = &csid_ops_680,
@@ -4601,6 +4604,7 @@ static const struct camss_subdev_resources csid_res_x1e80100[] = {
.reg = { "csid_lite1" },
.interrupt = { "csid_lite1" },
.csid = {
+ .hw_id = 4,
.is_lite = true,
.frame_sync_en = true,
.hw_ops = &csid_ops_680,
--
2.34.1