Skip to contentSkip to conversation

i2c: Add support for Qualcomm Camera Control Interface

PATCH Superseded Vinod Koul 2 participants 6 messages Jul 17, 2018 – Jul 23, 2018

Subsystems (3)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Vinod Koul

author
#0 lore raw

v2 cover i2c: Add support for Qualcomm Camera Control Interface

Hi,

This series adds support for Qualcomm Camera Control Interface (CCI). This contains two I2C masters and registers two adapters for each of the masters.

Changes in v2:
- Add support for two adapters

Todor Tomov (2):
dt-bindings: i2c: Add binding document for Qualcomm CCI
i2c: Add Qualcomm Camera Control Interface driver

 .../devicetree/bindings/i2c/i2c-qcom-cci.txt       |  46 ++
 drivers/i2c/busses/Kconfig                         |  10 +
 drivers/i2c/busses/Makefile                        |   1 +
 drivers/i2c/busses/i2c-qcom-cci.c                  | 793 +++++++++++++++++++++
 4 files changed, 850 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/i2c/i2c-qcom-cci.txt
 create mode 100644 drivers/i2c/busses/i2c-qcom-cci.c
Signature · 1 line
2.14.4
author
#1 lore raw

PATCH v2 1/2 dt-bindings: i2c: Add binding document for Qualcomm CCI

From: Todor Tomov <[email protected]>

Add DT binding document for Qualcomm Camera Control Interface device

---
 .../devicetree/bindings/i2c/i2c-qcom-cci.txt       | 46 ++++++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/i2c/i2c-qcom-cci.txt
Documentation/devicetree/bindings/i2c/i2c-qcom-cci.txt new file +46 -0
new file mode 100644
index 000000000000..cb1fe158fba3
@@ -0,0 +1,46 @@
+Qualcomm Camera Control Interface controller
+
+Required properties:
+ - compatible: Should be one of:
+   - "qcom,cci-v1.0.8" for 8916;
+   - "qcom,cci-v1.4.0" for 8996.
+ - #address-cells: Should be <1>.
+ - #size-cells: Should be <0>.
+ - reg: Base address of the controller and length of memory mapped region.
+ - interrupts: Specifier for CCI interrupt.
+ - clocks: List of clock specifiers, one for each entry in clock-names.
+ - clock-names: Should contain:
+   - "mmss_mmagic_ahb" - on 8996 only;
+   - "camss_top_ahb";
+   - "cci_ahb";
+   - "cci";
+   - "camss_ahb".
+
+Required properties on 8996:
+ - power-domains: Power domain specifier.
+
+Optional:
+ - clock-frequency: Desired I2C bus clock frequency in Hz, defaults to 100 kHz
+   if omitted.
+
+Example:
+
+                cci@a0c000 {
+                        compatible = "qcom,cci-v1.4.0";
+                        #address-cells = <1>;
+                        #size-cells = <0>;
+                        reg = <0xa0c000 0x1000>;
+                        interrupts = <GIC_SPI 295 IRQ_TYPE_EDGE_RISING>;
+                        power-domains = <&mmcc CAMSS_GDSC>;
+                        clocks = <&mmcc MMSS_MMAGIC_AHB_CLK>,
+                                        <&mmcc CAMSS_TOP_AHB_CLK>,
+                                        <&mmcc CAMSS_CCI_AHB_CLK>,
+                                        <&mmcc CAMSS_CCI_CLK>,
+                                        <&mmcc CAMSS_AHB_CLK>;
+                        clock-names = "mmss_mmagic_ahb",
+                                        "camss_top_ahb",
+                                        "cci_ahb",
+                                        "cci",
+                                        "camss_ahb";
+                        clock-frequency = <400000>;
+                };
Signature · 1 line
2.14.4
maintainer
#2 lore raw

Re: [PATCH v2 1/2] dt-bindings: i2c: Add binding document for Qualcomm CCI

Quoted 17 lines · Vinod Koul

From: Todor Tomov <[email protected]>

Add DT binding document for Qualcomm Camera Control Interface device

---
 .../devicetree/bindings/i2c/i2c-qcom-cci.txt       | 46 ++++++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/i2c/i2c-qcom-cci.txt
Documentation/devicetree/bindings/i2c/i2c-qcom-cci.txt new file +0 -0
new file mode 100644
index 000000000000..cb1fe158fba3

Documentation/devicetree/bindings/i2c/i2c-qcom-cci.txt line 6

