All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 00/14] CAMSS support for MSM8974
@ 2022-05-22 16:27 Luca Weiss
  2022-05-22 16:27 ` [RFC PATCH 01/14] media: dt-bindings: media: camss: Add qcom,msm8974-camss binding Luca Weiss
                   ` (14 more replies)
  0 siblings, 15 replies; 31+ messages in thread
From: Luca Weiss @ 2022-05-22 16:27 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: ~postmarketos/upstreaming, phone-devel, Loic Poulain,
	Robert Foss, Rob Herring, Krzysztof Kozlowski, Todor Tomov,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab, linux-i2c,
	devicetree, linux-kernel, linux-media, matti.lehtimaki,
	Luca Weiss

This RFC series adds support for CAMSS and CCI that are found on
msm8974, including the OV8865 found on the FP2.

The only reason it's marked RFC is that CAMSS doesn't behave properly on
this SoC without the last commit which is obviously not upstreamable.
Not sure if this should be a blocker for including most of the other
patches because other than that it seems to work fine and I can get a
picture from the camera sensor. When/if msm8974 gets IOMMU support I
hope this should be resolved and it works without this hack.

I think at least the CCI patches could get applied as they're not
dependent on the CAMSS hack?

Luca Weiss (5):
  dt-bindings: i2c: qcom-cci: add QCOM MSM8974 compatible
  ARM: dts: qcom: msm8974: add CCI bus
  ARM: dts: qcom: msm8974: add CAMSS node
  ARM: dts: qcom: msm8974-FP2: Add OV8865 rear camera
  [DNM] media: camss: hacks for MSM8974

Matti Lehtimäki (9):
  media: dt-bindings: media: camss: Add qcom,msm8974-camss binding
  media: camss: Add CAMSS_8x74 camss version
  media: camss: vfe: Add support for 8x74
  media: camss: video: Add support for 8x74
  media: camss: csid: Add support for 8x74
  media: camss: ispif: Add support for 8x74
  media: camss: csiphy: Add support for 8x74
  media: camss: Add 8x74 resources
  i2c: qcom-cci: add msm8974 compatible

 .../devicetree/bindings/i2c/i2c-qcom-cci.txt  |   7 +-
 .../bindings/media/qcom,msm8974-camss.yaml    | 321 ++++++++++++++++++
 arch/arm/boot/dts/qcom-msm8974.dtsi           | 184 ++++++++++
 .../dts/qcom-msm8974pro-fairphone-fp2.dts     |  70 ++++
 drivers/i2c/busses/i2c-qcom-cci.c             |  35 ++
 drivers/media/platform/qcom/camss/Kconfig     |   4 +-
 .../media/platform/qcom/camss/camss-csid.c    |   3 +-
 .../media/platform/qcom/camss/camss-csiphy.c  |   4 +-
 .../media/platform/qcom/camss/camss-ispif.c   |   5 +-
 drivers/media/platform/qcom/camss/camss-vfe.c |   7 +-
 .../media/platform/qcom/camss/camss-video.c   |  17 +-
 drivers/media/platform/qcom/camss/camss.c     | 161 +++++++++
 drivers/media/platform/qcom/camss/camss.h     |   1 +
 13 files changed, 801 insertions(+), 18 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/media/qcom,msm8974-camss.yaml

-- 
2.36.0


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

* [RFC PATCH 01/14] media: dt-bindings: media: camss: Add qcom,msm8974-camss binding
  2022-05-22 16:27 [RFC PATCH 00/14] CAMSS support for MSM8974 Luca Weiss
@ 2022-05-22 16:27 ` Luca Weiss
  2022-05-23 10:07   ` Krzysztof Kozlowski
  2022-05-22 16:27 ` [RFC PATCH 02/14] media: camss: Add CAMSS_8x74 camss version Luca Weiss
                   ` (13 subsequent siblings)
  14 siblings, 1 reply; 31+ messages in thread
From: Luca Weiss @ 2022-05-22 16:27 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: ~postmarketos/upstreaming, phone-devel, Loic Poulain,
	Robert Foss, Rob Herring, Krzysztof Kozlowski, Todor Tomov,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab, linux-i2c,
	devicetree, linux-kernel, linux-media, matti.lehtimaki,
	Luca Weiss

From: Matti Lehtimäki <matti.lehtimaki@gmail.com>

Add bindings for qcom,msm8974-camss in order to support the camera
subsystem on MSM8974.

Signed-off-by: Matti Lehtimäki <matti.lehtimaki@gmail.com>
Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
---
 .../bindings/media/qcom,msm8974-camss.yaml    | 321 ++++++++++++++++++
 1 file changed, 321 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/qcom,msm8974-camss.yaml

diff --git a/Documentation/devicetree/bindings/media/qcom,msm8974-camss.yaml b/Documentation/devicetree/bindings/media/qcom,msm8974-camss.yaml
new file mode 100644
index 000000000000..f8f71e477535
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/qcom,msm8974-camss.yaml
@@ -0,0 +1,321 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/media/qcom,msm8974-camss.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: Qualcomm CAMSS ISP
+
+maintainers:
+  - Robert Foss <robert.foss@linaro.org>
+
+description: |
+  The CAMSS IP is a CSI decoder and ISP present on Qualcomm platforms
+
+properties:
+  compatible:
+    const: qcom,msm8974-camss
+
+  clocks:
+    minItems: 31
+    maxItems: 31
+
+  clock-names:
+    items:
+      - const: top_ahb
+      - const: ispif_ahb
+      - const: csiphy0_timer
+      - const: csiphy1_timer
+      - const: csiphy2_timer
+      - const: csi0_ahb
+      - const: csi0
+      - const: csi0_phy
+      - const: csi0_pix
+      - const: csi0_rdi
+      - const: csi1_ahb
+      - const: csi1
+      - const: csi1_phy
+      - const: csi1_pix
+      - const: csi1_rdi
+      - const: csi2_ahb
+      - const: csi2
+      - const: csi2_phy
+      - const: csi2_pix
+      - const: csi2_rdi
+      - const: csi3_ahb
+      - const: csi3
+      - const: csi3_phy
+      - const: csi3_pix
+      - const: csi3_rdi
+      - const: vfe0
+      - const: vfe1
+      - const: csi_vfe0
+      - const: csi_vfe1
+      - const: iface
+      - const: bus
+
+  interrupts:
+    minItems: 10
+    maxItems: 10
+
+  interrupt-names:
+    items:
+      - const: csiphy0
+      - const: csiphy1
+      - const: csiphy2
+      - const: csid0
+      - const: csid1
+      - const: csid2
+      - const: csid3
+      - const: ispif
+      - const: vfe0
+      - const: vfe1
+
+  power-domains:
+    items:
+      - description: VFE GDSC - Video Front End, Global Distributed Switch Controller.
+
+  ports:
+    $ref: /schemas/graph.yaml#/properties/ports
+
+    description:
+      CSI input ports.
+
+    properties:
+      port@0:
+        $ref: /schemas/graph.yaml#/$defs/port-base
+        unevaluatedProperties: false
+        description:
+          Input port for receiving CSI data.
+
+        properties:
+          endpoint:
+            $ref: video-interfaces.yaml#
+            unevaluatedProperties: false
+
+            properties:
+              clock-lanes:
+                items:
+                  - const: 1
+
+              data-lanes:
+                minItems: 1
+                maxItems: 4
+
+            required:
+              - clock-lanes
+              - data-lanes
+
+      port@1:
+        $ref: /schemas/graph.yaml#/$defs/port-base
+        unevaluatedProperties: false
+        description:
+          Input port for receiving CSI data.
+
+        properties:
+          endpoint:
+            $ref: video-interfaces.yaml#
+            unevaluatedProperties: false
+
+            properties:
+              clock-lanes:
+                items:
+                  - const: 1
+
+              data-lanes:
+                minItems: 1
+                maxItems: 4
+
+            required:
+              - clock-lanes
+              - data-lanes
+
+      port@2:
+        $ref: /schemas/graph.yaml#/$defs/port-base
+        unevaluatedProperties: false
+        description:
+          Input port for receiving CSI data.
+
+        properties:
+          endpoint:
+            $ref: video-interfaces.yaml#
+            unevaluatedProperties: false
+
+            properties:
+              clock-lanes:
+                items:
+                  - const: 1
+
+              data-lanes:
+                minItems: 1
+                maxItems: 4
+
+            required:
+              - clock-lanes
+              - data-lanes
+
+  reg:
+    minItems: 14
+    maxItems: 14
+
+  reg-names:
+    items:
+      - const: csiphy0
+      - const: csiphy0_clk_mux
+      - const: csiphy1
+      - const: csiphy1_clk_mux
+      - const: csiphy2
+      - const: csiphy2_clk_mux
+      - const: csid0
+      - const: csid1
+      - const: csid2
+      - const: csid3
+      - const: ispif
+      - const: csi_clk_mux
+      - const: vfe0
+      - const: vfe1
+
+  vdda-supply:
+    description:
+      Definition of the regulator used as analog power supply.
+
+required:
+  - clock-names
+  - clocks
+  - compatible
+  - interrupt-names
+  - interrupts
+  - power-domains
+  - reg
+  - reg-names
+  - vdda-supply
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/clock/qcom,gcc-msm8974.h>
+    #include <dt-bindings/clock/qcom,mmcc-msm8974.h>
+    camss@fda00000 {
+        compatible = "qcom,msm8974-camss";
+        reg = <0xfda0ac00 0x200>,
+              <0xfda00030 0x4>,
+              <0xfda0b000 0x200>,
+              <0xfda00038 0x4>,
+              <0xfda0b400 0x200>,
+              <0xfda00040 0x4>,
+              <0xfda08000 0x100>,
+              <0xfda08400 0x100>,
+              <0xfda08800 0x100>,
+              <0xfda08c00 0x100>,
+              <0xfda0a000 0x800>,
+              <0xfda00020 0x10>,
+              <0xfda10000 0x1000>,
+              <0xfda14000 0x1000>;
+        reg-names = "csiphy0",
+                    "csiphy0_clk_mux",
+                    "csiphy1",
+                    "csiphy1_clk_mux",
+                    "csiphy2",
+                    "csiphy2_clk_mux",
+                    "csid0",
+                    "csid1",
+                    "csid2",
+                    "csid3",
+                    "ispif",
+                    "csi_clk_mux",
+                    "vfe0",
+                    "vfe1";
+        interrupts = <GIC_SPI 78 IRQ_TYPE_EDGE_RISING>,
+                     <GIC_SPI 79 IRQ_TYPE_EDGE_RISING>,
+                     <GIC_SPI 80 IRQ_TYPE_EDGE_RISING>,
+                     <GIC_SPI 51 IRQ_TYPE_EDGE_RISING>,
+                     <GIC_SPI 52 IRQ_TYPE_EDGE_RISING>,
+                     <GIC_SPI 53 IRQ_TYPE_EDGE_RISING>,
+                     <GIC_SPI 54 IRQ_TYPE_EDGE_RISING>,
+                     <GIC_SPI 55 IRQ_TYPE_EDGE_RISING>,
+                     <GIC_SPI 57 IRQ_TYPE_EDGE_RISING>,
+                     <GIC_SPI 58 IRQ_TYPE_EDGE_RISING>;
+        interrupt-names = "csiphy0",
+                          "csiphy1",
+                          "csiphy2",
+                          "csid0",
+                          "csid1",
+                          "csid2",
+                          "csid3",
+                          "ispif",
+                          "vfe0",
+                          "vfe1";
+        power-domains = <&mmcc CAMSS_VFE_GDSC>;
+        clocks = <&mmcc CAMSS_TOP_AHB_CLK>,
+                 <&mmcc CAMSS_ISPIF_AHB_CLK>,
+                 <&mmcc CAMSS_PHY0_CSI0PHYTIMER_CLK>,
+                 <&mmcc CAMSS_PHY1_CSI1PHYTIMER_CLK>,
+                 <&mmcc CAMSS_PHY2_CSI2PHYTIMER_CLK>,
+                 <&mmcc CAMSS_CSI0_AHB_CLK>,
+                 <&mmcc CAMSS_CSI0_CLK>,
+                 <&mmcc CAMSS_CSI0PHY_CLK>,
+                 <&mmcc CAMSS_CSI0PIX_CLK>,
+                 <&mmcc CAMSS_CSI0RDI_CLK>,
+                 <&mmcc CAMSS_CSI1_AHB_CLK>,
+                 <&mmcc CAMSS_CSI1_CLK>,
+                 <&mmcc CAMSS_CSI1PHY_CLK>,
+                 <&mmcc CAMSS_CSI1PIX_CLK>,
+                 <&mmcc CAMSS_CSI1RDI_CLK>,
+                 <&mmcc CAMSS_CSI2_AHB_CLK>,
+                 <&mmcc CAMSS_CSI2_CLK>,
+                 <&mmcc CAMSS_CSI2PHY_CLK>,
+                 <&mmcc CAMSS_CSI2PIX_CLK>,
+                 <&mmcc CAMSS_CSI2RDI_CLK>,
+                 <&mmcc CAMSS_CSI3_AHB_CLK>,
+                 <&mmcc CAMSS_CSI3_CLK>,
+                 <&mmcc CAMSS_CSI3PHY_CLK>,
+                 <&mmcc CAMSS_CSI3PIX_CLK>,
+                 <&mmcc CAMSS_CSI3RDI_CLK>,
+                 <&mmcc CAMSS_VFE_VFE0_CLK>,
+                 <&mmcc CAMSS_VFE_VFE1_CLK>,
+                 <&mmcc CAMSS_CSI_VFE0_CLK>,
+                 <&mmcc CAMSS_CSI_VFE1_CLK>,
+                 <&mmcc CAMSS_VFE_VFE_AHB_CLK>,
+                 <&mmcc CAMSS_VFE_VFE_AXI_CLK>;
+        clock-names = "top_ahb",
+                      "ispif_ahb",
+                      "csiphy0_timer",
+                      "csiphy1_timer",
+                      "csiphy2_timer",
+                      "csi0_ahb",
+                      "csi0",
+                      "csi0_phy",
+                      "csi0_pix",
+                      "csi0_rdi",
+                      "csi1_ahb",
+                      "csi1",
+                      "csi1_phy",
+                      "csi1_pix",
+                      "csi1_rdi",
+                      "csi2_ahb",
+                      "csi2",
+                      "csi2_phy",
+                      "csi2_pix",
+                      "csi2_rdi",
+                      "csi3_ahb",
+                      "csi3",
+                      "csi3_phy",
+                      "csi3_pix",
+                      "csi3_rdi",
+                      "vfe0",
+                      "vfe1",
+                      "csi_vfe0",
+                      "csi_vfe1",
+                      "iface",
+                      "bus";
+
+        vdda-supply = <&pm8941_l12>;
+
+        ports {
+                #address-cells = <1>;
+                #size-cells = <0>;
+        };
+    };
-- 
2.36.0


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

