Devicetree
 help / color / mirror / Atom feed
* [PATCH v2 00/10] Add the Qualcomm Titan camera NoC interconnect provider
@ 2026-12-04  7:53 Atanas Filipov
  2026-12-04  7:53 ` [PATCH v2 01/10] dt-bindings: interconnect: add the Qualcomm SM8250 Titan camera NoC Atanas Filipov
                   ` (9 more replies)
  0 siblings, 10 replies; 24+ messages in thread
From: Atanas Filipov @ 2026-12-04  7:53 UTC (permalink / raw)
  To: djakov, bod, linux-pm, linux-media
  Cc: mchehab, andersson, konradybcio, abelvesa, robh, krzk+dt,
	conor+dt, loic.poulain, linux-arm-msm, devicetree, linux-kernel,
	Dmitry Baryshkov, Prashant Shrotriya, Vikram Sharma,
	Gjorgji Rosikopulos, Atanas Filipov

Camera drivers can set a minimum rate on the shared camera NoC
clocks. The interconnect provider lets clients request bandwidth on
their camera NoC ports and on the camera AHB path. It uses those votes
to set the AXI and AHB clock rates and select a power rail level.

The series supports SM8250, SC7280 and SA8775P. The AXI rate follows
the largest bandwidth request across the rate nodes, with a margin and
a minimum rate. The AHB rate is one fixed rate. The provider uses OPPs
to vote for MMCX on SM8250, CX on SC7280, and MMCX and MXC on SA8775P.

The provider programs static QoS settings on runtime resume. It logs
and clears camera NoC errors. A client can use qcom_cam_icc_link() to
resume the provider before it resumes.

This series adds the provider. CAMSS and JPEG client conversion will
follow in separate series.

Please do not review v1. The Lemans device tree changed in linux-next
(the new lemans-embedded.dtsi file), so the SA8775P DTS patch in v1
does not apply any more. Please review this version only.

Validation:
- Ran hardware tests on RB5 and RB3 Gen2 with v7.4-rc4, this series
  and the separate CAMSS and JPEG client patches. The tests were
  concurrent capture on all RDI paths, JPEG encode, and both
  together, with repeated runs. The AXI rate followed the largest
  request of the active clients and went down to the lowest rate when
  no client was active. The kernel log had no warnings and no IOMMU
  faults. Unload and reload of the provider worked.
- RB8 was not tested with this version.

Changes since v1:
- Rebased on next-20261202.
- sa8775p: add the camera NoC node to lemans-embedded.dtsi, because
  the clocks and interconnect properties of the camera blocks moved
  there.

Atanas Filipov (10):
  dt-bindings: interconnect: add the Qualcomm SM8250 Titan camera NoC
  dt-bindings: interconnect: add the Qualcomm SC7280 Titan camera NoC
  dt-bindings: interconnect: add the Qualcomm SA8775P Titan camera NoC
  media: qcom: cam-icc: add the Titan camera NoC driver
  media: qcom: cam-icc: add the SM8250 data
  media: qcom: cam-icc: add the SC7280 data
  media: qcom: cam-icc: add the SA8775P data
  arm64: dts: qcom: sm8250: add the Titan camera NoC node
  arm64: dts: qcom: sc7280: add the Titan camera NoC node
  arm64: dts: qcom: sa8775p: add the Titan camera NoC node

 .../interconnect/qcom,sa8775p-cam-icc.yaml    | 148 ++++
 .../interconnect/qcom,sc7280-cam-icc.yaml     | 156 ++++
 .../interconnect/qcom,sm8250-cam-icc.yaml     | 149 ++++
 arch/arm64/boot/dts/qcom/kodiak.dtsi          |  61 ++
 arch/arm64/boot/dts/qcom/lemans-embedded.dtsi |  47 ++
 arch/arm64/boot/dts/qcom/sm8250.dtsi          |  50 ++
 drivers/media/platform/qcom/Kconfig           |   1 +
 drivers/media/platform/qcom/Makefile          |   1 +
 drivers/media/platform/qcom/cam-icc/Kconfig   |  14 +
 drivers/media/platform/qcom/cam-icc/Makefile  |   5 +
 .../platform/qcom/cam-icc/qcom-cam-icc-core.c | 673 ++++++++++++++++++
 .../platform/qcom/cam-icc/qcom-cam-icc-core.h | 131 ++++
 .../qcom/cam-icc/qcom-cam-icc-sa8775p.c       | 107 +++
 .../qcom/cam-icc/qcom-cam-icc-sc7280.c        | 134 ++++
 .../qcom/cam-icc/qcom-cam-icc-sm8250.c        | 127 ++++
 .../interconnect/qcom,sa8775p-cam-icc.h       |  17 +
 .../interconnect/qcom,sc7280-cam-icc.h        |  21 +
 .../interconnect/qcom,sm8250-cam-icc.h        |  21 +
 include/media/qcom-cam-icc.h                  |  26 +
 19 files changed, 1889 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/interconnect/qcom,sa8775p-cam-icc.yaml
 create mode 100644 Documentation/devicetree/bindings/interconnect/qcom,sc7280-cam-icc.yaml
 create mode 100644 Documentation/devicetree/bindings/interconnect/qcom,sm8250-cam-icc.yaml
 create mode 100644 drivers/media/platform/qcom/cam-icc/Kconfig
 create mode 100644 drivers/media/platform/qcom/cam-icc/Makefile
 create mode 100644 drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.c
 create mode 100644 drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.h
 create mode 100644 drivers/media/platform/qcom/cam-icc/qcom-cam-icc-sa8775p.c
 create mode 100644 drivers/media/platform/qcom/cam-icc/qcom-cam-icc-sc7280.c
 create mode 100644 drivers/media/platform/qcom/cam-icc/qcom-cam-icc-sm8250.c
 create mode 100644 include/dt-bindings/interconnect/qcom,sa8775p-cam-icc.h
 create mode 100644 include/dt-bindings/interconnect/qcom,sc7280-cam-icc.h
 create mode 100644 include/dt-bindings/interconnect/qcom,sm8250-cam-icc.h
 create mode 100644 include/media/qcom-cam-icc.h


base-commit: 799dd936553182df5770dde7f38d94c8337df75a
-- 
2.34.1


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH v2 01/10] dt-bindings: interconnect: add the Qualcomm SM8250 Titan camera NoC
  2026-12-04  7:53 [PATCH v2 00/10] Add the Qualcomm Titan camera NoC interconnect provider Atanas Filipov
@ 2026-12-04  7:53 ` Atanas Filipov
  2026-12-04  8:01   ` sashiko-bot
  2026-12-04  7:53 ` [PATCH v2 02/10] dt-bindings: interconnect: add the Qualcomm SC7280 " Atanas Filipov
                   ` (8 subsequent siblings)
  9 siblings, 1 reply; 24+ messages in thread
From: Atanas Filipov @ 2026-12-04  7:53 UTC (permalink / raw)
  To: djakov, bod, linux-pm, linux-media
  Cc: mchehab, andersson, konradybcio, abelvesa, robh, krzk+dt,
	conor+dt, loic.poulain, linux-arm-msm, devicetree, linux-kernel,
	Dmitry Baryshkov, Prashant Shrotriya, Vikram Sharma,
	Gjorgji Rosikopulos, Atanas Filipov

Add the binding of the SM8250 Titan camera NoC. The camera NoC connects
the camera blocks to the multimedia NoC and DDR.

It is an interconnect and not only a clock: each camera block has its
own ports on the camera NoC, and the votes on these ports set the
camera NoC clock rates and the rail level.

Signed-off-by: Atanas Filipov <atanas.filipov@oss.qualcomm.com>
---
 .../interconnect/qcom,sm8250-cam-icc.yaml     | 149 ++++++++++++++++++
 .../interconnect/qcom,sm8250-cam-icc.h        |  21 +++
 2 files changed, 170 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/interconnect/qcom,sm8250-cam-icc.yaml
 create mode 100644 include/dt-bindings/interconnect/qcom,sm8250-cam-icc.h

diff --git a/Documentation/devicetree/bindings/interconnect/qcom,sm8250-cam-icc.yaml b/Documentation/devicetree/bindings/interconnect/qcom,sm8250-cam-icc.yaml
new file mode 100644
index 000000000000..7b35a0640c7f
--- /dev/null
+++ b/Documentation/devicetree/bindings/interconnect/qcom,sm8250-cam-icc.yaml
@@ -0,0 +1,149 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/interconnect/qcom,sm8250-cam-icc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm SM8250 Titan camera NoC
+
+maintainers:
+  - Atanas Filipov <atanas.filipov@oss.qualcomm.com>
+
+description:
+  The camera NoC connects the camera blocks to the multimedia NoC and
+  DDR. It has one node for each camera NoC port and one node for the
+  camera AHB (config) path. Clients request bandwidth on paths that
+  start at these nodes.
+
+properties:
+  compatible:
+    enum:
+      - qcom,sm8250-cam-icc
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    items:
+      - description: GCC camera AHB clock
+      - description: GCC camera HF AXI clock
+      - description: GCC camera SF AXI clock
+      - description: CPAS AHB clock
+      - description: camera core AHB clock
+      - description: camera NoC AXI clock
+
+  clock-names:
+    items:
+      - const: iface
+      - const: gcc_axi_hf
+      - const: gcc_axi_sf
+      - const: cpas_ahb
+      - const: core_ahb
+      - const: camnoc_axi
+
+  power-domains:
+    items:
+      - description: Titan top GDSC
+      - description: MMCX power domain, for the camera NoC clock rate
+
+  power-domain-names:
+    items:
+      - const: top
+      - const: mmcx
+
+  operating-points-v2: true
+
+  opp-table:
+    type: object
+
+  interconnects:
+    items:
+      - description: config path from the CPU to the camera config space
+      - description: camera NoC HF port to DDR
+      - description: camera NoC SF port to DDR
+
+  interconnect-names:
+    items:
+      - const: cfg
+      - const: hf
+      - const: sf
+
+  '#interconnect-cells':
+    const: 2
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+  - clock-names
+  - power-domains
+  - power-domain-names
+  - operating-points-v2
+  - interconnects
+  - interconnect-names
+  - '#interconnect-cells'
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/qcom,camcc-sm8250.h>
+    #include <dt-bindings/clock/qcom,gcc-sm8250.h>
+    #include <dt-bindings/interconnect/qcom,icc.h>
+    #include <dt-bindings/interconnect/qcom,sm8250.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/power/qcom,rpmhpd.h>
+
+    interconnect@ac42000 {
+        compatible = "qcom,sm8250-cam-icc";
+        reg = <0x0ac42000 0x8000>;
+
+        interrupts = <GIC_SPI 459 IRQ_TYPE_EDGE_RISING>;
+
+        clocks = <&gcc GCC_CAMERA_AHB_CLK>,
+                 <&gcc GCC_CAMERA_HF_AXI_CLK>,
+                 <&gcc GCC_CAMERA_SF_AXI_CLK>,
+                 <&camcc CAM_CC_CPAS_AHB_CLK>,
+                 <&camcc CAM_CC_CORE_AHB_CLK>,
+                 <&camcc CAM_CC_CAMNOC_AXI_CLK>;
+        clock-names = "iface",
+                      "gcc_axi_hf",
+                      "gcc_axi_sf",
+                      "cpas_ahb",
+                      "core_ahb",
+                      "camnoc_axi";
+
+        power-domains = <&camcc TITAN_TOP_GDSC>,
+                        <&rpmhpd RPMHPD_MMCX>;
+        power-domain-names = "top", "mmcx";
+
+        operating-points-v2 = <&camnoc_opp_table>;
+
+        interconnects = <&gem_noc MASTER_AMPSS_M0 QCOM_ICC_TAG_ALWAYS
+                         &config_noc SLAVE_CAMERA_CFG QCOM_ICC_TAG_ALWAYS>,
+                        <&mmss_noc MASTER_CAMNOC_HF QCOM_ICC_TAG_ALWAYS
+                         &mc_virt SLAVE_EBI_CH0 QCOM_ICC_TAG_ALWAYS>,
+                        <&mmss_noc MASTER_CAMNOC_SF QCOM_ICC_TAG_ALWAYS
+                         &mc_virt SLAVE_EBI_CH0 QCOM_ICC_TAG_ALWAYS>;
+        interconnect-names = "cfg", "hf", "sf";
+
+        #interconnect-cells = <2>;
+
+        camnoc_opp_table: opp-table {
+            compatible = "operating-points-v2";
+
+            opp-300000000 {
+                opp-hz = /bits/ 64 <300000000>;
+                required-opps = <&rpmhpd_opp_low_svs>;
+            };
+
+            opp-400000000 {
+                opp-hz = /bits/ 64 <400000000>;
+                required-opps = <&rpmhpd_opp_svs>;
+            };
+        };
+    };
diff --git a/include/dt-bindings/interconnect/qcom,sm8250-cam-icc.h b/include/dt-bindings/interconnect/qcom,sm8250-cam-icc.h
new file mode 100644
index 000000000000..0461d32c8ab3
--- /dev/null
+++ b/include/dt-bindings/interconnect/qcom,sm8250-cam-icc.h
@@ -0,0 +1,21 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
+/*
+ * Qualcomm SM8250 camera NoC interconnect IDs
+ *
+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
+ */
+
+#ifndef __DT_BINDINGS_INTERCONNECT_QCOM_SM8250_CAM_ICC_H
+#define __DT_BINDINGS_INTERCONNECT_QCOM_SM8250_CAM_ICC_H
+
+#define MASTER_CAMNOC_IFE_LINEAR_WR	0
+#define MASTER_CAMNOC_IFE_RDI_WR	1
+#define MASTER_CAMNOC_IFE_RDI_RD	2
+#define MASTER_CAMNOC_JPEG_WR		3
+#define MASTER_CAMNOC_JPEG_RD		4
+#define MASTER_CAMNOC_AHB		5
+#define SLAVE_CAMNOC_HF			6
+#define SLAVE_CAMNOC_SF			7
+#define SLAVE_CAMNOC_AHB		8
+
+#endif
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 02/10] dt-bindings: interconnect: add the Qualcomm SC7280 Titan camera NoC
  2026-12-04  7:53 [PATCH v2 00/10] Add the Qualcomm Titan camera NoC interconnect provider Atanas Filipov
  2026-12-04  7:53 ` [PATCH v2 01/10] dt-bindings: interconnect: add the Qualcomm SM8250 Titan camera NoC Atanas Filipov
@ 2026-12-04  7:53 ` Atanas Filipov
  2026-12-04  8:04   ` sashiko-bot
  2026-12-04 11:10   ` Bryan O'Donoghue
  2026-12-04  7:53 ` [PATCH v2 03/10] dt-bindings: interconnect: add the Qualcomm SA8775P " Atanas Filipov
                   ` (7 subsequent siblings)
  9 siblings, 2 replies; 24+ messages in thread
From: Atanas Filipov @ 2026-12-04  7:53 UTC (permalink / raw)
  To: djakov, bod, linux-pm, linux-media
  Cc: mchehab, andersson, konradybcio, abelvesa, robh, krzk+dt,
	conor+dt, loic.poulain, linux-arm-msm, devicetree, linux-kernel,
	Dmitry Baryshkov, Prashant Shrotriya, Vikram Sharma,
	Gjorgji Rosikopulos, Atanas Filipov

Add the Titan camera NoC of SC7280. It is an interconnect provider for
the camera clients, with one node per camera NoC port and one node for
the camera AHB path. Compared to SM8250, it has no GCC camera AHB clock
and no camera core AHB clock, and the camera NoC registers are at a
different address.

Signed-off-by: Atanas Filipov <atanas.filipov@oss.qualcomm.com>
---
 .../interconnect/qcom,sc7280-cam-icc.yaml     | 156 ++++++++++++++++++
 .../interconnect/qcom,sc7280-cam-icc.h        |  21 +++
 2 files changed, 177 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/interconnect/qcom,sc7280-cam-icc.yaml
 create mode 100644 include/dt-bindings/interconnect/qcom,sc7280-cam-icc.h

diff --git a/Documentation/devicetree/bindings/interconnect/qcom,sc7280-cam-icc.yaml b/Documentation/devicetree/bindings/interconnect/qcom,sc7280-cam-icc.yaml
new file mode 100644
index 000000000000..2d8bc60dd3be
--- /dev/null
+++ b/Documentation/devicetree/bindings/interconnect/qcom,sc7280-cam-icc.yaml
@@ -0,0 +1,156 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/interconnect/qcom,sc7280-cam-icc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm SC7280 Titan camera NoC
+
+maintainers:
+  - Atanas Filipov <atanas.filipov@oss.qualcomm.com>
+
+description:
+  The camera NoC connects the camera blocks to the multimedia NoC and
+  DDR. It has one node for each camera NoC port and one node for the
+  camera AHB (config) path. Clients request bandwidth on paths that
+  start at these nodes.
+
+properties:
+  compatible:
+    enum:
+      - qcom,sc7280-cam-icc
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    items:
+      - description: GCC camera HF AXI clock
+      - description: GCC camera SF AXI clock
+      - description: CPAS AHB clock
+      - description: camera NoC AXI clock
+
+  clock-names:
+    items:
+      - const: gcc_axi_hf
+      - const: gcc_axi_sf
+      - const: cpas_ahb
+      - const: camnoc_axi
+
+  power-domains:
+    items:
+      - description: Titan top GDSC
+      - description: CX power domain, for the camera NoC clock rate
+
+  power-domain-names:
+    items:
+      - const: top
+      - const: cx
+
+  operating-points-v2: true
+
+  opp-table:
+    type: object
+
+  interconnects:
+    items:
+      - description: config path from the CPU to the camera config space
+      - description: camera NoC HF port to DDR
+      - description: camera NoC SF port to DDR
+
+  interconnect-names:
+    items:
+      - const: cfg
+      - const: hf
+      - const: sf
+
+  '#interconnect-cells':
+    const: 2
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+  - clock-names
+  - power-domains
+  - power-domain-names
+  - operating-points-v2
+  - interconnects
+  - interconnect-names
+  - '#interconnect-cells'
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/qcom,camcc-sc7280.h>
+    #include <dt-bindings/clock/qcom,gcc-sc7280.h>
+    #include <dt-bindings/interconnect/qcom,icc.h>
+    #include <dt-bindings/interconnect/qcom,sc7280.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/power/qcom,rpmhpd.h>
+
+    interconnect@ac9f000 {
+        compatible = "qcom,sc7280-cam-icc";
+        reg = <0x0ac9f000 0x10000>;
+
+        interrupts = <GIC_SPI 459 IRQ_TYPE_EDGE_RISING>;
+
+        clocks = <&gcc GCC_CAMERA_HF_AXI_CLK>,
+                 <&gcc GCC_CAMERA_SF_AXI_CLK>,
+                 <&camcc CAM_CC_CPAS_AHB_CLK>,
+                 <&camcc CAM_CC_CAMNOC_AXI_CLK>;
+        clock-names = "gcc_axi_hf",
+                      "gcc_axi_sf",
+                      "cpas_ahb",
+                      "camnoc_axi";
+
+        power-domains = <&camcc CAM_CC_TITAN_TOP_GDSC>,
+                        <&rpmhpd SC7280_CX>;
+        power-domain-names = "top", "cx";
+
+        operating-points-v2 = <&camnoc_opp_table>;
+
+        interconnects = <&gem_noc MASTER_APPSS_PROC QCOM_ICC_TAG_ALWAYS
+                         &cnoc2 SLAVE_CAMERA_CFG QCOM_ICC_TAG_ALWAYS>,
+                        <&mmss_noc MASTER_CAMNOC_HF QCOM_ICC_TAG_ALWAYS
+                         &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>,
+                        <&mmss_noc MASTER_CAMNOC_SF QCOM_ICC_TAG_ALWAYS
+                         &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>;
+        interconnect-names = "cfg", "hf", "sf";
+
+        #interconnect-cells = <2>;
+
+        camnoc_opp_table: opp-table {
+            compatible = "operating-points-v2";
+
+            opp-150000000 {
+                opp-hz = /bits/ 64 <150000000>;
+                required-opps = <&rpmhpd_opp_low_svs>;
+            };
+
+            opp-240000000 {
+                opp-hz = /bits/ 64 <240000000>;
+                required-opps = <&rpmhpd_opp_svs>;
+            };
+
+            opp-320000000 {
+                opp-hz = /bits/ 64 <320000000>;
+                required-opps = <&rpmhpd_opp_svs_l1>;
+            };
+
+            opp-400000000 {
+                opp-hz = /bits/ 64 <400000000>;
+                required-opps = <&rpmhpd_opp_nom>;
+            };
+
+            opp-480000000 {
+                opp-hz = /bits/ 64 <480000000>;
+                required-opps = <&rpmhpd_opp_turbo>;
+            };
+        };
+    };
diff --git a/include/dt-bindings/interconnect/qcom,sc7280-cam-icc.h b/include/dt-bindings/interconnect/qcom,sc7280-cam-icc.h
new file mode 100644
index 000000000000..01645008582d
--- /dev/null
+++ b/include/dt-bindings/interconnect/qcom,sc7280-cam-icc.h
@@ -0,0 +1,21 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
+/*
+ * Qualcomm SC7280 camera NoC interconnect IDs
+ *
+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
+ */
+
+#ifndef __DT_BINDINGS_INTERCONNECT_QCOM_SC7280_CAM_ICC_H
+#define __DT_BINDINGS_INTERCONNECT_QCOM_SC7280_CAM_ICC_H
+
+#define MASTER_CAMNOC_IFE_RDI_WR	0
+#define MASTER_CAMNOC_IFE_PIXEL_WR	1
+#define MASTER_CAMNOC_IFE2_PIXEL_WR	2
+#define MASTER_CAMNOC_JPEG_WR		3
+#define MASTER_CAMNOC_JPEG_RD		4
+#define MASTER_CAMNOC_AHB		5
+#define SLAVE_CAMNOC_HF			6
+#define SLAVE_CAMNOC_SF			7
+#define SLAVE_CAMNOC_AHB		8
+
+#endif
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 03/10] dt-bindings: interconnect: add the Qualcomm SA8775P Titan camera NoC
  2026-12-04  7:53 [PATCH v2 00/10] Add the Qualcomm Titan camera NoC interconnect provider Atanas Filipov
  2026-12-04  7:53 ` [PATCH v2 01/10] dt-bindings: interconnect: add the Qualcomm SM8250 Titan camera NoC Atanas Filipov
  2026-12-04  7:53 ` [PATCH v2 02/10] dt-bindings: interconnect: add the Qualcomm SC7280 " Atanas Filipov
@ 2026-12-04  7:53 ` Atanas Filipov
  2026-12-04  8:04   ` sashiko-bot
  2026-12-04 11:14   ` Bryan O'Donoghue
  2026-12-04  7:53 ` [PATCH v2 04/10] media: qcom: cam-icc: add the Titan camera NoC driver Atanas Filipov
                   ` (6 subsequent siblings)
  9 siblings, 2 replies; 24+ messages in thread
From: Atanas Filipov @ 2026-12-04  7:53 UTC (permalink / raw)
  To: djakov, bod, linux-pm, linux-media
  Cc: mchehab, andersson, konradybcio, abelvesa, robh, krzk+dt,
	conor+dt, loic.poulain, linux-arm-msm, devicetree, linux-kernel,
	Dmitry Baryshkov, Prashant Shrotriya, Vikram Sharma,
	Gjorgji Rosikopulos, Atanas Filipov

Add the Titan camera NoC of SA8775P. Compared to SM8250, the camera NoC
has a CPAS fast AHB clock and needs both the MMCX and MXC rails.

Signed-off-by: Atanas Filipov <atanas.filipov@oss.qualcomm.com>
---
 .../interconnect/qcom,sa8775p-cam-icc.yaml    | 148 ++++++++++++++++++
 .../interconnect/qcom,sa8775p-cam-icc.h       |  17 ++
 2 files changed, 165 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/interconnect/qcom,sa8775p-cam-icc.yaml
 create mode 100644 include/dt-bindings/interconnect/qcom,sa8775p-cam-icc.h

diff --git a/Documentation/devicetree/bindings/interconnect/qcom,sa8775p-cam-icc.yaml b/Documentation/devicetree/bindings/interconnect/qcom,sa8775p-cam-icc.yaml
new file mode 100644
index 000000000000..88fe0033074d
--- /dev/null
+++ b/Documentation/devicetree/bindings/interconnect/qcom,sa8775p-cam-icc.yaml
@@ -0,0 +1,148 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/interconnect/qcom,sa8775p-cam-icc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm SA8775P Titan camera NoC
+
+maintainers:
+  - Atanas Filipov <atanas.filipov@oss.qualcomm.com>
+
+description:
+  The camera NoC connects the camera blocks to the multimedia NoC and
+  DDR. It has one node for each camera NoC port and one node for the
+  camera AHB (config) path. Clients request bandwidth on paths that
+  start at these nodes.
+
+properties:
+  compatible:
+    enum:
+      - qcom,sa8775p-cam-icc
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    items:
+      - description: GCC camera AHB clock
+      - description: GCC camera HF AXI clock
+      - description: GCC camera SF AXI clock
+      - description: CPAS AHB clock
+      - description: camera core AHB clock
+      - description: CPAS fast AHB clock
+      - description: camera NoC AXI clock
+
+  clock-names:
+    items:
+      - const: iface
+      - const: gcc_axi_hf
+      - const: gcc_axi_sf
+      - const: cpas_ahb
+      - const: core_ahb
+      - const: cpas_fast_ahb
+      - const: camnoc_axi
+
+  power-domains:
+    items:
+      - description: Titan top GDSC
+      - description: MMCX power domain, for the camera NoC clock rate
+      - description: MXC power domain, for the camera NoC clock rate
+
+  power-domain-names:
+    items:
+      - const: top
+      - const: mmcx
+      - const: mxc
+
+  operating-points-v2: true
+
+  opp-table:
+    type: object
+
+  interconnects:
+    items:
+      - description: config path from the CPU to the camera config space
+      - description: camera NoC HF port to DDR
+
+  interconnect-names:
+    items:
+      - const: cfg
+      - const: hf
+
+  '#interconnect-cells':
+    const: 2
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+  - clock-names
+  - power-domains
+  - power-domain-names
+  - operating-points-v2
+  - interconnects
+  - interconnect-names
+  - '#interconnect-cells'
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/qcom,sa8775p-camcc.h>
+    #include <dt-bindings/clock/qcom,sa8775p-gcc.h>
+    #include <dt-bindings/interconnect/qcom,icc.h>
+    #include <dt-bindings/interconnect/qcom,sa8775p-rpmh.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/power/qcom,rpmhpd.h>
+
+    interconnect@ac1a000 {
+        compatible = "qcom,sa8775p-cam-icc";
+        reg = <0x0ac1a000 0x9400>;
+
+        interrupts = <GIC_SPI 459 IRQ_TYPE_EDGE_RISING>;
+
+        clocks = <&gcc GCC_CAMERA_AHB_CLK>,
+                 <&gcc GCC_CAMERA_HF_AXI_CLK>,
+                 <&gcc GCC_CAMERA_SF_AXI_CLK>,
+                 <&camcc CAM_CC_CPAS_AHB_CLK>,
+                 <&camcc CAM_CC_CORE_AHB_CLK>,
+                 <&camcc CAM_CC_CPAS_FAST_AHB_CLK>,
+                 <&camcc CAM_CC_CAMNOC_AXI_CLK>;
+        clock-names = "iface",
+                      "gcc_axi_hf",
+                      "gcc_axi_sf",
+                      "cpas_ahb",
+                      "core_ahb",
+                      "cpas_fast_ahb",
+                      "camnoc_axi";
+
+        power-domains = <&camcc CAM_CC_TITAN_TOP_GDSC>,
+                        <&rpmhpd SA8775P_MMCX>,
+                        <&rpmhpd SA8775P_MXC>;
+        power-domain-names = "top", "mmcx", "mxc";
+
+        operating-points-v2 = <&camnoc_opp_table>;
+
+        interconnects = <&gem_noc MASTER_APPSS_PROC QCOM_ICC_TAG_ALWAYS
+                         &config_noc SLAVE_CAMERA_CFG QCOM_ICC_TAG_ALWAYS>,
+                        <&mmss_noc MASTER_CAMNOC_HF QCOM_ICC_TAG_ALWAYS
+                         &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>;
+        interconnect-names = "cfg", "hf";
+
+        #interconnect-cells = <2>;
+
+        camnoc_opp_table: opp-table {
+            compatible = "operating-points-v2";
+
+            opp-400000000 {
+                opp-hz = /bits/ 64 <400000000>;
+                required-opps = <&rpmhpd_opp_svs_l1>,
+                                <&rpmhpd_opp_svs_l1>;
+            };
+        };
+    };
diff --git a/include/dt-bindings/interconnect/qcom,sa8775p-cam-icc.h b/include/dt-bindings/interconnect/qcom,sa8775p-cam-icc.h
new file mode 100644
index 000000000000..4c84a4e14d92
--- /dev/null
+++ b/include/dt-bindings/interconnect/qcom,sa8775p-cam-icc.h
@@ -0,0 +1,17 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
+/*
+ * Qualcomm SA8775P camera NoC interconnect IDs
+ *
+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
+ */
+
+#ifndef __DT_BINDINGS_INTERCONNECT_QCOM_SA8775P_CAM_ICC_H
+#define __DT_BINDINGS_INTERCONNECT_QCOM_SA8775P_CAM_ICC_H
+
+#define MASTER_CAMNOC_IFE_RT_WR0	0
+#define MASTER_CAMNOC_IFE_RT_WR1	1
+#define MASTER_CAMNOC_AHB		2
+#define SLAVE_CAMNOC_HF			3
+#define SLAVE_CAMNOC_AHB		4
+
+#endif
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 04/10] media: qcom: cam-icc: add the Titan camera NoC driver
  2026-12-04  7:53 [PATCH v2 00/10] Add the Qualcomm Titan camera NoC interconnect provider Atanas Filipov
                   ` (2 preceding siblings ...)
  2026-12-04  7:53 ` [PATCH v2 03/10] dt-bindings: interconnect: add the Qualcomm SA8775P " Atanas Filipov
@ 2026-12-04  7:53 ` Atanas Filipov
  2026-12-04  8:27   ` sashiko-bot
                     ` (2 more replies)
  2026-12-04  7:53 ` [PATCH v2 05/10] media: qcom: cam-icc: add the SM8250 data Atanas Filipov
                   ` (5 subsequent siblings)
  9 siblings, 3 replies; 24+ messages in thread