Quoted 6 lines
Documentation/devicetree/bindings/i2c/i2c-qcom-cci.txt new file +6 -0
@@ -0,0 +1,46 @@
+Qualcomm Camera Control Interface controller
+
+Required properties:
+ - compatible: Should be one of:
+   - "qcom,cci-v1.0.8" for 8916;
+   - "qcom,cci-v1.4.0" for 8996.

It's not very convincing to use version numbers instead of normal SoC part# convention when there is a 1-1 mapping.

Documentation/devicetree/bindings/i2c/i2c-qcom-cci.txt line 19

Quoted 13 lines
Documentation/devicetree/bindings/i2c/i2c-qcom-cci.txt new file +13 -0
+ - #address-cells: Should be <1>.
+ - #size-cells: Should be <0>.
+ - reg: Base address of the controller and length of memory mapped region.
+ - interrupts: Specifier for CCI interrupt.
+ - clocks: List of clock specifiers, one for each entry in clock-names.
+ - clock-names: Should contain:
+   - "mmss_mmagic_ahb" - on 8996 only;
+   - "camss_top_ahb";
+   - "cci_ahb";
+   - "cci";
+   - "camss_ahb".
+
+Required properties on 8996:

Rather than '8996', use the compatible string.

Documentation/devicetree/bindings/i2c/i2c-qcom-cci.txt line 24

Quoted 5 lines
Documentation/devicetree/bindings/i2c/i2c-qcom-cci.txt new file +5 -0
+ - power-domains: Power domain specifier.
+
+Optional:
+ - clock-frequency: Desired I2C bus clock frequency in Hz, defaults to 100 kHz
+   if omitted.

This is the only place that says this block is or has a I2C controller. Please make that more explicit (including what ever else this block does). I'm guessing there's more given how many clocks and that it has a power domain.

Quoted 25 lines
Documentation/devicetree/bindings/i2c/i2c-qcom-cci.txt new file +22 -0
+
+Example:
+
+                cci@a0c000 {
+                        compatible = "qcom,cci-v1.4.0";
+                        #address-cells = <1>;
+                        #size-cells = <0>;
+                        reg = <0xa0c000 0x1000>;
+                        interrupts = <GIC_SPI 295 IRQ_TYPE_EDGE_RISING>;
+                        power-domains = <&mmcc CAMSS_GDSC>;
+                        clocks = <&mmcc MMSS_MMAGIC_AHB_CLK>,
+                                        <&mmcc CAMSS_TOP_AHB_CLK>,
+                                        <&mmcc CAMSS_CCI_AHB_CLK>,
+                                        <&mmcc CAMSS_CCI_CLK>,
+                                        <&mmcc CAMSS_AHB_CLK>;
+                        clock-names = "mmss_mmagic_ahb",
+                                        "camss_top_ahb",
+                                        "cci_ahb",
+                                        "cci",
+                                        "camss_ahb";
+                        clock-frequency = <400000>;
+                };
Signature · 1 line
2.14.4
author
#3 lore raw

Re: [PATCH v2 1/2] dt-bindings: i2c: Add binding document for Qualcomm CCI

Quoted 10 lines · Rob Herring

Documentation/devicetree/bindings/i2c/i2c-qcom-cci.txt line 6

Quoted 6 lines · Vinod Koul

From: Todor Tomov <[email protected]>

Documentation/devicetree/bindings/i2c/i2c-qcom-cci.txt new file +4 -0
+Required properties:
+ - compatible: Should be one of:
+   - "qcom,cci-v1.0.8" for 8916;
+   - "qcom,cci-v1.4.0" for 8996.

It's not very convincing to use version numbers instead of normal SoC part# convention when there is a 1-1 mapping.

I was under the impression that we don't have 1-1 mapping. An IP version is found in multiple SoCs

Quoted 7 lines
Quoted 7 lines

+ - #address-cells: Should be <1>.
+ - #size-cells: Should be <0>.
+ - reg: Base address of the controller and length of memory mapped region.
+ - interrupts: Specifier for CCI interrupt.
+ - clocks: List of clock specifiers, one for each entry in clock-names.
+ - clock-names: Should contain:
+ - "mmss_mmagic_ahb" - on 8996 only;

Quoted 8 lines

Documentation/devicetree/bindings/i2c/i2c-qcom-cci.txt line 19