* [RFC PATCH 02/14] media: camss: Add CAMSS_8x74 camss version
  2022-05-22 16:27 [RFC PATCH 00/14] CAMSS support for MSM8974 Luca Weiss
  2022-05-22 16:27 ` [RFC PATCH 01/14] media: dt-bindings: media: camss: Add qcom,msm8974-camss binding Luca Weiss
@ 2022-05-22 16:27 ` Luca Weiss
  2022-05-26 12:32   ` Robert Foss
  2022-05-22 16:27 ` [RFC PATCH 03/14] media: camss: vfe: Add support for 8x74 Luca Weiss
                   ` (12 subsequent siblings)
  14 siblings, 1 reply; 31+ messages in thread
From: Luca Weiss @ 2022-05-22 16:27 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: ~postmarketos/upstreaming, phone-devel, Loic Poulain,
	Robert Foss, Rob Herring, Krzysztof Kozlowski, Todor Tomov,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab, linux-i2c,
	devicetree, linux-kernel, linux-media, matti.lehtimaki,
	Luca Weiss

From: Matti Lehtimäki <matti.lehtimaki@gmail.com>

Add enum representing the MSM8x74 SOC.

Signed-off-by: Matti Lehtimäki <matti.lehtimaki@gmail.com>
Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
---
 drivers/media/platform/qcom/camss/camss.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/platform/qcom/camss/camss.h b/drivers/media/platform/qcom/camss/camss.h
index c9b3e0df5be8..663cf24f52d9 100644
--- a/drivers/media/platform/qcom/camss/camss.h
+++ b/drivers/media/platform/qcom/camss/camss.h
@@ -76,6 +76,7 @@ enum pm_domain {
 
 enum camss_version {
 	CAMSS_8x16,
+	CAMSS_8x74,
 	CAMSS_8x96,
 	CAMSS_660,
 	CAMSS_845,
-- 
2.36.0


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

* [RFC PATCH 03/14] media: camss: vfe: Add support for 8x74
  2022-05-22 16:27 [RFC PATCH 00/14] CAMSS support for MSM8974 Luca Weiss
  2022-05-22 16:27 ` [RFC PATCH 01/14] media: dt-bindings: media: camss: Add qcom,msm8974-camss binding Luca Weiss
  2022-05-22 16:27 ` [RFC PATCH 02/14] media: camss: Add CAMSS_8x74 camss version Luca Weiss
@ 2022-05-22 16:27 ` Luca Weiss
  2022-05-26 12:36   ` Robert Foss
  2022-05-22 16:27 ` [RFC PATCH 04/14] media: camss: video: " Luca Weiss
                   ` (11 subsequent siblings)
  14 siblings, 1 reply; 31+ messages in thread
From: Luca Weiss @ 2022-05-22 16:27 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: ~postmarketos/upstreaming, phone-devel, Loic Poulain,
	Robert Foss, Rob Herring, Krzysztof Kozlowski, Todor Tomov,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab, linux-i2c,
	devicetree, linux-kernel, linux-media, matti.lehtimaki,
	Luca Weiss

From: Matti Lehtimäki <matti.lehtimaki@gmail.com>

VFE hardware modules on 8x74 and 8x16 are similar.

Signed-off-by: Matti Lehtimäki <matti.lehtimaki@gmail.com>
Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
---
 drivers/media/platform/qcom/camss/camss-vfe.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/qcom/camss/camss-vfe.c b/drivers/media/platform/qcom/camss/camss-vfe.c
index 5b148e9f8134..ace53ed24884 100644
--- a/drivers/media/platform/qcom/camss/camss-vfe.c
+++ b/drivers/media/platform/qcom/camss/camss-vfe.c
@@ -170,7 +170,8 @@ static u32 vfe_src_pad_code(struct vfe_line *line, u32 sink_code,
 {
 	struct vfe_device *vfe = to_vfe(line);
 
-	if (vfe->camss->version == CAMSS_8x16)
+	if (vfe->camss->version == CAMSS_8x16 ||
+		vfe->camss->version == CAMSS_8x74)
 		switch (sink_code) {
 		case MEDIA_BUS_FMT_YUYV8_2X8:
 		{
@@ -1286,6 +1287,7 @@ int msm_vfe_subdev_init(struct camss *camss, struct vfe_device *vfe,
 
 	switch (camss->version) {
 	case CAMSS_8x16:
+	case CAMSS_8x74:
 		vfe->ops = &vfe_ops_4_1;
 		break;
 	case CAMSS_8x96:
@@ -1390,7 +1392,8 @@ int msm_vfe_subdev_init(struct camss *camss, struct vfe_device *vfe,
 		init_completion(&l->output.sof);
 		init_completion(&l->output.reg_update);
 
-		if (camss->version == CAMSS_8x16) {
+		if (camss->version == CAMSS_8x16 ||
+			camss->version == CAMSS_8x74) {
 			if (i == VFE_LINE_PIX) {
 				l->formats = formats_pix_8x16;
 				l->nformats = ARRAY_SIZE(formats_pix_8x16);
-- 
2.36.0


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

* [RFC PATCH 04/14] media: camss: video: Add support for 8x74
  2022-05-22 16:27 [RFC PATCH 00/14] CAMSS support for MSM8974 Luca Weiss
                   ` (2 preceding siblings ...)
  2022-05-22 16:27 ` [RFC PATCH 03/14] media: camss: vfe: Add support for 8x74 Luca Weiss
@ 2022-05-22 16:27 ` Luca Weiss
  2022-05-26 12:37   ` Robert Foss
  2022-05-22 16:27 ` [RFC PATCH 05/14] media: camss: csid: " Luca Weiss
                   ` (10 subsequent siblings)
  14 siblings, 1 reply; 31+ messages in thread
From: Luca Weiss @ 2022-05-22 16:27 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: ~postmarketos/upstreaming, phone-devel, Loic Poulain,
	Robert Foss, Rob Herring, Krzysztof Kozlowski, Todor Tomov,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab, linux-i2c,
	devicetree, linux-kernel, linux-media, matti.lehtimaki,
	Luca Weiss

From: Matti Lehtimäki <matti.lehtimaki@gmail.com>

Video formats in 8x16 and 8x74 are similar.

Signed-off-by: Matti Lehtimäki <matti.lehtimaki@gmail.com>
Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
---
 drivers/media/platform/qcom/camss/camss-video.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/qcom/camss/camss-video.c b/drivers/media/platform/qcom/camss/camss-video.c
index 307bb1dc4589..ca955808fd6d 100644
--- a/drivers/media/platform/qcom/camss/camss-video.c
+++ b/drivers/media/platform/qcom/camss/camss-video.c
@@ -990,7 +990,8 @@ int msm_video_register(struct camss_video *video, struct v4l2_device *v4l2_dev,
 
 	mutex_init(&video->lock);
 
-	if (video->camss->version == CAMSS_8x16) {
+	if (video->camss->version == CAMSS_8x16 ||
+		video->camss->version == CAMSS_8x74) {
 		if (is_pix) {
 			video->formats = formats_pix_8x16;
 			video->nformats = ARRAY_SIZE(formats_pix_8x16);
-- 
2.36.0


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

* [RFC PATCH 05/14] media: camss: csid: Add support for 8x74
  2022-05-22 16:27 [RFC PATCH 00/14] CAMSS support for MSM8974 Luca Weiss
                   ` (3 preceding siblings ...)
  2022-05-22 16:27 ` [RFC PATCH 04/14] media: camss: video: " Luca Weiss
@ 2022-05-22 16:27 ` Luca Weiss
  2022-05-26 12:38   ` Robert Foss
  2022-05-22 16:27 ` [RFC PATCH 06/14] media: camss: ispif: " Luca Weiss
                   ` (9 subsequent siblings)
  14 siblings, 1 reply; 31+ messages in thread
From: Luca Weiss @ 2022-05-22 16:27 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: ~postmarketos/upstreaming, phone-devel, Loic Poulain,
	Robert Foss, Rob Herring, Krzysztof Kozlowski, Todor Tomov,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab, linux-i2c,
	devicetree, linux-kernel, linux-media, matti.lehtimaki,
	Luca Weiss

From: Matti Lehtimäki <matti.lehtimaki@gmail.com>

CSID hardware module on 8x74 is similar to 8x16.

Signed-off-by: Matti Lehtimäki <matti.lehtimaki@gmail.com>
Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
---
 drivers/media/platform/qcom/camss/camss-csid.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/qcom/camss/camss-csid.c b/drivers/media/platform/qcom/camss/camss-csid.c
index f993f349b66b..6b5cd9a66ff6 100644
--- a/drivers/media/platform/qcom/camss/camss-csid.c
+++ b/drivers/media/platform/qcom/camss/camss-csid.c
@@ -570,7 +570,8 @@ int msm_csid_subdev_init(struct camss *camss, struct csid_device *csid,
 	csid->camss = camss;
 	csid->id = id;
 
-	if (camss->version == CAMSS_8x16) {
+	if (camss->version == CAMSS_8x16 ||
+		camss->version == CAMSS_8x74) {
 		csid->ops = &csid_ops_4_1;
 	} else if (camss->version == CAMSS_8x96 ||
 		   camss->version == CAMSS_660) {
-- 
2.36.0


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

* [RFC PATCH 06/14] media: camss: ispif: Add support for 8x74
  2022-05-22 16:27 [RFC PATCH 00/14] CAMSS support for MSM8974 Luca Weiss
                   ` (4 preceding siblings ...)
  2022-05-22 16:27 ` [RFC PATCH 05/14] media: camss: csid: " Luca Weiss
@ 2022-05-22 16:27 ` Luca Weiss
  2022-05-26 12:39   ` Robert Foss
  2022-05-22 16:27 ` [RFC PATCH 07/14] media: camss: csiphy: " Luca Weiss
                   ` (8 subsequent siblings)
  14 siblings, 1 reply; 31+ messages in thread
From: Luca Weiss @ 2022-05-22 16:27 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: ~postmarketos/upstreaming, phone-devel, Loic Poulain,
	Robert Foss, Rob Herring, Krzysztof Kozlowski, Todor Tomov,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab, linux-i2c,
	devicetree, linux-kernel, linux-media, matti.lehtimaki,
	Luca Weiss

From: Matti Lehtimäki <matti.lehtimaki@gmail.com>

ISPIF hardware modules on 8x74, 8x16 and 8x96 are similar. However on
8x74 the ISPIF routes data to two VFE hardware modules like 8x96 but
formats are similar to 8x16.

Signed-off-by: Matti Lehtimäki <matti.lehtimaki@gmail.com>
Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
---
 drivers/media/platform/qcom/camss/camss-ispif.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/qcom/camss/camss-ispif.c b/drivers/media/platform/qcom/camss/camss-ispif.c
index 4ee11bb979cd..693807bf3c6b 100644
--- a/drivers/media/platform/qcom/camss/camss-ispif.c
+++ b/drivers/media/platform/qcom/camss/camss-ispif.c
@@ -1112,6 +1112,7 @@ int msm_ispif_subdev_init(struct camss *camss,
 	if (camss->version == CAMSS_8x16)
 		ispif->line_num = 2;
 	else if (camss->version == CAMSS_8x96 ||
+		 camss->version == CAMSS_8x74 ||
 		 camss->version == CAMSS_660)
 		ispif->line_num = 4;
 	else
@@ -1126,7 +1127,8 @@ int msm_ispif_subdev_init(struct camss *camss,
 		ispif->line[i].ispif = ispif;
 		ispif->line[i].id = i;
 
-		if (camss->version == CAMSS_8x16) {
+		if (camss->version == CAMSS_8x16 ||
+			   camss->version == CAMSS_8x74) {
 			ispif->line[i].formats = ispif_formats_8x16;
 			ispif->line[i].nformats =
 					ARRAY_SIZE(ispif_formats_8x16);
@@ -1163,6 +1165,7 @@ int msm_ispif_subdev_init(struct camss *camss,
 		ret = devm_request_irq(dev, ispif->irq, ispif_isr_8x16,
 			       IRQF_TRIGGER_RISING, ispif->irq_name, ispif);
 	else if (camss->version == CAMSS_8x96 ||
+		 camss->version == CAMSS_8x74 ||
 		 camss->version == CAMSS_660)
 		ret = devm_request_irq(dev, ispif->irq, ispif_isr_8x96,
 			       IRQF_TRIGGER_RISING, ispif->irq_name, ispif);
-- 
2.36.0


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

* [RFC PATCH 07/14] media: camss: csiphy: Add support for 8x74
  2022-05-22 16:27 [RFC PATCH 00/14] CAMSS support for MSM8974 Luca Weiss
                   ` (5 preceding siblings ...)
  2022-05-22 16:27 ` [RFC PATCH 06/14] media: camss: ispif: " Luca Weiss
@ 2022-05-22 16:27 ` Luca Weiss
  2022-05-26 12:40   ` Robert Foss
  2022-05-22 16:27 ` [RFC PATCH 08/14] media: camss: Add 8x74 resources Luca Weiss
                   ` (7 subsequent siblings)
  14 siblings, 1 reply; 31+ messages in thread
From: Luca Weiss @ 2022-05-22 16:27 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: ~postmarketos/upstreaming, phone-devel, Loic Poulain,
	Robert Foss, Rob Herring, Krzysztof Kozlowski, Todor Tomov,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab, linux-i2c,
	devicetree, linux-kernel, linux-media, matti.lehtimaki,
	Luca Weiss

From: Matti Lehtimäki <matti.lehtimaki@gmail.com>

CSIPHY hardware modules in 8x74 and 8x16 are similar.

Signed-off-by: Matti Lehtimäki <matti.lehtimaki@gmail.com>
Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
---
 drivers/media/platform/qcom/camss/camss-csiphy.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/qcom/camss/camss-csiphy.c b/drivers/media/platform/qcom/camss/camss-csiphy.c
index 75fcfc627400..a0122705a874 100644
--- a/drivers/media/platform/qcom/camss/camss-csiphy.c
+++ b/drivers/media/platform/qcom/camss/camss-csiphy.c
@@ -557,7 +557,8 @@ int msm_csiphy_subdev_init(struct camss *camss,
 	csiphy->id = id;
 	csiphy->cfg.combo_mode = 0;
 
-	if (camss->version == CAMSS_8x16) {
+	if (camss->version == CAMSS_8x16 ||
+		   camss->version == CAMSS_8x74) {
 		csiphy->ops = &csiphy_ops_2ph_1_0;
 		csiphy->formats = csiphy_formats_8x16;
 		csiphy->nformats = ARRAY_SIZE(csiphy_formats_8x16);
@@ -582,6 +583,7 @@ int msm_csiphy_subdev_init(struct camss *camss,
 		return PTR_ERR(csiphy->base);
 
 	if (camss->version == CAMSS_8x16 ||
+	    camss->version == CAMSS_8x74 ||
 	    camss->version == CAMSS_8x96) {
 		csiphy->base_clk_mux =
 			devm_platform_ioremap_resource_byname(pdev, res->reg[1]);
-- 
2.36.0


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

* [RFC PATCH 08/14] media: camss: Add 8x74 resources
  2022-05-22 16:27 [RFC PATCH 00/14] CAMSS support for MSM8974 Luca Weiss
                   ` (6 preceding siblings ...)
  2022-05-22 16:27 ` [RFC PATCH 07/14] media: camss: csiphy: " Luca Weiss
@ 2022-05-22 16:27 ` Luca Weiss
  2022-05-26 12:42   ` Robert Foss
  2022-05-22 16:27 ` [RFC PATCH 09/14] dt-bindings: i2c: qcom-cci: add QCOM MSM8974 compatible Luca Weiss
                   ` (6 subsequent siblings)
  14 siblings, 1 reply; 31+ messages in thread
From: Luca Weiss @ 2022-05-22 16:27 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: ~postmarketos/upstreaming, phone-devel, Loic Poulain,
	Robert Foss, Rob Herring, Krzysztof Kozlowski, Todor Tomov,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab, linux-i2c,
	devicetree, linux-kernel, linux-media, matti.lehtimaki,
	Luca Weiss

From: Matti Lehtimäki <matti.lehtimaki@gmail.com>

Add structs with 8x74 resources. The number of CSIPHY, CSID
and VFE hardware modules is the same as 8x96 but the support
is otherwise different.

Signed-off-by: Matti Lehtimäki <matti.lehtimaki@gmail.com>
Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
---
 drivers/media/platform/qcom/camss/camss.c | 161 ++++++++++++++++++++++
 1 file changed, 161 insertions(+)

diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c
index 79ad82e233cb..5a69ce48c792 100644
--- a/drivers/media/platform/qcom/camss/camss.c
+++ b/drivers/media/platform/qcom/camss/camss.c
@@ -126,6 +126,154 @@ static const struct resources vfe_res_8x16[] = {
 	}
 };
 
+static const struct resources csiphy_res_8974[] = {
+	/* CSIPHY0 */
+	{
+		.regulators = { NULL },
+		.clock = { "top_ahb", "ispif_ahb", "csiphy0_timer" },
+		.clock_rate = { { 0 },
+				{ 0 },
+				{ 100000000, 200000000 } },
+		.reg = { "csiphy0", "csiphy0_clk_mux" },
+		.interrupt = { "csiphy0" }
+	},
+
+	/* CSIPHY1 */
+	{
+		.regulators = { NULL },
+		.clock = { "top_ahb", "ispif_ahb", "csiphy1_timer" },
+		.clock_rate = { { 0 },
+				{ 0 },
+				{ 100000000, 200000000 } },
+		.reg = { "csiphy1", "csiphy1_clk_mux" },
+		.interrupt = { "csiphy1" }
+	},
+
+	/* CSIPHY2 */
+	{
+		.regulators = { NULL },
+		.clock = { "top_ahb", "ispif_ahb", "csiphy2_timer" },
+		.clock_rate = { { 0 },
+				{ 0 },
+				{ 100000000, 200000000 } },
+		.reg = { "csiphy2", "csiphy2_clk_mux" },
+		.interrupt = { "csiphy2" }
+	}
+};
+
+static const struct resources csid_res_8974[] = {
+	/* CSID0 */
+	{
+		.regulators = { "vdda" },
+		.clock = { "top_ahb", "ispif_ahb", "csi0_ahb",
+			   "csi0", "csi0_phy", "csi0_pix", "csi0_rdi" },
+		.clock_rate = { { 0 },
+				{ 0 },
+				{ 0 },
+				{ 100000000, 200000000 },
+				{ 0 },
+				{ 0 },
+				{ 0 } },
+		.reg = { "csid0" },
+		.interrupt = { "csid0" }
+	},
+
+	/* CSID1 */
+	{
+		.regulators = { "vdda" },
+		.clock = { "top_ahb", "ispif_ahb", "csi1_ahb",
+			   "csi1", "csi1_phy", "csi1_pix", "csi1_rdi" },
+		.clock_rate = { { 0 },
+				{ 0 },
+				{ 0 },
+				{ 100000000, 200000000 },
+				{ 0 },
+				{ 0 },
+				{ 0 } },
+		.reg = { "csid1" },
+		.interrupt = { "csid1" }
+	},
+
+	/* CSID2 */
+	{
+		.regulators = { "vdda" },
+		.clock = { "top_ahb", "ispif_ahb", "csi2_ahb",
+			   "csi2", "csi2_phy", "csi2_pix", "csi2_rdi" },
+		.clock_rate = { { 0 },
+				{ 0 },
+				{ 0 },
+				{ 100000000, 200000000 },
+				{ 0 },
+				{ 0 },
+				{ 0 } },
+		.reg = { "csid2" },
+		.interrupt = { "csid2" }
+	},
+
+	/* CSID3 */
+	{
+		.regulators = { "vdda" },
+		.clock = { "top_ahb", "ispif_ahb", "csi3_ahb",
+			   "csi3", "csi3_phy", "csi3_pix", "csi3_rdi" },
+		.clock_rate = { { 0 },
+				{ 0 },
+				{ 0 },
+				{ 100000000, 200000000 },
+				{ 0 },
+				{ 0 },
+				{ 0 } },
+		.reg = { "csid3" },
+		.interrupt = { "csid3" }
+	}
+};
+
+static const struct resources_ispif ispif_res_8974 = {
+	/* ISPIF */
+	.clock = { "top_ahb", "ispif_ahb",
+		   "csi0", "csi0_pix", "csi0_rdi",
+		   "csi1", "csi1_pix", "csi1_rdi",
+		   "csi2", "csi2_pix", "csi2_rdi",
+		   "csi3", "csi3_pix", "csi3_rdi" },
+	.clock_for_reset = { "vfe0", "csi_vfe0",
+		   "vfe1", "csi_vfe1" },
+	.reg = { "ispif", "csi_clk_mux" },
+	.interrupt = "ispif"
+
+};
+
+static const struct resources vfe_res_8974[] = {
+	/* VFE0 */
+	{
+		.regulators = { NULL },
+		.clock = { "top_ahb", "vfe0", "csi_vfe0",
+			   "iface", "bus" },
+		.clock_rate = { { 0 },
+				{ 50000000, 80000000, 100000000, 160000000,
+				  177780000, 200000000, 266670000, 320000000,
+				  400000000, 400000000 },
+				{ 0 },
+				{ 0 },
+				{ 0 } },
+		.reg = { "vfe0" },
+		.interrupt = { "vfe0" }
+	},
+	/* VFE1 */
+	{
+		.regulators = { NULL },
+		.clock = { "top_ahb", "vfe1", "csi_vfe1",
+			   "iface", "bus" },
+		.clock_rate = { { 0 },
+				{ 50000000, 80000000, 100000000, 160000000,
+				  177780000, 200000000, 266670000, 320000000,
+				  400000000, 400000000 },
+				{ 0 },
+				{ 0 },
+				{ 0 } },
+		.reg = { "vfe1" },
+		.interrupt = { "vfe1" }
+	}
+};
+
 static const struct resources csiphy_res_8x96[] = {
 	/* CSIPHY0 */
 	{
@@ -1132,6 +1280,11 @@ static int camss_init_subdevices(struct camss *camss)
 		csid_res = csid_res_8x16;
 		ispif_res = &ispif_res_8x16;
 		vfe_res = vfe_res_8x16;
+	} else if (camss->version == CAMSS_8x74) {
+		csiphy_res = csiphy_res_8974;
+		csid_res = csid_res_8974;
+		ispif_res = &ispif_res_8974;
+		vfe_res = vfe_res_8974;
 	} else if (camss->version == CAMSS_8x96) {
 		csiphy_res = csiphy_res_8x96;
 		csid_res = csid_res_8x96;
@@ -1542,6 +1695,12 @@ static int camss_probe(struct platform_device *pdev)
 		camss->csiphy_num = 2;
 		camss->csid_num = 2;
 		camss->vfe_num = 1;
+	} else if (of_device_is_compatible(dev->of_node,
+					   "qcom,msm8974-camss")) {
+		camss->version = CAMSS_8x74;
+		camss->csiphy_num = 3;
+		camss->csid_num = 4;
+		camss->vfe_num = 2;
 	} else if (of_device_is_compatible(dev->of_node,
 					   "qcom,msm8996-camss")) {
 		camss->version = CAMSS_8x96;
@@ -1586,6 +1745,7 @@ static int camss_probe(struct platform_device *pdev)
 	}
 
 	if (camss->version == CAMSS_8x16 ||
+	    camss->version == CAMSS_8x74 ||
 	    camss->version == CAMSS_8x96) {
 		camss->ispif = devm_kcalloc(dev, 1, sizeof(*camss->ispif), GFP_KERNEL);
 		if (!camss->ispif) {
@@ -1735,6 +1895,7 @@ static int camss_remove(struct platform_device *pdev)
 
 static const struct of_device_id camss_dt_match[] = {
 	{ .compatible = "qcom,msm8916-camss" },
+	{ .compatible = "qcom,msm8974-camss" },
 	{ .compatible = "qcom,msm8996-camss" },
 	{ .compatible = "qcom,sdm660-camss" },
 	{ .compatible = "qcom,sdm845-camss" },
-- 
2.36.0


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

* [RFC PATCH 09/14] dt-bindings: i2c: qcom-cci: add QCOM MSM8974 compatible
  2022-05-22 16:27 [RFC PATCH 00/14] CAMSS support for MSM8974 Luca Weiss
                   ` (7 preceding siblings ...)
  2022-05-22 16:27 ` [RFC PATCH 08/14] media: camss: Add 8x74 resources Luca Weiss
@ 2022-05-22 16:27 ` Luca Weiss
  2022-05-23 10:07   ` Krzysztof Kozlowski
  2022-05-22 16:27 ` [RFC PATCH 10/14] i2c: qcom-cci: add msm8974 compatible Luca Weiss
                   ` (5 subsequent siblings)
  14 siblings, 1 reply; 31+ messages in thread
From: Luca Weiss @ 2022-05-22 16:27 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: ~postmarketos/upstreaming, phone-devel, Loic Poulain,
	Robert Foss, Rob Herring, Krzysztof Kozlowski, Todor Tomov,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab, linux-i2c,
	devicetree, linux-kernel, linux-media, matti.lehtimaki,
	Luca Weiss

Add the compatible for the CCI found in MSM8974 which supports two I2C
masters.

Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
---
 Documentation/devicetree/bindings/i2c/i2c-qcom-cci.txt | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/i2c/i2c-qcom-cci.txt b/Documentation/devicetree/bindings/i2c/i2c-qcom-cci.txt
index 924ad8c03464..166865e48849 100644
--- a/Documentation/devicetree/bindings/i2c/i2c-qcom-cci.txt
+++ b/Documentation/devicetree/bindings/i2c/i2c-qcom-cci.txt
@@ -7,6 +7,7 @@ PROPERTIES:
 	Value type: <string>
 	Definition: must be one of:
 		"qcom,msm8916-cci"
+		"qcom,msm8974-cci"
 		"qcom,msm8996-cci"
 		"qcom,sdm845-cci"
 		"qcom,sm8250-cci"
@@ -43,9 +44,9 @@ PROPERTIES:
 
 SUBNODES:
 
-The CCI provides I2C masters for one (msm8916) or two i2c busses (msm8996,
-sdm845, sm8250 and sm8450), described as subdevices named "i2c-bus@0" and
-"i2c-bus@1".
+The CCI provides I2C masters for one (msm8916) or two i2c busses (msm8974,
+msm8996, sdm845, sm8250 and sm8450), described as subdevices named "i2c-bus@0"
+and "i2c-bus@1".
 
 PROPERTIES:
 
-- 
2.36.0


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

* [RFC PATCH 10/14] i2c: qcom-cci: add msm8974 compatible
  2022-05-22 16:27 [RFC PATCH 00/14] CAMSS support for MSM8974 Luca Weiss
                   ` (8 preceding siblings ...)
  2022-05-22 16:27 ` [RFC PATCH 09/14] dt-bindings: i2c: qcom-cci: add QCOM MSM8974 compatible Luca Weiss
@ 2022-05-22 16:27 ` Luca Weiss
  2022-06-14 20:20   ` Wolfram Sang
  2022-06-15 17:11   ` Loic Poulain
  2022-05-22 16:27 ` [RFC PATCH 11/14] ARM: dts: qcom: msm8974: add CCI bus Luca Weiss
                   ` (4 subsequent siblings)
  14 siblings, 2 replies; 31+ messages in thread