From: Atanas Filipov @ 2026-12-04  7:53 UTC (permalink / raw)
  To: djakov, bod, linux-pm, linux-media
  Cc: mchehab, andersson, konradybcio, abelvesa, robh, krzk+dt,
	conor+dt, loic.poulain, linux-arm-msm, devicetree, linux-kernel,
	Dmitry Baryshkov, Prashant Shrotriya, Vikram Sharma,
	Gjorgji Rosikopulos, Atanas Filipov

Add an interconnect provider for the Titan camera NoC. CAMSS blocks
vote bandwidth on their camera NoC port to DDR and on the camera AHB
path. The driver sets the camera NoC AXI and AHB clock rates from the
aggregated votes, and the rail level through an OPP table.

On every runtime resume the driver writes the static QoS settings and
enables the camera NoC error interrupt.

Signed-off-by: Atanas Filipov <atanas.filipov@oss.qualcomm.com>
---
 drivers/media/platform/qcom/Kconfig           |   1 +
 drivers/media/platform/qcom/Makefile          |   1 +
 drivers/media/platform/qcom/cam-icc/Kconfig   |  14 +
 drivers/media/platform/qcom/cam-icc/Makefile  |   4 +
 .../platform/qcom/cam-icc/qcom-cam-icc-core.c | 670 ++++++++++++++++++
 .../platform/qcom/cam-icc/qcom-cam-icc-core.h | 127 ++++
 include/media/qcom-cam-icc.h                  |  26 +
 7 files changed, 843 insertions(+)
 create mode 100644 drivers/media/platform/qcom/cam-icc/Kconfig
 create mode 100644 drivers/media/platform/qcom/cam-icc/Makefile
 create mode 100644 drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.c
 create mode 100644 drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.h
 create mode 100644 include/media/qcom-cam-icc.h

diff --git a/drivers/media/platform/qcom/Kconfig b/drivers/media/platform/qcom/Kconfig
index 4f4d3a68e6e5..95ea812c4996 100644
--- a/drivers/media/platform/qcom/Kconfig
+++ b/drivers/media/platform/qcom/Kconfig
@@ -4,4 +4,5 @@ comment "Qualcomm media platform drivers"
 
 source "drivers/media/platform/qcom/camss/Kconfig"
 source "drivers/media/platform/qcom/iris/Kconfig"
+source "drivers/media/platform/qcom/cam-icc/Kconfig"
 source "drivers/media/platform/qcom/venus/Kconfig"
diff --git a/drivers/media/platform/qcom/Makefile b/drivers/media/platform/qcom/Makefile
index ea2221a202c0..f5b95ba6dd98 100644
--- a/drivers/media/platform/qcom/Makefile
+++ b/drivers/media/platform/qcom/Makefile
@@ -1,4 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0-only
 obj-y += camss/
 obj-y += iris/
+obj-y += cam-icc/
 obj-y += venus/
diff --git a/drivers/media/platform/qcom/cam-icc/Kconfig b/drivers/media/platform/qcom/cam-icc/Kconfig
new file mode 100644
index 000000000000..8fae973ce1b0
--- /dev/null
+++ b/drivers/media/platform/qcom/cam-icc/Kconfig
@@ -0,0 +1,14 @@
+# SPDX-License-Identifier: GPL-2.0-only
+config QCOM_CAM_ICC
+	tristate "Qualcomm Titan camera NoC core driver"
+	depends on ARCH_QCOM || COMPILE_TEST
+	depends on COMMON_CLK && PM
+	depends on INTERCONNECT
+	select PM_OPP
+	default ARCH_QCOM
+	help
+	  Core driver for the camera NoC of Qualcomm SoCs. It manages the
+	  camera NoC resources shared by the camera drivers (CAMSS).
+
+	  To compile this driver as a module, choose M here: the module
+	  will be called qcom-cam-icc.
diff --git a/drivers/media/platform/qcom/cam-icc/Makefile b/drivers/media/platform/qcom/cam-icc/Makefile
new file mode 100644
index 000000000000..4d1cbf60fea0
--- /dev/null
+++ b/drivers/media/platform/qcom/cam-icc/Makefile
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0-only
+qcom-cam-icc-y := qcom-cam-icc-core.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
new file mode 100644
index 000000000000..dbfccdb30da3
--- /dev/null
+++ b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.c
@@ -0,0 +1,670 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
+ */
+
+#include <linux/bitfield.h>
+#include <linux/bits.h>
+#include <linux/clk.h>
+#include <linux/device.h>
+#include <linux/err.h>
+#include <linux/interconnect-provider.h>
+#include <linux/interconnect.h>
+#include <linux/interrupt.h>
+#include <linux/io.h>
+#include <linux/math64.h>
+#include <linux/minmax.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/of_platform.h>
+#include <linux/platform_device.h>
+#include <linux/pm_domain.h>
+#include <linux/pm_opp.h>
+#include <linux/pm_runtime.h>
+#include <linux/property.h>
+#include <linux/slab.h>
+
+#include <media/qcom-cam-icc.h>
+
+#include "qcom-cam-icc-core.h"
+
+#define QCOM_CAM_ICC_MIN_BW_KBPS	3000000
+#define QCOM_CAM_ICC_BUS_WIDTH		32
+#define QCOM_CAM_ICC_MARGIN_PCT		20
+#define QCOM_CAM_ICC_CFG_KBPS		76800
+#define QCOM_CAM_ICC_AHB_RATE		80000000
+/* Set minimum bandwidth required to keep data path functional */
+#define QCOM_CAM_ICC_HF_MIN_KBPS	1
+
+#define QCOM_CAM_ICC_ERL_MAINCTL		0x08
+#define QCOM_CAM_ICC_ERL_MAINCTL_STALL_EN	BIT(0)
+#define QCOM_CAM_ICC_ERL_MAINCTL_FAULT_EN	BIT(1)
+#define QCOM_CAM_ICC_ERL_ERRCLR			0x18
+#define QCOM_CAM_ICC_ERL_ERRLOG0		0x20
+#define QCOM_CAM_ICC_ERL_ERRLOG0_CODE		GENMASK(10, 8)
+#define QCOM_CAM_ICC_ERL_ERRLOG1		0x28
+
+struct qcom_cam_icc {
+	struct device *dev;
+	const struct qcom_cam_icc_data *data;
+	void __iomem *base;
+	int irq;
+	u32 irq_mask;
+	struct clk_bulk_data *clks;
+	int num_clks;
+	struct clk *axi_clk;
+	struct clk *ahb_clk;
+	struct icc_provider provider;
+	struct icc_onecell_data *icc_data;
+	u64 axi_rate;
+	unsigned long ahb_rate;
+	struct dev_pm_domain_list *pd_list;
+	struct dev_pm_domain_list *rail_pd_list;
+	struct icc_path *cfg_path;
+	struct icc_path *hf_path;
+};
+
+static int qcom_cam_icc_icc_aggregate(struct icc_node *node, u32 tag, u32 avg_bw,
+				      u32 peak_bw, u32 *agg_avg, u32 *agg_peak)
+{
+	const struct qcom_cam_icc_node *desc = node->data;
+
+	if (desc->merge == QCOM_CAM_ICC_MERGE_SUM_INTERLEAVE) {
+		avg_bw /= 2;
+		peak_bw /= 2;
+	}
+
+	*agg_avg += avg_bw;
+	*agg_peak = max(*agg_peak, peak_bw);
+
+	return 0;
+}
+
+static u64 qcom_cam_icc_axi_rate(struct qcom_cam_icc *camnoc)
+{
+	const struct qcom_cam_icc_data *data = camnoc->data;
+	u64 bw = 0;
+	size_t i;
+
+	for (i = 0; i < data->num_nodes; i++) {
+		const struct qcom_cam_icc_node *desc = &data->nodes[i];
+		struct icc_node *node = camnoc->icc_data->nodes[desc->id];
+
+		if (!desc->rate_node || !node)
+			continue;
+
+		bw = max_t(u64, bw, max(node->avg_bw, node->peak_bw));
+	}
+
+	if (!bw)
+		return 0;
+
+	bw += div_u64(bw * QCOM_CAM_ICC_MARGIN_PCT, 100);
+	bw = max_t(u64, bw, QCOM_CAM_ICC_MIN_BW_KBPS);
+
+	return div_u64(bw * 1000, QCOM_CAM_ICC_BUS_WIDTH);
+}
+
+static int qcom_cam_icc_set_axi_rate(struct qcom_cam_icc *camnoc, u64 rate)
+{
+	unsigned long freq = min_t(u64, rate, ULONG_MAX);
+	struct dev_pm_opp *opp;
+	int ret;
+
+	if (!rate) {
+		ret = clk_set_min_rate(camnoc->axi_clk, 0);
+		if (ret)
+			return ret;
+
+		ret = clk_set_rate(camnoc->axi_clk, 0);
+		if (ret)
+			return ret;
+
+		return dev_pm_opp_set_opp(camnoc->dev, NULL);
+	}
+
+	opp = dev_pm_opp_find_freq_ceil(camnoc->dev, &freq);
+	if (IS_ERR(opp))
+		opp = dev_pm_opp_find_freq_floor(camnoc->dev, &freq);
+	if (IS_ERR(opp))
+		return PTR_ERR(opp);
+
+	ret = dev_pm_opp_set_opp(camnoc->dev, opp);
+	dev_pm_opp_put(opp);
+
+	return ret;
+}
+
+static int qcom_cam_icc_update(struct qcom_cam_icc *camnoc)
+{
+	struct icc_node *ahb = camnoc->icc_data->nodes[camnoc->data->ahb_id];
+	unsigned long ahb_rate;
+	u64 rate;
+	int ret;
+
+	rate = qcom_cam_icc_axi_rate(camnoc);
+	ahb_rate = (ahb && (ahb->avg_bw || ahb->peak_bw)) ? QCOM_CAM_ICC_AHB_RATE : 0;
+	if (rate == camnoc->axi_rate && ahb_rate == camnoc->ahb_rate)
+		return 0;
+
+	if (rate != camnoc->axi_rate) {
+		ret = qcom_cam_icc_set_axi_rate(camnoc, rate);
+		if (ret)
+			return ret;
+
+		camnoc->axi_rate = rate;
+	}
+
+	if (ahb_rate != camnoc->ahb_rate) {
+		ret = clk_set_min_rate(camnoc->ahb_clk, ahb_rate);
+		if (ret)
+			return ret;
+
+		ret = clk_set_rate(camnoc->ahb_clk, ahb_rate);
+		if (ret)
+			return ret;
+
+		camnoc->ahb_rate = ahb_rate;
+	}
+
+	dev_dbg(camnoc->dev, "axi %llu Hz, cpas_ahb %lu Hz\n", rate, ahb_rate);
+
+	return 0;
+}
+
+static int qcom_cam_icc_icc_set(struct icc_node *src, struct icc_node *dst)
+{
+	struct qcom_cam_icc *camnoc = container_of(src->provider, struct qcom_cam_icc, provider);
+
+	return qcom_cam_icc_update(camnoc);
+}
+
+static int qcom_cam_icc_icc_get_bw(struct icc_node *node, u32 *avg, u32 *peak)
+{
+	*avg = 0;
+	*peak = 0;
+
+	return 0;
+}
+
+static int qcom_cam_icc_icc_link_path(struct qcom_cam_icc *camnoc,
+				      struct icc_node *node, const char *path)
+{
+	struct device_node *np = camnoc->dev->of_node;
+	struct icc_node_data *link_data;
+	struct of_phandle_args args;
+	struct icc_node *link;
+	int idx, ret;
+
+	idx = of_property_match_string(np, "interconnect-names", path);
+	if (idx < 0)
+		return idx;
+
+	ret = of_parse_phandle_with_args(np, "interconnects", "#interconnect-cells", idx * 2,
+					 &args);
+	if (ret)
+		return ret;
+
+	link_data = of_icc_get_from_provider(&args);
+	of_node_put(args.np);
+	if (IS_ERR(link_data))
+		return PTR_ERR(link_data);
+
+	link = link_data->node;
+	kfree(link_data);
+
+	return icc_link_nodes(node, &link);
+}
+
+static struct icc_node_data *qcom_cam_icc_xlate(const struct of_phandle_args *spec, void *data)
+{
+	struct icc_node_data *ndata;
+	struct icc_node *node;
+
+	node = of_icc_xlate_onecell(spec, data);
+	if (IS_ERR(node))
+		return ERR_CAST(node);
+
+	ndata = kzalloc_obj(*ndata);
+	if (!ndata)
+		return ERR_PTR(-ENOMEM);
+
+	ndata->node = node;
+	ndata->tag = spec->args[1];
+
+	return ndata;
+}
+
+static int qcom_cam_icc_icc_init(struct qcom_cam_icc *camnoc)
+{
+	const struct qcom_cam_icc_data *data = camnoc->data;
+	struct icc_provider *provider = &camnoc->provider;
+	struct icc_onecell_data *icc_data;
+	size_t i;
+	int ret;
+
+	icc_data = devm_kzalloc(camnoc->dev, struct_size(icc_data, nodes, data->num_ids),
+				GFP_KERNEL);
+	if (!icc_data)
+		return -ENOMEM;
+
+	icc_data->num_nodes = data->num_ids;
+	camnoc->icc_data = icc_data;
+
+	provider->dev = camnoc->dev;
+	provider->set = qcom_cam_icc_icc_set;
+	provider->aggregate = qcom_cam_icc_icc_aggregate;
+	provider->get_bw = qcom_cam_icc_icc_get_bw;
+	provider->xlate_extended = qcom_cam_icc_xlate;
+	provider->data = icc_data;
+	icc_provider_init(provider);
+
+	for (i = 0; i < data->num_nodes; i++) {
+		const struct qcom_cam_icc_node *desc = &data->nodes[i];
+		struct icc_node *node;
+
+		node = icc_node_create_dyn();
+		if (IS_ERR(node)) {
+			ret = PTR_ERR(node);
+			goto err_remove_nodes;
+		}
+
+		ret = icc_node_set_name(node, provider, desc->name);
+		if (ret) {
+			icc_node_destroy(node->id);
+			goto err_remove_nodes;
+		}
+
+		node->data = (void *)desc;
+		icc_data->nodes[desc->id] = node;
+		icc_node_add(node, provider);
+	}
+
+	for (i = 0; i < data->num_nodes; i++) {
+		const struct qcom_cam_icc_node *desc = &data->nodes[i];
+
+		if (desc->link_path)
+			ret = qcom_cam_icc_icc_link_path(camnoc, icc_data->nodes[desc->id],
+							 desc->link_path);
+		else
+			ret = icc_link_nodes(icc_data->nodes[desc->id],
+					     &icc_data->nodes[desc->link]);
+		if (ret)
+			goto err_remove_nodes;
+	}
+
+	ret = icc_provider_register(provider);
+	if (ret)
+		goto err_remove_nodes;
+
+	return 0;
+
+err_remove_nodes:
+	icc_nodes_remove(provider);
+
+	return ret;
+}
+
+static void qcom_cam_icc_qos_init(struct qcom_cam_icc *camnoc)
+{
+	const struct qcom_cam_icc_data *data = camnoc->data;
+	size_t i;
+
+	for (i = 0; i < data->num_qos; i++)
+		writel(data->qos[i].value, camnoc->base + data->qos[i].offset);
+}
+
+static void qcom_cam_icc_irq_init(struct qcom_cam_icc *camnoc)
+{
+	const struct qcom_cam_icc_data *data = camnoc->data;
+	size_t i;
+
+	writel(data->sbm->clear_val, camnoc->base + data->sbm->clear_reg);
+
+	for (i = 0; i < data->num_irq_errs; i++) {
+		const struct qcom_cam_icc_irq_err *err = &data->irq_errs[i];
+
+		writel(1, camnoc->base + err->base + err->clear_off);
+		writel(err->enable_val, camnoc->base + err->base + err->enable_off);
+	}
+
+	if (data->err_logger) {
+		writel(1, camnoc->base + data->err_logger->base + QCOM_CAM_ICC_ERL_ERRCLR);
+		writel(QCOM_CAM_ICC_ERL_MAINCTL_STALL_EN | QCOM_CAM_ICC_ERL_MAINCTL_FAULT_EN,
+		       camnoc->base + data->err_logger->base + QCOM_CAM_ICC_ERL_MAINCTL);
+	}
+
+	writel(camnoc->irq_mask, camnoc->base + data->sbm->enable_reg);
+}
+
+static void qcom_cam_icc_erl_handle(struct qcom_cam_icc *camnoc)
+{
+	void __iomem *erl = camnoc->base + camnoc->data->err_logger->base;
+	u32 log0 = readl(erl + QCOM_CAM_ICC_ERL_ERRLOG0);
+
+	dev_err_ratelimited(camnoc->dev, "slave error, code %lu, errlog0 %#x, errlog1 %#x\n",
+			    FIELD_GET(QCOM_CAM_ICC_ERL_ERRLOG0_CODE, log0), log0,
+			    readl(erl + QCOM_CAM_ICC_ERL_ERRLOG1));
+	writel(1, erl + QCOM_CAM_ICC_ERL_ERRCLR);
+}
+
+static irqreturn_t qcom_cam_icc_irq(int irq, void *dev_id)
+{
+	struct qcom_cam_icc *camnoc = dev_id;
+	const struct qcom_cam_icc_data *data = camnoc->data;
+	u32 status, pending;
+	size_t i;
+
+	if (pm_runtime_get_if_active(camnoc->dev) <= 0)
+		return IRQ_NONE;
+
+	status = readl(camnoc->base + data->sbm->status_reg);
+	pending = status & camnoc->irq_mask;
+	if (!pending) {
+		pm_runtime_put(camnoc->dev);
+		return IRQ_NONE;
+	}
+
+	if (data->err_logger && (pending & data->err_logger->sbm_mask))
+		qcom_cam_icc_erl_handle(camnoc);
+
+	for (i = 0; i < data->num_irq_errs; i++) {
+		const struct qcom_cam_icc_irq_err *err = &data->irq_errs[i];
+
+		if (!(pending & err->sbm_mask))
+			continue;
+
+		dev_err_ratelimited(camnoc->dev, "%s error, status %#x\n", err->name,
+				    readl(camnoc->base + err->base + err->status_off));
+		writel(1, camnoc->base + err->base + err->clear_off);
+	}
+
+	writel(data->sbm->clear_val, camnoc->base + data->sbm->clear_reg);
+
+	pm_runtime_put(camnoc->dev);
+
+	return IRQ_HANDLED;
+}
+
+static int qcom_cam_icc_irq_request(struct platform_device *pdev, struct qcom_cam_icc *camnoc)
+{
+	const struct qcom_cam_icc_data *data = camnoc->data;
+	size_t i;
+	int irq;
+
+	for (i = 0; i < data->num_irq_errs; i++)
+		camnoc->irq_mask |= data->irq_errs[i].sbm_mask;
+
+	if (data->err_logger)
+		camnoc->irq_mask |= data->err_logger->sbm_mask;
+
+	irq = platform_get_irq(pdev, 0);
+	if (irq < 0)
+		return irq;
+
+	camnoc->irq = irq;
+
+	return devm_request_threaded_irq(camnoc->dev, irq, NULL, qcom_cam_icc_irq, IRQF_ONESHOT,
+					 dev_name(camnoc->dev), camnoc);
+}
+
+static int qcom_cam_icc_runtime_suspend(struct device *dev)
+{
+	struct qcom_cam_icc *camnoc = dev_get_drvdata(dev);
+
+	clk_bulk_disable_unprepare(camnoc->num_clks, camnoc->clks);
+	icc_set_bw(camnoc->hf_path, 0, 0);
+	icc_set_bw(camnoc->cfg_path, 0, 0);
+
+	return 0;
+}
+
+static int qcom_cam_icc_runtime_resume(struct device *dev)
+{
+	struct qcom_cam_icc *camnoc = dev_get_drvdata(dev);
+	int ret;
+
+	ret = icc_set_bw(camnoc->cfg_path, 0, QCOM_CAM_ICC_CFG_KBPS);
+	if (ret)
+		return ret;
+
+	ret = icc_set_bw(camnoc->hf_path, 0, QCOM_CAM_ICC_HF_MIN_KBPS);
+	if (ret)
+		goto err_cfg;
+
+	ret = clk_bulk_prepare_enable(camnoc->num_clks, camnoc->clks);
+	if (ret)
+		goto err_cfg;
+
+	qcom_cam_icc_qos_init(camnoc);
+	qcom_cam_icc_irq_init(camnoc);
+
+	return 0;
+
+err_cfg:
+	icc_set_bw(camnoc->hf_path, 0, 0);
+	icc_set_bw(camnoc->cfg_path, 0, 0);
+
+	return ret;
+}
+
+static int qcom_cam_icc_suspend(struct device *dev)
+{
+	struct qcom_cam_icc *camnoc = dev_get_drvdata(dev);
+	int ret;
+
+	disable_irq(camnoc->irq);
+
+	ret = pm_runtime_force_suspend(dev);
+	if (ret)
+		enable_irq(camnoc->irq);
+
+	return ret;
+}
+
+static int qcom_cam_icc_resume(struct device *dev)
+{
+	struct qcom_cam_icc *camnoc = dev_get_drvdata(dev);
+	int ret;
+
+	ret = pm_runtime_force_resume(dev);
+	if (ret)
+		return ret;
+
+	enable_irq(camnoc->irq);
+
+	return 0;
+}
+
+static const struct dev_pm_ops qcom_cam_icc_pm_ops = {
+	SYSTEM_SLEEP_PM_OPS(qcom_cam_icc_suspend, qcom_cam_icc_resume)
+	RUNTIME_PM_OPS(qcom_cam_icc_runtime_suspend, qcom_cam_icc_runtime_resume, NULL)
+};
+
+static const char * const qcom_cam_icc_pd_names[] = { "top" };
+
+static const struct dev_pm_domain_attach_data qcom_cam_icc_pd_data = {
+	.pd_names = qcom_cam_icc_pd_names,
+	.num_pd_names = ARRAY_SIZE(qcom_cam_icc_pd_names),
+};
+
+static int qcom_cam_icc_pd_init(struct qcom_cam_icc *camnoc)
+{
+	int ret;
+
+	ret = devm_pm_domain_attach_list(camnoc->dev, &qcom_cam_icc_pd_data, &camnoc->pd_list);
+	if (ret < 0)
+		return ret;
+
+	ret = devm_pm_domain_attach_list(camnoc->dev, camnoc->data->rail_pd_data,
+					 &camnoc->rail_pd_list);
+	if (ret < 0)
+		return ret;
+
+	return 0;
+}
+
+static int qcom_cam_icc_config_clks(struct device *dev, struct opp_table *opp_table,
+				    struct dev_pm_opp *opp, void *data, bool scaling_down)
+{
+	struct qcom_cam_icc *camnoc = dev_get_drvdata(dev);
+	unsigned long freq = dev_pm_opp_get_freq(opp);
+	int ret;
+
+	ret = clk_set_min_rate(camnoc->axi_clk, freq);
+	if (ret)
+		return ret;
+
+	return clk_set_rate(camnoc->axi_clk, freq);
+}
+
+static int qcom_cam_icc_opp_init(struct qcom_cam_icc *camnoc)
+{
+	struct dev_pm_opp_config config = {
+		.clk_names = (const char *[]){ camnoc->data->rate_clk, NULL },
+		.config_clks = qcom_cam_icc_config_clks,
+	};
+	int ret;
+
+	ret = devm_pm_opp_set_config(camnoc->dev, &config);
+	if (ret)
+		return ret;
+
+	return devm_pm_opp_of_add_table(camnoc->dev);
+}
+
+static const struct of_device_id qcom_cam_icc_of_match[] = {
+	{ }
+};
+MODULE_DEVICE_TABLE(of, qcom_cam_icc_of_match);
+
+/**
+ * qcom_cam_icc_link() - link a camera NoC client to the camera NoC
+ * @client: client device with a camera NoC path in its "interconnects"
+ *
+ * Add a runtime PM device link from @client to the camera NoC, so that a
+ * runtime resume of @client resumes the camera NoC first. @client must get
+ * its camera NoC interconnect path before this call.
+ *
+ * Return: 0 on success, -ENODEV if @client has no camera NoC path,
+ * -EPROBE_DEFER if the camera NoC device is not created yet, or another
+ * negative error code.
+ */
+int qcom_cam_icc_link(struct device *client)
+{
+	struct platform_device *pdev;
+	struct of_phandle_args args;
+	struct device_link *link;
+	int i;
+
+	for (i = 0; ; i++) {
+		if (of_parse_phandle_with_args(client->of_node, "interconnects",
+					       "#interconnect-cells", i, &args))
+			return -ENODEV;
+
+		if (of_match_node(qcom_cam_icc_of_match, args.np))
+			break;
+
+		of_node_put(args.np);
+	}
+
+	pdev = of_find_device_by_node(args.np);
+	of_node_put(args.np);
+	if (!pdev)
+		return -EPROBE_DEFER;
+
+	link = device_link_add(client, &pdev->dev,
+			       DL_FLAG_PM_RUNTIME | DL_FLAG_AUTOREMOVE_CONSUMER);
+	put_device(&pdev->dev);
+
+	return link ? 0 : -EINVAL;
+}
+EXPORT_SYMBOL_GPL(qcom_cam_icc_link);
+
+static int qcom_cam_icc_probe(struct platform_device *pdev)
+{
+	struct device *dev = &pdev->dev;
+	struct qcom_cam_icc *camnoc;
+	int ret;
+
+	camnoc = devm_kzalloc(dev, sizeof(*camnoc), GFP_KERNEL);
+	if (!camnoc)
+		return -ENOMEM;
+
+	camnoc->dev = dev;
+	camnoc->data = device_get_match_data(dev);
+
+	camnoc->base = devm_platform_ioremap_resource(pdev, 0);
+	if (IS_ERR(camnoc->base))
+		return PTR_ERR(camnoc->base);
+
+	camnoc->num_clks = devm_clk_bulk_get_all(dev, &camnoc->clks);
+	if (camnoc->num_clks < 0)
+		return dev_err_probe(dev, camnoc->num_clks, "failed to get clocks\n");
+
+	camnoc->axi_clk = devm_clk_get(dev, camnoc->data->rate_clk);
+	if (IS_ERR(camnoc->axi_clk))
+		return dev_err_probe(dev, PTR_ERR(camnoc->axi_clk), "no %s clock\n",
+				     camnoc->data->rate_clk);
+
+	camnoc->ahb_clk = devm_clk_get(dev, "cpas_ahb");
+	if (IS_ERR(camnoc->ahb_clk))
+		return dev_err_probe(dev, PTR_ERR(camnoc->ahb_clk), "no cpas_ahb clock\n");
+
+	camnoc->cfg_path = devm_of_icc_get(dev, "cfg");
+	if (IS_ERR(camnoc->cfg_path))
+		return dev_err_probe(dev, PTR_ERR(camnoc->cfg_path),
+				     "failed to get the cfg path\n");
+
+	camnoc->hf_path = devm_of_icc_get(dev, "hf");
+	if (IS_ERR(camnoc->hf_path))
+		return dev_err_probe(dev, PTR_ERR(camnoc->hf_path),
+				     "failed to get the hf path\n");
+
+	platform_set_drvdata(pdev, camnoc);
+
+	ret = qcom_cam_icc_pd_init(camnoc);
+	if (ret)
+		return dev_err_probe(dev, ret, "failed to attach the power domains\n");
+
+	ret = qcom_cam_icc_opp_init(camnoc);
+	if (ret)
+		return dev_err_probe(dev, ret, "failed to add the OPP table\n");
+
+	ret = qcom_cam_icc_irq_request(pdev, camnoc);
+	if (ret)
+		return dev_err_probe(dev, ret, "failed to request the interrupt\n");
+
+	ret = devm_pm_runtime_enable(dev);
+	if (ret)
+		return ret;
+
+	ret = qcom_cam_icc_icc_init(camnoc);
+	if (ret)
+		return dev_err_probe(dev, ret, "failed to register the interconnect provider\n");
+
+	return 0;
+}
+
+static void qcom_cam_icc_remove(struct platform_device *pdev)
+{
+	struct qcom_cam_icc *camnoc = platform_get_drvdata(pdev);
+
+	icc_provider_deregister(&camnoc->provider);
+	icc_nodes_remove(&camnoc->provider);
+}
+
+static struct platform_driver qcom_cam_icc_driver = {
+	.probe = qcom_cam_icc_probe,
+	.remove = qcom_cam_icc_remove,
+	.driver = {
+		.name = "qcom-cam-icc",
+		.of_match_table = qcom_cam_icc_of_match,
+		.pm = pm_ptr(&qcom_cam_icc_pm_ops),
+		.sync_state = icc_sync_state,
+	},
+};
+module_platform_driver(qcom_cam_icc_driver);
+
+MODULE_DESCRIPTION("Qualcomm Titan camera NoC core driver");
+MODULE_LICENSE("GPL");
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
new file mode 100644
index 000000000000..eee7eb9c4c2d
--- /dev/null
+++ b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.h
@@ -0,0 +1,127 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
+ */
+
+#ifndef __QCOM_CAM_ICC_CORE_H__
+#define __QCOM_CAM_ICC_CORE_H__
+
+#include <linux/types.h>
+
+struct dev_pm_domain_attach_data;
+
+#define QCOM_CAM_ICC_PRIORITYLUT_LOW	0x30
+#define QCOM_CAM_ICC_PRIORITYLUT_HIGH	0x34
+#define QCOM_CAM_ICC_URGENCY_LOW	0x38
+#define QCOM_CAM_ICC_DANGERLUT_LOW	0x40
+#define QCOM_CAM_ICC_SAFELUT_LOW	0x48
+#define QCOM_CAM_ICC_MAINCTL_LOW	0x08
+#define QCOM_CAM_ICC_SHAPING_LOW	0x20
+#define QCOM_CAM_ICC_SHAPING_HIGH	0x24
+#define QCOM_CAM_ICC_DECERRSTATUS_LOW	0x110
+#define QCOM_CAM_ICC_DECERRCLR_LOW	0x118
+#define QCOM_CAM_ICC_DECERREN_LOW	0x120
+#define QCOM_CAM_ICC_ENCCTL_LOW		0x188
+#define QCOM_CAM_ICC_ENCERRSTATUS_LOW	0x190
+#define QCOM_CAM_ICC_ENCERRCLR_LOW	0x198
+#define QCOM_CAM_ICC_ENCERREN_LOW	0x1a0
+
+enum qcom_cam_icc_merge {
+	QCOM_CAM_ICC_MERGE_SUM,
+	QCOM_CAM_ICC_MERGE_SUM_INTERLEAVE,
+};
+
+struct qcom_cam_icc_node {
+	const char *name;
+	u16 id;
+	u16 link;
+	enum qcom_cam_icc_merge merge;
+	bool rate_node;
+	const char *link_path;
+};
+
+struct qcom_cam_icc_qos {
+	u32 offset;
+	u32 value;
+};
+
+struct qcom_cam_icc_sbm {
+	u32 enable_reg;
+	u32 status_reg;
+	u32 clear_reg;
+	u32 clear_val;
+};
+
+struct qcom_cam_icc_irq_err {
+	const char *name;
+	u32 sbm_mask;
+	u32 base;
+	u32 enable_off;
+	u32 enable_val;
+	u32 status_off;
+	u32 clear_off;
+};
+
+struct qcom_cam_icc_erl {
+	u32 base;
+	u32 sbm_mask;
+};
+
+struct qcom_cam_icc_data {
+	const char *rate_clk;
+	const struct qcom_cam_icc_node *nodes;
+	size_t num_nodes;
+	size_t num_ids;
+	u16 ahb_id;
+	const struct dev_pm_domain_attach_data *rail_pd_data;
+	const struct qcom_cam_icc_qos *qos;
+	size_t num_qos;
+	const struct qcom_cam_icc_sbm *sbm;
+	const struct qcom_cam_icc_irq_err *irq_errs;
+	size_t num_irq_errs;
+	const struct qcom_cam_icc_erl *err_logger;
+};
+
+#define CAMNOC_PORT(_id, _name, _link)			\
+	{						\
+		.name = _name,				\
+		.id = _id,				\
+		.link = _link,				\
+		.merge = QCOM_CAM_ICC_MERGE_SUM,	\
+		.rate_node = true,			\
+	}
+
+#define CAMNOC_INTERNAL(_id, _name, _link, _merge)	\
+	{						\
+		.name = _name,				\
+		.id = _id,				\
+		.link = _link,				\
+		.merge = _merge,			\
+		.rate_node = true,			\
+	}
+
+#define CAMNOC_LINK_SLAVE(_id, _name, _link_path)	\
+	{						\
+		.name = _name,				\
+		.id = _id,				\
+		.link_path = _link_path,		\
+	}
+
+#define CAMNOC_QOS(_base, _reg, _value)				\
+	{							\
+		.offset = (_base) + QCOM_CAM_ICC_##_reg,	\
+		.value = _value,				\
+	}
+
+#define CAMNOC_IRQ_ERR(_name, _mask, _base, _type, _enable_val)		\
+	{								\
+		.name = _name,						\
+		.sbm_mask = _mask,					\
+		.base = _base,						\
+		.enable_off = QCOM_CAM_ICC_##_type##ERREN_LOW,		\
+		.enable_val = _enable_val,				\
+		.status_off = QCOM_CAM_ICC_##_type##ERRSTATUS_LOW,	\
+		.clear_off = QCOM_CAM_ICC_##_type##ERRCLR_LOW,		\
+	}
+
+#endif
diff --git a/include/media/qcom-cam-icc.h b/include/media/qcom-cam-icc.h
new file mode 100644
index 000000000000..68c230687377
--- /dev/null
+++ b/include/media/qcom-cam-icc.h
@@ -0,0 +1,26 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
+ */
+
+#ifndef __MEDIA_QCOM_CAM_ICC_H__
+#define __MEDIA_QCOM_CAM_ICC_H__
+
+#include <linux/errno.h>
+
+struct device;
+
+#if IS_ENABLED(CONFIG_QCOM_CAM_ICC)
+
+int qcom_cam_icc_link(struct device *client);
+
+#else
+
+static inline int qcom_cam_icc_link(struct device *client)
+{
+	return -ENODEV;
+}
+
+#endif
+
+#endif
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 05/10] media: qcom: cam-icc: add the SM8250 data
  2026-12-04  7:53 [PATCH v2 00/10] Add the Qualcomm Titan camera NoC interconnect provider Atanas Filipov
                   ` (3 preceding siblings ...)
  2026-12-04  7:53 ` [PATCH v2 04/10] media: qcom: cam-icc: add the Titan camera NoC driver Atanas Filipov