Quoted 6 lines
Documentation/devicetree/bindings/i2c/i2c-qcom-cci.txt new file +6 -0
+   - "camss_top_ahb";
+   - "cci_ahb";
+   - "cci";
+   - "camss_ahb".
+
+Required properties on 8996:

Rather than '8996', use the compatible string.

Makes sense

Quoted 10 lines

Documentation/devicetree/bindings/i2c/i2c-qcom-cci.txt line 24

Quoted 5 lines

+ - power-domains: Power domain specifier.

Documentation/devicetree/bindings/i2c/i2c-qcom-cci.txt new file +4 -0
+
+Optional:
+ - clock-frequency: Desired I2C bus clock frequency in Hz, defaults to 100 kHz
+   if omitted.

This is the only place that says this block is or has a I2C controller. Please make that more explicit (including what ever else this block does). I'm guessing there's more given how many clocks and that it has a power domain.

Yes this also goes GPIO which will be added after this.

Signature · 1 line
~Vinod
maintainer
#4 lore raw

Re: [PATCH v2 1/2] dt-bindings: i2c: Add binding document for Qualcomm CCI

Quoted 10 lines · Vinod
Quoted 8 lines · Rob Herring
Quoted 6 lines · Vinod Koul

From: Todor Tomov <[email protected]>

Documentation/devicetree/bindings/i2c/i2c-qcom-cci.txt new file +4 -0
+Required properties:
+ - compatible: Should be one of:
+   - "qcom,cci-v1.0.8" for 8916;
+   - "qcom,cci-v1.4.0" for 8996.
Quoted 5 lines
Quoted 2 lines

It's not very convincing to use version numbers instead of normal SoC part# convention when there is a 1-1 mapping.

I was under the impression that we don't have 1-1 mapping. An IP version is found in multiple SoCs

Maybe so, but I'm only looking at what is getting upstream. We already discussed this at length on the thermal binding[1].

As you've written it, we'll still have to update the doc to add other chips for an already documented version.

Rob

[1] https://lkml.org/lkml/2018/7/5/830

author
#5 lore raw

PATCH v2 2/2 i2c: Add Qualcomm Camera Control Interface driver

In reply to Vinod Koul

From: Todor Tomov <[email protected]>

This commit adds I2C bus support for the Camera Control Interface (CCI) controller found on the Qualcomm SoC processors.

CCI versions supported:
- 1.0.8 - found on MSM8916/APQ8016
- 1.4.0 - found on MSM8996/APQ8096 I2C bus.

---
 drivers/i2c/busses/Kconfig        |  10 +
 drivers/i2c/busses/Makefile       |   1 +
 drivers/i2c/busses/i2c-qcom-cci.c | 793 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 804 insertions(+)
 create mode 100644 drivers/i2c/busses/i2c-qcom-cci.c
drivers/i2c/busses/Kconfig +10 -0
index 4f8df2ec87b1..033958bcdd4b 100644
@@ -828,6 +828,16 @@ config I2C_PXA_SLAVE
 	  is necessary for systems where the PXA may be a target on the
 	  I2C bus.
 
+config I2C_QCOM_CCI
+	tristate "Qualcomm Camera Control Interface"
+	depends on ARCH_QCOM
+	help
+	  If you say yes to this option, support will be included for the
+	  built-in camera control interface on the Qualcomm SoCs.
+
+	  This driver can also be built as a module.  If so, the module
+	  will be called i2c-qcom-cci.
+
 config I2C_QUP
 	tristate "Qualcomm QUP based I2C controller"
 	depends on ARCH_QCOM
drivers/i2c/busses/Makefile +1 -0
index 5a869144a0c5..d6e48ec3372a 100644
@@ -83,6 +83,7 @@ obj-$(CONFIG_I2C_PNX)		+= i2c-pnx.o
 obj-$(CONFIG_I2C_PUV3)		+= i2c-puv3.o
 obj-$(CONFIG_I2C_PXA)		+= i2c-pxa.o
 obj-$(CONFIG_I2C_PXA_PCI)	+= i2c-pxa-pci.o
+obj-$(CONFIG_I2C_QCOM_CCI)	+= i2c-qcom-cci.o
 obj-$(CONFIG_I2C_QUP)		+= i2c-qup.o
 obj-$(CONFIG_I2C_RIIC)		+= i2c-riic.o
 obj-$(CONFIG_I2C_RK3X)		+= i2c-rk3x.o
drivers/i2c/busses/i2c-qcom-cci.c new file +793 -0

793 lines not on this page · raw message

Signature · 1 line
2.14.4