[PATCH v2 07/10] media: qcom: cam-icc: add the SA8775P data

From: Atanas Filipov

Date: Fri Dec 04 2026 - 02:54:20 EST


Add the SA8775P camera NoC nodes, MMCX and MXC rails, static QoS
settings and error interrupt sources. The port list, the rail levels
and the QoS values are taken from the downstream camera driver of this
SoC.

Signed-off-by: Atanas Filipov <atanas.filipov@xxxxxxxxxxxxxxxx>
---
drivers/media/platform/qcom/cam-icc/Makefile | 3 +-
.../platform/qcom/cam-icc/qcom-cam-icc-core.c | 1 +
.../platform/qcom/cam-icc/qcom-cam-icc-core.h | 1 +
.../qcom/cam-icc/qcom-cam-icc-sa8775p.c | 107 ++++++++++++++++++
4 files changed, 111 insertions(+), 1 deletion(-)
create mode 100644 drivers/media/platform/qcom/cam-icc/qcom-cam-icc-sa8775p.c

diff --git a/drivers/media/platform/qcom/cam-icc/Makefile b/drivers/media/platform/qcom/cam-icc/Makefile
index 346abef8c51c..60d714bfce57 100644
--- a/drivers/media/platform/qcom/cam-icc/Makefile
+++ b/drivers/media/platform/qcom/cam-icc/Makefile
@@ -1,4 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
-qcom-cam-icc-y := qcom-cam-icc-core.o qcom-cam-icc-sc7280.o qcom-cam-icc-sm8250.o
+qcom-cam-icc-y := qcom-cam-icc-core.o qcom-cam-icc-sa8775p.o qcom-cam-icc-sc7280.o \
+ qcom-cam-icc-sm8250.o

obj-$(CONFIG_QCOM_CAM_ICC) += qcom-cam-icc.o
diff --git a/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.c b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.c
index 4aa5a0c76842..c40d2e6f2a46 100644
--- a/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.c
+++ b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.c
@@ -534,6 +534,7 @@ static int qcom_cam_icc_opp_init(struct qcom_cam_icc *camnoc)
}