@ 2026-12-04  7:53 ` Atanas Filipov
  2026-12-04  8:16   ` sashiko-bot
  2026-12-04  7:53 ` [PATCH v2 06/10] media: qcom: cam-icc: add the SC7280 data Atanas Filipov
                   ` (4 subsequent siblings)
  9 siblings, 1 reply; 24+ messages in thread
From: Atanas Filipov @ 2026-12-04  7:53 UTC (permalink / raw)
  To: djakov, bod, linux-pm, linux-media
  Cc: mchehab, andersson, konradybcio, abelvesa, robh, krzk+dt,
	conor+dt, loic.poulain, linux-arm-msm, devicetree, linux-kernel,
	Dmitry Baryshkov, Prashant Shrotriya, Vikram Sharma,
	Gjorgji Rosikopulos, Atanas Filipov

Add the SM8250 camera NoC nodes, MMCX rail, 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@oss.qualcomm.com>
---
 drivers/media/platform/qcom/cam-icc/Makefile  |   2 +-
 .../platform/qcom/cam-icc/qcom-cam-icc-core.c |   1 +
 .../platform/qcom/cam-icc/qcom-cam-icc-core.h |   2 +
 .../qcom/cam-icc/qcom-cam-icc-sm8250.c        | 127 ++++++++++++++++++
 4 files changed, 131 insertions(+), 1 deletion(-)
 create mode 100644 drivers/media/platform/qcom/cam-icc/qcom-cam-icc-sm8250.c

diff --git a/drivers/media/platform/qcom/cam-icc/Makefile b/drivers/media/platform/qcom/cam-icc/Makefile
index 4d1cbf60fea0..aa2acbe56285 100644
--- a/drivers/media/platform/qcom/cam-icc/Makefile
+++ b/drivers/media/platform/qcom/cam-icc/Makefile
@@ -1,4 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0-only
-qcom-cam-icc-y := qcom-cam-icc-core.o
+qcom-cam-icc-y := qcom-cam-icc-core.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 dbfccdb30da3..05086221728f 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,sm8250-cam-icc", .data = &qcom_cam_icc_sm8250_data },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, qcom_cam_icc_of_match);
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 eee7eb9c4c2d..eb2852978bd3 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,4 +124,6 @@ struct qcom_cam_icc_data {
 		.clear_off = QCOM_CAM_ICC_##_type##ERRCLR_LOW,		\
 	}
 
+extern const struct qcom_cam_icc_data qcom_cam_icc_sm8250_data;
+
 #endif
diff --git a/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-sm8250.c b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-sm8250.c
new file mode 100644
index 000000000000..5a07bc61c704
--- /dev/null
+++ b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-sm8250.c
@@ -0,0 +1,127 @@
+// 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,sm8250-cam-icc.h>
+
+#include "qcom-cam-icc-core.h"
+
+#define SM8250_CDM		0x0000
+#define SM8250_FD		0x0600
+#define SM8250_IFE_LINEAR	0x0a00
+#define SM8250_IFE_RDI_RD	0x1000
+#define SM8250_IFE_RDI_WR	0x1400
+#define SM8250_IFE_UBWC_STATS	0x1a00
+#define SM8250_IPE0_RD		0x1e00
+#define SM8250_IPE1_BPS_RD	0x2400
+#define SM8250_IPE_BPS_WR	0x2800
+#define SM8250_JPEG		0x2e00
+
+enum {
+	SM8250_CAMNOC_RT0_WR = SLAVE_CAMNOC_AHB + 1,
+	SM8250_CAMNOC_RT0_RD,
+	SM8250_CAMNOC_NRT0_WR,
+	SM8250_CAMNOC_NRT0_RD,
+	SM8250_CAMNOC_NUM_NODES,
+};
+
+static const struct qcom_cam_icc_node sm8250_nodes[] = {
+	CAMNOC_PORT(MASTER_CAMNOC_IFE_LINEAR_WR, "camnoc_ife_linear_wr", SM8250_CAMNOC_RT0_WR),
+	CAMNOC_PORT(MASTER_CAMNOC_IFE_RDI_WR, "camnoc_ife_rdi_wr", SM8250_CAMNOC_RT0_WR),
+	CAMNOC_PORT(MASTER_CAMNOC_IFE_RDI_RD, "camnoc_ife_rdi_rd", SM8250_CAMNOC_RT0_RD),
+	CAMNOC_PORT(MASTER_CAMNOC_JPEG_WR, "camnoc_jpeg_wr", SM8250_CAMNOC_NRT0_WR),
+	CAMNOC_PORT(MASTER_CAMNOC_JPEG_RD, "camnoc_jpeg_rd", SM8250_CAMNOC_NRT0_RD),
+	{
+		.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_SF, "camnoc_sf", "sf"),
+	CAMNOC_LINK_SLAVE(SLAVE_CAMNOC_AHB, "camnoc_ahb_slv", "cfg"),
+	CAMNOC_INTERNAL(SM8250_CAMNOC_RT0_WR, "camnoc_rt0_wr", SLAVE_CAMNOC_HF,
+			QCOM_CAM_ICC_MERGE_SUM_INTERLEAVE),
+	CAMNOC_INTERNAL(SM8250_CAMNOC_RT0_RD, "camnoc_rt0_rd", SLAVE_CAMNOC_HF,
+			QCOM_CAM_ICC_MERGE_SUM_INTERLEAVE),
+	CAMNOC_INTERNAL(SM8250_CAMNOC_NRT0_WR, "camnoc_nrt0_wr", SLAVE_CAMNOC_SF,
+			QCOM_CAM_ICC_MERGE_SUM_INTERLEAVE),
+	CAMNOC_INTERNAL(SM8250_CAMNOC_NRT0_RD, "camnoc_nrt0_rd", SLAVE_CAMNOC_SF,
+			QCOM_CAM_ICC_MERGE_SUM_INTERLEAVE),
+};
+
+static const char * const sm8250_rail_pd_names[] = { "mmcx" };
+
+static const struct dev_pm_domain_attach_data sm8250_rail_pd_data = {
+	.pd_names = sm8250_rail_pd_names,
+	.num_pd_names = ARRAY_SIZE(sm8250_rail_pd_names),
+	.pd_flags = PD_FLAG_REQUIRED_OPP,
+};
+
+static const struct qcom_cam_icc_qos sm8250_qos[] = {
+	CAMNOC_QOS(SM8250_CDM, URGENCY_LOW, 0x3),
+	CAMNOC_QOS(SM8250_FD, URGENCY_LOW, 0x33),
+	CAMNOC_QOS(SM8250_IFE_LINEAR, PRIORITYLUT_LOW, 0x66665433),
+	CAMNOC_QOS(SM8250_IFE_LINEAR, PRIORITYLUT_HIGH, 0x66666666),
+	CAMNOC_QOS(SM8250_IFE_LINEAR, URGENCY_LOW, 0x1030),
+	CAMNOC_QOS(SM8250_IFE_LINEAR, DANGERLUT_LOW, 0xffffff00),
+	CAMNOC_QOS(SM8250_IFE_LINEAR, SAFELUT_LOW, 0xf),
+	CAMNOC_QOS(SM8250_IFE_RDI_RD, URGENCY_LOW, 0x3),
+	CAMNOC_QOS(SM8250_IFE_RDI_RD, DANGERLUT_LOW, 0x0),
+	CAMNOC_QOS(SM8250_IFE_RDI_WR, PRIORITYLUT_LOW, 0x66665433),
+	CAMNOC_QOS(SM8250_IFE_RDI_WR, PRIORITYLUT_HIGH, 0x66666666),
+	CAMNOC_QOS(SM8250_IFE_RDI_WR, URGENCY_LOW, 0x1030),
+	CAMNOC_QOS(SM8250_IFE_RDI_WR, DANGERLUT_LOW, 0xffffff00),
+	CAMNOC_QOS(SM8250_IFE_RDI_WR, SAFELUT_LOW, 0xf),
+	CAMNOC_QOS(SM8250_IFE_UBWC_STATS, PRIORITYLUT_LOW, 0x66665433),
+	CAMNOC_QOS(SM8250_IFE_UBWC_STATS, PRIORITYLUT_HIGH, 0x66666666),
+	CAMNOC_QOS(SM8250_IFE_UBWC_STATS, URGENCY_LOW, 0x1030),
+	CAMNOC_QOS(SM8250_IFE_UBWC_STATS, DANGERLUT_LOW, 0xffffff00),
+	CAMNOC_QOS(SM8250_IFE_UBWC_STATS, SAFELUT_LOW, 0xf),
+	CAMNOC_QOS(SM8250_IPE0_RD, URGENCY_LOW, 0x3),
+	CAMNOC_QOS(SM8250_IPE1_BPS_RD, URGENCY_LOW, 0x3),
+	CAMNOC_QOS(SM8250_IPE_BPS_WR, PRIORITYLUT_LOW, 0x33333333),
+	CAMNOC_QOS(SM8250_IPE_BPS_WR, PRIORITYLUT_HIGH, 0x33333333),
+	CAMNOC_QOS(SM8250_IPE_BPS_WR, URGENCY_LOW, 0x30),
+	CAMNOC_QOS(SM8250_JPEG, PRIORITYLUT_LOW, 0x22222222),
+	CAMNOC_QOS(SM8250_JPEG, PRIORITYLUT_HIGH, 0x22222222),
+	CAMNOC_QOS(SM8250_JPEG, URGENCY_LOW, 0x22),
+};
+
+static const struct qcom_cam_icc_sbm sm8250_sbm = {
+	.enable_reg = 0x3840,
+	.status_reg = 0x3848,
+	.clear_reg = 0x3880,
+	.clear_val = 0x1,
+};
+
+static const struct qcom_cam_icc_irq_err sm8250_irq_errs[] = {
+	CAMNOC_IRQ_ERR("ife_ubwc_stats encode", BIT(1), SM8250_IFE_UBWC_STATS, ENC, 1),
+	CAMNOC_IRQ_ERR("ipe1_bps_rd decode", BIT(2), SM8250_IPE1_BPS_RD, DEC, 1),
+	CAMNOC_IRQ_ERR("ipe0_rd decode", BIT(3), SM8250_IPE0_RD, DEC, 1),
+	CAMNOC_IRQ_ERR("ipe_bps_wr encode", BIT(4), SM8250_IPE_BPS_WR, ENC, 1),
+};
+
+static const struct qcom_cam_icc_erl sm8250_err_log = {
+	.base = 0x7000,
+	.sbm_mask = BIT(0),
+};
+
+const struct qcom_cam_icc_data qcom_cam_icc_sm8250_data = {
+	.rate_clk	= "camnoc_axi",
+	.nodes		= sm8250_nodes,
+	.num_nodes	= ARRAY_SIZE(sm8250_nodes),
+	.num_ids	= SM8250_CAMNOC_NUM_NODES,
+	.ahb_id		= SLAVE_CAMNOC_AHB,
+	.rail_pd_data	= &sm8250_rail_pd_data,
+	.qos		= sm8250_qos,
+	.num_qos	= ARRAY_SIZE(sm8250_qos),
+	.sbm		= &sm8250_sbm,
+	.irq_errs	= sm8250_irq_errs,
+	.num_irq_errs	= ARRAY_SIZE(sm8250_irq_errs),
+	.err_logger	= &sm8250_err_log,
+};
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 06/10] media: qcom: cam-icc: add the SC7280 data
  2026-12-04  7:53 [PATCH v2 00/10] Add the Qualcomm Titan camera NoC interconnect provider Atanas Filipov
                   ` (4 preceding siblings ...)
  2026-12-04  7:53 ` [PATCH v2 05/10] media: qcom: cam-icc: add the SM8250 data Atanas Filipov
@ 2026-12-04  7:53 ` Atanas Filipov
  2026-12-04  7:53 ` [PATCH v2 07/10] media: qcom: cam-icc: add the SA8775P data Atanas Filipov
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 24+ messages in thread
From: Atanas Filipov @ 2026-12-04  7:53 UTC (permalink / raw)
  To: djakov, bod, linux-pm, linux-media
  Cc: mchehab, andersson, konradybcio, abelvesa, robh, krzk+dt,
	conor+dt, loic.poulain, linux-arm-msm, devicetree, linux-kernel,
	Dmitry Baryshkov, Prashant Shrotriya, Vikram Sharma,
	Gjorgji Rosikopulos, Atanas Filipov

Add the SC7280 camera NoC nodes, CX rail, 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@oss.qualcomm.com>
---
 drivers/media/platform/qcom/cam-icc/Makefile  |   2 +-
 .../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-sc7280.c        | 134 ++++++++++++++++++
 4 files changed, 137 insertions(+), 1 deletion(-)
 create mode 100644 drivers/media/platform/qcom/cam-icc/qcom-cam-icc-sc7280.c

diff --git a/drivers/media/platform/qcom/cam-icc/Makefile b/drivers/media/platform/qcom/cam-icc/Makefile
index aa2acbe56285..346abef8c51c 100644
--- a/drivers/media/platform/qcom/cam-icc/Makefile
+++ b/drivers/media/platform/qcom/cam-icc/Makefile
@@ -1,4 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0-only
-qcom-cam-icc-y := qcom-cam-icc-core.o qcom-cam-icc-sm8250.o
+qcom-cam-icc-y := qcom-cam-icc-core.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 05086221728f..4aa5a0c76842 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,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 eb2852978bd3..9d4d60653404 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_sc7280_data;
 extern const struct qcom_cam_icc_data qcom_cam_icc_sm8250_data;
 
 #endif
diff --git a/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-sc7280.c b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-sc7280.c
new file mode 100644
index 000000000000..56a9459c047d
--- /dev/null
+++ b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-sc7280.c
@@ -0,0 +1,134 @@
+// 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,sc7280-cam-icc.h>
+
+#include "qcom-cam-icc-core.h"
+
+#define SC7280_NRT_NIU_2		0x2600
+#define SC7280_NRT_NIU_1		0x2a00
+#define SC7280_NRT_NIU_0		0x2e00
+#define SC7280_IFE_NIU_2		0x3600
+#define SC7280_IFE_NIU_0		0x3a00
+#define SC7280_CDM_NIU			0x4200
+#define SC7280_IFE_NIU_0_QOSGEN		0x4700
+#define SC7280_IFE_NIU_2_QOSGEN		0x4800
+#define SC7280_ERL			0x4f00
+#define SC7280_IFE_NIU_1_QOSGEN		0x5180
+#define SC7280_IFE_NIU_1		0x5400
+
+enum {
+	SC7280_CAMNOC_RT0_WR = SLAVE_CAMNOC_AHB + 1,
+	SC7280_CAMNOC_RT1_WR,
+	SC7280_CAMNOC_NRT0_WR,
+	SC7280_CAMNOC_NRT0_RD,
+	SC7280_CAMNOC_NUM_NODES,
+};
+
+static const struct qcom_cam_icc_node sc7280_nodes[] = {
+	CAMNOC_PORT(MASTER_CAMNOC_IFE_RDI_WR, "camnoc_ife_rdi_wr", SC7280_CAMNOC_RT0_WR),
+	CAMNOC_PORT(MASTER_CAMNOC_IFE_PIXEL_WR, "camnoc_ife_pixel_wr", SC7280_CAMNOC_RT1_WR),
+	CAMNOC_PORT(MASTER_CAMNOC_IFE2_PIXEL_WR, "camnoc_ife2_pixel_wr", SC7280_CAMNOC_RT1_WR),
+	CAMNOC_PORT(MASTER_CAMNOC_JPEG_WR, "camnoc_jpeg_wr", SC7280_CAMNOC_NRT0_WR),
+	CAMNOC_PORT(MASTER_CAMNOC_JPEG_RD, "camnoc_jpeg_rd", SC7280_CAMNOC_NRT0_RD),
+	{
+		.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_SF, "camnoc_sf", "sf"),
+	CAMNOC_LINK_SLAVE(SLAVE_CAMNOC_AHB, "camnoc_ahb_slv", "cfg"),
+	CAMNOC_INTERNAL(SC7280_CAMNOC_RT0_WR, "camnoc_rt0_wr", SLAVE_CAMNOC_HF,
+			QCOM_CAM_ICC_MERGE_SUM_INTERLEAVE),
+	CAMNOC_INTERNAL(SC7280_CAMNOC_RT1_WR, "camnoc_rt1_wr", SLAVE_CAMNOC_HF,
+			QCOM_CAM_ICC_MERGE_SUM_INTERLEAVE),
+	CAMNOC_INTERNAL(SC7280_CAMNOC_NRT0_WR, "camnoc_nrt0_wr", SLAVE_CAMNOC_SF,
+			QCOM_CAM_ICC_MERGE_SUM),
+	CAMNOC_INTERNAL(SC7280_CAMNOC_NRT0_RD, "camnoc_nrt0_rd", SLAVE_CAMNOC_SF,
+			QCOM_CAM_ICC_MERGE_SUM),
+};
+
+static const char * const sc7280_rail_pd_names[] = { "cx" };
+
+static const struct dev_pm_domain_attach_data sc7280_rail_pd_data = {
+	.pd_names = sc7280_rail_pd_names,
+	.num_pd_names = ARRAY_SIZE(sc7280_rail_pd_names),
+	.pd_flags = PD_FLAG_REQUIRED_OPP,
+};
+
+static const struct qcom_cam_icc_qos sc7280_qos[] = {
+	CAMNOC_QOS(SC7280_CDM_NIU, URGENCY_LOW, 0x3),
+	CAMNOC_QOS(SC7280_IFE_NIU_2, PRIORITYLUT_LOW, 0x55554433),
+	CAMNOC_QOS(SC7280_IFE_NIU_2, PRIORITYLUT_HIGH, 0x66666666),
+	CAMNOC_QOS(SC7280_IFE_NIU_2, URGENCY_LOW, 0x1030),
+	CAMNOC_QOS(SC7280_IFE_NIU_2, DANGERLUT_LOW, 0xffffff00),
+	CAMNOC_QOS(SC7280_IFE_NIU_2, SAFELUT_LOW, 0xf),
+	CAMNOC_QOS(SC7280_IFE_NIU_2_QOSGEN, MAINCTL_LOW, 0x2),
+	CAMNOC_QOS(SC7280_IFE_NIU_2_QOSGEN, SHAPING_LOW, 0x07070707),
+	CAMNOC_QOS(SC7280_IFE_NIU_2_QOSGEN, SHAPING_HIGH, 0x07070707),
+	CAMNOC_QOS(SC7280_IFE_NIU_0, PRIORITYLUT_LOW, 0x55554433),
+	CAMNOC_QOS(SC7280_IFE_NIU_0, PRIORITYLUT_HIGH, 0x66666666),
+	CAMNOC_QOS(SC7280_IFE_NIU_0, URGENCY_LOW, 0x1030),
+	CAMNOC_QOS(SC7280_IFE_NIU_0, DANGERLUT_LOW, 0xffffff00),
+	CAMNOC_QOS(SC7280_IFE_NIU_0, SAFELUT_LOW, 0xf),
+	CAMNOC_QOS(SC7280_IFE_NIU_0, ENCCTL_LOW, 0x1),
+	CAMNOC_QOS(SC7280_IFE_NIU_0_QOSGEN, MAINCTL_LOW, 0x2),
+	CAMNOC_QOS(SC7280_IFE_NIU_0_QOSGEN, SHAPING_LOW, 0x07070707),
+	CAMNOC_QOS(SC7280_IFE_NIU_0_QOSGEN, SHAPING_HIGH, 0x07070707),
+	CAMNOC_QOS(SC7280_IFE_NIU_1, PRIORITYLUT_LOW, 0x55554433),
+	CAMNOC_QOS(SC7280_IFE_NIU_1, PRIORITYLUT_HIGH, 0x66666666),
+	CAMNOC_QOS(SC7280_IFE_NIU_1, URGENCY_LOW, 0x1030),
+	CAMNOC_QOS(SC7280_IFE_NIU_1, DANGERLUT_LOW, 0xffffff00),
+	CAMNOC_QOS(SC7280_IFE_NIU_1, SAFELUT_LOW, 0xf),
+	CAMNOC_QOS(SC7280_IFE_NIU_1_QOSGEN, MAINCTL_LOW, 0x2),
+	CAMNOC_QOS(SC7280_IFE_NIU_1_QOSGEN, SHAPING_LOW, 0x07070707),
+	CAMNOC_QOS(SC7280_IFE_NIU_1_QOSGEN, SHAPING_HIGH, 0x07070707),
+	CAMNOC_QOS(SC7280_NRT_NIU_0, URGENCY_LOW, 0x3),
+	CAMNOC_QOS(SC7280_NRT_NIU_1, PRIORITYLUT_LOW, 0x33333333),
+	CAMNOC_QOS(SC7280_NRT_NIU_1, PRIORITYLUT_HIGH, 0x33333333),
+	CAMNOC_QOS(SC7280_NRT_NIU_1, URGENCY_LOW, 0x30),
+	CAMNOC_QOS(SC7280_NRT_NIU_2, PRIORITYLUT_LOW, 0x22222222),
+	CAMNOC_QOS(SC7280_NRT_NIU_2, PRIORITYLUT_HIGH, 0x22222222),
+	CAMNOC_QOS(SC7280_NRT_NIU_2, URGENCY_LOW, 0x22),
+};
+
+static const struct qcom_cam_icc_sbm sc7280_sbm = {
+	.enable_reg = 0x2240,
+	.status_reg = 0x2248,
+	.clear_reg = 0x2280,
+	.clear_val = 0x2,
+};
+
+static const struct qcom_cam_icc_irq_err sc7280_irq_errs[] = {
+	CAMNOC_IRQ_ERR("ife_niu_0 encode", BIT(1), SC7280_IFE_NIU_0, ENC, 1),
+	CAMNOC_IRQ_ERR("ife_niu_1 encode", BIT(2), SC7280_IFE_NIU_1, ENC, 1),
+	CAMNOC_IRQ_ERR("nrt_niu_0 decode", BIT(3), SC7280_NRT_NIU_0, DEC, 1),
+	CAMNOC_IRQ_ERR("nrt_niu_1 encode", BIT(4), SC7280_NRT_NIU_1, ENC, 1),
+};
+
+static const struct qcom_cam_icc_erl sc7280_err_log = {
+	.base = SC7280_ERL,
+	.sbm_mask = BIT(0),
+};
+
+const struct qcom_cam_icc_data qcom_cam_icc_sc7280_data = {
+	.rate_clk	= "camnoc_axi",
+	.nodes		= sc7280_nodes,
+	.num_nodes	= ARRAY_SIZE(sc7280_nodes),
+	.num_ids	= SC7280_CAMNOC_NUM_NODES,
+	.ahb_id		= SLAVE_CAMNOC_AHB,
+	.rail_pd_data	= &sc7280_rail_pd_data,
+	.qos		= sc7280_qos,
+	.num_qos	= ARRAY_SIZE(sc7280_qos),
+	.sbm		= &sc7280_sbm,
+	.irq_errs	= sc7280_irq_errs,
+	.num_irq_errs	= ARRAY_SIZE(sc7280_irq_errs),
+	.err_logger	= &sc7280_err_log,
+};
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 07/10] media: qcom: cam-icc: add the SA8775P data
  2026-12-04  7:53 [PATCH v2 00/10] Add the Qualcomm Titan camera NoC interconnect provider Atanas Filipov
                   ` (5 preceding siblings ...)
  2026-12-04  7:53 ` [PATCH v2 06/10] media: qcom: cam-icc: add the SC7280 data Atanas Filipov