From: Luca Weiss @ 2022-05-22 16:27 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: ~postmarketos/upstreaming, phone-devel, Loic Poulain,
	Robert Foss, Rob Herring, Krzysztof Kozlowski, Todor Tomov,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab, linux-i2c,
	devicetree, linux-kernel, linux-media, matti.lehtimaki,
	Luca Weiss

From: Matti Lehtimäki <matti.lehtimaki@gmail.com>

MSM8974 CCI is the same as MSM8916 except it has two masters.

Signed-off-by: Matti Lehtimäki <matti.lehtimaki@gmail.com>
Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
---
To note, the cci_v1_5_data variable name is just a bit arbitrary and
isn't meant to reflect IP version "1.5". I'd be happy to change the
variable name to something else.

 drivers/i2c/busses/i2c-qcom-cci.c | 35 +++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/drivers/i2c/busses/i2c-qcom-cci.c b/drivers/i2c/busses/i2c-qcom-cci.c
index 5c7cc862f08f..a68f17eb9dd0 100644
--- a/drivers/i2c/busses/i2c-qcom-cci.c
+++ b/drivers/i2c/busses/i2c-qcom-cci.c
@@ -725,6 +725,40 @@ static const struct cci_data cci_v1_data = {
 	},
 };
 
+static const struct cci_data cci_v1_5_data = {
+	.num_masters = 2,
+	.queue_size = { 64, 16 },
+	.quirks = {
+		.max_write_len = 10,
+		.max_read_len = 12,
+	},
+	.cci_clk_rate =  19200000,
+	.params[I2C_MODE_STANDARD] = {
+		.thigh = 78,
+		.tlow = 114,
+		.tsu_sto = 28,
+		.tsu_sta = 28,
+		.thd_dat = 10,
+		.thd_sta = 77,
+		.tbuf = 118,
+		.scl_stretch_en = 0,
+		.trdhld = 6,
+		.tsp = 1
+	},
+	.params[I2C_MODE_FAST] = {
+		.thigh = 20,
+		.tlow = 28,
+		.tsu_sto = 21,
+		.tsu_sta = 21,
+		.thd_dat = 13,
+		.thd_sta = 18,
+		.tbuf = 32,
+		.scl_stretch_en = 0,
+		.trdhld = 6,
+		.tsp = 3
+	},
+};
+
 static const struct cci_data cci_v2_data = {
 	.num_masters = 2,
 	.queue_size = { 64, 16 },
@@ -773,6 +807,7 @@ static const struct cci_data cci_v2_data = {
 
 static const struct of_device_id cci_dt_match[] = {
 	{ .compatible = "qcom,msm8916-cci", .data = &cci_v1_data},
+	{ .compatible = "qcom,msm8974-cci", .data = &cci_v1_5_data},
 	{ .compatible = "qcom,msm8996-cci", .data = &cci_v2_data},
 	{ .compatible = "qcom,sdm845-cci", .data = &cci_v2_data},
 	{ .compatible = "qcom,sm8250-cci", .data = &cci_v2_data},
-- 
2.36.0


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

* [RFC PATCH 11/14] ARM: dts: qcom: msm8974: add CCI bus
  2022-05-22 16:27 [RFC PATCH 00/14] CAMSS support for MSM8974 Luca Weiss
                   ` (9 preceding siblings ...)
  2022-05-22 16:27 ` [RFC PATCH 10/14] i2c: qcom-cci: add msm8974 compatible Luca Weiss
@ 2022-05-22 16:27 ` Luca Weiss
  2022-05-26 12:16   ` Robert Foss
  2022-05-22 16:28 ` [RFC PATCH 12/14] ARM: dts: qcom: msm8974: add CAMSS node Luca Weiss
                   ` (3 subsequent siblings)
  14 siblings, 1 reply; 31+ messages in thread
From: Luca Weiss @ 2022-05-22 16:27 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: ~postmarketos/upstreaming, phone-devel, Loic Poulain,
	Robert Foss, Rob Herring, Krzysztof Kozlowski, Todor Tomov,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab, linux-i2c,
	devicetree, linux-kernel, linux-media, matti.lehtimaki,
	Luca Weiss

Add a node for the camera-specific i2c bus found on msm8974.

Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
---
 arch/arm/boot/dts/qcom-msm8974.dtsi | 62 +++++++++++++++++++++++++++++
 1 file changed, 62 insertions(+)

diff --git a/arch/arm/boot/dts/qcom-msm8974.dtsi b/arch/arm/boot/dts/qcom-msm8974.dtsi
index ffa6f874917a..a80b4ae71745 100644
--- a/arch/arm/boot/dts/qcom-msm8974.dtsi
+++ b/arch/arm/boot/dts/qcom-msm8974.dtsi
@@ -1434,6 +1434,34 @@ blsp2_i2c5_sleep: blsp2-i2c5-sleep {
 
 			/* BLSP2_I2C6 info is missing - nobody uses it though? */
 
+			cci0_default: cci0-default {
+				pins = "gpio19", "gpio20";
+				function = "cci_i2c0";
+				drive-strength = <2>;
+				bias-disable;
+			};
+
+			cci0_sleep: cci0-sleep {
+				pins = "gpio19", "gpio20";
+				function = "gpio";
+				drive-strength = <2>;
+				bias-disable;
+			};
+
+			cci1_default: cci1-default {
+				pins = "gpio21", "gpio22";
+				function = "cci_i2c1";
+				drive-strength = <2>;
+				bias-disable;
+			};
+
+			cci1_sleep: cci1-sleep {
+				pins = "gpio21", "gpio22";
+				function = "gpio";
+				drive-strength = <2>;
+				bias-disable;
+			};
+
 			spi8_default: spi8_default {
 				mosi {
 					pins = "gpio45";
@@ -1587,6 +1615,40 @@ dsi0_phy: dsi-phy@fd922a00 {
 			};
 		};
 
+		cci: cci@fda0c000 {
+			compatible = "qcom,msm8974-cci";
+			#address-cells = <1>;
+			#size-cells = <0>;
+			reg = <0xfda0c000 0x1000>;
+			interrupts = <GIC_SPI 50 IRQ_TYPE_EDGE_RISING>;
+			clocks = <&mmcc CAMSS_TOP_AHB_CLK>,
+				 <&mmcc CAMSS_CCI_CCI_AHB_CLK>,
+				 <&mmcc CAMSS_CCI_CCI_CLK>;
+			clock-names = "camss_top_ahb",
+				      "cci_ahb",
+				      "cci";
+
+			pinctrl-names = "default", "sleep";
+			pinctrl-0 = <&cci0_default &cci1_default>;
+			pinctrl-1 = <&cci0_sleep &cci1_sleep>;
+
+			status = "disabled";
+
+			cci_i2c0: i2c-bus@0 {
+				reg = <0>;
+				clock-frequency = <400000>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+			};
+
+			cci_i2c1: i2c-bus@1 {
+				reg = <1>;
+				clock-frequency = <400000>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+			};
+		};
+
 		gpu: adreno@fdb00000 {
 			compatible = "qcom,adreno-330.1", "qcom,adreno";
 			reg = <0xfdb00000 0x10000>;
-- 
2.36.0


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

* [RFC PATCH 12/14] ARM: dts: qcom: msm8974: add CAMSS node
  2022-05-22 16:27 [RFC PATCH 00/14] CAMSS support for MSM8974 Luca Weiss
                   ` (10 preceding siblings ...)
  2022-05-22 16:27 ` [RFC PATCH 11/14] ARM: dts: qcom: msm8974: add CCI bus Luca Weiss
@ 2022-05-22 16:28 ` Luca Weiss
  2022-05-22 16:28 ` [RFC PATCH 13/14] ARM: dts: qcom: msm8974-FP2: Add OV8865 rear camera Luca Weiss
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 31+ messages in thread
From: Luca Weiss @ 2022-05-22 16:28 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: ~postmarketos/upstreaming, phone-devel, Loic Poulain,
	Robert Foss, Rob Herring, Krzysztof Kozlowski, Todor Tomov,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab, linux-i2c,
	devicetree, linux-kernel, linux-media, matti.lehtimaki,
	Luca Weiss

Add a node for the camera subsystem found on msm8974.

Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
---
 arch/arm/boot/dts/qcom-msm8974.dtsi | 122 ++++++++++++++++++++++++++++
 1 file changed, 122 insertions(+)

diff --git a/arch/arm/boot/dts/qcom-msm8974.dtsi b/arch/arm/boot/dts/qcom-msm8974.dtsi
index a80b4ae71745..e684a9229f8c 100644
--- a/arch/arm/boot/dts/qcom-msm8974.dtsi
+++ b/arch/arm/boot/dts/qcom-msm8974.dtsi
@@ -1615,6 +1615,128 @@ dsi0_phy: dsi-phy@fd922a00 {
 			};
 		};
 
+		camss: camss@fda00000 {
+			compatible = "qcom,msm8974-camss";
+			reg = <0xfda0ac00 0x200>,
+			      <0xfda00030 0x4>,
+			      <0xfda0b000 0x200>,
+			      <0xfda00038 0x4>,
+			      <0xfda0b400 0x200>,
+			      <0xfda00040 0x4>,
+			      <0xfda08000 0x100>,
+			      <0xfda08400 0x100>,
+			      <0xfda08800 0x100>,
+			      <0xfda08c00 0x100>,
+			      <0xfda0a000 0x800>,
+			      <0xfda00020 0x10>,
+			      <0xfda10000 0x1000>,
+			      <0xfda14000 0x1000>;
+			reg-names = "csiphy0",
+				    "csiphy0_clk_mux",
+				    "csiphy1",
+				    "csiphy1_clk_mux",
+				    "csiphy2",
+				    "csiphy2_clk_mux",
+				    "csid0",
+				    "csid1",
+				    "csid2",
+				    "csid3",
+				    "ispif",
+				    "csi_clk_mux",
+				    "vfe0",
+				    "vfe1";
+			interrupts = <GIC_SPI 78 IRQ_TYPE_EDGE_RISING>,
+				     <GIC_SPI 79 IRQ_TYPE_EDGE_RISING>,
+				     <GIC_SPI 80 IRQ_TYPE_EDGE_RISING>,
+				     <GIC_SPI 51 IRQ_TYPE_EDGE_RISING>,
+				     <GIC_SPI 52 IRQ_TYPE_EDGE_RISING>,
+				     <GIC_SPI 53 IRQ_TYPE_EDGE_RISING>,
+				     <GIC_SPI 54 IRQ_TYPE_EDGE_RISING>,
+				     <GIC_SPI 55 IRQ_TYPE_EDGE_RISING>,
+				     <GIC_SPI 57 IRQ_TYPE_EDGE_RISING>,
+				     <GIC_SPI 58 IRQ_TYPE_EDGE_RISING>;
+			interrupt-names = "csiphy0",
+					  "csiphy1",
+					  "csiphy2",
+					  "csid0",
+					  "csid1",
+					  "csid2",
+					  "csid3",
+					  "ispif",
+					  "vfe0",
+					  "vfe1";
+			power-domains = <&mmcc CAMSS_VFE_GDSC>;
+			clocks = <&mmcc CAMSS_TOP_AHB_CLK>,
+				 <&mmcc CAMSS_ISPIF_AHB_CLK>,
+				 <&mmcc CAMSS_PHY0_CSI0PHYTIMER_CLK>,
+				 <&mmcc CAMSS_PHY1_CSI1PHYTIMER_CLK>,
+				 <&mmcc CAMSS_PHY2_CSI2PHYTIMER_CLK>,
+				 <&mmcc CAMSS_CSI0_AHB_CLK>,
+				 <&mmcc CAMSS_CSI0_CLK>,
+				 <&mmcc CAMSS_CSI0PHY_CLK>,
+				 <&mmcc CAMSS_CSI0PIX_CLK>,
+				 <&mmcc CAMSS_CSI0RDI_CLK>,
+				 <&mmcc CAMSS_CSI1_AHB_CLK>,
+				 <&mmcc CAMSS_CSI1_CLK>,
+				 <&mmcc CAMSS_CSI1PHY_CLK>,
+				 <&mmcc CAMSS_CSI1PIX_CLK>,
+				 <&mmcc CAMSS_CSI1RDI_CLK>,
+				 <&mmcc CAMSS_CSI2_AHB_CLK>,
+				 <&mmcc CAMSS_CSI2_CLK>,
+				 <&mmcc CAMSS_CSI2PHY_CLK>,
+				 <&mmcc CAMSS_CSI2PIX_CLK>,
+				 <&mmcc CAMSS_CSI2RDI_CLK>,
+				 <&mmcc CAMSS_CSI3_AHB_CLK>,
+				 <&mmcc CAMSS_CSI3_CLK>,
+				 <&mmcc CAMSS_CSI3PHY_CLK>,
+				 <&mmcc CAMSS_CSI3PIX_CLK>,
+				 <&mmcc CAMSS_CSI3RDI_CLK>,
+				 <&mmcc CAMSS_VFE_VFE0_CLK>,
+				 <&mmcc CAMSS_VFE_VFE1_CLK>,
+				 <&mmcc CAMSS_CSI_VFE0_CLK>,
+				 <&mmcc CAMSS_CSI_VFE1_CLK>,
+				 <&mmcc CAMSS_VFE_VFE_AHB_CLK>,
+				 <&mmcc CAMSS_VFE_VFE_AXI_CLK>;
+			clock-names = "top_ahb",
+				      "ispif_ahb",
+				      "csiphy0_timer",
+				      "csiphy1_timer",
+				      "csiphy2_timer",
+				      "csi0_ahb",
+				      "csi0",
+				      "csi0_phy",
+				      "csi0_pix",
+				      "csi0_rdi",
+				      "csi1_ahb",
+				      "csi1",
+				      "csi1_phy",
+				      "csi1_pix",
+				      "csi1_rdi",
+				      "csi2_ahb",
+				      "csi2",
+				      "csi2_phy",
+				      "csi2_pix",
+				      "csi2_rdi",
+				      "csi3_ahb",
+				      "csi3",
+				      "csi3_phy",
+				      "csi3_pix",
+				      "csi3_rdi",
+				      "vfe0",
+				      "vfe1",
+				      "csi_vfe0",
+				      "csi_vfe1",
+				      "iface",
+				      "bus";
+
+			status = "disabled";
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+			};
+		};
+
 		cci: cci@fda0c000 {
 			compatible = "qcom,msm8974-cci";
 			#address-cells = <1>;
-- 
2.36.0


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

* [RFC PATCH 13/14] ARM: dts: qcom: msm8974-FP2: Add OV8865 rear camera
  2022-05-22 16:27 [RFC PATCH 00/14] CAMSS support for MSM8974 Luca Weiss
                   ` (11 preceding siblings ...)
  2022-05-22 16:28 ` [RFC PATCH 12/14] ARM: dts: qcom: msm8974: add CAMSS node Luca Weiss
@ 2022-05-22 16:28 ` Luca Weiss
  2022-05-22 16:28 ` [RFC PATCH 14/14] [DNM] media: camss: hacks for MSM8974 Luca Weiss
  2022-05-23 12:39 ` [RFC PATCH 00/14] CAMSS support " Dmitry Baryshkov
  14 siblings, 0 replies; 31+ messages in thread
From: Luca Weiss @ 2022-05-22 16:28 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: ~postmarketos/upstreaming, phone-devel, Loic Poulain,
	Robert Foss, Rob Herring, Krzysztof Kozlowski, Todor Tomov,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab, linux-i2c,
	devicetree, linux-kernel, linux-media, matti.lehtimaki,
	Luca Weiss

Configure the rear camera found in the 8MP camera module for
Fairphone 2. There's also a AD5823 autofocus coil and an EEPROM present
on the module but currently not included.

Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
---
 .../dts/qcom-msm8974pro-fairphone-fp2.dts     | 70 +++++++++++++++++++
 1 file changed, 70 insertions(+)

diff --git a/arch/arm/boot/dts/qcom-msm8974pro-fairphone-fp2.dts b/arch/arm/boot/dts/qcom-msm8974pro-fairphone-fp2.dts
index 0fad82fc9e03..9a2c3a9177de 100644
--- a/arch/arm/boot/dts/qcom-msm8974pro-fairphone-fp2.dts
+++ b/arch/arm/boot/dts/qcom-msm8974pro-fairphone-fp2.dts
@@ -77,6 +77,60 @@ &blsp1_uart2 {
 	status = "okay";
 };
 
+&camss {
+	status = "okay";
+
+	vdda-supply = <&pm8941_l12>;
+
+	ports {
+		port@0 {
+			reg = <0>;
+			csiphy0_ep: endpoint {
+				clock-lanes = <1>;
+				data-lanes = <0 2 3 4>;
+				link-frequencies = /bits/ 64 <360000000>;
+				remote-endpoint = <&ov8865_ep>;
+			};
+		};
+	};
+};
+
+&cci {
+	status = "okay";
+};
+
+&cci_i2c0 {
+	ov8865: camera-sensor@10 {
+		compatible = "ovti,ov8865";
+		reg = <0x10>;
+
+		pinctrl-names = "default";
+		pinctrl-0 = <&mclk0_pin_a>;
+
+		clocks = <&mmcc CAMSS_MCLK0_CLK>;
+
+		avdd-supply = <&pm8941_l17>;
+		dovdd-supply = <&pm8941_lvs3>;
+		dvdd-supply = <&pm8941_l3>;
+
+		powerdown-gpios = <&tlmm 89 GPIO_ACTIVE_LOW>;
+		reset-gpios = <&tlmm 90 GPIO_ACTIVE_LOW>;
+
+		/* Rear camera */
+		orientation = <1>;
+		rotation = <90>;
+
+		port {
+			ov8865_ep: endpoint {
+				clock-lanes = <1>;
+				data-lanes = <0 2 3 4>;
+				link-frequencies = /bits/ 64 <360000000>;
+				remote-endpoint = <&csiphy0_ep>;
+			};
+		};
+	};
+};
+
 &dsi0 {
 	status = "okay";
 
@@ -413,6 +467,15 @@ pm8941_l24: l24 {
 			regulator-max-microvolt = <3075000>;
 			regulator-boot-on;
 		};
+
+		pm8941_lvs3: lvs3 {
+			/*
+			 * TODO: Used as CCI0 and CCI1 pull-up.
+			 * Replace with vbus-supply or similar once this lands
+			 * upstream!
+			 */
+			regulator-always-on;
+		};
 	};
 };
 
@@ -449,6 +512,13 @@ &smbb {
 };
 
 &tlmm {
+	mclk0_pin_a: mclk0-pin-active {
+		pins = "gpio15";
+		function = "cam_mclk0";
+		drive-strength = <2>;
+		bias-disable;
+	};
+
 	panel_pin: panel {
 		te {
 			pins = "gpio12";
-- 
2.36.0


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

* [RFC PATCH 14/14] [DNM] media: camss: hacks for MSM8974
  2022-05-22 16:27 [RFC PATCH 00/14] CAMSS support for MSM8974 Luca Weiss
                   ` (12 preceding siblings ...)
  2022-05-22 16:28 ` [RFC PATCH 13/14] ARM: dts: qcom: msm8974-FP2: Add OV8865 rear camera Luca Weiss
@ 2022-05-22 16:28 ` Luca Weiss
  2022-05-23 12:39 ` [RFC PATCH 00/14] CAMSS support " Dmitry Baryshkov
  14 siblings, 0 replies; 31+ messages in thread
From: Luca Weiss @ 2022-05-22 16:28 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: ~postmarketos/upstreaming, phone-devel, Loic Poulain,
	Robert Foss, Rob Herring, Krzysztof Kozlowski, Todor Tomov,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab, linux-i2c,
	devicetree, linux-kernel, linux-media, matti.lehtimaki,
	Luca Weiss

Remove IOMMU_DMA dependency from VIDEO_QCOM_CAMSS: We don't have IOMMU
on msm8974 yet.

DMA_SG -> DMA_CONTIG: Taking a photo without this works but is offset
and doing weird stuff.

Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
---
 drivers/media/platform/qcom/camss/Kconfig       |  4 ++--
 drivers/media/platform/qcom/camss/camss-video.c | 14 +++++++-------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/media/platform/qcom/camss/Kconfig b/drivers/media/platform/qcom/camss/Kconfig
index 4eda48cb1adf..e382fd77ecc3 100644
--- a/drivers/media/platform/qcom/camss/Kconfig
+++ b/drivers/media/platform/qcom/camss/Kconfig
@@ -2,8 +2,8 @@ config VIDEO_QCOM_CAMSS
 	tristate "Qualcomm V4L2 Camera Subsystem driver"
 	depends on V4L_PLATFORM_DRIVERS
 	depends on VIDEO_DEV
-	depends on (ARCH_QCOM && IOMMU_DMA) || COMPILE_TEST
+	depends on ARCH_QCOM || COMPILE_TEST
 	select MEDIA_CONTROLLER
 	select VIDEO_V4L2_SUBDEV_API
-	select VIDEOBUF2_DMA_SG
+	select VIDEOBUF2_DMA_CONTIG
 	select V4L2_FWNODE
diff --git a/drivers/media/platform/qcom/camss/camss-video.c b/drivers/media/platform/qcom/camss/camss-video.c
index ca955808fd6d..885a809cc941 100644
--- a/drivers/media/platform/qcom/camss/camss-video.c
+++ b/drivers/media/platform/qcom/camss/camss-video.c
@@ -13,7 +13,7 @@
 #include <media/v4l2-device.h>
 #include <media/v4l2-ioctl.h>
 #include <media/v4l2-mc.h>
-#include <media/videobuf2-dma-sg.h>
+#include <media/videobuf2-dma-contig.h>
 
 #include "camss-video.h"
 #include "camss.h"
@@ -410,15 +410,15 @@ static int video_buf_init(struct vb2_buffer *vb)
 						   vb);
 	const struct v4l2_pix_format_mplane *format =
 						&video->active_fmt.fmt.pix_mp;
-	struct sg_table *sgt;
+	//struct sg_table *sgt;
 	unsigned int i;
 
 	for (i = 0; i < format->num_planes; i++) {
-		sgt = vb2_dma_sg_plane_desc(vb, i);
-		if (!sgt)
-			return -EFAULT;
+		//sgt = vb2_dma_sg_plane_desc(vb, i);
+		//if (!sgt)
+		//	return -EFAULT;
 
-		buffer->addr[i] = sg_dma_address(sgt->sgl);
+		buffer->addr[i] = vb2_dma_contig_plane_dma_addr(vb, i); //sg_dma_address(sgt->sgl);
 	}
 
 	if (format->pixelformat == V4L2_PIX_FMT_NV12 ||
@@ -966,7 +966,7 @@ int msm_video_register(struct camss_video *video, struct v4l2_device *v4l2_dev,
 
 	q = &video->vb2_q;
 	q->drv_priv = video;
-	q->mem_ops = &vb2_dma_sg_memops;
+	q->mem_ops = &vb2_dma_contig_memops;
 	q->ops = &msm_video_vb2_q_ops;
 	q->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
 	q->io_modes = VB2_DMABUF | VB2_MMAP | VB2_READ;
-- 
2.36.0


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

* Re: [RFC PATCH 01/14] media: dt-bindings: media: camss: Add qcom,msm8974-camss binding
  2022-05-22 16:27 ` [RFC PATCH 01/14] media: dt-bindings: media: camss: Add qcom,msm8974-camss binding Luca Weiss
@ 2022-05-23 10:07   ` Krzysztof Kozlowski
  2022-06-02 13:01     ` Rob Herring
  0 siblings, 1 reply; 31+ messages in thread
From: Krzysztof Kozlowski @ 2022-05-23 10:07 UTC (permalink / raw)
  To: Luca Weiss, linux-arm-msm
  Cc: ~postmarketos/upstreaming, phone-devel, Loic Poulain,
	Robert Foss, Rob Herring, Krzysztof Kozlowski, Todor Tomov,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab, linux-i2c,
	devicetree, linux-kernel, linux-media, matti.lehtimaki

On 22/05/2022 18:27, Luca Weiss wrote:
> From: Matti Lehtimäki <matti.lehtimaki@gmail.com>

Thank you for your patch. There is something to discuss/improve.

> 
> Add bindings for qcom,msm8974-camss in order to support the camera
> subsystem on MSM8974.
> 
> Signed-off-by: Matti Lehtimäki <matti.lehtimaki@gmail.com>
> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
> ---
>  .../bindings/media/qcom,msm8974-camss.yaml    | 321 ++++++++++++++++++
>  1 file changed, 321 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/media/qcom,msm8974-camss.yaml
> 
> diff --git a/Documentation/devicetree/bindings/media/qcom,msm8974-camss.yaml b/Documentation/devicetree/bindings/media/qcom,msm8974-camss.yaml
> new file mode 100644
> index 000000000000..f8f71e477535
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/media/qcom,msm8974-camss.yaml
> @@ -0,0 +1,321 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +
> +%YAML 1.2
> +---
> +$id: "http://devicetree.org/schemas/media/qcom,msm8974-camss.yaml#"
> +$schema: "http://devicetree.org/meta-schemas/core.yaml#"
> +
> +title: Qualcomm CAMSS ISP
> +
> +maintainers:
> +  - Robert Foss <robert.foss@linaro.org>
> +
> +description: |
> +  The CAMSS IP is a CSI decoder and ISP present on Qualcomm platforms
> +
> +properties:
> +  compatible:
> +    const: qcom,msm8974-camss
> +
> +  clocks:
> +    minItems: 31

No need for minItems, they are equal to max by default.

> +    maxItems: 31
> +
> +  clock-names:
> +    items:
> +      - const: top_ahb
> +      - const: ispif_ahb
> +      - const: csiphy0_timer
> +      - const: csiphy1_timer
> +      - const: csiphy2_timer
> +      - const: csi0_ahb
> +      - const: csi0
> +      - const: csi0_phy
> +      - const: csi0_pix
> +      - const: csi0_rdi
> +      - const: csi1_ahb
> +      - const: csi1
> +      - const: csi1_phy
> +      - const: csi1_pix
> +      - const: csi1_rdi
> +      - const: csi2_ahb
> +      - const: csi2
> +      - const: csi2_phy
> +      - const: csi2_pix
> +      - const: csi2_rdi
> +      - const: csi3_ahb
> +      - const: csi3
> +      - const: csi3_phy
> +      - const: csi3_pix
> +      - const: csi3_rdi
> +      - const: vfe0
> +      - const: vfe1
> +      - const: csi_vfe0
> +      - const: csi_vfe1
> +      - const: iface
> +      - const: bus
> +
> +  interrupts:
> +    minItems: 10

Same.

> +    maxItems: 10
> +
> +  interrupt-names:
> +    items:
> +      - const: csiphy0
> +      - const: csiphy1
> +      - const: csiphy2
> +      - const: csid0
> +      - const: csid1
> +      - const: csid2
> +      - const: csid3
> +      - const: ispif
> +      - const: vfe0
> +      - const: vfe1
> +
> +  power-domains:
> +    items:
> +      - description: VFE GDSC - Video Front End, Global Distributed Switch Controller.
> +
> +  ports:
> +    $ref: /schemas/graph.yaml#/properties/ports
> +
> +    description:
> +      CSI input ports.
> +
> +    properties:
> +      port@0:
> +        $ref: /schemas/graph.yaml#/$defs/port-base
> +        unevaluatedProperties: false
> +        description:
> +          Input port for receiving CSI data.
> +
> +        properties:
> +          endpoint:
> +            $ref: video-interfaces.yaml#
> +            unevaluatedProperties: false
> +
> +            properties:
> +              clock-lanes:
> +                items:
> +                  - const: 1
> +
> +              data-lanes:
> +                minItems: 1
> +                maxItems: 4
> +
> +            required:
> +              - clock-lanes
> +              - data-lanes
> +
> +      port@1:

These look all the same, so just use patternPropreties (in "ports") with
proper pattern.

> +        $ref: /schemas/graph.yaml#/$defs/port-base
> +        unevaluatedProperties: false
> +        description:
> +          Input port for receiving CSI data.
> +
> +        properties:
> +          endpoint:
> +            $ref: video-interfaces.yaml#
> +            unevaluatedProperties: false
> +
> +            properties:
> +              clock-lanes:
> +                items:
> +                  - const: 1
> +
> +              data-lanes:
> +                minItems: 1
> +                maxItems: 4
> +
> +            required:
> +              - clock-lanes
> +              - data-lanes
> +
> +      port@2:
> +        $ref: /schemas/graph.yaml#/$defs/port-base
> +        unevaluatedProperties: false
> +        description:
> +          Input port for receiving CSI data.
> +
> +        properties:
> +          endpoint:
> +            $ref: video-interfaces.yaml#
> +            unevaluatedProperties: false
> +
> +            properties:
> +              clock-lanes:
> +                items:
> +                  - const: 1
> +
> +              data-lanes:
> +                minItems: 1
> +                maxItems: 4
> +
> +            required:
> +              - clock-lanes
> +              - data-lanes
> +
> +  reg:
> +    minItems: 14
> +    maxItems: 14
> +
> +  reg-names:
> +    items:
> +      - const: csiphy0
> +      - const: csiphy0_clk_mux
> +      - const: csiphy1
> +      - const: csiphy1_clk_mux
> +      - const: csiphy2
> +      - const: csiphy2_clk_mux
> +      - const: csid0
> +      - const: csid1
> +      - const: csid2
> +      - const: csid3
> +      - const: ispif
> +      - const: csi_clk_mux
> +      - const: vfe0
> +      - const: vfe1
> +
> +  vdda-supply:
> +    description:
> +      Definition of the regulator used as analog power supply.
> +
> +required:
> +  - clock-names
> +  - clocks
> +  - compatible
> +  - interrupt-names
> +  - interrupts
> +  - power-domains
> +  - reg
> +  - reg-names
> +  - vdda-supply
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/interrupt-controller/arm-gic.h>
> +    #include <dt-bindings/clock/qcom,gcc-msm8974.h>
> +    #include <dt-bindings/clock/qcom,mmcc-msm8974.h>
> +    camss@fda00000 {

Generic node name, so "isp" I guess?

> +        compatible = "qcom,msm8974-camss";
> +        reg = <0xfda0ac00 0x200>,
> +              <0xfda00030 0x4>,
> +              <0xfda0b000 0x200>,
> +              <0xfda00038 0x4>,
> +              <0xfda0b400 0x200>,
> +              <0xfda00040 0x4>,
> +              <0xfda08000 0x100>,
> +              <0xfda08400 0x100>,
> +              <0xfda08800 0x100>,
> +              <0xfda08c00 0x100>,
> +              <0xfda0a000 0x800>,
> +              <0xfda00020 0x10>,
> +              <0xfda10000 0x1000>,
> +              <0xfda14000 0x1000>;
> +        reg-names = "csiphy0",
> +                    "csiphy0_clk_mux",
> +                    "csiphy1",
> +                    "csiphy1_clk_mux",
> +                    "csiphy2",
> +                    "csiphy2_clk_mux",
> +                    "csid0",
> +                    "csid1",
> +                    "csid2",
> +                    "csid3",
> +                    "ispif",
> +                    "csi_clk_mux",
> +                    "vfe0",
> +                    "vfe1";
> +        interrupts = <GIC_SPI 78 IRQ_TYPE_EDGE_RISING>,
> +                     <GIC_SPI 79 IRQ_TYPE_EDGE_RISING>,
> +                     <GIC_SPI 80 IRQ_TYPE_EDGE_RISING>,
> +                     <GIC_SPI 51 IRQ_TYPE_EDGE_RISING>,
> +                     <GIC_SPI 52 IRQ_TYPE_EDGE_RISING>,
> +                     <GIC_SPI 53 IRQ_TYPE_EDGE_RISING>,
> +                     <GIC_SPI 54 IRQ_TYPE_EDGE_RISING>,
> +                     <GIC_SPI 55 IRQ_TYPE_EDGE_RISING>,
> +                     <GIC_SPI 57 IRQ_TYPE_EDGE_RISING>,
> +                     <GIC_SPI 58 IRQ_TYPE_EDGE_RISING>;
> +        interrupt-names = "csiphy0",
> +                          "csiphy1",
> +                          "csiphy2",
> +                          "csid0",
> +                          "csid1",
> +                          "csid2",
> +                          "csid3",
> +                          "ispif",
> +                          "vfe0",
> +                          "vfe1";
> +        power-domains = <&mmcc CAMSS_VFE_GDSC>;
> +        clocks = <&mmcc CAMSS_TOP_AHB_CLK>,
> +                 <&mmcc CAMSS_ISPIF_AHB_CLK>,
> +                 <&mmcc CAMSS_PHY0_CSI0PHYTIMER_CLK>,
> +                 <&mmcc CAMSS_PHY1_CSI1PHYTIMER_CLK>,
> +                 <&mmcc CAMSS_PHY2_CSI2PHYTIMER_CLK>,
> +                 <&mmcc CAMSS_CSI0_AHB_CLK>,
> +                 <&mmcc CAMSS_CSI0_CLK>,
> +                 <&mmcc CAMSS_CSI0PHY_CLK>,
> +                 <&mmcc CAMSS_CSI0PIX_CLK>,
> +                 <&mmcc CAMSS_CSI0RDI_CLK>,
> +                 <&mmcc CAMSS_CSI1_AHB_CLK>,
> +                 <&mmcc CAMSS_CSI1_CLK>,
> +                 <&mmcc CAMSS_CSI1PHY_CLK>,
> +                 <&mmcc CAMSS_CSI1PIX_CLK>,
> +                 <&mmcc CAMSS_CSI1RDI_CLK>,
> +                 <&mmcc CAMSS_CSI2_AHB_CLK>,
> +                 <&mmcc CAMSS_CSI2_CLK>,
> +                 <&mmcc CAMSS_CSI2PHY_CLK>,
> +                 <&mmcc CAMSS_CSI2PIX_CLK>,
> +                 <&mmcc CAMSS_CSI2RDI_CLK>,
> +                 <&mmcc CAMSS_CSI3_AHB_CLK>,
> +                 <&mmcc CAMSS_CSI3_CLK>,
> +                 <&mmcc CAMSS_CSI3PHY_CLK>,
> +                 <&mmcc CAMSS_CSI3PIX_CLK>,
> +                 <&mmcc CAMSS_CSI3RDI_CLK>,
> +                 <&mmcc CAMSS_VFE_VFE0_CLK>,
> +                 <&mmcc CAMSS_VFE_VFE1_CLK>,
> +                 <&mmcc CAMSS_CSI_VFE0_CLK>,
> +                 <&mmcc CAMSS_CSI_VFE1_CLK>,
> +                 <&mmcc CAMSS_VFE_VFE_AHB_CLK>,
> +                 <&mmcc CAMSS_VFE_VFE_AXI_CLK>;
> +        clock-names = "top_ahb",
> +                      "ispif_ahb",
> +                      "csiphy0_timer",
> +                      "csiphy1_timer",
> +                      "csiphy2_timer",
> +                      "csi0_ahb",
> +                      "csi0",
> +                      "csi0_phy",
> +                      "csi0_pix",
> +                      "csi0_rdi",
> +                      "csi1_ahb",
> +                      "csi1",
> +                      "csi1_phy",
> +                      "csi1_pix",
> +                      "csi1_rdi",
> +                      "csi2_ahb",
> +                      "csi2",
> +                      "csi2_phy",
> +                      "csi2_pix",
> +                      "csi2_rdi",
> +                      "csi3_ahb",
> +                      "csi3",
> +                      "csi3_phy",
> +                      "csi3_pix",
> +                      "csi3_rdi",
> +                      "vfe0",
> +                      "vfe1",
> +                      "csi_vfe0",
> +                      "csi_vfe1",
> +                      "iface",
> +                      "bus";
> +
> +        vdda-supply = <&pm8941_l12>;
> +
> +        ports {
> +                #address-cells = <1>;
> +                #size-cells = <0>;

This is not a complete example... empty ports node is useless, isn't it?

> +        };
> +    };


Best regards,
Krzysztof

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

* Re: [RFC PATCH 09/14] dt-bindings: i2c: qcom-cci: add QCOM MSM8974 compatible
  2022-05-22 16:27 ` [RFC PATCH 09/14] dt-bindings: i2c: qcom-cci: add QCOM MSM8974 compatible Luca Weiss
@ 2022-05-23 10:07   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 31+ messages in thread
From: Krzysztof Kozlowski @ 2022-05-23 10:07 UTC (permalink / raw)
  To: Luca Weiss, linux-arm-msm
  Cc: ~postmarketos/upstreaming, phone-devel, Loic Poulain,
	Robert Foss, Rob Herring, Krzysztof Kozlowski, Todor Tomov,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab, linux-i2c,
	devicetree, linux-kernel, linux-media, matti.lehtimaki

On 22/05/2022 18:27, Luca Weiss wrote:
> Add the compatible for the CCI found in MSM8974 which supports two I2C
> masters.
> 
> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
> ---
>  Documentation/devicetree/bindings/i2c/i2c-qcom-cci.txt | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 


Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>


Best regards,
Krzysztof

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

* Re: [RFC PATCH 00/14] CAMSS support for MSM8974
  2022-05-22 16:27 [RFC PATCH 00/14] CAMSS support for MSM8974 Luca Weiss
                   ` (13 preceding siblings ...)
  2022-05-22 16:28 ` [RFC PATCH 14/14] [DNM] media: camss: hacks for MSM8974 Luca Weiss
@ 2022-05-23 12:39 ` Dmitry Baryshkov
  2022-05-23 18:30   ` Brian Masney
  14 siblings, 1 reply; 31+ messages in thread
From: Dmitry Baryshkov @ 2022-05-23 12:39 UTC (permalink / raw)
  To: Luca Weiss, linux-arm-msm
  Cc: ~postmarketos/upstreaming, phone-devel, Loic Poulain,
	Robert Foss, Rob Herring, Krzysztof Kozlowski, Todor Tomov,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab, linux-i2c,
	devicetree, linux-kernel, linux-media, matti.lehtimaki

On 22/05/2022 19:27, Luca Weiss wrote:
> This RFC series adds support for CAMSS and CCI that are found on
> msm8974, including the OV8865 found on the FP2.
> 
> The only reason it's marked RFC is that CAMSS doesn't behave properly on
> this SoC without the last commit which is obviously not upstreamable.
> Not sure if this should be a blocker for including most of the other
> patches because other than that it seems to work fine and I can get a
> picture from the camera sensor. When/if msm8974 gets IOMMU support I
> hope this should be resolved and it works without this hack.
> 
> I think at least the CCI patches could get applied as they're not
> dependent on the CAMSS hack?

I'd also vote for the camcc patches to be applied.

As for the camss, I'd suggest to get them verified to work properly with 
a hacked/non-upstreamable/etc. IOMMU driver if one exists. Otherwise we 
can easily get into a situation where we merge up code that contains 
bugs itself.

Another option might be to actually check whether the device has an 
IOMMU attached (see device_iommu_mapped()) and to select whether the 
driver should use SG or CONTIG depending on that.

As an additional note regarding the offset issue you've mentioned. It 
looks like there is an issue with the swiotlb. On the IFC6410 (apq8064, 
no IOMMU) I got an issue with the PCI-attached networking card. Received 
packets are offset by 4 (IIRC) bytes. The same type of adapter works on 
db820c (apq8096, working IOMMU). What kind of issues did you observe 
with the camss? If it looks like the issue I had, it might be a symptom 
of a more generic issue.

> 
> Luca Weiss (5):
>    dt-bindings: i2c: qcom-cci: add QCOM MSM8974 compatible
>    ARM: dts: qcom: msm8974: add CCI bus
>    ARM: dts: qcom: msm8974: add CAMSS node
>    ARM: dts: qcom: msm8974-FP2: Add OV8865 rear camera
>    [DNM] media: camss: hacks for MSM8974
> 
> Matti Lehtimäki (9):
>    media: dt-bindings: media: camss: Add qcom,msm8974-camss binding
>    media: camss: Add CAMSS_8x74 camss version
>    media: camss: vfe: Add support for 8x74
>    media: camss: video: Add support for 8x74
>    media: camss: csid: Add support for 8x74
>    media: camss: ispif: Add support for 8x74
>    media: camss: csiphy: Add support for 8x74
>    media: camss: Add 8x74 resources
>    i2c: qcom-cci: add msm8974 compatible
> 
>   .../devicetree/bindings/i2c/i2c-qcom-cci.txt  |   7 +-
>   .../bindings/media/qcom,msm8974-camss.yaml    | 321 ++++++++++++++++++
>   arch/arm/boot/dts/qcom-msm8974.dtsi           | 184 ++++++++++
>   .../dts/qcom-msm8974pro-fairphone-fp2.dts     |  70 ++++
>   drivers/i2c/busses/i2c-qcom-cci.c             |  35 ++
>   drivers/media/platform/qcom/camss/Kconfig     |   4 +-
>   .../media/platform/qcom/camss/camss-csid.c    |   3 +-
>   .../media/platform/qcom/camss/camss-csiphy.c  |   4 +-
>   .../media/platform/qcom/camss/camss-ispif.c   |   5 +-
>   drivers/media/platform/qcom/camss/camss-vfe.c |   7 +-
>   .../media/platform/qcom/camss/camss-video.c   |  17 +-
>   drivers/media/platform/qcom/camss/camss.c     | 161 +++++++++
>   drivers/media/platform/qcom/camss/camss.h     |   1 +
>   13 files changed, 801 insertions(+), 18 deletions(-)
>   create mode 100644 Documentation/devicetree/bindings/media/qcom,msm8974-camss.yaml
> 


-- 
With best wishes
Dmitry

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

* Re: [RFC PATCH 00/14] CAMSS support for MSM8974
  2022-05-23 12:39 ` [RFC PATCH 00/14] CAMSS support " Dmitry Baryshkov
@ 2022-05-23 18:30   ` Brian Masney
  0 siblings, 0 replies; 31+ messages in thread
From: Brian Masney @ 2022-05-23 18:30 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Luca Weiss, linux-arm-msm, ~postmarketos/upstreaming,
	phone-devel, Loic Poulain, Robert Foss, Rob Herring,
	Krzysztof Kozlowski, Todor Tomov, Andy Gross, Bjorn Andersson,
	Mauro Carvalho Chehab, linux-i2c, devicetree, linux-kernel,
	linux-media, matti.lehtimaki

On Mon, May 23, 2022 at 03:39:53PM +0300, Dmitry Baryshkov wrote:
> On 22/05/2022 19:27, Luca Weiss wrote:
> > This RFC series adds support for CAMSS and CCI that are found on
> > msm8974, including the OV8865 found on the FP2.
> > 
> > The only reason it's marked RFC is that CAMSS doesn't behave properly on
> > this SoC without the last commit which is obviously not upstreamable.
> > Not sure if this should be a blocker for including most of the other
> > patches because other than that it seems to work fine and I can get a
> > picture from the camera sensor. When/if msm8974 gets IOMMU support I
> > hope this should be resolved and it works without this hack.
> > 
> > I think at least the CCI patches could get applied as they're not
> > dependent on the CAMSS hack?
> 
> I'd also vote for the camcc patches to be applied.
> 
> As for the camss, I'd suggest to get them verified to work properly with a
> hacked/non-upstreamable/etc. IOMMU driver if one exists. Otherwise we can
> easily get into a situation where we merge up code that contains bugs
> itself.

Last I checked, there's no IOMMU driver for msm8974 that works with an
upstream kernel at the moment. About 2 years ago, I took a stab at
attempting to enable IOMMU for the display and ran into some issues that
I documented at:

https://lore.kernel.org/lkml/20200109002606.35653-1-masneyb@onstation.org/

I'm not familiar with this part of the hardware and haven't had time
since then to look into this further.

Brian


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

* Re: [RFC PATCH 11/14] ARM: dts: qcom: msm8974: add CCI bus
  2022-05-22 16:27 ` [RFC PATCH 11/14] ARM: dts: qcom: msm8974: add CCI bus Luca Weiss
@ 2022-05-26 12:16   ` Robert Foss
  0 siblings, 0 replies; 31+ messages in thread
From: Robert Foss @ 2022-05-26 12:16 UTC (permalink / raw)
  To: Luca Weiss
  Cc: linux-arm-msm, ~postmarketos/upstreaming, phone-devel,
	Loic Poulain, Rob Herring, Krzysztof Kozlowski, Todor Tomov,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab, linux-i2c,
	devicetree, linux-kernel, linux-media, matti.lehtimaki

This patch does not apply on upstream-media/master or
upstream-next/master. Is there another branch this series should be
applied to?

On Sun, 22 May 2022 at 18:28, Luca Weiss <luca@z3ntu.xyz> wrote:
>
> Add a node for the camera-specific i2c bus found on msm8974.
>
> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
> ---
>  arch/arm/boot/dts/qcom-msm8974.dtsi | 62 +++++++++++++++++++++++++++++
>  1 file changed, 62 insertions(+)
>
> diff --git a/arch/arm/boot/dts/qcom-msm8974.dtsi b/arch/arm/boot/dts/qcom-msm8974.dtsi
> index ffa6f874917a..a80b4ae71745 100644
> --- a/arch/arm/boot/dts/qcom-msm8974.dtsi
> +++ b/arch/arm/boot/dts/qcom-msm8974.dtsi
> @@ -1434,6 +1434,34 @@ blsp2_i2c5_sleep: blsp2-i2c5-sleep {
>
>                         /* BLSP2_I2C6 info is missing - nobody uses it though? */
>
> +                       cci0_default: cci0-default {
> +                               pins = "gpio19", "gpio20";
> +                               function = "cci_i2c0";
> +                               drive-strength = <2>;
> +                               bias-disable;
> +                       };
> +
> +                       cci0_sleep: cci0-sleep {
> +                               pins = "gpio19", "gpio20";
> +                               function = "gpio";
> +                               drive-strength = <2>;
> +                               bias-disable;
> +                       };
> +
> +                       cci1_default: cci1-default {
> +                               pins = "gpio21", "gpio22";
> +                               function = "cci_i2c1";
> +                               drive-strength = <2>;
> +                               bias-disable;
> +                       };
> +
> +                       cci1_sleep: cci1-sleep {
> +                               pins = "gpio21", "gpio22";
> +                               function = "gpio";
> +                               drive-strength = <2>;
> +                               bias-disable;
> +                       };
> +
>                         spi8_default: spi8_default {
>                                 mosi {
>                                         pins = "gpio45";
> @@ -1587,6 +1615,40 @@ dsi0_phy: dsi-phy@fd922a00 {
>                         };
>                 };
>
> +               cci: cci@fda0c000 {
> +                       compatible = "qcom,msm8974-cci";
> +                       #address-cells = <1>;
> +                       #size-cells = <0>;
> +                       reg = <0xfda0c000 0x1000>;
> +                       interrupts = <GIC_SPI 50 IRQ_TYPE_EDGE_RISING>;
> +                       clocks = <&mmcc CAMSS_TOP_AHB_CLK>,
> +                                <&mmcc CAMSS_CCI_CCI_AHB_CLK>,
> +                                <&mmcc CAMSS_CCI_CCI_CLK>;
> +                       clock-names = "camss_top_ahb",
> +                                     "cci_ahb",
> +                                     "cci";
> +
> +                       pinctrl-names = "default", "sleep";
> +                       pinctrl-0 = <&cci0_default &cci1_default>;
> +                       pinctrl-1 = <&cci0_sleep &cci1_sleep>;
> +
> +                       status = "disabled";
> +
> +                       cci_i2c0: i2c-bus@0 {
> +                               reg = <0>;
> +                               clock-frequency = <400000>;
> +                               #address-cells = <1>;
> +                               #size-cells = <0>;
> +                       };
> +
> +                       cci_i2c1: i2c-bus@1 {
> +                               reg = <1>;
> +                               clock-frequency = <400000>;
> +                               #address-cells = <1>;
> +                               #size-cells = <0>;
> +                       };
> +               };
> +
>                 gpu: adreno@fdb00000 {
>                         compatible = "qcom,adreno-330.1", "qcom,adreno";
>                         reg = <0xfdb00000 0x10000>;
> --
> 2.36.0
>

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

* Re: [RFC PATCH 02/14] media: camss: Add CAMSS_8x74 camss version
  2022-05-22 16:27 ` [RFC PATCH 02/14] media: camss: Add CAMSS_8x74 camss version Luca Weiss
@ 2022-05-26 12:32   ` Robert Foss
  0 siblings, 0 replies; 31+ messages in thread
From: Robert Foss @ 2022-05-26 12:32 UTC (permalink / raw)
  To: Luca Weiss
  Cc: linux-arm-msm, ~postmarketos/upstreaming, phone-devel,
	Loic Poulain, Rob Herring, Krzysztof Kozlowski, Todor Tomov,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab, linux-i2c,
	devicetree, linux-kernel, linux-media, matti.lehtimaki

On Sun, 22 May 2022 at 18:28, Luca Weiss <luca@z3ntu.xyz> wrote:
>
> From: Matti Lehtimäki <matti.lehtimaki@gmail.com>
>
> Add enum representing the MSM8x74 SOC.
>
> Signed-off-by: Matti Lehtimäki <matti.lehtimaki@gmail.com>
> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
> ---
>  drivers/media/platform/qcom/camss/camss.h | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/media/platform/qcom/camss/camss.h b/drivers/media/platform/qcom/camss/camss.h
> index c9b3e0df5be8..663cf24f52d9 100644
> --- a/drivers/media/platform/qcom/camss/camss.h
> +++ b/drivers/media/platform/qcom/camss/camss.h
> @@ -76,6 +76,7 @@ enum pm_domain {
>
>  enum camss_version {
>         CAMSS_8x16,
> +       CAMSS_8x74,
>         CAMSS_8x96,
>         CAMSS_660,
>         CAMSS_845,
> --
> 2.36.0
>

Reviewed-by: Robert Foss <robert.foss@linaro.org>

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

* Re: [RFC PATCH 03/14] media: camss: vfe: Add support for 8x74
  2022-05-22 16:27 ` [RFC PATCH 03/14] media: camss: vfe: Add support for 8x74 Luca Weiss
@ 2022-05-26 12:36   ` Robert Foss
  0 siblings, 0 replies; 31+ messages in thread
From: Robert Foss @ 2022-05-26 12:36 UTC (permalink / raw)
  To: Luca Weiss
  Cc: linux-arm-msm, ~postmarketos/upstreaming, phone-devel,
	Loic Poulain, Rob Herring, Krzysztof Kozlowski, Todor Tomov,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab, linux-i2c,
	devicetree, linux-kernel, linux-media, matti.lehtimaki

On Sun, 22 May 2022 at 18:28, Luca Weiss <luca@z3ntu.xyz> wrote:
>
> From: Matti Lehtimäki <matti.lehtimaki@gmail.com>
>
> VFE hardware modules on 8x74 and 8x16 are similar.
>
> Signed-off-by: Matti Lehtimäki <matti.lehtimaki@gmail.com>
> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
> ---
>  drivers/media/platform/qcom/camss/camss-vfe.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/platform/qcom/camss/camss-vfe.c b/drivers/media/platform/qcom/camss/camss-vfe.c
> index 5b148e9f8134..ace53ed24884 100644
> --- a/drivers/media/platform/qcom/camss/camss-vfe.c
> +++ b/drivers/media/platform/qcom/camss/camss-vfe.c
> @@ -170,7 +170,8 @@ static u32 vfe_src_pad_code(struct vfe_line *line, u32 sink_code,
>  {
>         struct vfe_device *vfe = to_vfe(line);
>
> -       if (vfe->camss->version == CAMSS_8x16)
> +       if (vfe->camss->version == CAMSS_8x16 ||
> +               vfe->camss->version == CAMSS_8x74)

Match indentation of previous line.

CHECK: Alignment should match open parenthesis
#27: FILE: drivers/media/platform/qcom/camss/camss-vfe.c:174:
+    if (vfe->camss->version == CAMSS_8x16 ||
+        vfe->camss->version == CAMSS_8x74)

>                 switch (sink_code) {
>                 case MEDIA_BUS_FMT_YUYV8_2X8:
>                 {
> @@ -1286,6 +1287,7 @@ int msm_vfe_subdev_init(struct camss *camss, struct vfe_device *vfe,
>
>         switch (camss->version) {
>         case CAMSS_8x16:
> +       case CAMSS_8x74:
>                 vfe->ops = &vfe_ops_4_1;
>                 break;
>         case CAMSS_8x96:
> @@ -1390,7 +1392,8 @@ int msm_vfe_subdev_init(struct camss *camss, struct vfe_device *vfe,
>                 init_completion(&l->output.sof);
>                 init_completion(&l->output.reg_update);
>
> -               if (camss->version == CAMSS_8x16) {
> +               if (camss->version == CAMSS_8x16 ||
> +                       camss->version == CAMSS_8x74) {

Same

>                         if (i == VFE_LINE_PIX) {
>                                 l->formats = formats_pix_8x16;
>                                 l->nformats = ARRAY_SIZE(formats_pix_8x16);
> --
> 2.36.0
>

With that fixed:
Reviewed-by: Robert Foss <robert.foss@linaro.org>

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

* Re: [RFC PATCH 04/14] media: camss: video: Add support for 8x74
  2022-05-22 16:27 ` [RFC PATCH 04/14] media: camss: video: " Luca Weiss
@ 2022-05-26 12:37   ` Robert Foss
  0 siblings, 0 replies; 31+ messages in thread
From: Robert Foss @ 2022-05-26 12:37 UTC (permalink / raw)
  To: Luca Weiss
  Cc: linux-arm-msm, ~postmarketos/upstreaming, phone-devel,
	Loic Poulain, Rob Herring, Krzysztof Kozlowski, Todor Tomov,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab, linux-i2c,
	devicetree, linux-kernel, linux-media, matti.lehtimaki

On Sun, 22 May 2022 at 18:28, Luca Weiss <luca@z3ntu.xyz> wrote:
>
> From: Matti Lehtimäki <matti.lehtimaki@gmail.com>
>
> Video formats in 8x16 and 8x74 are similar.
>
> Signed-off-by: Matti Lehtimäki <matti.lehtimaki@gmail.com>
> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
> ---
>  drivers/media/platform/qcom/camss/camss-video.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/platform/qcom/camss/camss-video.c b/drivers/media/platform/qcom/camss/camss-video.c
> index 307bb1dc4589..ca955808fd6d 100644
> --- a/drivers/media/platform/qcom/camss/camss-video.c
> +++ b/drivers/media/platform/qcom/camss/camss-video.c
> @@ -990,7 +990,8 @@ int msm_video_register(struct camss_video *video, struct v4l2_device *v4l2_dev,
>
>         mutex_init(&video->lock);
>
> -       if (video->camss->version == CAMSS_8x16) {
> +       if (video->camss->version == CAMSS_8x16 ||
> +               video->camss->version == CAMSS_8x74) {

#27: FILE: drivers/media/platform/qcom/camss/camss-video.c:994:
+    if (video->camss->version == CAMSS_8x16 ||
+        video->camss->version == CAMSS_8x74) {


>                 if (is_pix) {
>                         video->formats = formats_pix_8x16;
>                         video->nformats = ARRAY_SIZE(formats_pix_8x16);
> --
> 2.36.0
>

With that fixed:

Reviewed-by: Robert Foss <robert.foss@linaro.org>

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

* Re: [RFC PATCH 05/14] media: camss: csid: Add support for 8x74
  2022-05-22 16:27 ` [RFC PATCH 05/14] media: camss: csid: " Luca Weiss
@ 2022-05-26 12:38   ` Robert Foss
  0 siblings, 0 replies; 31+ messages in thread
From: Robert Foss @ 2022-05-26 12:38 UTC (permalink / raw)
  To: Luca Weiss
  Cc: linux-arm-msm, ~postmarketos/upstreaming, phone-devel,
	Loic Poulain, Rob Herring, Krzysztof Kozlowski, Todor Tomov,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab, linux-i2c,
	devicetree, linux-kernel, linux-media, matti.lehtimaki

On Sun, 22 May 2022 at 18:28, Luca Weiss <luca@z3ntu.xyz> wrote:
>
> From: Matti Lehtimäki <matti.lehtimaki@gmail.com>
>
> CSID hardware module on 8x74 is similar to 8x16.
>
> Signed-off-by: Matti Lehtimäki <matti.lehtimaki@gmail.com>
> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
> ---
>  drivers/media/platform/qcom/camss/camss-csid.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/platform/qcom/camss/camss-csid.c b/drivers/media/platform/qcom/camss/camss-csid.c
> index f993f349b66b..6b5cd9a66ff6 100644
> --- a/drivers/media/platform/qcom/camss/camss-csid.c
> +++ b/drivers/media/platform/qcom/camss/camss-csid.c
> @@ -570,7 +570,8 @@ int msm_csid_subdev_init(struct camss *camss, struct csid_device *csid,
>         csid->camss = camss;
>         csid->id = id;
>
> -       if (camss->version == CAMSS_8x16) {
> +       if (camss->version == CAMSS_8x16 ||
> +               camss->version == CAMSS_8x74) {

CHECK: Alignment should match open parenthesis
#27: FILE: drivers/media/platform/qcom/camss/camss-csid.c:574:
+    if (camss->version == CAMSS_8x16 ||
+        camss->version == CAMSS_8x74) {


>                 csid->ops = &csid_ops_4_1;
>         } else if (camss->version == CAMSS_8x96 ||
>                    camss->version == CAMSS_660) {
> --
> 2.36.0
>

With that fixed:

Reviewed-by: Robert Foss <robert.foss@linaro.org>

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

* Re: [RFC PATCH 06/14] media: camss: ispif: Add support for 8x74
  2022-05-22 16:27 ` [RFC PATCH 06/14] media: camss: ispif: " Luca Weiss
@ 2022-05-26 12:39   ` Robert Foss
  0 siblings, 0 replies; 31+ messages in thread
From: Robert Foss @ 2022-05-26 12:39 UTC (permalink / raw)
  To: Luca Weiss
  Cc: linux-arm-msm, ~postmarketos/upstreaming, phone-devel,
	Loic Poulain, Rob Herring, Krzysztof Kozlowski, Todor Tomov,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab, linux-i2c,
	devicetree, linux-kernel, linux-media, matti.lehtimaki

On Sun, 22 May 2022 at 18:28, Luca Weiss <luca@z3ntu.xyz> wrote:
>
> From: Matti Lehtimäki <matti.lehtimaki@gmail.com>
>
> ISPIF hardware modules on 8x74, 8x16 and 8x96 are similar. However on
> 8x74 the ISPIF routes data to two VFE hardware modules like 8x96 but
> formats are similar to 8x16.
>
> Signed-off-by: Matti Lehtimäki <matti.lehtimaki@gmail.com>
> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
> ---
>  drivers/media/platform/qcom/camss/camss-ispif.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/platform/qcom/camss/camss-ispif.c b/drivers/media/platform/qcom/camss/camss-ispif.c
> index 4ee11bb979cd..693807bf3c6b 100644
> --- a/drivers/media/platform/qcom/camss/camss-ispif.c
> +++ b/drivers/media/platform/qcom/camss/camss-ispif.c
> @@ -1112,6 +1112,7 @@ int msm_ispif_subdev_init(struct camss *camss,
>         if (camss->version == CAMSS_8x16)
>                 ispif->line_num = 2;
>         else if (camss->version == CAMSS_8x96 ||
> +                camss->version == CAMSS_8x74 ||
>                  camss->version == CAMSS_660)
>                 ispif->line_num = 4;
>         else
> @@ -1126,7 +1127,8 @@ int msm_ispif_subdev_init(struct camss *camss,
>                 ispif->line[i].ispif = ispif;
>                 ispif->line[i].id = i;
>
> -               if (camss->version == CAMSS_8x16) {
> +               if (camss->version == CAMSS_8x16 ||
> +                          camss->version == CAMSS_8x74) {

CHECK: Alignment should match open parenthesis
#37: FILE: drivers/media/platform/qcom/camss/camss-ispif.c:1131:
+        if (camss->version == CAMSS_8x16 ||
+               camss->version == CAMSS_8x74) {


>                         ispif->line[i].formats = ispif_formats_8x16;
>                         ispif->line[i].nformats =
>                                         ARRAY_SIZE(ispif_formats_8x16);
> @@ -1163,6 +1165,7 @@ int msm_ispif_subdev_init(struct camss *camss,
>                 ret = devm_request_irq(dev, ispif->irq, ispif_isr_8x16,
>                                IRQF_TRIGGER_RISING, ispif->irq_name, ispif);
>         else if (camss->version == CAMSS_8x96 ||
> +                camss->version == CAMSS_8x74 ||
>                  camss->version == CAMSS_660)
>                 ret = devm_request_irq(dev, ispif->irq, ispif_isr_8x96,
>                                IRQF_TRIGGER_RISING, ispif->irq_name, ispif);
> --
> 2.36.0
>

With that fixed:
Reviewed-by: Robert Foss <robert.foss@linaro.org>

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

* Re: [RFC PATCH 07/14] media: camss: csiphy: Add support for 8x74
  2022-05-22 16:27 ` [RFC PATCH 07/14] media: camss: csiphy: " Luca Weiss
@ 2022-05-26 12:40   ` Robert Foss
  0 siblings, 0 replies; 31+ messages in thread
From: Robert Foss @ 2022-05-26 12:40 UTC (permalink / raw)
  To: Luca Weiss
  Cc: linux-arm-msm, ~postmarketos/upstreaming, phone-devel,
	Loic Poulain, Rob Herring, Krzysztof Kozlowski, Todor Tomov,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab, linux-i2c,
	devicetree, linux-kernel, linux-media, matti.lehtimaki

On Sun, 22 May 2022 at 18:28, Luca Weiss <luca@z3ntu.xyz> wrote:
>
> From: Matti Lehtimäki <matti.lehtimaki@gmail.com>
>
> CSIPHY hardware modules in 8x74 and 8x16 are similar.
>
> Signed-off-by: Matti Lehtimäki <matti.lehtimaki@gmail.com>
> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
> ---
>  drivers/media/platform/qcom/camss/camss-csiphy.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/platform/qcom/camss/camss-csiphy.c b/drivers/media/platform/qcom/camss/camss-csiphy.c
> index 75fcfc627400..a0122705a874 100644
> --- a/drivers/media/platform/qcom/camss/camss-csiphy.c
> +++ b/drivers/media/platform/qcom/camss/camss-csiphy.c
> @@ -557,7 +557,8 @@ int msm_csiphy_subdev_init(struct camss *camss,
>         csiphy->id = id;
>         csiphy->cfg.combo_mode = 0;
>
> -       if (camss->version == CAMSS_8x16) {
> +       if (camss->version == CAMSS_8x16 ||
> +                  camss->version == CAMSS_8x74) {

CHECK: Alignment should match open parenthesis
#27: FILE: drivers/media/platform/qcom/camss/camss-csiphy.c:561:
+    if (camss->version == CAMSS_8x16 ||
+           camss->version == CAMSS_8x74) {


>                 csiphy->ops = &csiphy_ops_2ph_1_0;
>                 csiphy->formats = csiphy_formats_8x16;
>                 csiphy->nformats = ARRAY_SIZE(csiphy_formats_8x16);
> @@ -582,6 +583,7 @@ int msm_csiphy_subdev_init(struct camss *camss,
>                 return PTR_ERR(csiphy->base);
>
>         if (camss->version == CAMSS_8x16 ||
> +           camss->version == CAMSS_8x74 ||
>             camss->version == CAMSS_8x96) {
>                 csiphy->base_clk_mux =
>                         devm_platform_ioremap_resource_byname(pdev, res->reg[1]);
> --
> 2.36.0
>

With that fixed:
Reviewed-by: Robert Foss <robert.foss@linaro.org>

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

* Re: [RFC PATCH 08/14] media: camss: Add 8x74 resources
  2022-05-22 16:27 ` [RFC PATCH 08/14] media: camss: Add 8x74 resources Luca Weiss
@ 2022-05-26 12:42   ` Robert Foss
  0 siblings, 0 replies; 31+ messages in thread
From: Robert Foss @ 2022-05-26 12:42 UTC (permalink / raw)
  To: Luca Weiss
  Cc: linux-arm-msm, ~postmarketos/upstreaming, phone-devel,
	Loic Poulain, Rob Herring, Krzysztof Kozlowski, Todor Tomov,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab, linux-i2c,
	devicetree, linux-kernel, linux-media, matti.lehtimaki

On Sun, 22 May 2022 at 18:28, Luca Weiss <luca@z3ntu.xyz> wrote:
>
> From: Matti Lehtimäki <matti.lehtimaki@gmail.com>
>
> Add structs with 8x74 resources. The number of CSIPHY, CSID
> and VFE hardware modules is the same as 8x96 but the support
> is otherwise different.
>
> Signed-off-by: Matti Lehtimäki <matti.lehtimaki@gmail.com>
> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
> ---
>  drivers/media/platform/qcom/camss/camss.c | 161 ++++++++++++++++++++++
>  1 file changed, 161 insertions(+)
>
> diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c
> index 79ad82e233cb..5a69ce48c792 100644
> --- a/drivers/media/platform/qcom/camss/camss.c
> +++ b/drivers/media/platform/qcom/camss/camss.c
> @@ -126,6 +126,154 @@ static const struct resources vfe_res_8x16[] = {
>         }
>  };
>
> +static const struct resources csiphy_res_8974[] = {
> +       /* CSIPHY0 */
> +       {
> +               .regulators = { NULL },
> +               .clock = { "top_ahb", "ispif_ahb", "csiphy0_timer" },
> +               .clock_rate = { { 0 },
> +                               { 0 },
> +                               { 100000000, 200000000 } },
> +               .reg = { "csiphy0", "csiphy0_clk_mux" },
> +               .interrupt = { "csiphy0" }
> +       },
> +
> +       /* CSIPHY1 */
> +       {
> +               .regulators = { NULL },
> +               .clock = { "top_ahb", "ispif_ahb", "csiphy1_timer" },
> +               .clock_rate = { { 0 },
> +                               { 0 },
> +                               { 100000000, 200000000 } },
> +               .reg = { "csiphy1", "csiphy1_clk_mux" },
> +               .interrupt = { "csiphy1" }
> +       },
> +
> +       /* CSIPHY2 */
> +       {
> +               .regulators = { NULL },
> +               .clock = { "top_ahb", "ispif_ahb", "csiphy2_timer" },
> +               .clock_rate = { { 0 },
> +                               { 0 },
> +                               { 100000000, 200000000 } },
> +               .reg = { "csiphy2", "csiphy2_clk_mux" },
> +               .interrupt = { "csiphy2" }
> +       }
> +};
> +
> +static const struct resources csid_res_8974[] = {
> +       /* CSID0 */
> +       {
> +               .regulators = { "vdda" },
> +               .clock = { "top_ahb", "ispif_ahb", "csi0_ahb",
> +                          "csi0", "csi0_phy", "csi0_pix", "csi0_rdi" },
> +               .clock_rate = { { 0 },
> +                               { 0 },
> +                               { 0 },
> +                               { 100000000, 200000000 },
> +                               { 0 },
> +                               { 0 },
> +                               { 0 } },
> +               .reg = { "csid0" },
> +               .interrupt = { "csid0" }
> +       },
> +
> +       /* CSID1 */
> +       {
> +               .regulators = { "vdda" },
> +               .clock = { "top_ahb", "ispif_ahb", "csi1_ahb",
> +                          "csi1", "csi1_phy", "csi1_pix", "csi1_rdi" },
> +               .clock_rate = { { 0 },
> +                               { 0 },
> +                               { 0 },
> +                               { 100000000, 200000000 },
> +                               { 0 },
> +                               { 0 },
> +                               { 0 } },
> +               .reg = { "csid1" },
> +               .interrupt = { "csid1" }
> +       },
> +
> +       /* CSID2 */
> +       {
> +               .regulators = { "vdda" },
> +               .clock = { "top_ahb", "ispif_ahb", "csi2_ahb",
> +                          "csi2", "csi2_phy", "csi2_pix", "csi2_rdi" },
> +               .clock_rate = { { 0 },
> +                               { 0 },
> +                               { 0 },
> +                               { 100000000, 200000000 },
> +                               { 0 },
> +                               { 0 },
> +                               { 0 } },
> +               .reg = { "csid2" },
> +               .interrupt = { "csid2" }
> +       },
> +
> +       /* CSID3 */
> +       {
> +               .regulators = { "vdda" },
> +               .clock = { "top_ahb", "ispif_ahb", "csi3_ahb",
> +                          "csi3", "csi3_phy", "csi3_pix", "csi3_rdi" },
> +               .clock_rate = { { 0 },
> +                               { 0 },
> +                               { 0 },
> +                               { 100000000, 200000000 },
> +                               { 0 },
> +                               { 0 },
> +                               { 0 } },
> +               .reg = { "csid3" },
> +               .interrupt = { "csid3" }
> +       }
> +};
> +
> +static const struct resources_ispif ispif_res_8974 = {
> +       /* ISPIF */
> +       .clock = { "top_ahb", "ispif_ahb",
> +                  "csi0", "csi0_pix", "csi0_rdi",
> +                  "csi1", "csi1_pix", "csi1_rdi",
> +                  "csi2", "csi2_pix", "csi2_rdi",
> +                  "csi3", "csi3_pix", "csi3_rdi" },
> +       .clock_for_reset = { "vfe0", "csi_vfe0",
> +                  "vfe1", "csi_vfe1" },
> +       .reg = { "ispif", "csi_clk_mux" },
> +       .interrupt = "ispif"
> +
> +};
> +
> +static const struct resources vfe_res_8974[] = {
> +       /* VFE0 */
> +       {
> +               .regulators = { NULL },
> +               .clock = { "top_ahb", "vfe0", "csi_vfe0",
> +                          "iface", "bus" },
> +               .clock_rate = { { 0 },
> +                               { 50000000, 80000000, 100000000, 160000000,
> +                                 177780000, 200000000, 266670000, 320000000,
> +                                 400000000, 400000000 },
> +                               { 0 },
> +                               { 0 },
> +                               { 0 } },
> +               .reg = { "vfe0" },
> +               .interrupt = { "vfe0" }
> +       },
> +       /* VFE1 */
> +       {
> +               .regulators = { NULL },
> +               .clock = { "top_ahb", "vfe1", "csi_vfe1",
> +                          "iface", "bus" },
> +               .clock_rate = { { 0 },
> +                               { 50000000, 80000000, 100000000, 160000000,
> +                                 177780000, 200000000, 266670000, 320000000,
> +                                 400000000, 400000000 },
> +                               { 0 },
> +                               { 0 },
> +                               { 0 } },
> +               .reg = { "vfe1" },
> +               .interrupt = { "vfe1" }
> +       }
> +};
> +
>  static const struct resources csiphy_res_8x96[] = {
>         /* CSIPHY0 */
>         {
> @@ -1132,6 +1280,11 @@ static int camss_init_subdevices(struct camss *camss)
>                 csid_res = csid_res_8x16;
>                 ispif_res = &ispif_res_8x16;
>                 vfe_res = vfe_res_8x16;
> +       } else if (camss->version == CAMSS_8x74) {
> +               csiphy_res = csiphy_res_8974;
> +               csid_res = csid_res_8974;
> +               ispif_res = &ispif_res_8974;
> +               vfe_res = vfe_res_8974;
>         } else if (camss->version == CAMSS_8x96) {
>                 csiphy_res = csiphy_res_8x96;
>                 csid_res = csid_res_8x96;
> @@ -1542,6 +1695,12 @@ static int camss_probe(struct platform_device *pdev)
>                 camss->csiphy_num = 2;
>                 camss->csid_num = 2;
>                 camss->vfe_num = 1;
> +       } else if (of_device_is_compatible(dev->of_node,
> +                                          "qcom,msm8974-camss")) {
> +               camss->version = CAMSS_8x74;
> +               camss->csiphy_num = 3;
> +               camss->csid_num = 4;
> +               camss->vfe_num = 2;
>         } else if (of_device_is_compatible(dev->of_node,
>                                            "qcom,msm8996-camss")) {
>                 camss->version = CAMSS_8x96;
> @@ -1586,6 +1745,7 @@ static int camss_probe(struct platform_device *pdev)
>         }
>
>         if (camss->version == CAMSS_8x16 ||
> +           camss->version == CAMSS_8x74 ||
>             camss->version == CAMSS_8x96) {
>                 camss->ispif = devm_kcalloc(dev, 1, sizeof(*camss->ispif), GFP_KERNEL);
>                 if (!camss->ispif) {
> @@ -1735,6 +1895,7 @@ static int camss_remove(struct platform_device *pdev)
>
>  static const struct of_device_id camss_dt_match[] = {
>         { .compatible = "qcom,msm8916-camss" },
> +       { .compatible = "qcom,msm8974-camss" },
>         { .compatible = "qcom,msm8996-camss" },
>         { .compatible = "qcom,sdm660-camss" },
>         { .compatible = "qcom,sdm845-camss" },
> --
> 2.36.0
>

Reviewed-by: Robert Foss <robert.foss@linaro.org>

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

* Re: [RFC PATCH 01/14] media: dt-bindings: media: camss: Add qcom,msm8974-camss binding
  2022-05-23 10:07   ` Krzysztof Kozlowski
@ 2022-06-02 13:01     ` Rob Herring
  0 siblings, 0 replies; 31+ messages in thread
From: Rob Herring @ 2022-06-02 13:01 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Luca Weiss, linux-arm-msm, ~postmarketos/upstreaming,
	phone-devel, Loic Poulain, Robert Foss, Krzysztof Kozlowski,
	Todor Tomov, Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab,
	linux-i2c, devicetree, linux-kernel, linux-media,
	matti.lehtimaki

On Mon, May 23, 2022 at 12:07:10PM +0200, Krzysztof Kozlowski wrote:
> On 22/05/2022 18:27, Luca Weiss wrote:
> > From: Matti Lehtimäki <matti.lehtimaki@gmail.com>
> 
> Thank you for your patch. There is something to discuss/improve.
> 
> > 
> > Add bindings for qcom,msm8974-camss in order to support the camera
> > subsystem on MSM8974.
> > 
> > Signed-off-by: Matti Lehtimäki <matti.lehtimaki@gmail.com>
> > Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
> > ---
> >  .../bindings/media/qcom,msm8974-camss.yaml    | 321 ++++++++++++++++++
> >  1 file changed, 321 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/media/qcom,msm8974-camss.yaml
> > 
> > diff --git a/Documentation/devicetree/bindings/media/qcom,msm8974-camss.yaml b/Documentation/devicetree/bindings/media/qcom,msm8974-camss.yaml
> > new file mode 100644
> > index 000000000000..f8f71e477535
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/media/qcom,msm8974-camss.yaml
> > @@ -0,0 +1,321 @@
> > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > +
> > +%YAML 1.2
> > +---
> > +$id: "http://devicetree.org/schemas/media/qcom,msm8974-camss.yaml#"
> > +$schema: "http://devicetree.org/meta-schemas/core.yaml#"
> > +
> > +title: Qualcomm CAMSS ISP
> > +
> > +maintainers:
> > +  - Robert Foss <robert.foss@linaro.org>
> > +
> > +description: |
> > +  The CAMSS IP is a CSI decoder and ISP present on Qualcomm platforms
> > +
> > +properties:
> > +  compatible:
> > +    const: qcom,msm8974-camss
> > +
> > +  clocks:
> > +    minItems: 31
> 
> No need for minItems, they are equal to max by default.
> 
> > +    maxItems: 31
> > +
> > +  clock-names:
> > +    items:
> > +      - const: top_ahb
> > +      - const: ispif_ahb
> > +      - const: csiphy0_timer
> > +      - const: csiphy1_timer
> > +      - const: csiphy2_timer
> > +      - const: csi0_ahb
> > +      - const: csi0
> > +      - const: csi0_phy
> > +      - const: csi0_pix
> > +      - const: csi0_rdi
> > +      - const: csi1_ahb
> > +      - const: csi1
> > +      - const: csi1_phy
> > +      - const: csi1_pix
> > +      - const: csi1_rdi
> > +      - const: csi2_ahb
> > +      - const: csi2
> > +      - const: csi2_phy
> > +      - const: csi2_pix
> > +      - const: csi2_rdi
> > +      - const: csi3_ahb
> > +      - const: csi3
> > +      - const: csi3_phy
> > +      - const: csi3_pix
> > +      - const: csi3_rdi
> > +      - const: vfe0
> > +      - const: vfe1
> > +      - const: csi_vfe0
> > +      - const: csi_vfe1
> > +      - const: iface
> > +      - const: bus
> > +
> > +  interrupts:
> > +    minItems: 10
> 
> Same.
> 
> > +    maxItems: 10
> > +
> > +  interrupt-names:
> > +    items:
> > +      - const: csiphy0
> > +      - const: csiphy1
> > +      - const: csiphy2
> > +      - const: csid0
> > +      - const: csid1
> > +      - const: csid2
> > +      - const: csid3
> > +      - const: ispif
> > +      - const: vfe0
> > +      - const: vfe1
> > +
> > +  power-domains:
> > +    items:
> > +      - description: VFE GDSC - Video Front End, Global Distributed Switch Controller.
> > +
> > +  ports:
> > +    $ref: /schemas/graph.yaml#/properties/ports
> > +
> > +    description:
> > +      CSI input ports.
> > +
> > +    properties:
> > +      port@0:
> > +        $ref: /schemas/graph.yaml#/$defs/port-base
> > +        unevaluatedProperties: false
> > +        description:
> > +          Input port for receiving CSI data.
> > +
> > +        properties:
> > +          endpoint:
> > +            $ref: video-interfaces.yaml#
> > +            unevaluatedProperties: false
> > +
> > +            properties:
> > +              clock-lanes:
> > +                items:
> > +                  - const: 1
> > +
> > +              data-lanes:
> > +                minItems: 1
> > +                maxItems: 4
> > +
> > +            required:
> > +              - clock-lanes
> > +              - data-lanes
> > +
> > +      port@1:
> 
> These look all the same, so just use patternPropreties (in "ports") with
> proper pattern.

That's fine, but whatever difference there is in ports 0, 1, and 2 needs 
to be described.

> > +        $ref: /schemas/graph.yaml#/$defs/port-base
> > +        unevaluatedProperties: false
> > +        description:
> > +          Input port for receiving CSI data.

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

* Re: [RFC PATCH 10/14] i2c: qcom-cci: add msm8974 compatible
  2022-05-22 16:27 ` [RFC PATCH 10/14] i2c: qcom-cci: add msm8974 compatible Luca Weiss
@ 2022-06-14 20:20   ` Wolfram Sang
  2022-06-15 17:13     ` Loic Poulain
  2022-06-15 17:11   ` Loic Poulain
  1 sibling, 1 reply; 31+ messages in thread
From: Wolfram Sang @ 2022-06-14 20:20 UTC (permalink / raw)
  To: Luca Weiss
  Cc: linux-arm-msm, ~postmarketos/upstreaming, phone-devel,
	Loic Poulain, Robert Foss, Rob Herring, Krzysztof Kozlowski,
	Todor Tomov, Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab,
	linux-i2c, devicetree, linux-kernel, linux-media,
	matti.lehtimaki

[-- Attachment #1: Type: text/plain, Size: 619 bytes --]

On Sun, May 22, 2022 at 06:27:58PM +0200, Luca Weiss wrote:
> From: Matti Lehtimäki <matti.lehtimaki@gmail.com>
> 
> MSM8974 CCI is the same as MSM8916 except it has two masters.
> 
> Signed-off-by: Matti Lehtimäki <matti.lehtimaki@gmail.com>
> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
> ---
> To note, the cci_v1_5_data variable name is just a bit arbitrary and
> isn't meant to reflect IP version "1.5". I'd be happy to change the
> variable name to something else.

Loic, Robert: I know this series is marked RFC, but the I2C patches
adding a new SoC to the driver are maybe interesting already?


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [RFC PATCH 10/14] i2c: qcom-cci: add msm8974 compatible
  2022-05-22 16:27 ` [RFC PATCH 10/14] i2c: qcom-cci: add msm8974 compatible Luca Weiss
  2022-06-14 20:20   ` Wolfram Sang
@ 2022-06-15 17:11   ` Loic Poulain
  1 sibling, 0 replies; 31+ messages in thread
From: Loic Poulain @ 2022-06-15 17:11 UTC (permalink / raw)
  To: Luca Weiss
  Cc: linux-arm-msm, ~postmarketos/upstreaming, phone-devel,
	Robert Foss, Rob Herring, Krzysztof Kozlowski, Todor Tomov,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab, linux-i2c,
	devicetree, linux-kernel, linux-media, matti.lehtimaki

On Sun, 22 May 2022 at 18:28, Luca Weiss <luca@z3ntu.xyz> wrote:
>
> From: Matti Lehtimäki <matti.lehtimaki@gmail.com>
>
> MSM8974 CCI is the same as MSM8916 except it has two masters.
>
> Signed-off-by: Matti Lehtimäki <matti.lehtimaki@gmail.com>
> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>

Reviewed-by: Loic Poulain <loic.poulain@linaro.org>

> ---
> To note, the cci_v1_5_data variable name is just a bit arbitrary and
> isn't meant to reflect IP version "1.5". I'd be happy to change the
> variable name to something else.
>
>  drivers/i2c/busses/i2c-qcom-cci.c | 35 +++++++++++++++++++++++++++++++
>  1 file changed, 35 insertions(+)
>
> diff --git a/drivers/i2c/busses/i2c-qcom-cci.c b/drivers/i2c/busses/i2c-qcom-cci.c
> index 5c7cc862f08f..a68f17eb9dd0 100644
> --- a/drivers/i2c/busses/i2c-qcom-cci.c
> +++ b/drivers/i2c/busses/i2c-qcom-cci.c
> @@ -725,6 +725,40 @@ static const struct cci_data cci_v1_data = {
>         },
>  };
>
> +static const struct cci_data cci_v1_5_data = {
> +       .num_masters = 2,
> +       .queue_size = { 64, 16 },
> +       .quirks = {
> +               .max_write_len = 10,
> +               .max_read_len = 12,
> +       },
> +       .cci_clk_rate =  19200000,
> +       .params[I2C_MODE_STANDARD] = {
> +               .thigh = 78,
> +               .tlow = 114,
> +               .tsu_sto = 28,
> +               .tsu_sta = 28,
> +               .thd_dat = 10,
> +               .thd_sta = 77,
> +               .tbuf = 118,
> +               .scl_stretch_en = 0,
> +               .trdhld = 6,
> +               .tsp = 1
> +       },
> +       .params[I2C_MODE_FAST] = {
> +               .thigh = 20,
> +               .tlow = 28,
> +               .tsu_sto = 21,
> +               .tsu_sta = 21,
> +               .thd_dat = 13,
> +               .thd_sta = 18,
> +               .tbuf = 32,
> +               .scl_stretch_en = 0,
> +               .trdhld = 6,
> +               .tsp = 3
> +       },
> +};
> +
>  static const struct cci_data cci_v2_data = {
>         .num_masters = 2,
>         .queue_size = { 64, 16 },
> @@ -773,6 +807,7 @@ static const struct cci_data cci_v2_data = {
>
>  static const struct of_device_id cci_dt_match[] = {
>         { .compatible = "qcom,msm8916-cci", .data = &cci_v1_data},
> +       { .compatible = "qcom,msm8974-cci", .data = &cci_v1_5_data},
>         { .compatible = "qcom,msm8996-cci", .data = &cci_v2_data},
>         { .compatible = "qcom,sdm845-cci", .data = &cci_v2_data},
>         { .compatible = "qcom,sm8250-cci", .data = &cci_v2_data},
> --
> 2.36.0
>

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

* Re: [RFC PATCH 10/14] i2c: qcom-cci: add msm8974 compatible
  2022-06-14 20:20   ` Wolfram Sang
@ 2022-06-15 17:13     ` Loic Poulain
  0 siblings, 0 replies; 31+ messages in thread
From: Loic Poulain @ 2022-06-15 17:13 UTC (permalink / raw)
  To: Wolfram Sang, Luca Weiss, linux-arm-msm,
	~postmarketos/upstreaming, phone-devel, Loic Poulain,
	Robert Foss, Rob Herring, Krzysztof Kozlowski, Todor Tomov,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab, linux-i2c,
	devicetree, linux-kernel, linux-media, matti.lehtimaki

On Tue, 14 Jun 2022 at 22:20, Wolfram Sang <wsa@kernel.org> wrote:
>
> On Sun, May 22, 2022 at 06:27:58PM +0200, Luca Weiss wrote:
> > From: Matti Lehtimäki <matti.lehtimaki@gmail.com>
> >
> > MSM8974 CCI is the same as MSM8916 except it has two masters.
> >
> > Signed-off-by: Matti Lehtimäki <matti.lehtimaki@gmail.com>
> > Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
> > ---
> > To note, the cci_v1_5_data variable name is just a bit arbitrary and
> > isn't meant to reflect IP version "1.5". I'd be happy to change the
> > variable name to something else.
>
> Loic, Robert: I know this series is marked RFC, but the I2C patches
> adding a new SoC to the driver are maybe interesting already?

Yes I agree, no objection to get them.

Regards,
Loic

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

end of thread, other threads:[~2022-06-15 17:14 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-22 16:27 [RFC PATCH 00/14] CAMSS support for MSM8974 Luca Weiss
2022-05-22 16:27 ` [RFC PATCH 01/14] media: dt-bindings: media: camss: Add qcom,msm8974-camss binding Luca Weiss
2022-05-23 10:07   ` Krzysztof Kozlowski
2022-06-02 13:01     ` Rob Herring
2022-05-22 16:27 ` [RFC PATCH 02/14] media: camss: Add CAMSS_8x74 camss version Luca Weiss
2022-05-26 12:32   ` Robert Foss
2022-05-22 16:27 ` [RFC PATCH 03/14] media: camss: vfe: Add support for 8x74 Luca Weiss
2022-05-26 12:36   ` Robert Foss
2022-05-22 16:27 ` [RFC PATCH 04/14] media: camss: video: " Luca Weiss
2022-05-26 12:37   ` Robert Foss
2022-05-22 16:27 ` [RFC PATCH 05/14] media: camss: csid: " Luca Weiss
2022-05-26 12:38   ` Robert Foss
2022-05-22 16:27 ` [RFC PATCH 06/14] media: camss: ispif: " Luca Weiss
2022-05-26 12:39   ` Robert Foss
2022-05-22 16:27 ` [RFC PATCH 07/14] media: camss: csiphy: " Luca Weiss
2022-05-26 12:40   ` Robert Foss
2022-05-22 16:27 ` [RFC PATCH 08/14] media: camss: Add 8x74 resources Luca Weiss
2022-05-26 12:42   ` Robert Foss
2022-05-22 16:27 ` [RFC PATCH 09/14] dt-bindings: i2c: qcom-cci: add QCOM MSM8974 compatible Luca Weiss
2022-05-23 10:07   ` Krzysztof Kozlowski
2022-05-22 16:27 ` [RFC PATCH 10/14] i2c: qcom-cci: add msm8974 compatible Luca Weiss
2022-06-14 20:20   ` Wolfram Sang
2022-06-15 17:13     ` Loic Poulain
2022-06-15 17:11   ` Loic Poulain
2022-05-22 16:27 ` [RFC PATCH 11/14] ARM: dts: qcom: msm8974: add CCI bus Luca Weiss
2022-05-26 12:16   ` Robert Foss
2022-05-22 16:28 ` [RFC PATCH 12/14] ARM: dts: qcom: msm8974: add CAMSS node Luca Weiss
2022-05-22 16:28 ` [RFC PATCH 13/14] ARM: dts: qcom: msm8974-FP2: Add OV8865 rear camera Luca Weiss
2022-05-22 16:28 ` [RFC PATCH 14/14] [DNM] media: camss: hacks for MSM8974 Luca Weiss
2022-05-23 12:39 ` [RFC PATCH 00/14] CAMSS support " Dmitry Baryshkov
2022-05-23 18:30   ` Brian Masney

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.