static const struct of_device_id qcom_cam_icc_of_match[] = {
+ { .compatible = "qcom,sa8775p-cam-icc", .data = &qcom_cam_icc_sa8775p_data },
{ .compatible = "qcom,sc7280-cam-icc", .data = &qcom_cam_icc_sc7280_data },
{ .compatible = "qcom,sm8250-cam-icc", .data = &qcom_cam_icc_sm8250_data },
{ }
diff --git a/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.h b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.h
index 9d4d60653404..c35286c02a09 100644
--- a/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.h
+++ b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.h
@@ -124,6 +124,7 @@ struct qcom_cam_icc_data {
.clear_off = QCOM_CAM_ICC_##_type##ERRCLR_LOW, \
}

+extern const struct qcom_cam_icc_data qcom_cam_icc_sa8775p_data;
extern const struct qcom_cam_icc_data qcom_cam_icc_sc7280_data;
extern const struct qcom_cam_icc_data qcom_cam_icc_sm8250_data;

diff --git a/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-sa8775p.c b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-sa8775p.c
new file mode 100644
index 000000000000..a181c1c7540c
--- /dev/null
+++ b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-sa8775p.c
@@ -0,0 +1,107 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
+ */
+
+#include <linux/array_size.h>
+#include <linux/bits.h>
+#include <linux/pm_domain.h>
+
+#include <dt-bindings/interconnect/qcom,sa8775p-cam-icc.h>
+
+#include "qcom-cam-icc-core.h"
+
+#define SA8775P_RT0 0x6200
+#define SA8775P_RT1 0x6400
+#define SA8775P_RT2 0x6600
+#define SA8775P_NRT0 0x5c00
+#define SA8775P_NRT1 0x5e00
+#define SA8775P_NRT2 0x6000
+
+enum {
+ SA8775P_CAMNOC_RT_WR0 = SLAVE_CAMNOC_AHB + 1,
+ SA8775P_CAMNOC_RT_WR1,
+ SA8775P_CAMNOC_NUM_NODES,
+};
+
+static const struct qcom_cam_icc_node sa8775p_nodes[] = {
+ CAMNOC_PORT(MASTER_CAMNOC_IFE_RT_WR0, "camnoc_ife_rt_wr0", SA8775P_CAMNOC_RT_WR0),
+ CAMNOC_PORT(MASTER_CAMNOC_IFE_RT_WR1, "camnoc_ife_rt_wr1", SA8775P_CAMNOC_RT_WR1),
+ {
+ .name = "camnoc_ahb",
+ .id = MASTER_CAMNOC_AHB,
+ .link = SLAVE_CAMNOC_AHB,
+ },
+ CAMNOC_LINK_SLAVE(SLAVE_CAMNOC_HF, "camnoc_hf", "hf"),
+ CAMNOC_LINK_SLAVE(SLAVE_CAMNOC_AHB, "camnoc_ahb_slv", "cfg"),
+ CAMNOC_INTERNAL(SA8775P_CAMNOC_RT_WR0, "camnoc_rt_wr0", SLAVE_CAMNOC_HF,
+ QCOM_CAM_ICC_MERGE_SUM),
+ CAMNOC_INTERNAL(SA8775P_CAMNOC_RT_WR1, "camnoc_rt_wr1", SLAVE_CAMNOC_HF,
+ QCOM_CAM_ICC_MERGE_SUM),
+};
+
+static const char * const sa8775p_rail_pd_names[] = { "mmcx", "mxc" };
+
+static const struct dev_pm_domain_attach_data sa8775p_rail_pd_data = {
+ .pd_names = sa8775p_rail_pd_names,
+ .num_pd_names = ARRAY_SIZE(sa8775p_rail_pd_names),
+ .pd_flags = PD_FLAG_REQUIRED_OPP,
+};
+
+static const struct qcom_cam_icc_qos sa8775p_qos[] = {
+ CAMNOC_QOS(SA8775P_RT0, PRIORITYLUT_LOW, 0x0),
+ CAMNOC_QOS(SA8775P_RT0, PRIORITYLUT_HIGH, 0x0),
+ CAMNOC_QOS(SA8775P_RT0, URGENCY_LOW, 0x1003),
+ CAMNOC_QOS(SA8775P_RT0, DANGERLUT_LOW, 0x0),
+ CAMNOC_QOS(SA8775P_RT0, SAFELUT_LOW, 0xffff),
+ CAMNOC_QOS(SA8775P_RT1, PRIORITYLUT_LOW, 0x66665433),
+ CAMNOC_QOS(SA8775P_RT1, PRIORITYLUT_HIGH, 0x66666666),
+ CAMNOC_QOS(SA8775P_RT1, URGENCY_LOW, 0x1b30),
+ CAMNOC_QOS(SA8775P_RT1, DANGERLUT_LOW, 0xffffff00),
+ CAMNOC_QOS(SA8775P_RT1, SAFELUT_LOW, 0xf),
+ CAMNOC_QOS(SA8775P_RT2, PRIORITYLUT_LOW, 0x66665433),
+ CAMNOC_QOS(SA8775P_RT2, PRIORITYLUT_HIGH, 0x66666666),
+ CAMNOC_QOS(SA8775P_RT2, URGENCY_LOW, 0x1b30),
+ CAMNOC_QOS(SA8775P_RT2, DANGERLUT_LOW, 0xffffff00),
+ CAMNOC_QOS(SA8775P_RT2, SAFELUT_LOW, 0xf),
+ CAMNOC_QOS(SA8775P_NRT0, PRIORITYLUT_LOW, 0x0),
+ CAMNOC_QOS(SA8775P_NRT0, PRIORITYLUT_HIGH, 0x0),
+ CAMNOC_QOS(SA8775P_NRT0, URGENCY_LOW, 0x3),
+ CAMNOC_QOS(SA8775P_NRT1, PRIORITYLUT_LOW, 0x0),
+ CAMNOC_QOS(SA8775P_NRT1, PRIORITYLUT_HIGH, 0x0),
+ CAMNOC_QOS(SA8775P_NRT1, URGENCY_LOW, 0x3),
+ CAMNOC_QOS(SA8775P_NRT2, PRIORITYLUT_LOW, 0x33333333),
+ CAMNOC_QOS(SA8775P_NRT2, PRIORITYLUT_HIGH, 0x33333333),
+ CAMNOC_QOS(SA8775P_NRT2, URGENCY_LOW, 0x30),
+};
+
+static const struct qcom_cam_icc_sbm sa8775p_sbm = {
+ .enable_reg = 0x240,
+ .status_reg = 0x248,
+ .clear_reg = 0x280,
+ .clear_val = 0x1,
+};
+
+static const struct qcom_cam_icc_irq_err sa8775p_irq_errs[] = {
+ CAMNOC_IRQ_ERR("nrt1 decode", BIT(2), SA8775P_NRT1, DEC, 0xff),
+};
+
+static const struct qcom_cam_icc_erl sa8775p_err_log = {
+ .base = 0x0000,
+ .sbm_mask = BIT(0),
+};
+
+const struct qcom_cam_icc_data qcom_cam_icc_sa8775p_data = {
+ .rate_clk = "camnoc_axi",
+ .nodes = sa8775p_nodes,
+ .num_nodes = ARRAY_SIZE(sa8775p_nodes),
+ .num_ids = SA8775P_CAMNOC_NUM_NODES,
+ .ahb_id = SLAVE_CAMNOC_AHB,
+ .rail_pd_data = &sa8775p_rail_pd_data,
+ .qos = sa8775p_qos,
+ .num_qos = ARRAY_SIZE(sa8775p_qos),
+ .sbm = &sa8775p_sbm,
+ .irq_errs = sa8775p_irq_errs,
+ .num_irq_errs = ARRAY_SIZE(sa8775p_irq_errs),
+ .err_logger = &sa8775p_err_log,
+};
--
2.34.1