@ 2026-12-04  7:53 ` Atanas Filipov
  2026-12-04  8:19   ` sashiko-bot
  2026-12-04  7:53 ` [PATCH v2 08/10] arm64: dts: qcom: sm8250: add the Titan camera NoC node Atanas Filipov
                   ` (2 subsequent siblings)
  9 siblings, 1 reply; 24+ messages in thread
From: Atanas Filipov @ 2026-12-04  7:53 UTC (permalink / raw)
  To: djakov, bod, linux-pm, linux-media
  Cc: mchehab, andersson, konradybcio, abelvesa, robh, krzk+dt,
	conor+dt, loic.poulain, linux-arm-msm, devicetree, linux-kernel,
	Dmitry Baryshkov, Prashant Shrotriya, Vikram Sharma,
	Gjorgji Rosikopulos, Atanas Filipov

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@oss.qualcomm.com>
---
 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


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 08/10] arm64: dts: qcom: sm8250: add the Titan camera NoC node
  2026-12-04  7:53 [PATCH v2 00/10] Add the Qualcomm Titan camera NoC interconnect provider Atanas Filipov
                   ` (6 preceding siblings ...)
  2026-12-04  7:53 ` [PATCH v2 07/10] media: qcom: cam-icc: add the SA8775P data Atanas Filipov
@ 2026-12-04  7:53 ` Atanas Filipov
  2026-12-04  8:25   ` sashiko-bot
  2026-12-04  7:53 ` [PATCH v2 09/10] arm64: dts: qcom: sc7280: " Atanas Filipov
  2026-12-04  7:53 ` [PATCH v2 10/10] arm64: dts: qcom: sa8775p: " Atanas Filipov
  9 siblings, 1 reply; 24+ messages in thread
From: Atanas Filipov @ 2026-12-04  7:53 UTC (permalink / raw)
  To: djakov, bod, linux-pm, linux-media
  Cc: mchehab, andersson, konradybcio, abelvesa, robh, krzk+dt,
	conor+dt, loic.poulain, linux-arm-msm, devicetree, linux-kernel,
	Dmitry Baryshkov, Prashant Shrotriya, Vikram Sharma,
	Gjorgji Rosikopulos, Atanas Filipov

Add the Titan camera NoC node. It registers the camera NoC
interconnect provider, so the camera clients can vote bandwidth on
their camera NoC ports and on the camera AHB node.

Signed-off-by: Atanas Filipov <atanas.filipov@oss.qualcomm.com>
---
 arch/arm64/boot/dts/qcom/sm8250.dtsi | 50 ++++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sm8250.dtsi b/arch/arm64/boot/dts/qcom/sm8250.dtsi
index 992284e64d38..a8ed6d9847b1 100644
--- a/arch/arm64/boot/dts/qcom/sm8250.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8250.dtsi
@@ -4407,6 +4407,56 @@ videocc: clock-controller@abf0000 {
 			#power-domain-cells = <1>;
 		};
 
+		cam_icc: interconnect@ac42000 {
+			compatible = "qcom,sm8250-cam-icc";
+			reg = <0 0x0ac42000 0 0x8000>;
+
+			interrupts = <GIC_SPI 459 IRQ_TYPE_EDGE_RISING>;
+
+			clocks = <&gcc GCC_CAMERA_AHB_CLK>,
+				 <&gcc GCC_CAMERA_HF_AXI_CLK>,
+				 <&gcc GCC_CAMERA_SF_AXI_CLK>,
+				 <&camcc CAM_CC_CPAS_AHB_CLK>,
+				 <&camcc CAM_CC_CORE_AHB_CLK>,
+				 <&camcc CAM_CC_CAMNOC_AXI_CLK>;
+			clock-names = "iface",
+				      "gcc_axi_hf",
+				      "gcc_axi_sf",
+				      "cpas_ahb",
+				      "core_ahb",
+				      "camnoc_axi";
+
+			power-domains = <&camcc TITAN_TOP_GDSC>,
+					<&rpmhpd RPMHPD_MMCX>;
+			power-domain-names = "top", "mmcx";
+
+			operating-points-v2 = <&cam_icc_opp_table>;
+
+			interconnects = <&gem_noc MASTER_AMPSS_M0 QCOM_ICC_TAG_ALWAYS
+					 &config_noc SLAVE_CAMERA_CFG QCOM_ICC_TAG_ALWAYS>,
+					<&mmss_noc MASTER_CAMNOC_HF QCOM_ICC_TAG_ALWAYS
+					 &mc_virt SLAVE_EBI_CH0 QCOM_ICC_TAG_ALWAYS>,
+					<&mmss_noc MASTER_CAMNOC_SF QCOM_ICC_TAG_ALWAYS
+					 &mc_virt SLAVE_EBI_CH0 QCOM_ICC_TAG_ALWAYS>;
+			interconnect-names = "cfg", "hf", "sf";
+
+			#interconnect-cells = <2>;
+
+			cam_icc_opp_table: opp-table {
+				compatible = "operating-points-v2";
+
+				opp-300000000 {
+					opp-hz = /bits/ 64 <300000000>;
+					required-opps = <&rpmhpd_opp_low_svs>;
+				};
+
+				opp-400000000 {
+					opp-hz = /bits/ 64 <400000000>;
+					required-opps = <&rpmhpd_opp_svs>;
+				};
+			};
+		};
+
 		cci0: cci@ac4f000 {
 			compatible = "qcom,sm8250-cci", "qcom,msm8996-cci";
 			#address-cells = <1>;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 09/10] arm64: dts: qcom: sc7280: add the Titan camera NoC node
  2026-12-04  7:53 [PATCH v2 00/10] Add the Qualcomm Titan camera NoC interconnect provider Atanas Filipov
                   ` (7 preceding siblings ...)
  2026-12-04  7:53 ` [PATCH v2 08/10] arm64: dts: qcom: sm8250: add the Titan camera NoC node Atanas Filipov
@ 2026-12-04  7:53 ` Atanas Filipov
  2026-12-04  8:30   ` sashiko-bot
  2026-12-04  7:53 ` [PATCH v2 10/10] arm64: dts: qcom: sa8775p: " Atanas Filipov
  9 siblings, 1 reply; 24+ messages in thread
From: Atanas Filipov @ 2026-12-04  7:53 UTC (permalink / raw)
  To: djakov, bod, linux-pm, linux-media
  Cc: mchehab, andersson, konradybcio, abelvesa, robh, krzk+dt,
	conor+dt, loic.poulain, linux-arm-msm, devicetree, linux-kernel,
	Dmitry Baryshkov, Prashant Shrotriya, Vikram Sharma,
	Gjorgji Rosikopulos, Atanas Filipov

Add the Titan camera NoC node. It registers the camera NoC
interconnect provider, so the camera clients can vote bandwidth on
their camera NoC ports and on the camera AHB node.

Signed-off-by: Atanas Filipov <atanas.filipov@oss.qualcomm.com>
---
 arch/arm64/boot/dts/qcom/kodiak.dtsi | 61 ++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/kodiak.dtsi b/arch/arm64/boot/dts/qcom/kodiak.dtsi
index 10e9a5279ed6..b331a4461719 100644
--- a/arch/arm64/boot/dts/qcom/kodiak.dtsi
+++ b/arch/arm64/boot/dts/qcom/kodiak.dtsi
@@ -5179,6 +5179,67 @@ cci1_i2c1: i2c-bus@1 {
 			};
 		};
 
+		cam_icc: interconnect@ac9f000 {
+			compatible = "qcom,sc7280-cam-icc";
+			reg = <0 0x0ac9f000 0 0x10000>;
+
+			interrupts = <GIC_SPI 459 IRQ_TYPE_EDGE_RISING>;
+
+			clocks = <&gcc GCC_CAMERA_HF_AXI_CLK>,
+				 <&gcc GCC_CAMERA_SF_AXI_CLK>,
+				 <&camcc CAM_CC_CPAS_AHB_CLK>,
+				 <&camcc CAM_CC_CAMNOC_AXI_CLK>;
+			clock-names = "gcc_axi_hf",
+				      "gcc_axi_sf",
+				      "cpas_ahb",
+				      "camnoc_axi";
+
+			power-domains = <&camcc CAM_CC_TITAN_TOP_GDSC>,
+					<&rpmhpd SC7280_CX>;
+			power-domain-names = "top", "cx";
+
+			operating-points-v2 = <&cam_icc_opp_table>;
+
+			interconnects = <&gem_noc MASTER_APPSS_PROC QCOM_ICC_TAG_ALWAYS
+					 &cnoc2 SLAVE_CAMERA_CFG QCOM_ICC_TAG_ALWAYS>,
+					<&mmss_noc MASTER_CAMNOC_HF QCOM_ICC_TAG_ALWAYS
+					 &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>,
+					<&mmss_noc MASTER_CAMNOC_SF QCOM_ICC_TAG_ALWAYS
+					 &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>;
+			interconnect-names = "cfg", "hf", "sf";
+
+			#interconnect-cells = <2>;
+
+			cam_icc_opp_table: opp-table {
+				compatible = "operating-points-v2";
+
+				opp-150000000 {
+					opp-hz = /bits/ 64 <150000000>;
+					required-opps = <&rpmhpd_opp_low_svs>;
+				};
+
+				opp-240000000 {
+					opp-hz = /bits/ 64 <240000000>;
+					required-opps = <&rpmhpd_opp_svs>;
+				};
+
+				opp-320000000 {
+					opp-hz = /bits/ 64 <320000000>;
+					required-opps = <&rpmhpd_opp_svs_l1>;
+				};
+
+				opp-400000000 {
+					opp-hz = /bits/ 64 <400000000>;
+					required-opps = <&rpmhpd_opp_nom>;
+				};
+
+				opp-480000000 {
+					opp-hz = /bits/ 64 <480000000>;
+					required-opps = <&rpmhpd_opp_turbo>;
+				};
+			};
+		};
+
 		camss: isp@acb3000 {
 			compatible = "qcom,sc7280-camss";
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 10/10] arm64: dts: qcom: sa8775p: add the Titan camera NoC node
  2026-12-04  7:53 [PATCH v2 00/10] Add the Qualcomm Titan camera NoC interconnect provider Atanas Filipov
                   ` (8 preceding siblings ...)
  2026-12-04  7:53 ` [PATCH v2 09/10] arm64: dts: qcom: sc7280: " Atanas Filipov
@ 2026-12-04  7:53 ` Atanas Filipov
  2026-12-04  8:35   ` sashiko-bot
  9 siblings, 1 reply; 24+ messages in thread
From: Atanas Filipov @ 2026-12-04  7:53 UTC (permalink / raw)
  To: djakov, bod, linux-pm, linux-media
  Cc: mchehab, andersson, konradybcio, abelvesa, robh, krzk+dt,
	conor+dt, loic.poulain, linux-arm-msm, devicetree, linux-kernel,
	Dmitry Baryshkov, Prashant Shrotriya, Vikram Sharma,
	Gjorgji Rosikopulos, Atanas Filipov

Add the Titan camera NoC node. It registers the camera NoC
interconnect provider, so the camera clients can vote bandwidth on
their camera NoC ports and on the camera AHB node.

Signed-off-by: Atanas Filipov <atanas.filipov@oss.qualcomm.com>
---
 arch/arm64/boot/dts/qcom/lemans-embedded.dtsi | 47 +++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/lemans-embedded.dtsi b/arch/arm64/boot/dts/qcom/lemans-embedded.dtsi
index 0be39bb9de1e..308c05cd6d1a 100644
--- a/arch/arm64/boot/dts/qcom/lemans-embedded.dtsi
+++ b/arch/arm64/boot/dts/qcom/lemans-embedded.dtsi
@@ -2001,6 +2001,53 @@ videocc: clock-controller@abf0000 {
 		#power-domain-cells = <1>;
 	};
 
+	cam_icc: interconnect@ac1a000 {
+		compatible = "qcom,sa8775p-cam-icc";
+		reg = <0x0 0x0ac1a000 0x0 0x9400>;
+
+		interrupts = <GIC_SPI 459 IRQ_TYPE_EDGE_RISING>;
+
+		clocks = <&gcc GCC_CAMERA_AHB_CLK>,
+			 <&gcc GCC_CAMERA_HF_AXI_CLK>,
+			 <&gcc GCC_CAMERA_SF_AXI_CLK>,
+			 <&camcc CAM_CC_CPAS_AHB_CLK>,
+			 <&camcc CAM_CC_CORE_AHB_CLK>,
+			 <&camcc CAM_CC_CPAS_FAST_AHB_CLK>,
+			 <&camcc CAM_CC_CAMNOC_AXI_CLK>;
+		clock-names = "iface",
+			      "gcc_axi_hf",
+			      "gcc_axi_sf",
+			      "cpas_ahb",
+			      "core_ahb",
+			      "cpas_fast_ahb",
+			      "camnoc_axi";
+
+		power-domains = <&camcc CAM_CC_TITAN_TOP_GDSC>,
+				<&rpmhpd SA8775P_MMCX>,
+				<&rpmhpd SA8775P_MXC>;
+		power-domain-names = "top", "mmcx", "mxc";
+
+		operating-points-v2 = <&cam_icc_opp_table>;
+
+		interconnects = <&gem_noc MASTER_APPSS_PROC QCOM_ICC_TAG_ALWAYS
+				 &config_noc SLAVE_CAMERA_CFG QCOM_ICC_TAG_ALWAYS>,
+				<&mmss_noc MASTER_CAMNOC_HF QCOM_ICC_TAG_ALWAYS
+				 &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>;
+		interconnect-names = "cfg", "hf";
+
+		#interconnect-cells = <2>;
+
+		cam_icc_opp_table: opp-table {
+			compatible = "operating-points-v2";
+
+			opp-400000000 {
+				opp-hz = /bits/ 64 <400000000>;
+				required-opps = <&rpmhpd_opp_svs_l1>,
+						<&rpmhpd_opp_svs_l1>;
+			};
+		};
+	};
+
 	camcc: clock-controller@ade0000 {
 		compatible = "qcom,sa8775p-camcc";
 		reg = <0x0 0x0ade0000 0x0 0x20000>;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* Re: [PATCH v2 01/10] dt-bindings: interconnect: add the Qualcomm SM8250 Titan camera NoC
  2026-12-04  7:53 ` [PATCH v2 01/10] dt-bindings: interconnect: add the Qualcomm SM8250 Titan camera NoC Atanas Filipov
@ 2026-12-04  8:01   ` sashiko-bot
  0 siblings, 0 replies; 24+ messages in thread
From: sashiko-bot @ 2026-12-04  8:01 UTC (permalink / raw)
  To: Atanas Filipov; +Cc: devicetree, robh, conor+dt, media-ci

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] dt-bindings: interconnect: interrupts listed before clocks in
  sm8250-cam-icc
--

commit 7f59b5f783d83d9932de850dba22bf27dbe747ce
Author: Atanas Filipov <atanas.filipov@oss.qualcomm.com>

dt-bindings: interconnect: add the Qualcomm SM8250 Titan camera NoC

This commit adds the Device Tree binding schema and interconnect ID header
for the Qualcomm SM8250 Titan camera NoC.

> diff --git a/Documentation/devicetree/bindings/interconnect/qcom,sm8250-cam-icc.yaml b/Documentation/devicetree/bindings/interconnect/qcom,sm8250-cam-icc.yaml
> new file mode 100644
> index 0000000000000..7b35a0640c7f8
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/interconnect/qcom,sm8250-cam-icc.yaml
> @@ -0,0 +1,149 @@

[ ... ]

> +properties:
> +  compatible:
> +    enum:
> +      - qcom,sm8250-cam-icc
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  clocks:

[Severity: Low]
Should interrupts be placed after clocks and clock-names (and before
power-domains) here, as well as in the required list and the example
node?  DT binding schemas follow the canonical property order of
compatible, reg, clocks, clock-names, interrupts, and power-domains.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261204075339.4077387-1-atanas.filipov@oss.qualcomm.com?part=1

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v2 03/10] dt-bindings: interconnect: add the Qualcomm SA8775P Titan camera NoC
  2026-12-04  7:53 ` [PATCH v2 03/10] dt-bindings: interconnect: add the Qualcomm SA8775P " Atanas Filipov
@ 2026-12-04  8:04   ` sashiko-bot
  2026-12-04 11:14   ` Bryan O'Donoghue
  1 sibling, 0 replies; 24+ messages in thread
From: sashiko-bot @ 2026-12-04  8:04 UTC (permalink / raw)
  To: Atanas Filipov; +Cc: devicetree, robh, conor+dt, media-ci

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] dt-bindings: interconnect: sa8775p-cam-icc omits SF
  interconnect path
- [Low] dt-bindings: interconnect: interrupts listed before clocks in
  sa8775p-cam-icc
--

commit 085b65dd1d0ba9ea1689d5501bbd079ea5cb2c7c
Author: Atanas Filipov <atanas.filipov@oss.qualcomm.com>

dt-bindings: interconnect: add the Qualcomm SA8775P Titan camera NoC

This commit adds the Device Tree binding schema and interconnect ID header
for the Qualcomm SA8775P Titan camera NoC.

> diff --git a/Documentation/devicetree/bindings/interconnect/qcom,sa8775p-cam-icc.yaml b/Documentation/devicetree/bindings/interconnect/qcom,sa8775p-cam-icc.yaml
> new file mode 100644
> index 0000000000000..88fe0033074d6
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/interconnect/qcom,sa8775p-cam-icc.yaml
> @@ -0,0 +1,148 @@

[ ... ]

> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  clocks:
> +    items:
> +      - description: GCC camera AHB clock
> +      - description: GCC camera HF AXI clock
> +      - description: GCC camera SF AXI clock

[Severity: Low]
Should interrupts be listed after clocks and clock-names here, as well as in
the required list and the example node?  The canonical DT property order puts
clocks and clock-names before interrupts and power-domains.

[ ... ]

> +  interconnects:
> +    items:
> +      - description: config path from the CPU to the camera config space
> +      - description: camera NoC HF port to DDR
> +
> +  interconnect-names:
> +    items:
> +      - const: cfg
> +      - const: hf

[Severity: Medium]
Should interconnects and interconnect-names also include the sf path, with
SLAVE_CAMNOC_SF added to qcom,sa8775p-cam-icc.h?

The schema requires the gcc_axi_sf clock, and SA8775P already defines
MASTER_CAMNOC_SF in qcom,sa8775p-rpmh.h and qnm_camnoc_sf in
drivers/interconnect/qcom/sa8775p.c.  Sibling camera NoC bindings such as
SM8250 and SC7280 include cfg, hf, and sf.

Fixing interconnects to two entries with additionalProperties: false prevents
describing the SF path in DTBs without later relaxing the schema and handling
older DTBs that omit sf.  If SA8775P intentionally omits the sf path, the
commit message should explain why alongside the other differences from SM8250.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261204075339.4077387-1-atanas.filipov@oss.qualcomm.com?part=3

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v2 02/10] dt-bindings: interconnect: add the Qualcomm SC7280 Titan camera NoC
  2026-12-04  7:53 ` [PATCH v2 02/10] dt-bindings: interconnect: add the Qualcomm SC7280 " Atanas Filipov
@ 2026-12-04  8:04   ` sashiko-bot
  2026-12-04 11:10   ` Bryan O'Donoghue
  1 sibling, 0 replies; 24+ messages in thread
From: sashiko-bot @ 2026-12-04  8:04 UTC (permalink / raw)
  To: Atanas Filipov; +Cc: devicetree, robh, conor+dt, media-ci

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] dt-bindings: interconnect: qcom,sc7280-cam-icc: interrupts
  before clocks
--

commit 61ba0d9117be4e8de4d760531a3bf432faf63ada
Author: Atanas Filipov <atanas.filipov@oss.qualcomm.com>

dt-bindings: interconnect: add the Qualcomm SC7280 Titan camera NoC

This commit adds the Device Tree binding schema and interconnect ID
header for the Qualcomm SC7280 Titan camera NoC.

> diff --git a/Documentation/devicetree/bindings/interconnect/qcom,sc7280-cam-icc.yaml b/Documentation/devicetree/bindings/interconnect/qcom,sc7280-cam-icc.yaml
> new file mode 100644
> index 0000000000000..2d8bc60dd3be0
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/interconnect/qcom,sc7280-cam-icc.yaml
> @@ -0,0 +1,156 @@

[ ... ]

> +properties:
> +  compatible:
> +    enum:
> +      - qcom,sc7280-cam-icc
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  clocks:
> +    items:
> +      - description: GCC camera HF AXI clock
> +      - description: GCC camera SF AXI clock
> +      - description: CPAS AHB clock
> +      - description: camera NoC AXI clock
> +
> +  clock-names:
> +    items:
> +      - const: gcc_axi_hf
> +      - const: gcc_axi_sf
> +      - const: cpas_ahb
> +      - const: camnoc_axi
> +
> +  power-domains:

[Severity: Low]
Should interrupts be placed after clocks and clock-names (and before
power-domains) here, as well as in the required list and the example
node?  The canonical DT binding property order puts clocks before
interrupts.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261204075339.4077387-1-atanas.filipov@oss.qualcomm.com?part=2

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v2 05/10] media: qcom: cam-icc: add the SM8250 data
  2026-12-04  7:53 ` [PATCH v2 05/10] media: qcom: cam-icc: add the SM8250 data Atanas Filipov
@ 2026-12-04  8:16   ` sashiko-bot
  0 siblings, 0 replies; 24+ messages in thread
From: sashiko-bot @ 2026-12-04  8:16 UTC (permalink / raw)
  To: Atanas Filipov; +Cc: devicetree, robh, conor+dt, media-ci

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] media: qcom: cam-icc: clock refcount leak on unbind in
  qcom_cam_icc_remove()
--

commit 2779df1b820af93e9dbec7bf95d2121513670a95
Author: Atanas Filipov <atanas.filipov@oss.qualcomm.com>

media: qcom: cam-icc: add the SM8250 data

This commit adds the SM8250 camera NoC configuration (nodes, MMCX rail,
static QoS settings, and error interrupt sources) and wires it into
qcom_cam_icc_of_match[] so the qcom-cam-icc driver can bind on SM8250.

> 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 dbfccdb30da3e..05086221728f5 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,sm8250-cam-icc", .data = &qcom_cam_icc_sm8250_data },
>  	{ }
>  };
>  MODULE_DEVICE_TABLE(of, qcom_cam_icc_of_match);

[Severity: Medium]
Can unbinding the driver leak prepare and enable refcounts on camnoc->clks?

qcom_cam_icc_runtime_resume() enables camnoc->clks, and only
qcom_cam_icc_runtime_suspend() disables them.  If the device is unbound while
runtime-active (for example, with power/control set to on),
qcom_cam_icc_remove() returns without suspending it.

devres then disables runtime PM without running the suspend callback, and
devm_clk_bulk_release_all() only puts the clock handles without disabling or
unpreparing them, leaving all six SM8250 clocks enabled until reboot.

Suspending the device in qcom_cam_icc_remove() when
!pm_runtime_status_suspended(&pdev->dev) and registering the devm IRQ after
devm_pm_runtime_enable() (so the IRQ is freed before runtime PM is disabled)
would avoid this.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261204075339.4077387-1-atanas.filipov@oss.qualcomm.com?part=5

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v2 07/10] media: qcom: cam-icc: add the SA8775P data
  2026-12-04  7:53 ` [PATCH v2 07/10] media: qcom: cam-icc: add the SA8775P data Atanas Filipov
@ 2026-12-04  8:19   ` sashiko-bot
  0 siblings, 0 replies; 24+ messages in thread
From: sashiko-bot @ 2026-12-04  8:19 UTC (permalink / raw)
  To: Atanas Filipov; +Cc: devicetree, robh, conor+dt, media-ci

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] media: qcom: cam-icc: SA8775P runs camnoc_axi at 400 MHz
  without rail OPP
--

commit 796b8b0cbd8e5c49f62c8e1ebc62144d437261d3
Author: Atanas Filipov <atanas.filipov@oss.qualcomm.com>

media: qcom: cam-icc: add the SA8775P data

This commit adds the SA8775P camera NoC interconnect nodes, mmcx and mxc
rail power domains, static QoS settings, and error interrupt data to the
qcom-cam-icc driver.

> 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 0000000000000..a181c1c7540c6
> --- /dev/null
> +++ b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-sa8775p.c

[ ... ]

> +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,

[Severity: High]
Can camnoc_axi be left running at 400 MHz without the required mmcx and mxc
OPP votes?

When aggregated AXI bandwidth drops to zero, qcom_cam_icc_set_axi_rate()
calls clk_set_rate(camnoc->axi_clk, 0) followed by
dev_pm_opp_set_opp(camnoc->dev, NULL), assuming the clock drops to XO before
clearing the rail votes.

On SA8775P, ftbl_cam_cc_camnoc_axi_clk_src in drivers/clk/qcom/camcc-sa8775p.c
only defines a 400 MHz entry with no 19.2 MHz P_BI_TCXO entry.  Because
cam_cc_camnoc_axi_clk_src uses clk_rcg2_shared_ops, clk_set_rate(..., 0)
rounds up to 400 MHz and the mmcx and mxc votes are dropped anyway.

On runtime suspend, clk_rcg2_shared_disable() caches that 400 MHz setting in
parked_cfg, so qcom_cam_icc_runtime_resume() also restores 400 MHz on every
later resume before any OPP is voted.  Running the camera NoC at 400 MHz
below SVS_L1 risks bus errors or hangs when no other consumer holds the rails.

Note that ftbl_cam_cc_slow_ahb_clk_src in camcc-sa8775p.c similarly lacks a
19.2 MHz P_BI_TCXO entry, leaving cpas_ahb at 80 MHz on clk_set_rate(..., 0).
Adding 19.2 MHz P_BI_TCXO entries in camcc-sa8775p.c as a prerequisite, or
keeping the rail OPP active while camnoc_axi stays at 400 MHz, would fix this.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261204075339.4077387-1-atanas.filipov@oss.qualcomm.com?part=7

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v2 08/10] arm64: dts: qcom: sm8250: add the Titan camera NoC node
  2026-12-04  7:53 ` [PATCH v2 08/10] arm64: dts: qcom: sm8250: add the Titan camera NoC node Atanas Filipov
@ 2026-12-04  8:25   ` sashiko-bot
  0 siblings, 0 replies; 24+ messages in thread
From: sashiko-bot @ 2026-12-04  8:25 UTC (permalink / raw)
  To: Atanas Filipov; +Cc: devicetree, robh, conor+dt, media-ci

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] arm64: dts: qcom: sm8250: enabled cam_icc blocks global
  icc_sync_state()
--

commit cfeb43ff2651d8f982a4c0a3dda6ae47023c65b8
Author: Atanas Filipov <atanas.filipov@oss.qualcomm.com>

arm64: dts: qcom: sm8250: add the Titan camera NoC node

This commit adds the cam_icc interconnect provider node to the SM8250
devicetree for the Titan camera NoC.

> diff --git a/arch/arm64/boot/dts/qcom/sm8250.dtsi b/arch/arm64/boot/dts/qcom/sm8250.dtsi
> index 992284e64d38c..a8ed6d9847b18 100644
> --- a/arch/arm64/boot/dts/qcom/sm8250.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sm8250.dtsi
> @@ -4407,6 +4407,56 @@ videocc: clock-controller@abf0000 {
>  			#power-domain-cells = <1>;
>  		};
>  
> +		cam_icc: interconnect@ac42000 {
> +			compatible = "qcom,sm8250-cam-icc";
> +			reg = <0 0x0ac42000 0 0x8000>;

[ ... ]

> +			#interconnect-cells = <2>;

[Severity: High]
Can enabling cam_icc by default permanently block icc_sync_state() on
SM8250?

At boot, of_count_icc_providers() in drivers/interconnect/core.c counts
every available DT node with #interconnect-cells into providers_count.
Adding cam_icc without status = "disabled" raises providers_count from 12
to 13 across all SM8250 boards.

CONFIG_QCOM_CAM_ICC lives under MEDIA_SUPPORT (=m in arm64 defconfig) and
depends on camcc (CONFIG_SM_CAMCC_8250, default m).  When either driver
is disabled or not loaded, cam_icc never binds and dev_sync_state() never
calls icc_sync_state() for it.

With count stuck below providers_count, synced_state never becomes true
and boot-time init_avg/init_peak floors are never cleared on any SM8250
interconnect.  This pins L3 cache (epss_l3), DDR, and system NoCs at
boot/maximum bandwidth and breaks low-power sleep states and suspend.

At minimum, should cam_icc be marked status = "disabled" in sm8250.dtsi
(matching camss, cci0, and cci1) while addressing how optional media
interconnect providers interact with global icc_sync_state()?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261204075339.4077387-1-atanas.filipov@oss.qualcomm.com?part=8

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v2 04/10] media: qcom: cam-icc: add the Titan camera NoC driver
  2026-12-04  7:53 ` [PATCH v2 04/10] media: qcom: cam-icc: add the Titan camera NoC driver Atanas Filipov
@ 2026-12-04  8:27   ` sashiko-bot
  2026-12-04 11:33   ` Bryan O'Donoghue
  2026-12-04 12:25   ` Georgi Djakov
  2 siblings, 0 replies; 24+ messages in thread
From: sashiko-bot @ 2026-12-04  8:27 UTC (permalink / raw)
  To: Atanas Filipov; +Cc: devicetree, robh, conor+dt, media-ci

Thank you for your contribution! Sashiko AI review found 8 potential
issues to consider:
- [High] media: qcom: cam-icc: Kconfig under MEDIA_SUPPORT stalls
  icc_sync_state()
- [High] media: qcom: cam-icc: drop OPP votes while camnoc_axi stays at
  400 MHz
- [Medium] media: qcom: cam-icc: qcom_cam_icc_remove() leaks enabled
  clocks on unbind
- [Medium] media: qcom: cam-icc: partial clock/OPP failure breaks
  icc_set_bw() rollback
- [Medium] media: qcom: cam-icc: unbalanced disable_irq() in
  qcom_cam_icc_resume()
- [Medium] media: qcom: cam-icc: unchecked match data in
  qcom_cam_icc_probe()
- [Medium] media: qcom: cam-icc: SBM IRQ left unmasked across runtime PM
  transitions
- [Medium] media: qcom: cam-icc: wrong IRQ clear order and unmask during
  RPM_RESUMING
--

commit 28878b8cb1373ee083c9daeccda766f64646eb4a
Author: Atanas Filipov <atanas.filipov@oss.qualcomm.com>

media: qcom: cam-icc: add the Titan camera NoC driver

This commit adds an interconnect provider driver for the Qualcomm Titan
camera NoC, scaling AXI and AHB clocks and rail OPP levels from aggregated
bandwidth votes while configuring static QoS and error interrupts on runtime
resume.

> diff --git a/drivers/media/platform/qcom/cam-icc/Kconfig b/drivers/media/platform/qcom/cam-icc/Kconfig
> new file mode 100644
> index 0000000000000..8fae973ce1b0c
> --- /dev/null
> +++ b/drivers/media/platform/qcom/cam-icc/Kconfig
> @@ -0,0 +1,14 @@
> +# SPDX-License-Identifier: GPL-2.0-only
> +config QCOM_CAM_ICC
> +	tristate "Qualcomm Titan camera NoC core driver"
> +	depends on ARCH_QCOM || COMPILE_TEST
> +	depends on COMMON_CLK && PM
> +	depends on INTERCONNECT
> +	select PM_OPP
> +	default ARCH_QCOM

[Severity: High]
Can nesting QCOM_CAM_ICC under MEDIA_SUPPORT prevent icc_sync_state() from
ever completing?

This Kconfig file is sourced inside MEDIA_SUPPORT, MEDIA_PLATFORM_SUPPORT,
and MEDIA_PLATFORM_DRIVERS, so default ARCH_QCOM has no effect when
CONFIG_MEDIA_SUPPORT=n and limits the driver to at most =m when
CONFIG_MEDIA_SUPPORT=m (as in arm64 defconfig).  Because qcom_cam_icc_driver
sets .sync_state = icc_sync_state, any boot where the camera NoC DT node has
#interconnect-cells enabled but this driver is not built in or loaded leaves
icc_sync_state() below providers_count.  That permanently pins boot floor
bandwidth constraints across every interconnect provider on the SoC,
breaking low-power scaling and system suspend.

> 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
> new file mode 100644
> index 0000000000000..dbfccdb30da3e
> --- /dev/null
> +++ b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.c

[ ... ]

> +static int qcom_cam_icc_set_axi_rate(struct qcom_cam_icc *camnoc, u64 rate)
> +{
> +	unsigned long freq = min_t(u64, rate, ULONG_MAX);
> +	struct dev_pm_opp *opp;
> +	int ret;
> +
> +	if (!rate) {
> +		ret = clk_set_min_rate(camnoc->axi_clk, 0);
> +		if (ret)
> +			return ret;
> +
> +		ret = clk_set_rate(camnoc->axi_clk, 0);
> +		if (ret)
> +			return ret;
> +
> +		return dev_pm_opp_set_opp(camnoc->dev, NULL);
> +	}

[Severity: High]
Can dev_pm_opp_set_opp(camnoc->dev, NULL) drop the rail voltage while
camnoc_axi is still running at 400 MHz on SA8775P?

Unlike SM8250 and SC7280, ftbl_cam_cc_camnoc_axi_clk_src in
drivers/clk/qcom/camcc-sa8775p.c has no 19.2 MHz XO entry and only a single
400 MHz entry, so clk_set_rate(camnoc->axi_clk, 0) rounds up to 400 MHz and
leaves cam_cc_camnoc_axi_clk enabled at 400 MHz.  Calling
dev_pm_opp_set_opp(camnoc->dev, NULL) while the device is runtime-active
immediately lowers SA8775P_MMCX and SA8775P_MXC below their required
rpmhpd_opp_svs_l1 corner.

On the next qcom_cam_icc_runtime_resume(), clk_bulk_prepare_enable() also
restores the parked 400 MHz RCG configuration via clk_rcg2_shared_enable()
and writes QoS and IRQ registers before any client votes bandwidth to raise
those rails, risking bus errors or hardware hangs.

[ ... ]

> +static int qcom_cam_icc_update(struct qcom_cam_icc *camnoc)
> +{
> +	struct icc_node *ahb = camnoc->icc_data->nodes[camnoc->data->ahb_id];
> +	unsigned long ahb_rate;
> +	u64 rate;
> +	int ret;
> +
> +	rate = qcom_cam_icc_axi_rate(camnoc);
> +	ahb_rate = (ahb && (ahb->avg_bw || ahb->peak_bw)) ? QCOM_CAM_ICC_AHB_RATE : 0;
> +	if (rate == camnoc->axi_rate && ahb_rate == camnoc->ahb_rate)
> +		return 0;
> +
> +	if (rate != camnoc->axi_rate) {
> +		ret = qcom_cam_icc_set_axi_rate(camnoc, rate);
> +		if (ret)
> +			return ret;
> +
> +		camnoc->axi_rate = rate;
> +	}
> +
> +	if (ahb_rate != camnoc->ahb_rate) {
> +		ret = clk_set_min_rate(camnoc->ahb_clk, ahb_rate);
> +		if (ret)
> +			return ret;
> +
> +		ret = clk_set_rate(camnoc->ahb_clk, ahb_rate);
> +		if (ret)
> +			return ret;
> +
> +		camnoc->ahb_rate = ahb_rate;
> +	}

[Severity: Medium]
Can a partial clock or OPP failure leave hardware clock state out of sync
with camnoc->axi_rate and camnoc->ahb_rate and defeat icc_set_bw() rollback?

In qcom_cam_icc_set_axi_rate() when !rate, if clk_set_rate() or
dev_pm_opp_set_opp() fails after clk_set_min_rate(0) succeeds, axi_clk is
already lowered while camnoc->axi_rate keeps the old frequency.  The same
mismatch occurs if clk_set_rate() fails after clk_set_min_rate() for ahb_clk
here or for axi_clk in qcom_cam_icc_config_clks().

When icc_set_bw() rolls back a failed apply_constraints() by restoring the
previous bandwidths and calling provider->set() again, the early check
rate == camnoc->axi_rate && ahb_rate == camnoc->ahb_rate returns 0 and skips
restoring the modified clock state.

[ ... ]

> +static void qcom_cam_icc_irq_init(struct qcom_cam_icc *camnoc)
> +{
> +	const struct qcom_cam_icc_data *data = camnoc->data;
> +	size_t i;
> +
> +	writel(data->sbm->clear_val, camnoc->base + data->sbm->clear_reg);
> +
> +	for (i = 0; i < data->num_irq_errs; i++) {
> +		const struct qcom_cam_icc_irq_err *err = &data->irq_errs[i];
> +
> +		writel(1, camnoc->base + err->base + err->clear_off);
> +		writel(err->enable_val, camnoc->base + err->base + err->enable_off);
> +	}
> +
> +	if (data->err_logger) {
> +		writel(1, camnoc->base + data->err_logger->base + QCOM_CAM_ICC_ERL_ERRCLR);
> +		writel(QCOM_CAM_ICC_ERL_MAINCTL_STALL_EN | QCOM_CAM_ICC_ERL_MAINCTL_FAULT_EN,
> +		       camnoc->base + data->err_logger->base + QCOM_CAM_ICC_ERL_MAINCTL);
> +	}
> +
> +	writel(camnoc->irq_mask, camnoc->base + data->sbm->enable_reg);
> +}

[Severity: Medium]
Is data->sbm->clear_reg cleared too early here, and can unmasking
data->sbm->enable_reg during RPM_RESUMING wedge the error interrupt?

Unlike qcom_cam_icc_irq(), this clears data->sbm->clear_reg before clearing
err->clear_off and QCOM_CAM_ICC_ERL_ERRCLR.  If a stale error persists
across runtime suspend while the shared top GDSC stays powered, the SBM can
re-latch before the individual sources are cleared.

In addition, qcom_cam_icc_irq_init() runs inside qcom_cam_icc_runtime_resume()
while rpm_resume() still has runtime_status set to RPM_RESUMING.  If an
interrupt fires before rpm_resume() transitions to RPM_ACTIVE,
qcom_cam_icc_irq() sees pm_runtime_get_if_active() <= 0 and returns IRQ_NONE
without clearing the latched status, which leaves a rising-edge interrupt
line asserted high and silences future error interrupts until the next
suspend/resume cycle.

[ ... ]

> +static int qcom_cam_icc_runtime_suspend(struct device *dev)
> +{
> +	struct qcom_cam_icc *camnoc = dev_get_drvdata(dev);
> +
> +	clk_bulk_disable_unprepare(camnoc->num_clks, camnoc->clks);
> +	icc_set_bw(camnoc->hf_path, 0, 0);
> +	icc_set_bw(camnoc->cfg_path, 0, 0);
> +
> +	return 0;
> +}

[Severity: Medium]
Can leaving SBM interrupts unmasked in qcom_cam_icc_runtime_suspend() drop
and wedge edge-triggered camera NoC error interrupts?

qcom_cam_icc_runtime_suspend() disables clocks without masking
data->sbm->enable_reg (or the per-source error enables) and without
synchronizing with the threaded qcom_cam_icc_irq() handler.  If an error
fires during suspend, or while suspended with the shared TITAN_TOP_GDSC held
on by another consumer such as cci0 or cci1, the threaded handler bails out:

CPU0                              CPU1
rpm_suspend()
  runtime_status = RPM_SUSPENDING
  qcom_cam_icc_runtime_suspend()
    clk_bulk_disable_unprepare()
                                  <hardirq> -> wakes qcom_cam_icc_irq()
                                  qcom_cam_icc_irq()
                                    pm_runtime_get_if_active() -> 0
                                    return IRQ_NONE  <-- status uncleared

Because the interrupt is rising-edge triggered, leaving the SBM status
uncleared keeps the line latched high and suppresses further error
interrupts (and leaves the error logger stalled if STALL_EN triggered) until
the next runtime resume re-runs qcom_cam_icc_irq_init().

[ ... ]

> +static int qcom_cam_icc_resume(struct device *dev)
> +{
> +	struct qcom_cam_icc *camnoc = dev_get_drvdata(dev);
> +	int ret;
> +
> +	ret = pm_runtime_force_resume(dev);
> +	if (ret)
> +		return ret;
> +
> +	enable_irq(camnoc->irq);
> +
> +	return 0;
> +}

[Severity: Medium]
Does returning early when pm_runtime_force_resume() fails leave camnoc->irq
permanently disabled?

qcom_cam_icc_suspend() calls disable_irq(camnoc->irq), and even on callback
failure pm_runtime_force_resume() marks the device suspended and re-enables
runtime PM before system resume proceeds.  Skipping enable_irq(camnoc->irq)
leaves the IRQ disable depth unbalanced across subsequent runtime resumes.
Calling enable_irq(camnoc->irq) unconditionally is safe because the device
remains suspended on error and qcom_cam_icc_irq() checks
pm_runtime_get_if_active() <= 0.

[ ... ]

> +	camnoc->dev = dev;
> +	camnoc->data = device_get_match_data(dev);
> +
> +	camnoc->base = devm_platform_ioremap_resource(pdev, 0);
> +	if (IS_ERR(camnoc->base))
> +		return PTR_ERR(camnoc->base);
> +
> +	camnoc->num_clks = devm_clk_bulk_get_all(dev, &camnoc->clks);
> +	if (camnoc->num_clks < 0)
> +		return dev_err_probe(dev, camnoc->num_clks, "failed to get clocks\n");
> +
> +	camnoc->axi_clk = devm_clk_get(dev, camnoc->data->rate_clk);

[Severity: Medium]
Can device_get_match_data() return NULL here and cause a NULL pointer
dereference?

If a platform device is bound to qcom-cam-icc without matching
qcom_cam_icc_of_match (for example via sysfs driver_override and bind),
camnoc->data is NULL and dereferencing camnoc->data->rate_clk oopses in
devm_clk_get().  Checking if (!camnoc->data) and returning -ENODEV avoids
the crash.

[ ... ]

> +	ret = qcom_cam_icc_irq_request(pdev, camnoc);
> +	if (ret)
> +		return dev_err_probe(dev, ret, "failed to request the interrupt\n");
> +
> +	ret = devm_pm_runtime_enable(dev);
> +	if (ret)
> +		return ret;
> +
> +	ret = qcom_cam_icc_icc_init(camnoc);
> +	if (ret)
> +		return dev_err_probe(dev, ret, "failed to register the interconnect provider\n");
> +
> +	return 0;
> +}
> +
> +static void qcom_cam_icc_remove(struct platform_device *pdev)
> +{
> +	struct qcom_cam_icc *camnoc = platform_get_drvdata(pdev);
> +
> +	icc_provider_deregister(&camnoc->provider);
> +	icc_nodes_remove(&camnoc->provider);
> +}

[Severity: Medium]
Can unbinding the driver while the device is RPM_ACTIVE leak enabled clocks
and detach power domains while clocks are still running?

During unbind, __device_release_driver() resumes the device with
pm_runtime_get_sync() and calls pm_runtime_put_sync().  If the device stays
RPM_ACTIVE (for example because userspace set power/control to on, or an
in-flight qcom_cam_icc_irq() holds pm_runtime_get_if_active()),
qcom_cam_icc_remove() returns without synchronizing IRQ teardown or
suspending the device.

Because devm_pm_runtime_enable() is registered after
qcom_cam_icc_irq_request(), LIFO devres teardown runs pm_runtime_disable()
before free_irq() without calling qcom_cam_icc_runtime_suspend().  Later
devres callbacks then detach the power domains while clocks are active, and
devm_clk_bulk_release_all() puts the handles without disabling or
unpreparing them, permanently leaking prepare_count and enable_count on
camnoc->clks.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261204075339.4077387-1-atanas.filipov@oss.qualcomm.com?part=4

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v2 09/10] arm64: dts: qcom: sc7280: add the Titan camera NoC node
  2026-12-04  7:53 ` [PATCH v2 09/10] arm64: dts: qcom: sc7280: " Atanas Filipov
@ 2026-12-04  8:30   ` sashiko-bot
  0 siblings, 0 replies; 24+ messages in thread
From: sashiko-bot @ 2026-12-04  8:30 UTC (permalink / raw)
  To: Atanas Filipov; +Cc: devicetree, robh, conor+dt, media-ci

Thank you for your contribution! Sashiko AI review found 3 potential
issues to consider:
- [High] arm64: dts: qcom: kodiak: enabled cam_icc stalls icc and rpmhpd
  sync_state
- [Medium] arm64: dts: qcom: kodiak: cam_icc cfg path uses
  QCOM_ICC_TAG_ALWAYS
- [Low] arm64: dts: qcom: commit subject uses sc7280 prefix instead of
  kodiak
--

commit 71c9488946dafbd687b43c8969d6e6461f01f63f
Author: Atanas Filipov <atanas.filipov@oss.qualcomm.com>

arm64: dts: qcom: sc7280: add the Titan camera NoC node

This commit adds the Titan camera NoC interconnect provider node (cam_icc)
to kodiak.dtsi along with its OPP table, clocks, power domains, and
interconnect paths.

> arm64: dts: qcom: sc7280: add the Titan camera NoC node

[Severity: Low]
Should the subject prefix be "arm64: dts: qcom: kodiak:" to match
kodiak.dtsi?  Commit dd6edcd7d3e4 ("arm64: dts: qcom: rename sc7280 to
kodiak") renamed this file because SC7280, QCM6490, and QCS6490 share the
kodiak die.

> diff --git a/arch/arm64/boot/dts/qcom/kodiak.dtsi b/arch/arm64/boot/dts/qcom/kodiak.dtsi
> index 10e9a5279ed60..b331a4461719e 100644
> --- a/arch/arm64/boot/dts/qcom/kodiak.dtsi
> +++ b/arch/arm64/boot/dts/qcom/kodiak.dtsi
> @@ -5179,6 +5179,67 @@ cci1_i2c1: i2c-bus@1 {
>  			};
>  		};
>  
> +		cam_icc: interconnect@ac9f000 {
> +			compatible = "qcom,sc7280-cam-icc";
> +			reg = <0 0x0ac9f000 0 0x10000>;

[Severity: High]
Does leaving cam_icc enabled by default stall icc_sync_state() and
rpmhpd_sync_state() when the camera drivers are not loaded?

Because cam_icc is available with #interconnect-cells,
of_count_icc_providers() counts it in providers_count and fw_devlink
tracks it on <&rpmhpd SC7280_CX>.  CONFIG_QCOM_CAM_ICC is under
MEDIA_SUPPORT (=m in arm64 defconfig), so non-media builds leave it unbound.

As a result, icc_sync_state() never releases the INT_MAX boot-floor votes
on the SC7280 NoCs, and rpmhpd_aggregate_corner() keeps RPMh voltage rails
clamped at their highest active and sleep corners.  Should cam_icc default
to status = "disabled" here, matching camss, cci0, and cci1?

[ ... ]

> +			interconnects = <&gem_noc MASTER_APPSS_PROC QCOM_ICC_TAG_ALWAYS
> +					 &cnoc2 SLAVE_CAMERA_CFG QCOM_ICC_TAG_ALWAYS>,
> +					<&mmss_noc MASTER_CAMNOC_HF QCOM_ICC_TAG_ALWAYS
> +					 &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>,
> +					<&mmss_noc MASTER_CAMNOC_SF QCOM_ICC_TAG_ALWAYS
> +					 &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>;
> +			interconnect-names = "cfg", "hf", "sf";

[Severity: Medium]
Should the cfg path (MASTER_APPSS_PROC to SLAVE_CAMERA_CFG) use
QCOM_ICC_TAG_ACTIVE_ONLY instead of QCOM_ICC_TAG_ALWAYS?

qcom_cam_icc_runtime_resume() holds a non-zero peak vote on cfg_path while
camera streaming is active.  With QCOM_ICC_TAG_ALWAYS, that vote also goes
into the RPMh sleep bucket, keeping bcm_sh4 and bcm_cn1 voted while APSS
CPUs are asleep between frames and cannot issue register accesses.

The adjacent camss node in kodiak.dtsi already tags this same path as
QCOM_ICC_TAG_ACTIVE_ONLY.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261204075339.4077387-1-atanas.filipov@oss.qualcomm.com?part=9

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v2 10/10] arm64: dts: qcom: sa8775p: add the Titan camera NoC node
  2026-12-04  7:53 ` [PATCH v2 10/10] arm64: dts: qcom: sa8775p: " Atanas Filipov
@ 2026-12-04  8:35   ` sashiko-bot
  0 siblings, 0 replies; 24+ messages in thread
From: sashiko-bot @ 2026-12-04  8:35 UTC (permalink / raw)
  To: Atanas Filipov; +Cc: devicetree, robh, conor+dt, media-ci

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] arm64: dts: qcom: sa8775p: enabled cam_icc can deadlock
  icc_sync_state()
--

commit 1a04be8f715c4df91cf4f30e9e3b22dfaac1bc8a
Author: Atanas Filipov <atanas.filipov@oss.qualcomm.com>

arm64: dts: qcom: sa8775p: add the Titan camera NoC node

This commit adds the cam_icc interconnect node to lemans-embedded.dtsi so
camera clients on SA8775P can vote for bandwidth on the Titan camera NoC
and AHB paths.

> diff --git a/arch/arm64/boot/dts/qcom/lemans-embedded.dtsi b/arch/arm64/boot/dts/qcom/lemans-embedded.dtsi
> index 0be39bb9de1e1..308c05cd6d1a3 100644
> --- a/arch/arm64/boot/dts/qcom/lemans-embedded.dtsi
> +++ b/arch/arm64/boot/dts/qcom/lemans-embedded.dtsi
> @@ -2001,6 +2001,53 @@ videocc: clock-controller@abf0000 {
>  		#power-domain-cells = <1>;
>  	};
>  
> +	cam_icc: interconnect@ac1a000 {
> +		compatible = "qcom,sa8775p-cam-icc";
> +		reg = <0x0 0x0ac1a000 0x0 0x9400>;
[ ... ]
> +		#interconnect-cells = <2>;

[Severity: High]
Can leaving cam_icc enabled by default block icc_sync_state() across the
whole SoC?

At boot, of_count_icc_providers() counts every available DT node with
#interconnect-cells into providers_count.  With cam_icc enabled, that
raises SA8775P's expected count from 16 to 17.

Unlike the other SA8775P interconnect drivers, CONFIG_QCOM_CAM_ICC is under
CONFIG_MEDIA_SUPPORT (m in arm64 defconfig) and depends on camcc (default
m).  When either driver is not built or loaded, cam_icc never binds, so
fw_devlink timeout recovery skips it because dev_has_sync_state() is false.

Because icc_sync_state() is never called for cam_icc, count stays below
providers_count and synced_state is never reached.  All 12 physical RPMh
NoCs then keep their INT_MAX boot-floor bandwidth votes active, preventing
DDR/NoC frequency scaling and low-power states.

Marking cam_icc as status = "disabled" here and enabling it alongside camss
in camera board or overlay files would avoid counting an unused provider.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261204075339.4077387-1-atanas.filipov@oss.qualcomm.com?part=10

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v2 02/10] dt-bindings: interconnect: add the Qualcomm SC7280 Titan camera NoC
  2026-12-04  7:53 ` [PATCH v2 02/10] dt-bindings: interconnect: add the Qualcomm SC7280 " Atanas Filipov
  2026-12-04  8:04   ` sashiko-bot
@ 2026-12-04 11:10   ` Bryan O'Donoghue
  1 sibling, 0 replies; 24+ messages in thread
From: Bryan O'Donoghue @ 2026-12-04 11:10 UTC (permalink / raw)
  To: Atanas Filipov, djakov, linux-pm, linux-media
  Cc: mchehab, andersson, konradybcio, abelvesa, robh, krzk+dt,
	conor+dt, loic.poulain, linux-arm-msm, devicetree, linux-kernel,
	Dmitry Baryshkov, Prashant Shrotriya, Vikram Sharma,
	Gjorgji Rosikopulos

On 04/12/2026 07:53, Atanas Filipov wrote:
> Add the Titan camera NoC of SC7280. It is an interconnect provider for
> the camera clients, with one node per camera NoC port and one node for
> the camera AHB path. Compared to SM8250, it has no GCC camera AHB clock
> and no camera core AHB clock, and the camera NoC registers are at a
> different address.
> 
> Signed-off-by: Atanas Filipov <atanas.filipov@oss.qualcomm.com>
> ---
>   .../interconnect/qcom,sc7280-cam-icc.yaml     | 156 ++++++++++++++++++
>   .../interconnect/qcom,sc7280-cam-icc.h        |  21 +++
>   2 files changed, 177 insertions(+)
>   create mode 100644 Documentation/devicetree/bindings/interconnect/qcom,sc7280-cam-icc.yaml
>   create mode 100644 include/dt-bindings/interconnect/qcom,sc7280-cam-icc.h
> 
> diff --git a/Documentation/devicetree/bindings/interconnect/qcom,sc7280-cam-icc.yaml b/Documentation/devicetree/bindings/interconnect/qcom,sc7280-cam-icc.yaml
> new file mode 100644
> index 000000000000..2d8bc60dd3be
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/interconnect/qcom,sc7280-cam-icc.yaml
> @@ -0,0 +1,156 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/interconnect/qcom,sc7280-cam-icc.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Qualcomm SC7280 Titan camera NoC
> +
> +maintainers:
> +  - Atanas Filipov <atanas.filipov@oss.qualcomm.com>
> +
> +description:
> +  The camera NoC connects the camera blocks to the multimedia NoC and
> +  DDR. It has one node for each camera NoC port and one node for the
> +  camera AHB (config) path. Clients request bandwidth on paths that
> +  start at these nodes.
> +
> +properties:
> +  compatible:
> +    enum:
> +      - qcom,sc7280-cam-icc
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  clocks:
> +    items:
> +      - description: GCC camera HF AXI clock
> +      - description: GCC camera SF AXI clock
> +      - description: CPAS AHB clock
> +      - description: camera NoC AXI clock
> +
> +  clock-names:
> +    items:
> +      - const: gcc_axi_hf
> +      - const: gcc_axi_sf
> +      - const: cpas_ahb
> +      - const: camnoc_axi

The last two should probably just be "ahb" and "axi"

> +
> +  power-domains:
> +    items:
> +      - description: Titan top GDSC
> +      - description: CX power domain, for the camera NoC clock rate
> +
> +  power-domain-names:
> +    items:
> +      - const: top
> +      - const: cx
> +
> +  operating-points-v2: true
> +
> +  opp-table:
> +    type: object
> +
> +  interconnects:
> +    items:
> +      - description: config path from the CPU to the camera config space
> +      - description: camera NoC HF port to DDR
> +      - description: camera NoC SF port to DDR
> +
> +  interconnect-names:
> +    items:
> +      - const: cfg
> +      - const: hf
> +      - const: sf
> +
> +  '#interconnect-cells':
> +    const: 2
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +  - clocks
> +  - clock-names
> +  - power-domains
> +  - power-domain-names
> +  - operating-points-v2
> +  - interconnects
> +  - interconnect-names
> +  - '#interconnect-cells'
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/clock/qcom,camcc-sc7280.h>
> +    #include <dt-bindings/clock/qcom,gcc-sc7280.h>
> +    #include <dt-bindings/interconnect/qcom,icc.h>
> +    #include <dt-bindings/interconnect/qcom,sc7280.h>
> +    #include <dt-bindings/interrupt-controller/arm-gic.h>
> +    #include <dt-bindings/power/qcom,rpmhpd.h>
> +
> +    interconnect@ac9f000 {
> +        compatible = "qcom,sc7280-cam-icc";

We have "camcc" so IMO this should just be "camicc" minus the hyphenation.

Otherwise this looks pretty good to me.

---
bod

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v2 03/10] dt-bindings: interconnect: add the Qualcomm SA8775P Titan camera NoC
  2026-12-04  7:53 ` [PATCH v2 03/10] dt-bindings: interconnect: add the Qualcomm SA8775P " Atanas Filipov
  2026-12-04  8:04   ` sashiko-bot
@ 2026-12-04 11:14   ` Bryan O'Donoghue
  1 sibling, 0 replies; 24+ messages in thread
From: Bryan O'Donoghue @ 2026-12-04 11:14 UTC (permalink / raw)
  To: Atanas Filipov, djakov, linux-pm, linux-media
  Cc: mchehab, andersson, konradybcio, abelvesa, robh, krzk+dt,
	conor+dt, loic.poulain, linux-arm-msm, devicetree, linux-kernel,
	Dmitry Baryshkov, Prashant Shrotriya, Vikram Sharma,
	Gjorgji Rosikopulos

On 04/12/2026 07:53, Atanas Filipov wrote:
> +  clocks:
> +    items:
> +      - description: GCC camera AHB clock
> +      - description: GCC camera HF AXI clock
> +      - description: GCC camera SF AXI clock
> +      - description: CPAS AHB clock
> +      - description: camera core AHB clock
> +      - description: CPAS fast AHB clock
> +      - description: camera NoC AXI clock
> +
> +  clock-names:
> +    items:
> +      - const: iface
> +      - const: gcc_axi_hf
> +      - const: gcc_axi_sf
> +      - const: cpas_ahb
> +      - const: core_ahb
> +      - const: cpas_fast_ahb
> +      - const: camnoc_axi

Right so this maps back to the comment I just gave. I think one of these 
clocks is the core ahb/axi confusingly core_ahb is missing from sc7280.

So, I think you should have an ahb, axi and cpas_ahb clock in 7280 then, 
based on this list and I suggest core_ahb and camnoc_axi become "ahb" 
and "axi" here.

---
bod

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v2 04/10] media: qcom: cam-icc: add the Titan camera NoC driver
  2026-12-04  7:53 ` [PATCH v2 04/10] media: qcom: cam-icc: add the Titan camera NoC driver Atanas Filipov
  2026-12-04  8:27   ` sashiko-bot
@ 2026-12-04 11:33   ` Bryan O'Donoghue
  2026-12-04 12:25   ` Georgi Djakov
  2 siblings, 0 replies; 24+ messages in thread
From: Bryan O'Donoghue @ 2026-12-04 11:33 UTC (permalink / raw)
  To: Atanas Filipov, djakov, linux-pm, linux-media
  Cc: mchehab, andersson, konradybcio, abelvesa, robh, krzk+dt,
	conor+dt, loic.poulain, linux-arm-msm, devicetree, linux-kernel,
	Dmitry Baryshkov, Prashant Shrotriya, Vikram Sharma,
	Gjorgji Rosikopulos

On 04/12/2026 07:53, Atanas Filipov wrote:
> Add an interconnect provider for the Titan camera NoC. CAMSS blocks
> vote bandwidth on their camera NoC port to DDR and on the camera AHB
> path. The driver sets the camera NoC AXI and AHB clock rates from the
> aggregated votes, and the rail level through an OPP table.
> 
> On every runtime resume the driver writes the static QoS settings and
> enables the camera NoC error interrupt.
> 
> Signed-off-by: Atanas Filipov <atanas.filipov@oss.qualcomm.com>
> ---
>   drivers/media/platform/qcom/Kconfig           |   1 +
>   drivers/media/platform/qcom/Makefile          |   1 +
>   drivers/media/platform/qcom/cam-icc/Kconfig   |  14 +
>   drivers/media/platform/qcom/cam-icc/Makefile  |   4 +
>   .../platform/qcom/cam-icc/qcom-cam-icc-core.c | 670 ++++++++++++++++++
>   .../platform/qcom/cam-icc/qcom-cam-icc-core.h | 127 ++++
>   include/media/qcom-cam-icc.h                  |  26 +
>   7 files changed, 843 insertions(+)
>   create mode 100644 drivers/media/platform/qcom/cam-icc/Kconfig
>   create mode 100644 drivers/media/platform/qcom/cam-icc/Makefile
>   create mode 100644 drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.c
>   create mode 100644 drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.h
>   create mode 100644 include/media/qcom-cam-icc.h
> 
> diff --git a/drivers/media/platform/qcom/Kconfig b/drivers/media/platform/qcom/Kconfig
> index 4f4d3a68e6e5..95ea812c4996 100644
> --- a/drivers/media/platform/qcom/Kconfig
> +++ b/drivers/media/platform/qcom/Kconfig
> @@ -4,4 +4,5 @@ comment "Qualcomm media platform drivers"
> 
>   source "drivers/media/platform/qcom/camss/Kconfig"
>   source "drivers/media/platform/qcom/iris/Kconfig"
> +source "drivers/media/platform/qcom/cam-icc/Kconfig"
>   source "drivers/media/platform/qcom/venus/Kconfig"
> diff --git a/drivers/media/platform/qcom/Makefile b/drivers/media/platform/qcom/Makefile
> index ea2221a202c0..f5b95ba6dd98 100644
> --- a/drivers/media/platform/qcom/Makefile
> +++ b/drivers/media/platform/qcom/Makefile
> @@ -1,4 +1,5 @@
>   # SPDX-License-Identifier: GPL-2.0-only
>   obj-y += camss/
>   obj-y += iris/
> +obj-y += cam-icc/
>   obj-y += venus/
> diff --git a/drivers/media/platform/qcom/cam-icc/Kconfig b/drivers/media/platform/qcom/cam-icc/Kconfig
> new file mode 100644
> index 000000000000..8fae973ce1b0
> --- /dev/null
> +++ b/drivers/media/platform/qcom/cam-icc/Kconfig
> @@ -0,0 +1,14 @@
> +# SPDX-License-Identifier: GPL-2.0-only
> +config QCOM_CAM_ICC
> +	tristate "Qualcomm Titan camera NoC core driver"
> +	depends on ARCH_QCOM || COMPILE_TEST
> +	depends on COMMON_CLK && PM
> +	depends on INTERCONNECT
> +	select PM_OPP
> +	default ARCH_QCOM
> +	help
> +	  Core driver for the camera NoC of Qualcomm SoCs. It manages the
> +	  camera NoC resources shared by the camera drivers (CAMSS).
> +
> +	  To compile this driver as a module, choose M here: the module
> +	  will be called qcom-cam-icc.
> diff --git a/drivers/media/platform/qcom/cam-icc/Makefile b/drivers/media/platform/qcom/cam-icc/Makefile
> new file mode 100644
> index 000000000000..4d1cbf60fea0
> --- /dev/null
> +++ b/drivers/media/platform/qcom/cam-icc/Makefile
> @@ -0,0 +1,4 @@
> +# SPDX-License-Identifier: GPL-2.0-only
> +qcom-cam-icc-y := qcom-cam-icc-core.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
> new file mode 100644
> index 000000000000..dbfccdb30da3
> --- /dev/null
> +++ b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.c
> @@ -0,0 +1,670 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +/*
> + * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
> + */
> +
> +#include <linux/bitfield.h>
> +#include <linux/bits.h>
> +#include <linux/clk.h>
> +#include <linux/device.h>
> +#include <linux/err.h>
> +#include <linux/interconnect-provider.h>
> +#include <linux/interconnect.h>
> +#include <linux/interrupt.h>
> +#include <linux/io.h>
> +#include <linux/math64.h>
> +#include <linux/minmax.h>
> +#include <linux/module.h>
> +#include <linux/of.h>
> +#include <linux/of_platform.h>
> +#include <linux/platform_device.h>
> +#include <linux/pm_domain.h>
> +#include <linux/pm_opp.h>
> +#include <linux/pm_runtime.h>
> +#include <linux/property.h>
> +#include <linux/slab.h>
> +
> +#include <media/qcom-cam-icc.h>
> +
> +#include "qcom-cam-icc-core.h"
> +
> +#define QCOM_CAM_ICC_MIN_BW_KBPS	3000000
> +#define QCOM_CAM_ICC_BUS_WIDTH		32
> +#define QCOM_CAM_ICC_MARGIN_PCT		20
> +#define QCOM_CAM_ICC_CFG_KBPS		76800
> +#define QCOM_CAM_ICC_AHB_RATE		80000000
> +/* Set minimum bandwidth required to keep data path functional */
> +#define QCOM_CAM_ICC_HF_MIN_KBPS	1
> +
> +#define QCOM_CAM_ICC_ERL_MAINCTL		0x08
> +#define QCOM_CAM_ICC_ERL_MAINCTL_STALL_EN	BIT(0)
> +#define QCOM_CAM_ICC_ERL_MAINCTL_FAULT_EN	BIT(1)
> +#define QCOM_CAM_ICC_ERL_ERRCLR			0x18
> +#define QCOM_CAM_ICC_ERL_ERRLOG0		0x20
> +#define QCOM_CAM_ICC_ERL_ERRLOG0_CODE		GENMASK(10, 8)
> +#define QCOM_CAM_ICC_ERL_ERRLOG1		0x28
> +
> +struct qcom_cam_icc {
> +	struct device *dev;
> +	const struct qcom_cam_icc_data *data;
> +	void __iomem *base;
> +	int irq;
> +	u32 irq_mask;
> +	struct clk_bulk_data *clks;
> +	int num_clks;
> +	struct clk *axi_clk;
> +	struct clk *ahb_clk;
> +	struct icc_provider provider;
> +	struct icc_onecell_data *icc_data;
> +	u64 axi_rate;
> +	unsigned long ahb_rate;
> +	struct dev_pm_domain_list *pd_list;
> +	struct dev_pm_domain_list *rail_pd_list;
> +	struct icc_path *cfg_path;
> +	struct icc_path *hf_path;
> +};
> +
> +static int qcom_cam_icc_icc_aggregate(struct icc_node *node, u32 tag, u32 avg_bw,
> +				      u32 peak_bw, u32 *agg_avg, u32 *agg_peak)
> +{
> +	const struct qcom_cam_icc_node *desc = node->data;
> +
> +	if (desc->merge == QCOM_CAM_ICC_MERGE_SUM_INTERLEAVE) {
> +		avg_bw /= 2;
> +		peak_bw /= 2;
> +	}

Deserves a comment

> +
> +	*agg_avg += avg_bw;
> +	*agg_peak = max(*agg_peak, peak_bw);
> +
> +	return 0;

Should this routine be void - you return static 0

> +}
> +
> +static u64 qcom_cam_icc_axi_rate(struct qcom_cam_icc *camnoc)
> +{
> +	const struct qcom_cam_icc_data *data = camnoc->data;
> +	u64 bw = 0;
> +	size_t i;
> +
> +	for (i = 0; i < data->num_nodes; i++) {
> +		const struct qcom_cam_icc_node *desc = &data->nodes[i];
> +		struct icc_node *node = camnoc->icc_data->nodes[desc->id];
> +
> +		if (!desc->rate_node || !node)
> +			continue;

Is !node expected to be a valid state ?

> +
> +		bw = max_t(u64, bw, max(node->avg_bw, node->peak_bw));
> +	}
> +
> +	if (!bw)
> +		return 0;
> +
> +	bw += div_u64(bw * QCOM_CAM_ICC_MARGIN_PCT, 100);
> +	bw = max_t(u64, bw, QCOM_CAM_ICC_MIN_BW_KBPS);
> +
> +	return div_u64(bw * 1000, QCOM_CAM_ICC_BUS_WIDTH);
> +}
> +
> +static int qcom_cam_icc_set_axi_rate(struct qcom_cam_icc *camnoc, u64 rate)
> +{
> +	unsigned long freq = min_t(u64, rate, ULONG_MAX);
> +	struct dev_pm_opp *opp;
> +	int ret;
> +
> +	if (!rate) {
> +		ret = clk_set_min_rate(camnoc->axi_clk, 0);
> +		if (ret)
> +			return ret;
> +
> +		ret = clk_set_rate(camnoc->axi_clk, 0);
> +		if (ret)
> +			return ret;
> +
> +		return dev_pm_opp_set_opp(camnoc->dev, NULL);
> +	}
> +
> +	opp = dev_pm_opp_find_freq_ceil(camnoc->dev, &freq);
> +	if (IS_ERR(opp))
> +		opp = dev_pm_opp_find_freq_floor(camnoc->dev, &freq);
> +	if (IS_ERR(opp))
> +		return PTR_ERR(opp);
> +
> +	ret = dev_pm_opp_set_opp(camnoc->dev, opp);
> +	dev_pm_opp_put(opp);
> +
> +	return ret;
> +}
> +
> +static int qcom_cam_icc_update(struct qcom_cam_icc *camnoc)
> +{
> +	struct icc_node *ahb = camnoc->icc_data->nodes[camnoc->data->ahb_id];
> +	unsigned long ahb_rate;
> +	u64 rate;
> +	int ret;
> +
> +	rate = qcom_cam_icc_axi_rate(camnoc);
> +	ahb_rate = (ahb && (ahb->avg_bw || ahb->peak_bw)) ? QCOM_CAM_ICC_AHB_RATE : 0;

Is !ahb expected to be valid ? Why ? AHB is a fundamental clock.

> +	if (rate == camnoc->axi_rate && ahb_rate == camnoc->ahb_rate)
> +		return 0;
> +
> +	if (rate != camnoc->axi_rate) {
> +		ret = qcom_cam_icc_set_axi_rate(camnoc, rate);
> +		if (ret)
> +			return ret;
> +
> +		camnoc->axi_rate = rate;
> +	}
> +
> +	if (ahb_rate != camnoc->ahb_rate) {
> +		ret = clk_set_min_rate(camnoc->ahb_clk, ahb_rate);
> +		if (ret)
> +			return ret;
> +
> +		ret = clk_set_rate(camnoc->ahb_clk, ahb_rate);
> +		if (ret)
> +			return ret;
> +
> +		camnoc->ahb_rate = ahb_rate;
> +	}
> +
> +	dev_dbg(camnoc->dev, "axi %llu Hz, cpas_ahb %lu Hz\n", rate, ahb_rate);
> +
> +	return 0;
> +}
> +
> +static int qcom_cam_icc_icc_set(struct icc_node *src, struct icc_node *dst)
> +{
> +	struct qcom_cam_icc *camnoc = container_of(src->provider, struct qcom_cam_icc, provider);
> +
> +	return qcom_cam_icc_update(camnoc);
> +}
> +
> +static int qcom_cam_icc_icc_get_bw(struct icc_node *node, u32 *avg, u32 *peak)
> +{
> +	*avg = 0;
> +	*peak = 0;
> +
> +	return 0;
> +}
> +
> +static int qcom_cam_icc_icc_link_path(struct qcom_cam_icc *camnoc,
> +				      struct icc_node *node, const char *path)
> +{
> +	struct device_node *np = camnoc->dev->of_node;
> +	struct icc_node_data *link_data;
> +	struct of_phandle_args args;
> +	struct icc_node *link;
> +	int idx, ret;
> +
> +	idx = of_property_match_string(np, "interconnect-names", path);
> +	if (idx < 0)
> +		return idx;
> +
> +	ret = of_parse_phandle_with_args(np, "interconnects", "#interconnect-cells", idx * 2,
> +					 &args);
> +	if (ret)
> +		return ret;
> +
> +	link_data = of_icc_get_from_provider(&args);
> +	of_node_put(args.np);
> +	if (IS_ERR(link_data))
> +		return PTR_ERR(link_data);
> +
> +	link = link_data->node;
> +	kfree(link_data);
> +
> +	return icc_link_nodes(node, &link);
> +}
> +
> +static struct icc_node_data *qcom_cam_icc_xlate(const struct of_phandle_args *spec, void *data)
> +{
> +	struct icc_node_data *ndata;
> +	struct icc_node *node;
> +
> +	node = of_icc_xlate_onecell(spec, data);
> +	if (IS_ERR(node))
> +		return ERR_CAST(node);
> +
> +	ndata = kzalloc_obj(*ndata);
> +	if (!ndata)
> +		return ERR_PTR(-ENOMEM);
> +
> +	ndata->node = node;
> +	ndata->tag = spec->args[1];
> +
> +	return ndata;
> +}
> +
> +static int qcom_cam_icc_icc_init(struct qcom_cam_icc *camnoc)
> +{
> +	const struct qcom_cam_icc_data *data = camnoc->data;
> +	struct icc_provider *provider = &camnoc->provider;
> +	struct icc_onecell_data *icc_data;
> +	size_t i;
> +	int ret;
> +
> +	icc_data = devm_kzalloc(camnoc->dev, struct_size(icc_data, nodes, data->num_ids),
> +				GFP_KERNEL);
> +	if (!icc_data)
> +		return -ENOMEM;
> +
> +	icc_data->num_nodes = data->num_ids;
> +	camnoc->icc_data = icc_data;
> +
> +	provider->dev = camnoc->dev;
> +	provider->set = qcom_cam_icc_icc_set;
> +	provider->aggregate = qcom_cam_icc_icc_aggregate;
> +	provider->get_bw = qcom_cam_icc_icc_get_bw;
> +	provider->xlate_extended = qcom_cam_icc_xlate;
> +	provider->data = icc_data;
> +	icc_provider_init(provider);
> +
> +	for (i = 0; i < data->num_nodes; i++) {
> +		const struct qcom_cam_icc_node *desc = &data->nodes[i];
> +		struct icc_node *node;
> +
> +		node = icc_node_create_dyn();
> +		if (IS_ERR(node)) {
> +			ret = PTR_ERR(node);
> +			goto err_remove_nodes;
> +		}
> +
> +		ret = icc_node_set_name(node, provider, desc->name);
> +		if (ret) {
> +			icc_node_destroy(node->id);
> +			goto err_remove_nodes;
> +		}
> +
> +		node->data = (void *)desc;
> +		icc_data->nodes[desc->id] = node;
> +		icc_node_add(node, provider);
> +	}
> +
> +	for (i = 0; i < data->num_nodes; i++) {
> +		const struct qcom_cam_icc_node *desc = &data->nodes[i];
> +
> +		if (desc->link_path)
> +			ret = qcom_cam_icc_icc_link_path(camnoc, icc_data->nodes[desc->id],
> +							 desc->link_path);
> +		else
> +			ret = icc_link_nodes(icc_data->nodes[desc->id],
> +					     &icc_data->nodes[desc->link]);
> +		if (ret)
> +			goto err_remove_nodes;
> +	}
> +
> +	ret = icc_provider_register(provider);
> +	if (ret)
> +		goto err_remove_nodes;
> +
> +	return 0;
> +
> +err_remove_nodes:
> +	icc_nodes_remove(provider);
> +
> +	return ret;
> +}
> +
> +static void qcom_cam_icc_qos_init(struct qcom_cam_icc *camnoc)
> +{
> +	const struct qcom_cam_icc_data *data = camnoc->data;
> +	size_t i;
> +
> +	for (i = 0; i < data->num_qos; i++)
> +		writel(data->qos[i].value, camnoc->base + data->qos[i].offset);
> +}
> +
> +static void qcom_cam_icc_irq_init(struct qcom_cam_icc *camnoc)
> +{
> +	const struct qcom_cam_icc_data *data = camnoc->data;
> +	size_t i;
> +
> +	writel(data->sbm->clear_val, camnoc->base + data->sbm->clear_reg);
> +
> +	for (i = 0; i < data->num_irq_errs; i++) {
> +		const struct qcom_cam_icc_irq_err *err = &data->irq_errs[i];
> +
> +		writel(1, camnoc->base + err->base + err->clear_off);
> +		writel(err->enable_val, camnoc->base + err->base + err->enable_off);
> +	}
> +
> +	if (data->err_logger) {
> +		writel(1, camnoc->base + data->err_logger->base + QCOM_CAM_ICC_ERL_ERRCLR);
> +		writel(QCOM_CAM_ICC_ERL_MAINCTL_STALL_EN | QCOM_CAM_ICC_ERL_MAINCTL_FAULT_EN,
> +		       camnoc->base + data->err_logger->base + QCOM_CAM_ICC_ERL_MAINCTL);
> +	}
> +
> +	writel(camnoc->irq_mask, camnoc->base + data->sbm->enable_reg);
> +}
> +
> +static void qcom_cam_icc_erl_handle(struct qcom_cam_icc *camnoc)
> +{
> +	void __iomem *erl = camnoc->base + camnoc->data->err_logger->base;
> +	u32 log0 = readl(erl + QCOM_CAM_ICC_ERL_ERRLOG0);
> +
> +	dev_err_ratelimited(camnoc->dev, "slave error, code %lu, errlog0 %#x, errlog1 %#x\n",
> +			    FIELD_GET(QCOM_CAM_ICC_ERL_ERRLOG0_CODE, log0), log0,
> +			    readl(erl + QCOM_CAM_ICC_ERL_ERRLOG1));
> +	writel(1, erl + QCOM_CAM_ICC_ERL_ERRCLR);
> +}
> +
> +static irqreturn_t qcom_cam_icc_irq(int irq, void *dev_id)
> +{
> +	struct qcom_cam_icc *camnoc = dev_id;
> +	const struct qcom_cam_icc_data *data = camnoc->data;
> +	u32 status, pending;
> +	size_t i;
> +
> +	if (pm_runtime_get_if_active(camnoc->dev) <= 0)
> +		return IRQ_NONE;

Why would the IRQ run if this is false ?

> +
> +	status = readl(camnoc->base + data->sbm->status_reg);
> +	pending = status & camnoc->irq_mask;
> +	if (!pending) {
> +		pm_runtime_put(camnoc->dev);
> +		return IRQ_NONE;

As I read this, we run, we read a status and then we return 'nothing to 
do' which seems odd to me.

> +	}
> +
> +	if (data->err_logger && (pending & data->err_logger->sbm_mask))
> +		qcom_cam_icc_erl_handle(camnoc);
> +
> +	for (i = 0; i < data->num_irq_errs; i++) {
> +		const struct qcom_cam_icc_irq_err *err = &data->irq_errs[i];
> +
> +		if (!(pending & err->sbm_mask))
> +			continue;
> +
> +		dev_err_ratelimited(camnoc->dev, "%s error, status %#x\n", err->name,
> +				    readl(camnoc->base + err->base + err->status_off));
> +		writel(1, camnoc->base + err->base + err->clear_off);
> +	}
> +
> +	writel(data->sbm->clear_val, camnoc->base + data->sbm->clear_reg);
> +
> +	pm_runtime_put(camnoc->dev);
> +
> +	return IRQ_HANDLED;
> +}
> +
> +static int qcom_cam_icc_irq_request(struct platform_device *pdev, struct qcom_cam_icc *camnoc)
> +{
> +	const struct qcom_cam_icc_data *data = camnoc->data;
> +	size_t i;
> +	int irq;
> +
> +	for (i = 0; i < data->num_irq_errs; i++)
> +		camnoc->irq_mask |= data->irq_errs[i].sbm_mask;
> +
> +	if (data->err_logger)
> +		camnoc->irq_mask |= data->err_logger->sbm_mask;
> +
> +	irq = platform_get_irq(pdev, 0);
> +	if (irq < 0)
> +		return irq;
> +
> +	camnoc->irq = irq;
> +
> +	return devm_request_threaded_irq(camnoc->dev, irq, NULL, qcom_cam_icc_irq, IRQF_ONESHOT,
> +					 dev_name(camnoc->dev), camnoc);
> +}
> +
> +static int qcom_cam_icc_runtime_suspend(struct device *dev)
> +{
> +	struct qcom_cam_icc *camnoc = dev_get_drvdata(dev);
> +
> +	clk_bulk_disable_unprepare(camnoc->num_clks, camnoc->clks);
> +	icc_set_bw(camnoc->hf_path, 0, 0);
> +	icc_set_bw(camnoc->cfg_path, 0, 0);
> +
> +	return 0;
> +}
> +
> +static int qcom_cam_icc_runtime_resume(struct device *dev)
> +{
> +	struct qcom_cam_icc *camnoc = dev_get_drvdata(dev);
> +	int ret;
> +
> +	ret = icc_set_bw(camnoc->cfg_path, 0, QCOM_CAM_ICC_CFG_KBPS);
> +	if (ret)
> +		return ret;
> +
> +	ret = icc_set_bw(camnoc->hf_path, 0, QCOM_CAM_ICC_HF_MIN_KBPS);
> +	if (ret)
> +		goto err_cfg;
> +
> +	ret = clk_bulk_prepare_enable(camnoc->num_clks, camnoc->clks);
> +	if (ret)
> +		goto err_cfg;
> +
> +	qcom_cam_icc_qos_init(camnoc);
> +	qcom_cam_icc_irq_init(camnoc);
> +
> +	return 0;
> +
> +err_cfg:
> +	icc_set_bw(camnoc->hf_path, 0, 0);
> +	icc_set_bw(camnoc->cfg_path, 0, 0);
> +
> +	return ret;
> +}
> +
> +static int qcom_cam_icc_suspend(struct device *dev)
> +{
> +	struct qcom_cam_icc *camnoc = dev_get_drvdata(dev);
> +	int ret;
> +
> +	disable_irq(camnoc->irq);
> +
> +	ret = pm_runtime_force_suspend(dev);
> +	if (ret)
> +		enable_irq(camnoc->irq);
> +
> +	return ret;
> +}
> +
> +static int qcom_cam_icc_resume(struct device *dev)
> +{
> +	struct qcom_cam_icc *camnoc = dev_get_drvdata(dev);
> +	int ret;
> +
> +	ret = pm_runtime_force_resume(dev);
> +	if (ret)
> +		return ret;
> +
> +	enable_irq(camnoc->irq);
> +
> +	return 0;
> +}
> +
> +static const struct dev_pm_ops qcom_cam_icc_pm_ops = {
> +	SYSTEM_SLEEP_PM_OPS(qcom_cam_icc_suspend, qcom_cam_icc_resume)
> +	RUNTIME_PM_OPS(qcom_cam_icc_runtime_suspend, qcom_cam_icc_runtime_resume, NULL)
> +};
> +
> +static const char * const qcom_cam_icc_pd_names[] = { "top" };
> +
> +static const struct dev_pm_domain_attach_data qcom_cam_icc_pd_data = {
> +	.pd_names = qcom_cam_icc_pd_names,
> +	.num_pd_names = ARRAY_SIZE(qcom_cam_icc_pd_names),
> +};
> +
> +static int qcom_cam_icc_pd_init(struct qcom_cam_icc *camnoc)
> +{
> +	int ret;
> +
> +	ret = devm_pm_domain_attach_list(camnoc->dev, &qcom_cam_icc_pd_data, &camnoc->pd_list);
> +	if (ret < 0)
> +		return ret;
> +
> +	ret = devm_pm_domain_attach_list(camnoc->dev, camnoc->data->rail_pd_data,
> +					 &camnoc->rail_pd_list);
> +	if (ret < 0)
> +		return ret;
> +
> +	return 0;
> +}
> +
> +static int qcom_cam_icc_config_clks(struct device *dev, struct opp_table *opp_table,
> +				    struct dev_pm_opp *opp, void *data, bool scaling_down)
> +{
> +	struct qcom_cam_icc *camnoc = dev_get_drvdata(dev);
> +	unsigned long freq = dev_pm_opp_get_freq(opp);
> +	int ret;
> +
> +	ret = clk_set_min_rate(camnoc->axi_clk, freq);
> +	if (ret)
> +		return ret;
> +
> +	return clk_set_rate(camnoc->axi_clk, freq);
> +}
> +
> +static int qcom_cam_icc_opp_init(struct qcom_cam_icc *camnoc)
> +{
> +	struct dev_pm_opp_config config = {
> +		.clk_names = (const char *[]){ camnoc->data->rate_clk, NULL },
> +		.config_clks = qcom_cam_icc_config_clks,
> +	};
> +	int ret;
> +
> +	ret = devm_pm_opp_set_config(camnoc->dev, &config);
> +	if (ret)
> +		return ret;
> +
> +	return devm_pm_opp_of_add_table(camnoc->dev);
> +}
> +
> +static const struct of_device_id qcom_cam_icc_of_match[] = {
> +	{ }
> +};
> +MODULE_DEVICE_TABLE(of, qcom_cam_icc_of_match);
> +
> +/**
> + * qcom_cam_icc_link() - link a camera NoC client to the camera NoC
> + * @client: client device with a camera NoC path in its "interconnects"
> + *
> + * Add a runtime PM device link from @client to the camera NoC, so that a
> + * runtime resume of @client resumes the camera NoC first. @client must get
> + * its camera NoC interconnect path before this call.
> + *
> + * Return: 0 on success, -ENODEV if @client has no camera NoC path,
> + * -EPROBE_DEFER if the camera NoC device is not created yet, or another
> + * negative error code.
> + */

This is the only function with an explanatory header. Suggest you either 
replicate this everywhere or zap it.

Now that I review a bit later I see we have a new function 
qcom_cam_icc_link() ... but why aren't we just describing the camnoc 
interconnect exactly as we do any other interconnect ? Why do we need a 
custom function ?

Shouldn't it just be icc_set_bw() with the interconnect nodes between 
jpeg, ife etc pointing the same way the root DT for this points to 
interconnects provided elsewhere the EB ports to DRAM as an example ?

> +int qcom_cam_icc_link(struct device *client)
> +{
> +	struct platform_device *pdev;
> +	struct of_phandle_args args;
> +	struct device_link *link;
> +	int i;
> +
> +	for (i = 0; ; i++) {
> +		if (of_parse_phandle_with_args(client->of_node, "interconnects",
> +					       "#interconnect-cells", i, &args))
> +			return -ENODEV;
> +
> +		if (of_match_node(qcom_cam_icc_of_match, args.np))
> +			break;
> +
> +		of_node_put(args.np);
> +	}
> +
> +	pdev = of_find_device_by_node(args.np);
> +	of_node_put(args.np);
> +	if (!pdev)
> +		return -EPROBE_DEFER;
> +
> +	link = device_link_add(client, &pdev->dev,
> +			       DL_FLAG_PM_RUNTIME | DL_FLAG_AUTOREMOVE_CONSUMER);
> +	put_device(&pdev->dev);
> +
> +	return link ? 0 : -EINVAL;

Why -EINVAL and not -ENODEV, i.e. what's the bad input parameter we are 
reporting @ -EINVAL, surely its no device here => -ENODEV;

> +}
> +EXPORT_SYMBOL_GPL(qcom_cam_icc_link);
> +
> +static int qcom_cam_icc_probe(struct platform_device *pdev)
> +{
> +	struct device *dev = &pdev->dev;
> +	struct qcom_cam_icc *camnoc;
> +	int ret;
> +
> +	camnoc = devm_kzalloc(dev, sizeof(*camnoc), GFP_KERNEL);
> +	if (!camnoc)
> +		return -ENOMEM;
> +
> +	camnoc->dev = dev;
> +	camnoc->data = device_get_match_data(dev);
> +
> +	camnoc->base = devm_platform_ioremap_resource(pdev, 0);
> +	if (IS_ERR(camnoc->base))
> +		return PTR_ERR(camnoc->base);
> +
> +	camnoc->num_clks = devm_clk_bulk_get_all(dev, &camnoc->clks);
> +	if (camnoc->num_clks < 0)
> +		return dev_err_probe(dev, camnoc->num_clks, "failed to get clocks\n");
> +
> +	camnoc->axi_clk = devm_clk_get(dev, camnoc->data->rate_clk);
> +	if (IS_ERR(camnoc->axi_clk))
> +		return dev_err_probe(dev, PTR_ERR(camnoc->axi_clk), "no %s clock\n",
> +				     camnoc->data->rate_clk);
> +
> +	camnoc->ahb_clk = devm_clk_get(dev, "cpas_ahb");
> +	if (IS_ERR(camnoc->ahb_clk))
> +		return dev_err_probe(dev, PTR_ERR(camnoc->ahb_clk), "no cpas_ahb clock\n");
> +
> +	camnoc->cfg_path = devm_of_icc_get(dev, "cfg");
> +	if (IS_ERR(camnoc->cfg_path))
> +		return dev_err_probe(dev, PTR_ERR(camnoc->cfg_path),
> +				     "failed to get the cfg path\n");
> +
> +	camnoc->hf_path = devm_of_icc_get(dev, "hf");
> +	if (IS_ERR(camnoc->hf_path))
> +		return dev_err_probe(dev, PTR_ERR(camnoc->hf_path),
> +				     "failed to get the hf path\n");
> +
> +	platform_set_drvdata(pdev, camnoc);
> +
> +	ret = qcom_cam_icc_pd_init(camnoc);
> +	if (ret)
> +		return dev_err_probe(dev, ret, "failed to attach the power domains\n");
> +
> +	ret = qcom_cam_icc_opp_init(camnoc);
> +	if (ret)
> +		return dev_err_probe(dev, ret, "failed to add the OPP table\n");
> +
> +	ret = qcom_cam_icc_irq_request(pdev, camnoc);
> +	if (ret)
> +		return dev_err_probe(dev, ret, "failed to request the interrupt\n");
> +
> +	ret = devm_pm_runtime_enable(dev);
> +	if (ret)
> +		return ret;
> +
> +	ret = qcom_cam_icc_icc_init(camnoc);
> +	if (ret)
> +		return dev_err_probe(dev, ret, "failed to register the interconnect provider\n");
> +
> +	return 0;
> +}
> +
> +static void qcom_cam_icc_remove(struct platform_device *pdev)
> +{
> +	struct qcom_cam_icc *camnoc = platform_get_drvdata(pdev);
> +
> +	icc_provider_deregister(&camnoc->provider);
> +	icc_nodes_remove(&camnoc->provider);
> +}
> +
> +static struct platform_driver qcom_cam_icc_driver = {
> +	.probe = qcom_cam_icc_probe,
> +	.remove = qcom_cam_icc_remove,
> +	.driver = {
> +		.name = "qcom-cam-icc",
> +		.of_match_table = qcom_cam_icc_of_match,
> +		.pm = pm_ptr(&qcom_cam_icc_pm_ops),
> +		.sync_state = icc_sync_state,
> +	},
> +};
> +module_platform_driver(qcom_cam_icc_driver);
> +
> +MODULE_DESCRIPTION("Qualcomm Titan camera NoC core driver");
> +MODULE_LICENSE("GPL");
> 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
> new file mode 100644
> index 000000000000..eee7eb9c4c2d
> --- /dev/null
> +++ b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.h
> @@ -0,0 +1,127 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +/*
> + * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
> + */
> +
> +#ifndef __QCOM_CAM_ICC_CORE_H__
> +#define __QCOM_CAM_ICC_CORE_H__
> +
> +#include <linux/types.h>
> +
> +struct dev_pm_domain_attach_data;
> +
> +#define QCOM_CAM_ICC_PRIORITYLUT_LOW	0x30
> +#define QCOM_CAM_ICC_PRIORITYLUT_HIGH	0x34
> +#define QCOM_CAM_ICC_URGENCY_LOW	0x38
> +#define QCOM_CAM_ICC_DANGERLUT_LOW	0x40
> +#define QCOM_CAM_ICC_SAFELUT_LOW	0x48
> +#define QCOM_CAM_ICC_MAINCTL_LOW	0x08
> +#define QCOM_CAM_ICC_SHAPING_LOW	0x20
> +#define QCOM_CAM_ICC_SHAPING_HIGH	0x24
> +#define QCOM_CAM_ICC_DECERRSTATUS_LOW	0x110
> +#define QCOM_CAM_ICC_DECERRCLR_LOW	0x118
> +#define QCOM_CAM_ICC_DECERREN_LOW	0x120
> +#define QCOM_CAM_ICC_ENCCTL_LOW		0x188
> +#define QCOM_CAM_ICC_ENCERRSTATUS_LOW	0x190
> +#define QCOM_CAM_ICC_ENCERRCLR_LOW	0x198
> +#define QCOM_CAM_ICC_ENCERREN_LOW	0x1a0
> +
> +enum qcom_cam_icc_merge {
> +	QCOM_CAM_ICC_MERGE_SUM,
> +	QCOM_CAM_ICC_MERGE_SUM_INTERLEAVE,
> +};
> +
> +struct qcom_cam_icc_node {
> +	const char *name;
> +	u16 id;
> +	u16 link;
> +	enum qcom_cam_icc_merge merge;
> +	bool rate_node;
> +	const char *link_path;
> +};
> +
> +struct qcom_cam_icc_qos {
> +	u32 offset;
> +	u32 value;
> +};
> +
> +struct qcom_cam_icc_sbm {
> +	u32 enable_reg;
> +	u32 status_reg;
> +	u32 clear_reg;
> +	u32 clear_val;
> +};
> +
> +struct qcom_cam_icc_irq_err {
> +	const char *name;
> +	u32 sbm_mask;
> +	u32 base;
> +	u32 enable_off;
> +	u32 enable_val;
> +	u32 status_off;
> +	u32 clear_off;
> +};
> +
> +struct qcom_cam_icc_erl {
> +	u32 base;
> +	u32 sbm_mask;
> +};
> +
> +struct qcom_cam_icc_data {
> +	const char *rate_clk;
> +	const struct qcom_cam_icc_node *nodes;
> +	size_t num_nodes;
> +	size_t num_ids;
> +	u16 ahb_id;
> +	const struct dev_pm_domain_attach_data *rail_pd_data;
> +	const struct qcom_cam_icc_qos *qos;
> +	size_t num_qos;
> +	const struct qcom_cam_icc_sbm *sbm;
> +	const struct qcom_cam_icc_irq_err *irq_errs;
> +	size_t num_irq_errs;
> +	const struct qcom_cam_icc_erl *err_logger;
> +};
> +
> +#define CAMNOC_PORT(_id, _name, _link)			\
> +	{						\
> +		.name = _name,				\
> +		.id = _id,				\
> +		.link = _link,				\
> +		.merge = QCOM_CAM_ICC_MERGE_SUM,	\
> +		.rate_node = true,			\
> +	}
> +
> +#define CAMNOC_INTERNAL(_id, _name, _link, _merge)	\
> +	{						\
> +		.name = _name,				\
> +		.id = _id,				\
> +		.link = _link,				\
> +		.merge = _merge,			\
> +		.rate_node = true,			\
> +	}
> +
> +#define CAMNOC_LINK_SLAVE(_id, _name, _link_path)	\
> +	{						\
> +		.name = _name,				\
> +		.id = _id,				\
> +		.link_path = _link_path,		\
> +	}
> +
> +#define CAMNOC_QOS(_base, _reg, _value)				\
> +	{							\
> +		.offset = (_base) + QCOM_CAM_ICC_##_reg,	\
> +		.value = _value,				\
> +	}
> +
> +#define CAMNOC_IRQ_ERR(_name, _mask, _base, _type, _enable_val)		\
> +	{								\
> +		.name = _name,						\
> +		.sbm_mask = _mask,					\
> +		.base = _base,						\
> +		.enable_off = QCOM_CAM_ICC_##_type##ERREN_LOW,		\
> +		.enable_val = _enable_val,				\
> +		.status_off = QCOM_CAM_ICC_##_type##ERRSTATUS_LOW,	\
> +		.clear_off = QCOM_CAM_ICC_##_type##ERRCLR_LOW,		\
> +	}
> +
> +#endif
> diff --git a/include/media/qcom-cam-icc.h b/include/media/qcom-cam-icc.h
> new file mode 100644
> index 000000000000..68c230687377
> --- /dev/null
> +++ b/include/media/qcom-cam-icc.h
> @@ -0,0 +1,26 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +/*
> + * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
> + */
> +
> +#ifndef __MEDIA_QCOM_CAM_ICC_H__
> +#define __MEDIA_QCOM_CAM_ICC_H__
> +
> +#include <linux/errno.h>
> +
> +struct device;
> +
> +#if IS_ENABLED(CONFIG_QCOM_CAM_ICC)
> +
> +int qcom_cam_icc_link(struct device *client);
> +
> +#else
> +
> +static inline int qcom_cam_icc_link(struct device *client)
> +{
> +	return -ENODEV;
> +}
> +
> +#endif
> +
> +#endif
> --
> 2.34.1


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v2 04/10] media: qcom: cam-icc: add the Titan camera NoC driver
  2026-12-04  7:53 ` [PATCH v2 04/10] media: qcom: cam-icc: add the Titan camera NoC driver Atanas Filipov
  2026-12-04  8:27   ` sashiko-bot
  2026-12-04 11:33   ` Bryan O'Donoghue
@ 2026-12-04 12:25   ` Georgi Djakov
  2 siblings, 0 replies; 24+ messages in thread
From: Georgi Djakov @ 2026-12-04 12:25 UTC (permalink / raw)
  To: Atanas Filipov, bod, linux-pm, linux-media
  Cc: mchehab, andersson, konradybcio, abelvesa, robh, krzk+dt,
	conor+dt, loic.poulain, linux-arm-msm, devicetree, linux-kernel,
	Dmitry Baryshkov, Prashant Shrotriya, Vikram Sharma,
	Gjorgji Rosikopulos

Hi Atanas,

On 12/4/26 9:53 AM, Atanas Filipov wrote:
> Add an interconnect provider for the Titan camera NoC. CAMSS blocks
> vote bandwidth on their camera NoC port to DDR and on the camera AHB
> path. The driver sets the camera NoC AXI and AHB clock rates from the
> aggregated votes, and the rail level through an OPP table.
> 
> On every runtime resume the driver writes the static QoS settings and
> enables the camera NoC error interrupt.
> 
> Signed-off-by: Atanas Filipov <atanas.filipov@oss.qualcomm.com>
> ---
>   drivers/media/platform/qcom/Kconfig           |   1 +
>   drivers/media/platform/qcom/Makefile          |   1 +
>   drivers/media/platform/qcom/cam-icc/Kconfig   |  14 +
>   drivers/media/platform/qcom/cam-icc/Makefile  |   4 +
>   .../platform/qcom/cam-icc/qcom-cam-icc-core.c | 670 ++++++++++++++++++
>   .../platform/qcom/cam-icc/qcom-cam-icc-core.h | 127 ++++
>   include/media/qcom-cam-icc.h                  |  26 +
>   7 files changed, 843 insertions(+)
>   create mode 100644 drivers/media/platform/qcom/cam-icc/Kconfig
>   create mode 100644 drivers/media/platform/qcom/cam-icc/Makefile
>   create mode 100644 drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.c
>   create mode 100644 drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.h
>   create mode 100644 include/media/qcom-cam-icc.h
> 

This is an interconnect provider with bindings under bindings/interconnect/, but
you put it in drivers/media/platform/qcom/, why? Maybe you should move it to
drivers/interconnect/qcom/

> diff --git a/drivers/media/platform/qcom/Kconfig b/drivers/media/platform/qcom/Kconfig
> index 4f4d3a68e6e5..95ea812c4996 100644
> --- a/drivers/media/platform/qcom/Kconfig
> +++ b/drivers/media/platform/qcom/Kconfig
> @@ -4,4 +4,5 @@ comment "Qualcomm media platform drivers"
>   
>   source "drivers/media/platform/qcom/camss/Kconfig"
>   source "drivers/media/platform/qcom/iris/Kconfig"
> +source "drivers/media/platform/qcom/cam-icc/Kconfig"
>   source "drivers/media/platform/qcom/venus/Kconfig"
> diff --git a/drivers/media/platform/qcom/Makefile b/drivers/media/platform/qcom/Makefile
> index ea2221a202c0..f5b95ba6dd98 100644
> --- a/drivers/media/platform/qcom/Makefile
> +++ b/drivers/media/platform/qcom/Makefile
> @@ -1,4 +1,5 @@
>   # SPDX-License-Identifier: GPL-2.0-only
>   obj-y += camss/
>   obj-y += iris/
> +obj-y += cam-icc/
>   obj-y += venus/
> diff --git a/drivers/media/platform/qcom/cam-icc/Kconfig b/drivers/media/platform/qcom/cam-icc/Kconfig
> new file mode 100644
> index 000000000000..8fae973ce1b0
> --- /dev/null
> +++ b/drivers/media/platform/qcom/cam-icc/Kconfig
> @@ -0,0 +1,14 @@
> +# SPDX-License-Identifier: GPL-2.0-only
> +config QCOM_CAM_ICC
> +	tristate "Qualcomm Titan camera NoC core driver"
> +	depends on ARCH_QCOM || COMPILE_TEST
> +	depends on COMMON_CLK && PM
> +	depends on INTERCONNECT
> +	select PM_OPP
> +	default ARCH_QCOM
> +	help
> +	  Core driver for the camera NoC of Qualcomm SoCs. It manages the
> +	  camera NoC resources shared by the camera drivers (CAMSS).
> +
> +	  To compile this driver as a module, choose M here: the module
> +	  will be called qcom-cam-icc.
> diff --git a/drivers/media/platform/qcom/cam-icc/Makefile b/drivers/media/platform/qcom/cam-icc/Makefile
[..]
> +++ b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.c
> @@ -0,0 +1,670 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +/*
> + * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
> + */
> +
> +#include <linux/bitfield.h>
> +#include <linux/bits.h>
> +#include <linux/clk.h>
> +#include <linux/device.h>
> +#include <linux/err.h>
> +#include <linux/interconnect-provider.h>
> +#include <linux/interconnect.h>
> +#include <linux/interrupt.h>
> +#include <linux/io.h>
> +#include <linux/math64.h>
> +#include <linux/minmax.h>
> +#include <linux/module.h>
> +#include <linux/of.h>
> +#include <linux/of_platform.h>
> +#include <linux/platform_device.h>
> +#include <linux/pm_domain.h>
> +#include <linux/pm_opp.h>
> +#include <linux/pm_runtime.h>
> +#include <linux/property.h>
> +#include <linux/slab.h>
> +
> +#include <media/qcom-cam-icc.h>
> +
> +#include "qcom-cam-icc-core.h"
> +
> +#define QCOM_CAM_ICC_MIN_BW_KBPS	3000000

Why is this 3GB/s floor? Why not use kBps_to_icc() or MBps_to_icc() etc?

> +#define QCOM_CAM_ICC_BUS_WIDTH		32
> +#define QCOM_CAM_ICC_MARGIN_PCT		20

Please explain this 20% margin? Is it an arbitrary number?

> +#define QCOM_CAM_ICC_CFG_KBPS		76800
> +#define QCOM_CAM_ICC_AHB_RATE		80000000
> +/* Set minimum bandwidth required to keep data path functional */
> +#define QCOM_CAM_ICC_HF_MIN_KBPS	1

What actually needs the MM NoC up while the camera NoC is resumed - maybe the
QoS writes? The "SF" path gets no such vote?

> +
> +#define QCOM_CAM_ICC_ERL_MAINCTL		0x08
> +#define QCOM_CAM_ICC_ERL_MAINCTL_STALL_EN	BIT(0)
> +#define QCOM_CAM_ICC_ERL_MAINCTL_FAULT_EN	BIT(1)
> +#define QCOM_CAM_ICC_ERL_ERRCLR			0x18
> +#define QCOM_CAM_ICC_ERL_ERRLOG0		0x20
> +#define QCOM_CAM_ICC_ERL_ERRLOG0_CODE		GENMASK(10, 8)
> +#define QCOM_CAM_ICC_ERL_ERRLOG1		0x28
> +
> +struct qcom_cam_icc {
> +	struct device *dev;
> +	const struct qcom_cam_icc_data *data;
> +	void __iomem *base;
> +	int irq;
> +	u32 irq_mask;
> +	struct clk_bulk_data *clks;
> +	int num_clks;
> +	struct clk *axi_clk;
> +	struct clk *ahb_clk;
> +	struct icc_provider provider;
> +	struct icc_onecell_data *icc_data;
> +	u64 axi_rate;
> +	unsigned long ahb_rate;
> +	struct dev_pm_domain_list *pd_list;
> +	struct dev_pm_domain_list *rail_pd_list;
> +	struct icc_path *cfg_path;
> +	struct icc_path *hf_path;
> +};
> +
> +static int qcom_cam_icc_icc_aggregate(struct icc_node *node, u32 tag, u32 avg_bw,
> +				      u32 peak_bw, u32 *agg_avg, u32 *agg_peak)
> +{
> +	const struct qcom_cam_icc_node *desc = node->data;
> +
> +	if (desc->merge == QCOM_CAM_ICC_MERGE_SUM_INTERLEAVE) {
> +		avg_bw /= 2;
> +		peak_bw /= 2;
> +	}

Please explain this aggregation policy. With one or two equal clients behind an
internal node, the un-halved port value wins. Looks like halving only matters from
three clients up. Is that the intended behavior?

> +
> +	*agg_avg += avg_bw;
> +	*agg_peak = max(*agg_peak, peak_bw);
> +
> +	return 0;
> +}
> +
> +static u64 qcom_cam_icc_axi_rate(struct qcom_cam_icc *camnoc)
> +{
> +	const struct qcom_cam_icc_data *data = camnoc->data;
> +	u64 bw = 0;
> +	size_t i;
> +
> +	for (i = 0; i < data->num_nodes; i++) {
> +		const struct qcom_cam_icc_node *desc = &data->nodes[i];
> +		struct icc_node *node = camnoc->icc_data->nodes[desc->id];
> +
> +		if (!desc->rate_node || !node)
> +			continue;
> +
> +		bw = max_t(u64, bw, max(node->avg_bw, node->peak_bw));
> +	}
> +
> +	if (!bw)
> +		return 0;
> +
> +	bw += div_u64(bw * QCOM_CAM_ICC_MARGIN_PCT, 100);
> +	bw = max_t(u64, bw, QCOM_CAM_ICC_MIN_BW_KBPS);
> +
> +	return div_u64(bw * 1000, QCOM_CAM_ICC_BUS_WIDTH);
> +}
> +
> +static int qcom_cam_icc_set_axi_rate(struct qcom_cam_icc *camnoc, u64 rate)
> +{
> +	unsigned long freq = min_t(u64, rate, ULONG_MAX);
> +	struct dev_pm_opp *opp;
> +	int ret;
> +
> +	if (!rate) {
> +		ret = clk_set_min_rate(camnoc->axi_clk, 0);
> +		if (ret)
> +			return ret;
> +
> +		ret = clk_set_rate(camnoc->axi_clk, 0);
> +		if (ret)
> +			return ret;
> +
> +		return dev_pm_opp_set_opp(camnoc->dev, NULL);
> +	}
> +
> +	opp = dev_pm_opp_find_freq_ceil(camnoc->dev, &freq);
> +	if (IS_ERR(opp))
> +		opp = dev_pm_opp_find_freq_floor(camnoc->dev, &freq);
> +	if (IS_ERR(opp))
> +		return PTR_ERR(opp);
> +
> +	ret = dev_pm_opp_set_opp(camnoc->dev, opp);
> +	dev_pm_opp_put(opp);
> +
> +	return ret;
> +}

Have you tried to run this with a real client and PROVE_LOCKING enabled?

> +
> +static int qcom_cam_icc_update(struct qcom_cam_icc *camnoc)
> +{
> +	struct icc_node *ahb = camnoc->icc_data->nodes[camnoc->data->ahb_id];
> +	unsigned long ahb_rate;
> +	u64 rate;
> +	int ret;
> +
> +	rate = qcom_cam_icc_axi_rate(camnoc);
> +	ahb_rate = (ahb && (ahb->avg_bw || ahb->peak_bw)) ? QCOM_CAM_ICC_AHB_RATE : 0;
> +	if (rate == camnoc->axi_rate && ahb_rate == camnoc->ahb_rate)
> +		return 0;
> +
> +	if (rate != camnoc->axi_rate) {
> +		ret = qcom_cam_icc_set_axi_rate(camnoc, rate);
> +		if (ret)
> +			return ret;
> +
> +		camnoc->axi_rate = rate;
> +	}
> +
> +	if (ahb_rate != camnoc->ahb_rate) {
> +		ret = clk_set_min_rate(camnoc->ahb_clk, ahb_rate);
> +		if (ret)
> +			return ret;
> +
> +		ret = clk_set_rate(camnoc->ahb_clk, ahb_rate);
> +		if (ret)
> +			return ret;

This will leave the AXI rate applied and cached if the AHB step fails?

> +
> +		camnoc->ahb_rate = ahb_rate;
> +	}
> +
> +	dev_dbg(camnoc->dev, "axi %llu Hz, cpas_ahb %lu Hz\n", rate, ahb_rate);
> +
> +	return 0;
> +}
> +
> +static int qcom_cam_icc_icc_set(struct icc_node *src, struct icc_node *dst)
> +{
> +	struct qcom_cam_icc *camnoc = container_of(src->provider, struct qcom_cam_icc, provider);
> +
> +	return qcom_cam_icc_update(camnoc);
> +}
> +
> +static int qcom_cam_icc_icc_get_bw(struct icc_node *node, u32 *avg, u32 *peak)
> +{
> +	*avg = 0;
> +	*peak = 0;
> +
> +	return 0;
> +}
> +
> +static int qcom_cam_icc_icc_link_path(struct qcom_cam_icc *camnoc,
> +				      struct icc_node *node, const char *path)
> +{
> +	struct device_node *np = camnoc->dev->of_node;
> +	struct icc_node_data *link_data;
> +	struct of_phandle_args args;
> +	struct icc_node *link;
> +	int idx, ret;
> +
> +	idx = of_property_match_string(np, "interconnect-names", path);
> +	if (idx < 0)
> +		return idx;
> +
> +	ret = of_parse_phandle_with_args(np, "interconnects", "#interconnect-cells", idx * 2,
> +					 &args);
> +	if (ret)
> +		return ret;
> +
> +	link_data = of_icc_get_from_provider(&args);
> +	of_node_put(args.np);
> +	if (IS_ERR(link_data))
> +		return PTR_ERR(link_data);
> +
> +	link = link_data->node;
> +	kfree(link_data);
> +
> +	return icc_link_nodes(node, &link);
> +}
> +
> +static struct icc_node_data *qcom_cam_icc_xlate(const struct of_phandle_args *spec, void *data)
> +{
> +	struct icc_node_data *ndata;
> +	struct icc_node *node;
> +
> +	node = of_icc_xlate_onecell(spec, data);
> +	if (IS_ERR(node))
> +		return ERR_CAST(node);
> +
> +	ndata = kzalloc_obj(*ndata);
> +	if (!ndata)
> +		return ERR_PTR(-ENOMEM);
> +
> +	ndata->node = node;
> +	ndata->tag = spec->args[1];
> +
> +	return ndata;
> +}

Looks like a copy of the existing qcom_icc_xlate_extended()

> +
> +static int qcom_cam_icc_icc_init(struct qcom_cam_icc *camnoc)
> +{
> +	const struct qcom_cam_icc_data *data = camnoc->data;
> +	struct icc_provider *provider = &camnoc->provider;
> +	struct icc_onecell_data *icc_data;
> +	size_t i;
> +	int ret;
> +
> +	icc_data = devm_kzalloc(camnoc->dev, struct_size(icc_data, nodes, data->num_ids),
> +				GFP_KERNEL);
> +	if (!icc_data)
> +		return -ENOMEM;
> +
> +	icc_data->num_nodes = data->num_ids;
> +	camnoc->icc_data = icc_data;
> +
> +	provider->dev = camnoc->dev;
> +	provider->set = qcom_cam_icc_icc_set;
> +	provider->aggregate = qcom_cam_icc_icc_aggregate;
> +	provider->get_bw = qcom_cam_icc_icc_get_bw;
> +	provider->xlate_extended = qcom_cam_icc_xlate;

Why not use qcom_icc_xlate_extended() ?

> +	provider->data = icc_data;
> +	icc_provider_init(provider);
> +
> +	for (i = 0; i < data->num_nodes; i++) {
> +		const struct qcom_cam_icc_node *desc = &data->nodes[i];
> +		struct icc_node *node;
> +
> +		node = icc_node_create_dyn();
> +		if (IS_ERR(node)) {
> +			ret = PTR_ERR(node);
> +			goto err_remove_nodes;
> +		}
> +
> +		ret = icc_node_set_name(node, provider, desc->name);
> +		if (ret) {
> +			icc_node_destroy(node->id);
> +			goto err_remove_nodes;
> +		}
> +
> +		node->data = (void *)desc;
> +		icc_data->nodes[desc->id] = node;
> +		icc_node_add(node, provider);
> +	}
> +
> +	for (i = 0; i < data->num_nodes; i++) {
> +		const struct qcom_cam_icc_node *desc = &data->nodes[i];
> +
> +		if (desc->link_path)
> +			ret = qcom_cam_icc_icc_link_path(camnoc, icc_data->nodes[desc->id],
> +							 desc->link_path);
> +		else
> +			ret = icc_link_nodes(icc_data->nodes[desc->id],
> +					     &icc_data->nodes[desc->link]);
> +		if (ret)
> +			goto err_remove_nodes;
> +	}
> +
> +	ret = icc_provider_register(provider);
> +	if (ret)
> +		goto err_remove_nodes;
> +
> +	return 0;
> +
> +err_remove_nodes:
> +	icc_nodes_remove(provider);
> +
> +	return ret;
> +}
> +
> +static void qcom_cam_icc_qos_init(struct qcom_cam_icc *camnoc)
> +{
> +	const struct qcom_cam_icc_data *data = camnoc->data;
> +	size_t i;
> +
> +	for (i = 0; i < data->num_qos; i++)
> +		writel(data->qos[i].value, camnoc->base + data->qos[i].offset);
> +}
> +
> +static void qcom_cam_icc_irq_init(struct qcom_cam_icc *camnoc)
> +{
> +	const struct qcom_cam_icc_data *data = camnoc->data;
> +	size_t i;
> +
> +	writel(data->sbm->clear_val, camnoc->base + data->sbm->clear_reg);
> +

We dereference data->sbm unconditionally while err_logger is optional. Maybe make it
consistent?

> +	for (i = 0; i < data->num_irq_errs; i++) {
> +		const struct qcom_cam_icc_irq_err *err = &data->irq_errs[i];
> +
> +		writel(1, camnoc->base + err->base + err->clear_off);
> +		writel(err->enable_val, camnoc->base + err->base + err->enable_off);
> +	}
> +
> +	if (data->err_logger) {
> +		writel(1, camnoc->base + data->err_logger->base + QCOM_CAM_ICC_ERL_ERRCLR);
> +		writel(QCOM_CAM_ICC_ERL_MAINCTL_STALL_EN | QCOM_CAM_ICC_ERL_MAINCTL_FAULT_EN,
> +		       camnoc->base + data->err_logger->base + QCOM_CAM_ICC_ERL_MAINCTL);
> +	}
> +
> +	writel(camnoc->irq_mask, camnoc->base + data->sbm->enable_reg);
> +}
> +
> +static void qcom_cam_icc_erl_handle(struct qcom_cam_icc *camnoc)
> +{
> +	void __iomem *erl = camnoc->base + camnoc->data->err_logger->base;
> +	u32 log0 = readl(erl + QCOM_CAM_ICC_ERL_ERRLOG0);
> +
> +	dev_err_ratelimited(camnoc->dev, "slave error, code %lu, errlog0 %#x, errlog1 %#x\n",
> +			    FIELD_GET(QCOM_CAM_ICC_ERL_ERRLOG0_CODE, log0), log0,
> +			    readl(erl + QCOM_CAM_ICC_ERL_ERRLOG1));
> +	writel(1, erl + QCOM_CAM_ICC_ERL_ERRCLR);
> +}
> +
> +static irqreturn_t qcom_cam_icc_irq(int irq, void *dev_id)
> +{
> +	struct qcom_cam_icc *camnoc = dev_id;
> +	const struct qcom_cam_icc_data *data = camnoc->data;
> +	u32 status, pending;
> +	size_t i;
> +
> +	if (pm_runtime_get_if_active(camnoc->dev) <= 0)
> +		return IRQ_NONE;
> +
> +	status = readl(camnoc->base + data->sbm->status_reg);
> +	pending = status & camnoc->irq_mask;
> +	if (!pending) {
> +		pm_runtime_put(camnoc->dev);
> +		return IRQ_NONE;
> +	}
> +
> +	if (data->err_logger && (pending & data->err_logger->sbm_mask))
> +		qcom_cam_icc_erl_handle(camnoc);
> +
> +	for (i = 0; i < data->num_irq_errs; i++) {
> +		const struct qcom_cam_icc_irq_err *err = &data->irq_errs[i];
> +
> +		if (!(pending & err->sbm_mask))
> +			continue;
> +
> +		dev_err_ratelimited(camnoc->dev, "%s error, status %#x\n", err->name,
> +				    readl(camnoc->base + err->base + err->status_off));
> +		writel(1, camnoc->base + err->base + err->clear_off);
> +	}
> +
> +	writel(data->sbm->clear_val, camnoc->base + data->sbm->clear_reg);
> +
> +	pm_runtime_put(camnoc->dev);
> +
> +	return IRQ_HANDLED;
> +}
> +
> +static int qcom_cam_icc_irq_request(struct platform_device *pdev, struct qcom_cam_icc *camnoc)
> +{
> +	const struct qcom_cam_icc_data *data = camnoc->data;
> +	size_t i;
> +	int irq;
> +
> +	for (i = 0; i < data->num_irq_errs; i++)
> +		camnoc->irq_mask |= data->irq_errs[i].sbm_mask;
> +
> +	if (data->err_logger)
> +		camnoc->irq_mask |= data->err_logger->sbm_mask;
> +
> +	irq = platform_get_irq(pdev, 0);
> +	if (irq < 0)
> +		return irq;
> +
> +	camnoc->irq = irq;
> +
> +	return devm_request_threaded_irq(camnoc->dev, irq, NULL, qcom_cam_icc_irq, IRQF_ONESHOT,
> +					 dev_name(camnoc->dev), camnoc);
> +}
> +
> +static int qcom_cam_icc_runtime_suspend(struct device *dev)
> +{
> +	struct qcom_cam_icc *camnoc = dev_get_drvdata(dev);
> +
> +	clk_bulk_disable_unprepare(camnoc->num_clks, camnoc->clks);
> +	icc_set_bw(camnoc->hf_path, 0, 0);
> +	icc_set_bw(camnoc->cfg_path, 0, 0);
> +
> +	return 0;
> +}
> +
> +static int qcom_cam_icc_runtime_resume(struct device *dev)
> +{
> +	struct qcom_cam_icc *camnoc = dev_get_drvdata(dev);
> +	int ret;
> +
> +	ret = icc_set_bw(camnoc->cfg_path, 0, QCOM_CAM_ICC_CFG_KBPS);
> +	if (ret)
> +		return ret;
> +
> +	ret = icc_set_bw(camnoc->hf_path, 0, QCOM_CAM_ICC_HF_MIN_KBPS);
> +	if (ret)
> +		goto err_cfg;
> +
> +	ret = clk_bulk_prepare_enable(camnoc->num_clks, camnoc->clks);
> +	if (ret)
> +		goto err_cfg;
> +
> +	qcom_cam_icc_qos_init(camnoc);
> +	qcom_cam_icc_irq_init(camnoc);
> +
> +	return 0;
> +
> +err_cfg:
> +	icc_set_bw(camnoc->hf_path, 0, 0);
> +	icc_set_bw(camnoc->cfg_path, 0, 0);
> +
> +	return ret;
> +}
> +
> +static int qcom_cam_icc_suspend(struct device *dev)
> +{
> +	struct qcom_cam_icc *camnoc = dev_get_drvdata(dev);
> +	int ret;
> +
> +	disable_irq(camnoc->irq);
> +
> +	ret = pm_runtime_force_suspend(dev);
> +	if (ret)
> +		enable_irq(camnoc->irq);
> +
> +	return ret;
> +}
> +
> +static int qcom_cam_icc_resume(struct device *dev)
> +{
> +	struct qcom_cam_icc *camnoc = dev_get_drvdata(dev);
> +	int ret;
> +
> +	ret = pm_runtime_force_resume(dev);
> +	if (ret)
> +		return ret;
> +
> +	enable_irq(camnoc->irq);
> +
> +	return 0;
> +}
> +
> +static const struct dev_pm_ops qcom_cam_icc_pm_ops = {
> +	SYSTEM_SLEEP_PM_OPS(qcom_cam_icc_suspend, qcom_cam_icc_resume)
> +	RUNTIME_PM_OPS(qcom_cam_icc_runtime_suspend, qcom_cam_icc_runtime_resume, NULL)
> +};
> +
> +static const char * const qcom_cam_icc_pd_names[] = { "top" };
> +
> +static const struct dev_pm_domain_attach_data qcom_cam_icc_pd_data = {
> +	.pd_names = qcom_cam_icc_pd_names,
> +	.num_pd_names = ARRAY_SIZE(qcom_cam_icc_pd_names),
> +};
> +
> +static int qcom_cam_icc_pd_init(struct qcom_cam_icc *camnoc)
> +{
> +	int ret;
> +
> +	ret = devm_pm_domain_attach_list(camnoc->dev, &qcom_cam_icc_pd_data, &camnoc->pd_list);
> +	if (ret < 0)
> +		return ret;
> +
> +	ret = devm_pm_domain_attach_list(camnoc->dev, camnoc->data->rail_pd_data,
> +					 &camnoc->rail_pd_list);
> +	if (ret < 0)
> +		return ret;
> +
> +	return 0;
> +}
> +
> +static int qcom_cam_icc_config_clks(struct device *dev, struct opp_table *opp_table,
> +				    struct dev_pm_opp *opp, void *data, bool scaling_down)
> +{
> +	struct qcom_cam_icc *camnoc = dev_get_drvdata(dev);
> +	unsigned long freq = dev_pm_opp_get_freq(opp);
> +	int ret;
> +
> +	ret = clk_set_min_rate(camnoc->axi_clk, freq);
> +	if (ret)
> +		return ret;
> +
> +	return clk_set_rate(camnoc->axi_clk, freq);
> +}
> +
> +static int qcom_cam_icc_opp_init(struct qcom_cam_icc *camnoc)
> +{
> +	struct dev_pm_opp_config config = {
> +		.clk_names = (const char *[]){ camnoc->data->rate_clk, NULL },
> +		.config_clks = qcom_cam_icc_config_clks,
> +	};
> +	int ret;
> +
> +	ret = devm_pm_opp_set_config(camnoc->dev, &config);
> +	if (ret)
> +		return ret;
> +
> +	return devm_pm_opp_of_add_table(camnoc->dev);
> +}
> +
> +static const struct of_device_id qcom_cam_icc_of_match[] = {
> +	{ }
> +};
> +MODULE_DEVICE_TABLE(of, qcom_cam_icc_of_match);
> +
> +/**
> + * qcom_cam_icc_link() - link a camera NoC client to the camera NoC
> + * @client: client device with a camera NoC path in its "interconnects"
> + *
> + * Add a runtime PM device link from @client to the camera NoC, so that a
> + * runtime resume of @client resumes the camera NoC first. @client must get
> + * its camera NoC interconnect path before this call.
> + *
> + * Return: 0 on success, -ENODEV if @client has no camera NoC path,
> + * -EPROBE_DEFER if the camera NoC device is not created yet, or another
> + * negative error code.
> + */
> +int qcom_cam_icc_link(struct device *client)
> +{
> +	struct platform_device *pdev;
> +	struct of_phandle_args args;
> +	struct device_link *link;
> +	int i;
> +
> +	for (i = 0; ; i++) {
> +		if (of_parse_phandle_with_args(client->of_node, "interconnects",
> +					       "#interconnect-cells", i, &args))
> +			return -ENODEV;
> +
> +		if (of_match_node(qcom_cam_icc_of_match, args.np))
> +			break;
> +
> +		of_node_put(args.np);
> +	}
> +
> +	pdev = of_find_device_by_node(args.np);
> +	of_node_put(args.np);
> +	if (!pdev)
> +		return -EPROBE_DEFER;
> +
> +	link = device_link_add(client, &pdev->dev,
> +			       DL_FLAG_PM_RUNTIME | DL_FLAG_AUTOREMOVE_CONSUMER);
> +	put_device(&pdev->dev);
> +
> +	return link ? 0 : -EINVAL;
> +}
> +EXPORT_SYMBOL_GPL(qcom_cam_icc_link);

This is exported, but i see no user?

> +
> +static int qcom_cam_icc_probe(struct platform_device *pdev)
> +{
> +	struct device *dev = &pdev->dev;
> +	struct qcom_cam_icc *camnoc;
> +	int ret;
> +
> +	camnoc = devm_kzalloc(dev, sizeof(*camnoc), GFP_KERNEL);
> +	if (!camnoc)
> +		return -ENOMEM;
> +
> +	camnoc->dev = dev;
> +	camnoc->data = device_get_match_data(dev);

Should we check for NULL here?

> +
> +	camnoc->base = devm_platform_ioremap_resource(pdev, 0);
> +	if (IS_ERR(camnoc->base))
> +		return PTR_ERR(camnoc->base);
> +
> +	camnoc->num_clks = devm_clk_bulk_get_all(dev, &camnoc->clks);
> +	if (camnoc->num_clks < 0)
> +		return dev_err_probe(dev, camnoc->num_clks, "failed to get clocks\n");
> +
> +	camnoc->axi_clk = devm_clk_get(dev, camnoc->data->rate_clk);
> +	if (IS_ERR(camnoc->axi_clk))
> +		return dev_err_probe(dev, PTR_ERR(camnoc->axi_clk), "no %s clock\n",
> +				     camnoc->data->rate_clk);
> +
> +	camnoc->ahb_clk = devm_clk_get(dev, "cpas_ahb");
> +	if (IS_ERR(camnoc->ahb_clk))
> +		return dev_err_probe(dev, PTR_ERR(camnoc->ahb_clk), "no cpas_ahb clock\n");
> +
> +	camnoc->cfg_path = devm_of_icc_get(dev, "cfg");
> +	if (IS_ERR(camnoc->cfg_path))
> +		return dev_err_probe(dev, PTR_ERR(camnoc->cfg_path),
> +				     "failed to get the cfg path\n");
> +
> +	camnoc->hf_path = devm_of_icc_get(dev, "hf");
> +	if (IS_ERR(camnoc->hf_path))
> +		return dev_err_probe(dev, PTR_ERR(camnoc->hf_path),
> +				     "failed to get the hf path\n");
> +
> +	platform_set_drvdata(pdev, camnoc);
> +
> +	ret = qcom_cam_icc_pd_init(camnoc);
> +	if (ret)
> +		return dev_err_probe(dev, ret, "failed to attach the power domains\n");
> +
> +	ret = qcom_cam_icc_opp_init(camnoc);
> +	if (ret)
> +		return dev_err_probe(dev, ret, "failed to add the OPP table\n");
> +
> +	ret = qcom_cam_icc_irq_request(pdev, camnoc);
> +	if (ret)
> +		return dev_err_probe(dev, ret, "failed to request the interrupt\n");
> +
> +	ret = devm_pm_runtime_enable(dev);
> +	if (ret)
> +		return ret;
> +
> +	ret = qcom_cam_icc_icc_init(camnoc);
> +	if (ret)
> +		return dev_err_probe(dev, ret, "failed to register the interconnect provider\n");
> +
> +	return 0;
> +}
> +
> +static void qcom_cam_icc_remove(struct platform_device *pdev)
> +{
> +	struct qcom_cam_icc *camnoc = platform_get_drvdata(pdev);
> +
> +	icc_provider_deregister(&camnoc->provider);
> +	icc_nodes_remove(&camnoc->provider);
> +}
> +
> +static struct platform_driver qcom_cam_icc_driver = {
> +	.probe = qcom_cam_icc_probe,
> +	.remove = qcom_cam_icc_remove,
> +	.driver = {
> +		.name = "qcom-cam-icc",
> +		.of_match_table = qcom_cam_icc_of_match,
> +		.pm = pm_ptr(&qcom_cam_icc_pm_ops),
> +		.sync_state = icc_sync_state,
> +	},
> +};
> +module_platform_driver(qcom_cam_icc_driver);
> +
> +MODULE_DESCRIPTION("Qualcomm Titan camera NoC core driver");
> +MODULE_LICENSE("GPL");
> 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
> new file mode 100644
> index 000000000000..eee7eb9c4c2d
> --- /dev/null
> +++ b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.h
> @@ -0,0 +1,127 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +/*
> + * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
> + */
> +
> +#ifndef __QCOM_CAM_ICC_CORE_H__
> +#define __QCOM_CAM_ICC_CORE_H__
> +
> +#include <linux/types.h>
> +
> +struct dev_pm_domain_attach_data;
> +
> +#define QCOM_CAM_ICC_PRIORITYLUT_LOW	0x30
> +#define QCOM_CAM_ICC_PRIORITYLUT_HIGH	0x34
> +#define QCOM_CAM_ICC_URGENCY_LOW	0x38
> +#define QCOM_CAM_ICC_DANGERLUT_LOW	0x40
> +#define QCOM_CAM_ICC_SAFELUT_LOW	0x48
> +#define QCOM_CAM_ICC_MAINCTL_LOW	0x08
> +#define QCOM_CAM_ICC_SHAPING_LOW	0x20
> +#define QCOM_CAM_ICC_SHAPING_HIGH	0x24
> +#define QCOM_CAM_ICC_DECERRSTATUS_LOW	0x110
> +#define QCOM_CAM_ICC_DECERRCLR_LOW	0x118
> +#define QCOM_CAM_ICC_DECERREN_LOW	0x120
> +#define QCOM_CAM_ICC_ENCCTL_LOW		0x188
> +#define QCOM_CAM_ICC_ENCERRSTATUS_LOW	0x190
> +#define QCOM_CAM_ICC_ENCERRCLR_LOW	0x198
> +#define QCOM_CAM_ICC_ENCERREN_LOW	0x1a0

I don't see where all these are used? Please remove what is unused.

> +
> +enum qcom_cam_icc_merge {
> +	QCOM_CAM_ICC_MERGE_SUM,
> +	QCOM_CAM_ICC_MERGE_SUM_INTERLEAVE,
> +};
> +
> +struct qcom_cam_icc_node {
> +	const char *name;
> +	u16 id;
> +	u16 link;
> +	enum qcom_cam_icc_merge merge;
> +	bool rate_node;
> +	const char *link_path;
> +};
> +
> +struct qcom_cam_icc_qos {
> +	u32 offset;
> +	u32 value;
> +};
> +
> +struct qcom_cam_icc_sbm {
> +	u32 enable_reg;
> +	u32 status_reg;
> +	u32 clear_reg;
> +	u32 clear_val;
> +};
> +
> +struct qcom_cam_icc_irq_err {
> +	const char *name;
> +	u32 sbm_mask;
> +	u32 base;
> +	u32 enable_off;
> +	u32 enable_val;
> +	u32 status_off;
> +	u32 clear_off;
> +};
> +
> +struct qcom_cam_icc_erl {
> +	u32 base;
> +	u32 sbm_mask;
> +};
> +
> +struct qcom_cam_icc_data {
> +	const char *rate_clk;
> +	const struct qcom_cam_icc_node *nodes;
> +	size_t num_nodes;
> +	size_t num_ids;
> +	u16 ahb_id;
> +	const struct dev_pm_domain_attach_data *rail_pd_data;
> +	const struct qcom_cam_icc_qos *qos;
> +	size_t num_qos;
> +	const struct qcom_cam_icc_sbm *sbm;
> +	const struct qcom_cam_icc_irq_err *irq_errs;
> +	size_t num_irq_errs;
> +	const struct qcom_cam_icc_erl *err_logger;
> +};
> +
> +#define CAMNOC_PORT(_id, _name, _link)			\
> +	{						\
> +		.name = _name,				\
> +		.id = _id,				\
> +		.link = _link,				\
> +		.merge = QCOM_CAM_ICC_MERGE_SUM,	\
> +		.rate_node = true,			\
> +	}
> +
> +#define CAMNOC_INTERNAL(_id, _name, _link, _merge)	\
> +	{						\
> +		.name = _name,				\
> +		.id = _id,				\
> +		.link = _link,				\
> +		.merge = _merge,			\
> +		.rate_node = true,			\
> +	}
> +
> +#define CAMNOC_LINK_SLAVE(_id, _name, _link_path)	\
> +	{						\
> +		.name = _name,				\
> +		.id = _id,				\
> +		.link_path = _link_path,		\
> +	}
> +
> +#define CAMNOC_QOS(_base, _reg, _value)				\
> +	{							\
> +		.offset = (_base) + QCOM_CAM_ICC_##_reg,	\
> +		.value = _value,				\
> +	}
> +
> +#define CAMNOC_IRQ_ERR(_name, _mask, _base, _type, _enable_val)		\
> +	{								\
> +		.name = _name,						\
> +		.sbm_mask = _mask,					\
> +		.base = _base,						\
> +		.enable_off = QCOM_CAM_ICC_##_type##ERREN_LOW,		\
> +		.enable_val = _enable_val,				\
> +		.status_off = QCOM_CAM_ICC_##_type##ERRSTATUS_LOW,	\
> +		.clear_off = QCOM_CAM_ICC_##_type##ERRCLR_LOW,		\
> +	}
> +
> +#endif
> diff --git a/include/media/qcom-cam-icc.h b/include/media/qcom-cam-icc.h
> new file mode 100644
> index 000000000000..68c230687377
> --- /dev/null
> +++ b/include/media/qcom-cam-icc.h
> @@ -0,0 +1,26 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +/*
> + * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
> + */
> +
> +#ifndef __MEDIA_QCOM_CAM_ICC_H__
> +#define __MEDIA_QCOM_CAM_ICC_H__
> +
> +#include <linux/errno.h>
> +
> +struct device;
> +
> +#if IS_ENABLED(CONFIG_QCOM_CAM_ICC)

I would expect that with a tristate and an IS_ENABLED() stub, a built-in client
against a modular provider will fail to link. Is this a possible scenario?

> +
> +int qcom_cam_icc_link(struct device *client);
> +
> +#else
> +
> +static inline int qcom_cam_icc_link(struct device *client)
> +{
> +	return -ENODEV;
> +}
> +
> +#endif
> +
> +#endif

Thanks,
Georgi

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2026-12-04 12:25 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04  7:53 [PATCH v2 00/10] Add the Qualcomm Titan camera NoC interconnect provider Atanas Filipov
2026-12-04  7:53 ` [PATCH v2 01/10] dt-bindings: interconnect: add the Qualcomm SM8250 Titan camera NoC Atanas Filipov
2026-12-04  8:01   ` sashiko-bot
2026-12-04  7:53 ` [PATCH v2 02/10] dt-bindings: interconnect: add the Qualcomm SC7280 " Atanas Filipov
2026-12-04  8:04   ` sashiko-bot
2026-12-04 11:10   ` Bryan O'Donoghue
2026-12-04  7:53 ` [PATCH v2 03/10] dt-bindings: interconnect: add the Qualcomm SA8775P " Atanas Filipov
2026-12-04  8:04   ` sashiko-bot
2026-12-04 11:14   ` Bryan O'Donoghue
2026-12-04  7:53 ` [PATCH v2 04/10] media: qcom: cam-icc: add the Titan camera NoC driver Atanas Filipov
2026-12-04  8:27   ` sashiko-bot
2026-12-04 11:33   ` Bryan O'Donoghue
2026-12-04 12:25   ` Georgi Djakov
2026-12-04  7:53 ` [PATCH v2 05/10] media: qcom: cam-icc: add the SM8250 data Atanas Filipov
2026-12-04  8:16   ` sashiko-bot
2026-12-04  7:53 ` [PATCH v2 06/10] media: qcom: cam-icc: add the SC7280 data Atanas Filipov
2026-12-04  7:53 ` [PATCH v2 07/10] media: qcom: cam-icc: add the SA8775P data Atanas Filipov
2026-12-04  8:19   ` sashiko-bot
2026-12-04  7:53 ` [PATCH v2 08/10] arm64: dts: qcom: sm8250: add the Titan camera NoC node Atanas Filipov
2026-12-04  8:25   ` sashiko-bot
2026-12-04  7:53 ` [PATCH v2 09/10] arm64: dts: qcom: sc7280: " Atanas Filipov
2026-12-04  8:30   ` sashiko-bot
2026-12-04  7:53 ` [PATCH v2 10/10] arm64: dts: qcom: sa8775p: " Atanas Filipov
2026-12-04  8:35   ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox