Skip to contentSkip to conversation

staging: imx-drm: document internal HDMI I2C master controller DT binding

PATCH New Vladimir Zapolskiy 6 participants 12 messages Nov 15, 2014 – Dec 2, 2014 2 messages not in the archive

Subsystems (5)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/3 staging: imx-drm: document internal HDMI I2C master controller DT binding

Provide information about how to bind internal iMX6Q/DL HDMI DDC I2C master controller. The property is set as optional one, because iMX6 HDMI DDC bus may be represented by one of general purpose I2C busses found on SoC.

Cc Wolfram Sang <[email protected]>
Cc Philipp Zabel <[email protected]>
Cc Shawn Guo <[email protected]>
Cc devicetree at vger.kernel.org
Cc linux-media at vger.kernel.org
Cc linux-arm-kernel at lists.infradead.org
Cc linux-i2c at vger.kernel.org
---
 Documentation/devicetree/bindings/staging/imx-drm/hdmi.txt |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/staging/imx-drm/hdmi.txt +9 -1
index 1b756cf..43c8924 100644
@@ -10,6 +10,8 @@ Required properties:
  - #address-cells : should be <1>
  - #size-cells : should be <0>
  - compatible : should be "fsl,imx6q-hdmi" or "fsl,imx6dl-hdmi".
+   If internal HDMI DDC I2C master controller is supposed to be used,
+   then "simple-bus" should be added to compatible value.
  - gpr : should be <&gpr>.
    The phandle points to the iomuxc-gpr region containing the HDMI
    multiplexer control register.
@@ -22,6 +24,7 @@ Required properties:
 
 Optional properties:
  - ddc-i2c-bus: phandle of an I2C controller used for DDC EDID probing
+ - ddc: internal HDMI DDC I2C master controller
 
 example:
 
@@ -32,7 +35,7 @@ example:
         hdmi: hdmi at 0120000 {
                 #address-cells = <1>;
                 #size-cells = <0>;
-                compatible = "fsl,imx6q-hdmi";
+                compatible = "fsl,imx6q-hdmi", "simple-bus";
                 reg = <0x00120000 0x9000>;
                 interrupts = <0 115 0x04>;
                 gpr = <&gpr>;
@@ -40,6 +43,11 @@ example:
                 clock-names = "iahb", "isfr";
                 ddc-i2c-bus = <&i2c2>;
 
+                hdmi_ddc: ddc {
+                        compatible = "fsl,imx6q-hdmi-ddc";
+                        status = "disabled";
+                };
+
                 port at 0 {
                         reg = <0>;
 
Signature · 1 line
1.7.10.4
#2 lore raw

PATCH 1/3 staging: imx-drm: document internal HDMI I2C master controller DT binding

Hi Philipp and Shawn,

Quoted 50 lines · Vladimir Zapolskiy

Provide information about how to bind internal iMX6Q/DL HDMI DDC I2C master controller. The property is set as optional one, because iMX6 HDMI DDC bus may be represented by one of general purpose I2C busses found on SoC.

Cc Wolfram Sang <[email protected]>
Cc Philipp Zabel <[email protected]>
Cc Shawn Guo <[email protected]>
Cc devicetree at vger.kernel.org
Cc linux-media at vger.kernel.org
Cc linux-arm-kernel at lists.infradead.org
Cc linux-i2c at vger.kernel.org
---
 Documentation/devicetree/bindings/staging/imx-drm/hdmi.txt |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/staging/imx-drm/hdmi.txt +4 -1
index 1b756cf..43c8924 100644
@@ -10,6 +10,8 @@ Required properties:
  - #address-cells : should be <1>
  - #size-cells : should be <0>
  - compatible : should be "fsl,imx6q-hdmi" or "fsl,imx6dl-hdmi".
+   If internal HDMI DDC I2C master controller is supposed to be used,
+   then "simple-bus" should be added to compatible value.
  - gpr : should be <&gpr>.
    The phandle points to the iomuxc-gpr region containing the HDMI
    multiplexer control register.
@@ -22,6 +24,7 @@ Required properties:
 
 Optional properties:
  - ddc-i2c-bus: phandle of an I2C controller used for DDC EDID probing
+ - ddc: internal HDMI DDC I2C master controller
 
 example:
 
@@ -32,7 +35,7 @@ example:
         hdmi: hdmi at 0120000 {
                 #address-cells = <1>;
                 #size-cells = <0>;
-                compatible = "fsl,imx6q-hdmi";
+                compatible = "fsl,imx6q-hdmi", "simple-bus";
                 reg = <0x00120000 0x9000>;
                 interrupts = <0 115 0x04>;
                 gpr = <&gpr>;
@@ -40,6 +43,11 @@ example:
                 clock-names = "iahb", "isfr";

Documentation/devicetree/bindings/staging/imx-drm/hdmi.txt example: · line 53

Quoted 10 lines
Documentation/devicetree/bindings/staging/imx-drm/hdmi.txt +5 -0
                 ddc-i2c-bus = <&i2c2>;
 
+                hdmi_ddc: ddc {
+                        compatible = "fsl,imx6q-hdmi-ddc";
+                        status = "disabled";
+                };
+
                 port at 0 {
                         reg = <0>;
 

knowing in advance that I2C framework lacks a graceful support of non fully compliant I2C devices, do you have any objections to the proposed iMX HDMI DTS change?

--
With best wishes,
Vladimir

#3 lore raw

PATCH 1/3 staging: imx-drm: document internal HDMI I2C master controller DT binding

Am Montag, den 01.12.2014, 16:54 +0200 schrieb Vladimir Zapolskiy:

Quoted 54 lines

Hi Philipp and Shawn,

Quoted 51 lines · Vladimir Zapolskiy

Provide information about how to bind internal iMX6Q/DL HDMI DDC I2C master controller. The property is set as optional one, because iMX6 HDMI DDC bus may be represented by one of general purpose I2C busses found on SoC.

Cc Wolfram Sang <[email protected]>
Cc Philipp Zabel <[email protected]>
Cc Shawn Guo <[email protected]>
Cc devicetree at vger.kernel.org
Cc linux-media at vger.kernel.org
Cc linux-arm-kernel at lists.infradead.org
Cc linux-i2c at vger.kernel.org
---
 Documentation/devicetree/bindings/staging/imx-drm/hdmi.txt |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/staging/imx-drm/hdmi.txt +4 -1
index 1b756cf..43c8924 100644
@@ -10,6 +10,8 @@ Required properties:
  - #address-cells : should be <1>
  - #size-cells : should be <0>
  - compatible : should be "fsl,imx6q-hdmi" or "fsl,imx6dl-hdmi".
+   If internal HDMI DDC I2C master controller is supposed to be used,
+   then "simple-bus" should be added to compatible value.
  - gpr : should be <&gpr>.
    The phandle points to the iomuxc-gpr region containing the HDMI
    multiplexer control register.
@@ -22,6 +24,7 @@ Required properties:
 
 Optional properties:
  - ddc-i2c-bus: phandle of an I2C controller used for DDC EDID probing
+ - ddc: internal HDMI DDC I2C master controller
 
 example:
 
@@ -32,7 +35,7 @@ example:
         hdmi: hdmi at 0120000 {
                 #address-cells = <1>;
                 #size-cells = <0>;
-                compatible = "fsl,imx6q-hdmi";
+                compatible = "fsl,imx6q-hdmi", "simple-bus";
                 reg = <0x00120000 0x9000>;
                 interrupts = <0 115 0x04>;
                 gpr = <&gpr>;
@@ -40,6 +43,11 @@ example:
                 clock-names = "iahb", "isfr";
                 ddc-i2c-bus = <&i2c2>;
 
Quoted 13 lines

Documentation/devicetree/bindings/staging/imx-drm/hdmi.txt example: · line 53

Quoted 9 lines
Documentation/devicetree/bindings/staging/imx-drm/hdmi.txt +5 -0
+                hdmi_ddc: ddc {
+                        compatible = "fsl,imx6q-hdmi-ddc";
+                        status = "disabled";
+                };
+
                 port at 0 {
                         reg = <0>;
 

knowing in advance that I2C framework lacks a graceful support of non fully compliant I2C devices, do you have any objections to the proposed iMX HDMI DTS change?

I'm not sure about this. Have you seen "drm: Decouple EDID parsing from I2C adapter"? I feel like in the absence of a ddc-i2c-bus property the imx-hdmi/dw-hdmi driver should try to use the internal HDMI DDC I2C master controller, bypassing the I2C framework altogether.

regards
Philipp

#4 lore raw

PATCH 1/3 staging: imx-drm: document internal HDMI I2C master controller DT binding

Quoted 69 lines · Philipp Zabel

Am Montag, den 01.12.2014, 16:54 +0200 schrieb Vladimir Zapolskiy:

Quoted 54 lines

Hi Philipp and Shawn,

Quoted 51 lines · Vladimir Zapolskiy

Provide information about how to bind internal iMX6Q/DL HDMI DDC I2C master controller. The property is set as optional one, because iMX6 HDMI DDC bus may be represented by one of general purpose I2C busses found on SoC.

Cc Wolfram Sang <[email protected]>
Cc Philipp Zabel <[email protected]>
Cc Shawn Guo <[email protected]>
Cc devicetree at vger.kernel.org
Cc linux-media at vger.kernel.org
Cc linux-arm-kernel at lists.infradead.org
Cc linux-i2c at vger.kernel.org
---
 Documentation/devicetree/bindings/staging/imx-drm/hdmi.txt |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/staging/imx-drm/hdmi.txt +4 -1
index 1b756cf..43c8924 100644
@@ -10,6 +10,8 @@ Required properties:
  - #address-cells : should be <1>
  - #size-cells : should be <0>
  - compatible : should be "fsl,imx6q-hdmi" or "fsl,imx6dl-hdmi".
+   If internal HDMI DDC I2C master controller is supposed to be used,
+   then "simple-bus" should be added to compatible value.
  - gpr : should be <&gpr>.
    The phandle points to the iomuxc-gpr region containing the HDMI
    multiplexer control register.
@@ -22,6 +24,7 @@ Required properties:
 
 Optional properties:
  - ddc-i2c-bus: phandle of an I2C controller used for DDC EDID probing
+ - ddc: internal HDMI DDC I2C master controller
 
 example:
 
@@ -32,7 +35,7 @@ example:
         hdmi: hdmi at 0120000 {
                 #address-cells = <1>;
                 #size-cells = <0>;
-                compatible = "fsl,imx6q-hdmi";
+                compatible = "fsl,imx6q-hdmi", "simple-bus";
                 reg = <0x00120000 0x9000>;
                 interrupts = <0 115 0x04>;
                 gpr = <&gpr>;
@@ -40,6 +43,11 @@ example:
                 clock-names = "iahb", "isfr";
                 ddc-i2c-bus = <&i2c2>;
 
Quoted 13 lines

Documentation/devicetree/bindings/staging/imx-drm/hdmi.txt example: · line 53

Quoted 9 lines
Documentation/devicetree/bindings/staging/imx-drm/hdmi.txt +5 -0
+                hdmi_ddc: ddc {
+                        compatible = "fsl,imx6q-hdmi-ddc";
+                        status = "disabled";
+                };
+
                 port at 0 {
                         reg = <0>;
 

knowing in advance that I2C framework lacks a graceful support of non fully compliant I2C devices, do you have any objections to the proposed iMX HDMI DTS change?

Quoted 5 lines

I'm not sure about this. Have you seen "drm: Decouple EDID parsing from I2C adapter"? I feel like in the absence of a ddc-i2c-bus property the imx-hdmi/dw-hdmi driver should try to use the internal HDMI DDC I2C master controller, bypassing the I2C framework altogether.

My idea is exactly not to bypass the I2C framework, briefly the rationale is that
* it allows to reuse I2C UAPI/tools naturally applied to the internal iMX HDMI DDC bus,
* it allows to use iMX HDMI DDC bus as an additional feature-limited I2C bus on SoC (who knows, I absolutely won't be surprised, if anyone needs it on practice),
* if an HDMI controller supports an external I2C bus, the integration with HDMI DDC bus driver based on I2C framework is seamless.

However I agree that the selected approach may look odd, the question is if the oddness comes from the technical side or from the fact that nobody has done it before this way.

I'm open to any critique, if the proposal of creating an I2C bus from HDMI DDC bus is lame, then I suppose the shared iMX HDMI DDC bus driver should be converted to something formless and internally used by imx-hdmi. The negative side-effects of such a change from my point of view are
* more or less natural modularity is lost,
* a number of I2C framework API/functions should be copy-pasted to the updated HDMI DDC bus driver to support a subset of I2C read/write transactions.

--
With best wishes,
Vladimir

#5 lore raw

PATCH 1/3 staging: imx-drm: document internal HDMI I2C master controller DT binding

Hi Vladimir,

[Added Andy Yan to Cc:, because imx-hdmi->dw-hdmi]

Am Montag, den 01.12.2014, 17:39 +0200 schrieb Vladimir Zapolskiy:

Quoted 89 lines · Philipp Zabel
Quoted 69 lines

Am Montag, den 01.12.2014, 16:54 +0200 schrieb Vladimir Zapolskiy:

Quoted 54 lines

Hi Philipp and Shawn,

Quoted 51 lines · Vladimir Zapolskiy

Provide information about how to bind internal iMX6Q/DL HDMI DDC I2C master controller. The property is set as optional one, because iMX6 HDMI DDC bus may be represented by one of general purpose I2C busses found on SoC.

Cc Wolfram Sang <[email protected]>
Cc Philipp Zabel <[email protected]>
Cc Shawn Guo <[email protected]>
Cc devicetree at vger.kernel.org
Cc linux-media at vger.kernel.org
Cc linux-arm-kernel at lists.infradead.org
Cc linux-i2c at vger.kernel.org
---
 Documentation/devicetree/bindings/staging/imx-drm/hdmi.txt |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/staging/imx-drm/hdmi.txt +4 -1
index 1b756cf..43c8924 100644
@@ -10,6 +10,8 @@ Required properties:
  - #address-cells : should be <1>
  - #size-cells : should be <0>
  - compatible : should be "fsl,imx6q-hdmi" or "fsl,imx6dl-hdmi".
+   If internal HDMI DDC I2C master controller is supposed to be used,
+   then "simple-bus" should be added to compatible value.
  - gpr : should be <&gpr>.
    The phandle points to the iomuxc-gpr region containing the HDMI
    multiplexer control register.
@@ -22,6 +24,7 @@ Required properties:
 
 Optional properties:
  - ddc-i2c-bus: phandle of an I2C controller used for DDC EDID probing
+ - ddc: internal HDMI DDC I2C master controller
 
 example:
 
@@ -32,7 +35,7 @@ example:
         hdmi: hdmi at 0120000 {
                 #address-cells = <1>;
                 #size-cells = <0>;
-                compatible = "fsl,imx6q-hdmi";
+                compatible = "fsl,imx6q-hdmi", "simple-bus";
                 reg = <0x00120000 0x9000>;
                 interrupts = <0 115 0x04>;
                 gpr = <&gpr>;
@@ -40,6 +43,11 @@ example:
                 clock-names = "iahb", "isfr";
                 ddc-i2c-bus = <&i2c2>;
 
Quoted 13 lines

Documentation/devicetree/bindings/staging/imx-drm/hdmi.txt example: · line 53

Quoted 9 lines
Documentation/devicetree/bindings/staging/imx-drm/hdmi.txt +5 -0
+                hdmi_ddc: ddc {
+                        compatible = "fsl,imx6q-hdmi-ddc";
+                        status = "disabled";
+                };
+
                 port at 0 {
                         reg = <0>;
 

knowing in advance that I2C framework lacks a graceful support of non fully compliant I2C devices, do you have any objections to the proposed iMX HDMI DTS change?

Quoted 5 lines

I'm not sure about this. Have you seen "drm: Decouple EDID parsing from I2C adapter"? I feel like in the absence of a ddc-i2c-bus property the imx-hdmi/dw-hdmi driver should try to use the internal HDMI DDC I2C master controller, bypassing the I2C framework altogether.

My idea is exactly not to bypass the I2C framework, briefly the rationale is that
* it allows to reuse I2C UAPI/tools naturally applied to the internal iMX HDMI DDC bus,
* it allows to use iMX HDMI DDC bus as an additional feature-limited I2C bus on SoC (who knows, I absolutely won't be surprised, if anyone needs it on practice),
* if an HDMI controller supports an external I2C bus, the integration with HDMI DDC bus driver based on I2C framework is seamless.

However I agree that the selected approach may look odd, the question is if the oddness comes from the technical side or from the fact that nobody has done it before this way.

Quoted 9 lines

I'm open to any critique, if the proposal of creating an I2C bus from HDMI DDC bus is lame, then I suppose the shared iMX HDMI DDC bus driver should be converted to something formless and internally used by imx-hdmi. The negative side-effects of such a change from my point of view are
* more or less natural modularity is lost,
* a number of I2C framework API/functions should be copy-pasted to the updated HDMI DDC bus driver to support a subset of I2C read/write transactions.

If Wolfram is happy to accomodate such feature limited, 'I2C master' devices in i2c/drivers/busses in principle, I won't disagree.

But then it should be abstracted properly. The dw-hdmi-tx core on i.MX6 has the DDC I2C master register space at 0x7e00 - 0x7e12. What are the offsets on the Rockchip version? If the "simple-bus" compatible is to be set on the hdmi driver, the ddc driver should do its own register access, and therefore needs a reg property. I suspect for the ddc-i2cm we should get away with a common compatible like "snps,dw-hdmi-i2c".

	hdmi: hdmi at 120000 {
		/* ... */
		compatible = "fsl,imx6q-hdmi", "snps,dw-hdmi";
		ddc-i2c-bus = <&hdmi_ddc>;

		hdmi_ddc: i2c at 127e00 {
			compatible = "snps,dw-hdmi-i2c";
			reg = <0x1207e00 0x13>
		};

		/* could add phy-i2cm, cec, ... here */
	};

Also there's an i2c bus for communication with the phy at 0x3020 - 0x3032, should that be handled in a similar way, then?

Do we need to make the hdmi driver a proper interrupt controller? At least the two i2c masters have two interrupts each, "done" and "error".

regards
Philipp

#6 lore raw

PATCH 1/3 staging: imx-drm: document internal HDMI I2C master controller DT binding

Hi Vladimir:

I am working on convert imx-hdmi to dw_hdmi now:
https://lkml.org/lkml/2014/12/1/190
I also have a plan to use the internal HDMI I2C master under the I2c
framework,
and I also have a patch to do this work. So glad to see your work.
Please also Cc me<[email protected]> and Zubair.Kakakhel at imgtec.com,
maybe Zubair also have interests on your future patch.

Quoted 124 lines · Philipp Zabel

Hi Vladimir,

[Added Andy Yan to Cc:, because imx-hdmi->dw-hdmi]

Am Montag, den 01.12.2014, 17:39 +0200 schrieb Vladimir Zapolskiy:

Quoted 87 lines · Philipp Zabel
Quoted 67 lines

Am Montag, den 01.12.2014, 16:54 +0200 schrieb Vladimir Zapolskiy:

Quoted 54 lines

Hi Philipp and Shawn,

Quoted 51 lines · Vladimir Zapolskiy

Provide information about how to bind internal iMX6Q/DL HDMI DDC I2C master controller. The property is set as optional one, because iMX6 HDMI DDC bus may be represented by one of general purpose I2C busses found on SoC.

Cc Wolfram Sang <[email protected]>
Cc Philipp Zabel <[email protected]>
Cc Shawn Guo <[email protected]>
Cc devicetree at vger.kernel.org
Cc linux-media at vger.kernel.org
Cc linux-arm-kernel at lists.infradead.org
Cc linux-i2c at vger.kernel.org
---
  Documentation/devicetree/bindings/staging/imx-drm/hdmi.txt |   10 +++++++++-
  1 file changed, 9 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/staging/imx-drm/hdmi.txt +4 -1
index 1b756cf..43c8924 100644
@@ -10,6 +10,8 @@ Required properties:
   - #address-cells : should be <1>
   - #size-cells : should be <0>
   - compatible : should be "fsl,imx6q-hdmi" or "fsl,imx6dl-hdmi".
+   If internal HDMI DDC I2C master controller is supposed to be used,
+   then "simple-bus" should be added to compatible value.
   - gpr : should be <&gpr>.
     The phandle points to the iomuxc-gpr region containing the HDMI
     multiplexer control register.
@@ -22,6 +24,7 @@ Required properties:
 
  Optional properties:
   - ddc-i2c-bus: phandle of an I2C controller used for DDC EDID probing
+ - ddc: internal HDMI DDC I2C master controller
 
  example:
 
@@ -32,7 +35,7 @@ example:
          hdmi: hdmi at 0120000 {
                  #address-cells = <1>;
                  #size-cells = <0>;
-                compatible = "fsl,imx6q-hdmi";
+                compatible = "fsl,imx6q-hdmi", "simple-bus";
                  reg = <0x00120000 0x9000>;
                  interrupts = <0 115 0x04>;
                  gpr = <&gpr>;
@@ -40,6 +43,11 @@ example:
                  clock-names = "iahb", "isfr";
                  ddc-i2c-bus = <&i2c2>;
 
Quoted 12 lines

Documentation/devicetree/bindings/staging/imx-drm/hdmi.txt example: · line 53

Quoted 9 lines
Documentation/devicetree/bindings/staging/imx-drm/hdmi.txt +5 -0
+                hdmi_ddc: ddc {
+                        compatible = "fsl,imx6q-hdmi-ddc";
+                        status = "disabled";
+                };
+
                  port at 0 {
                          reg = <0>;
 

knowing in advance that I2C framework lacks a graceful support of non fully compliant I2C devices, do you have any objections to the proposed iMX HDMI DTS change?

Quoted 5 lines

I'm not sure about this. Have you seen "drm: Decouple EDID parsing from I2C adapter"? I feel like in the absence of a ddc-i2c-bus property the imx-hdmi/dw-hdmi driver should try to use the internal HDMI DDC I2C master controller, bypassing the I2C framework altogether.

My idea is exactly not to bypass the I2C framework, briefly the rationale is that
* it allows to reuse I2C UAPI/tools naturally applied to the internal iMX HDMI DDC bus,
* it allows to use iMX HDMI DDC bus as an additional feature-limited I2C bus on SoC (who knows, I absolutely won't be surprised, if anyone needs it on practice),
* if an HDMI controller supports an external I2C bus, the integration with HDMI DDC bus driver based on I2C framework is seamless.

However I agree that the selected approach may look odd, the question is if the oddness comes from the technical side or from the fact that nobody has done it before this way.

Quoted 9 lines

I'm open to any critique, if the proposal of creating an I2C bus from HDMI DDC bus is lame, then I suppose the shared iMX HDMI DDC bus driver should be converted to something formless and internally used by imx-hdmi. The negative side-effects of such a change from my point of view are
* more or less natural modularity is lost,
* a number of I2C framework API/functions should be copy-pasted to the updated HDMI DDC bus driver to support a subset of I2C read/write transactions.

If Wolfram is happy to accomodate such feature limited, 'I2C master' devices in i2c/drivers/busses in principle, I won't disagree.

But then it should be abstracted properly. The dw-hdmi-tx core on i.MX6 has the DDC I2C master register space at 0x7e00 - 0x7e12. What are the offsets on the Rockchip version? If the "simple-bus" compatible is to be set on the hdmi driver, the ddc driver should do its own register access, and therefore needs a reg property. I suspect for the ddc-i2cm we should get away with a common compatible like "snps,dw-hdmi-i2c".

	hdmi: hdmi at 120000 {
		/* ... */
		compatible = "fsl,imx6q-hdmi", "snps,dw-hdmi";
		ddc-i2c-bus = <&hdmi_ddc>;

		hdmi_ddc: i2c at 127e00 {
			compatible = "snps,dw-hdmi-i2c";
			reg = <0x1207e00 0x13>
		};

		/* could add phy-i2cm, cec, ... here */
	};
Quoted 2 lines

Also there's an i2c bus for communication with the phy at 0x3020 - 0x3032, should that be handled in a similar way, then?

Rockchip RK3288 has the same DDC I2C master and phy i2c master register offset as imx hdmi.

what my suggestion is: make the ddc-i2c-bus property optional, if
the dw_hdmi driver

    can't found the ddc-i2c-bus node, then use the internal i2cm:
        ddc_node = of_parse_phandle(np, "ddc-i2c-bus", 0);
         if (ddc_node) {
                 hdmi->ddc = of_find_i2c_adapter_by_node(ddc_node);
                 of_node_put(ddc_node);
                 if (!hdmi->ddc) {
                         dev_dbg(hdmi->dev, "failed to read ddc node\n");
                         return -EPROBE_DEFER;
                 }

         } else {
                 hdmi->ddc = dw_hdmi_ddc_adapter_register(hdmi).
         }

         and we can have a file put with dw_hdmi.c in a same dir, which
        implement  standard i2c adapter interface .
       I found that other hdmi platform such as msm(/msm/hdmi/hdmi_i2c.c) ,
       radeon(radeon_i2c.c) also do like this
Quoted 10 lines

Do we need to make the hdmi driver a proper interrupt controller? At least the two i2c masters have two interrupts each, "done" and "error".

regards
Philipp

#7 lore raw

PATCH 1/3 staging: imx-drm: document internal HDMI I2C master controller DT binding

Hi Andy,

thank you for joining the discussion.

Quoted 131 lines · Andy Yan

Hi Vladimir:

I am working on convert imx-hdmi to dw_hdmi now:
https://lkml.org/lkml/2014/12/1/190
I also have a plan to use the internal HDMI I2C master under the I2c
framework,
and I also have a patch to do this work. So glad to see your work.
Please also Cc me<[email protected]> and Zubair.Kakakhel at imgtec.com,
maybe Zubair also have interests on your future patch.

Quoted 121 lines · Philipp Zabel

Hi Vladimir,

[Added Andy Yan to Cc:, because imx-hdmi->dw-hdmi]

Am Montag, den 01.12.2014, 17:39 +0200 schrieb Vladimir Zapolskiy:

Quoted 87 lines · Philipp Zabel
Quoted 67 lines

Am Montag, den 01.12.2014, 16:54 +0200 schrieb Vladimir Zapolskiy:

Quoted 54 lines

Hi Philipp and Shawn,

Quoted 51 lines · Vladimir Zapolskiy

Provide information about how to bind internal iMX6Q/DL HDMI DDC I2C master controller. The property is set as optional one, because iMX6 HDMI DDC bus may be represented by one of general purpose I2C busses found on SoC.

Cc Wolfram Sang <[email protected]>
Cc Philipp Zabel <[email protected]>
Cc Shawn Guo <[email protected]>
Cc devicetree at vger.kernel.org
Cc linux-media at vger.kernel.org
Cc linux-arm-kernel at lists.infradead.org
Cc linux-i2c at vger.kernel.org
---
  Documentation/devicetree/bindings/staging/imx-drm/hdmi.txt |   10 +++++++++-
  1 file changed, 9 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/staging/imx-drm/hdmi.txt +4 -1
index 1b756cf..43c8924 100644
@@ -10,6 +10,8 @@ Required properties:
   - #address-cells : should be <1>
   - #size-cells : should be <0>
   - compatible : should be "fsl,imx6q-hdmi" or "fsl,imx6dl-hdmi".
+   If internal HDMI DDC I2C master controller is supposed to be used,
+   then "simple-bus" should be added to compatible value.
   - gpr : should be <&gpr>.
     The phandle points to the iomuxc-gpr region containing the HDMI
     multiplexer control register.
@@ -22,6 +24,7 @@ Required properties:
 
  Optional properties:
   - ddc-i2c-bus: phandle of an I2C controller used for DDC EDID probing
+ - ddc: internal HDMI DDC I2C master controller
 
  example:
 
@@ -32,7 +35,7 @@ example:
          hdmi: hdmi at 0120000 {
                  #address-cells = <1>;
                  #size-cells = <0>;
-                compatible = "fsl,imx6q-hdmi";
+                compatible = "fsl,imx6q-hdmi", "simple-bus";
                  reg = <0x00120000 0x9000>;
                  interrupts = <0 115 0x04>;
                  gpr = <&gpr>;
@@ -40,6 +43,11 @@ example:
                  clock-names = "iahb", "isfr";
                  ddc-i2c-bus = <&i2c2>;
 
Quoted 12 lines

Documentation/devicetree/bindings/staging/imx-drm/hdmi.txt example: · line 53

Quoted 9 lines
Documentation/devicetree/bindings/staging/imx-drm/hdmi.txt +5 -0
+                hdmi_ddc: ddc {
+                        compatible = "fsl,imx6q-hdmi-ddc";
+                        status = "disabled";
+                };
+
                  port at 0 {
                          reg = <0>;
 

knowing in advance that I2C framework lacks a graceful support of non fully compliant I2C devices, do you have any objections to the proposed iMX HDMI DTS change?

Quoted 5 lines

I'm not sure about this. Have you seen "drm: Decouple EDID parsing from I2C adapter"? I feel like in the absence of a ddc-i2c-bus property the imx-hdmi/dw-hdmi driver should try to use the internal HDMI DDC I2C master controller, bypassing the I2C framework altogether.

My idea is exactly not to bypass the I2C framework, briefly the rationale is that
* it allows to reuse I2C UAPI/tools naturally applied to the internal iMX HDMI DDC bus,
* it allows to use iMX HDMI DDC bus as an additional feature-limited I2C bus on SoC (who knows, I absolutely won't be surprised, if anyone needs it on practice),
* if an HDMI controller supports an external I2C bus, the integration with HDMI DDC bus driver based on I2C framework is seamless.

However I agree that the selected approach may look odd, the question is if the oddness comes from the technical side or from the fact that nobody has done it before this way.

Quoted 9 lines

I'm open to any critique, if the proposal of creating an I2C bus from HDMI DDC bus is lame, then I suppose the shared iMX HDMI DDC bus driver should be converted to something formless and internally used by imx-hdmi. The negative side-effects of such a change from my point of view are
* more or less natural modularity is lost,
* a number of I2C framework API/functions should be copy-pasted to the updated HDMI DDC bus driver to support a subset of I2C read/write transactions.

If Wolfram is happy to accomodate such feature limited, 'I2C master' devices in i2c/drivers/busses in principle, I won't disagree.

But then it should be abstracted properly. The dw-hdmi-tx core on i.MX6 has the DDC I2C master register space at 0x7e00 - 0x7e12. What are the offsets on the Rockchip version? If the "simple-bus" compatible is to be set on the hdmi driver, the ddc driver should do its own register access, and therefore needs a reg property. I suspect for the ddc-i2cm we should get away with a common compatible like "snps,dw-hdmi-i2c".

	hdmi: hdmi at 120000 {
		/* ... */
		compatible = "fsl,imx6q-hdmi", "snps,dw-hdmi";
		ddc-i2c-bus = <&hdmi_ddc>;

		hdmi_ddc: i2c at 127e00 {
			compatible = "snps,dw-hdmi-i2c";
			reg = <0x1207e00 0x13>
		};
Quoted 8 lines
Quoted 5 lines
		/* could add phy-i2cm, cec, ... here */
	};

Also there's an i2c bus for communication with the phy at 0x3020 - 0x3032, should that be handled in a similar way, then?

Rockchip RK3288 has the same DDC I2C master and phy i2c master register offset as imx hdmi.

Good to know, I was not aware of it. Definitely it should be supported as well.

Quoted 12 lines

what my suggestion is: make the ddc-i2c-bus property optional, if
the dw_hdmi driver

    can't found the ddc-i2c-bus node, then use the internal i2cm:
        ddc_node = of_parse_phandle(np, "ddc-i2c-bus", 0);
         if (ddc_node) {
                 hdmi->ddc = of_find_i2c_adapter_by_node(ddc_node);
                 of_node_put(ddc_node);
                 if (!hdmi->ddc) {
                         dev_dbg(hdmi->dev, "failed to read ddc node\n");
                         return -EPROBE_DEFER;
                 }
Quoted 8 lines
         } else {
                 hdmi->ddc = dw_hdmi_ddc_adapter_register(hdmi).
         }

         and we can have a file put with dw_hdmi.c in a same dir, which
        implement  standard i2c adapter interface .
       I found that other hdmi platform such as msm(/msm/hdmi/hdmi_i2c.c) ,
       radeon(radeon_i2c.c) also do like this

Thank you for references.

I see that msm and a number of other DRM device drivers (radeon, nouveau, i915, gma500) quite resemble the situation, now I'm convinced that the same should be done for iMX6/RK3288 HDMI driver. In background I'll try to review all out of i2c/busses/* registered i2c adapters, may be there is something in common between all of them.

I'll prepare the change of the HDMI DDC support for review (will be able to test it only on iMX6), Wolfram, please skip from your consideration the published version of the i2c bus driver.

Wolfram, by the way is I2C_CLASS_DDC adapter class in operational use or deprecated?

Quoted 8 lines
Quoted 8 lines

Do we need to make the hdmi driver a proper interrupt controller? At least the two i2c masters have two interrupts each, "done" and "error".

regards
Philipp

--
With best wishes,
Vladimir

#8 lore raw

PATCH 1/3 staging: imx-drm: document internal HDMI I2C master controller DT binding

Quoted 2 lines

Thank you for references.

Yes, thank you all. Really great to see this consolidation effort going on!

Quoted 2 lines

I'll try to review all out of i2c/busses/* registered i2c adapters, may be there is something in common between all of them.

Yay, cool! Thanks!

Quoted 3 lines

I'll prepare the change of the HDMI DDC support for review (will be able to test it only on iMX6), Wolfram, please skip from your consideration the published version of the i2c bus driver.

Okay, will do.

Quoted 2 lines

Wolfram, by the way is I2C_CLASS_DDC adapter class in operational use or deprecated?

Class based instantiation is NOT deprecated and will stay as far as I can see. Many platform bus drivers did set the class flag needlessly, so we had a deprecation mechanism to get rid of those flags in drivers in order to speed up boot time.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141202/32141fca/attachment-0001.sig>

A message that is not in the archive (sent off-list or not yet received): 1416073759-19939-1-git-send-email-vladimir_zapolskiy-nmGgyN9QBj3QT0dZR+AlfA@public.gmane.org

#10 lore raw

PATCH 2/3 i2c: i2c-imx-hdmi: add support of iMX6 HDMI DDC I2C master bus

The i.MX6 SoC in HDMI controller has one more on-SoC I2C bus dedicated to read EDID data from a connected monitor. The controller does not fully support I2C communications, only specific forms of I2C transfer patters can be programmed, but having those limitations in mind it seems reasonable to add another I2C bus driver representing iMX6 HDMI DDC bus. The bus can be used to read monitor's EDID or access EEPROM, but communication to most of the I2C devices will fail or be invalid.

The iMX6 HDMI DDC I2C bus may be used separately from main iMX6 HDMI controller code, for instance as an additional I2C bus with limited capabilities.

Cc Wolfram Sang <wsa-z923LK4zBo2bacvFa/[email protected]>
Cc Philipp Zabel <[email protected]>
---
 drivers/i2c/busses/Kconfig        |   13 +
 drivers/i2c/busses/Makefile       |    1 +
 drivers/i2c/busses/i2c-imx-hdmi.c |  510 +++++++++++++++++++++++++++++++++++++
 3 files changed, 524 insertions(+)
 create mode 100644 drivers/i2c/busses/i2c-imx-hdmi.c
drivers/i2c/busses/Kconfig +13 -0
index 06e99eb..82848a9 100644
@@ -1045,4 +1045,17 @@ config SCx200_ACB
 	  This support is also available as a module.  If so, the module
 	  will be called scx200_acb.
 
+config I2C_IMX_HDMI
+	tristate "IMX6 HDMI DDC I2C master interface"
+	depends on ARCH_MXC
+	default n
+	help
+	  Say Y here if you want to use the HDMI DDC bus controller
+	  found on the Freescale i.MX6 processors. Most probably you
+	  don't need this driver, if HDMI monitor is supposed to be
+	  connected over regular iMX6 I2C bus.
+
+	  This driver can also be built as a module.  If so, the module
+	  will be called i2c-imx-hdmi.
+
 endmenu
drivers/i2c/busses/Makefile +1 -0
index 78d56c5..49bebb0 100644
@@ -99,6 +99,7 @@ obj-$(CONFIG_I2C_ACORN)		+= i2c-acorn.o
 obj-$(CONFIG_I2C_BCM_KONA)	+= i2c-bcm-kona.o
 obj-$(CONFIG_I2C_CROS_EC_TUNNEL)	+= i2c-cros-ec-tunnel.o
 obj-$(CONFIG_I2C_ELEKTOR)	+= i2c-elektor.o
+obj-$(CONFIG_I2C_IMX_HDMI)	+= i2c-imx-hdmi.o
 obj-$(CONFIG_I2C_PCA_ISA)	+= i2c-pca-isa.o
 obj-$(CONFIG_I2C_SIBYTE)	+= i2c-sibyte.o
 obj-$(CONFIG_SCx200_ACB)	+= scx200_acb.o
drivers/i2c/busses/i2c-imx-hdmi.c new file +510 -0

510 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#11 lore raw

PATCH 3/3 i2c: i2c-imx-hdmi: add documentation file of the bus

In reply to a message not in the archive

Add simple description of iMX6 HDMI DDC controller used as a I2C master.

Cc Wolfram Sang <wsa-z923LK4zBo2bacvFa/[email protected]>
Cc Philipp Zabel <[email protected]>
---
 Documentation/i2c/busses/i2c-imx-hdmi |   62 +++++++++++++++++++++++++++++++++
 1 file changed, 62 insertions(+)
 create mode 100644 Documentation/i2c/busses/i2c-imx-hdmi
Documentation/i2c/busses/i2c-imx-hdmi new file +62 -0
new file mode 100644
index 0000000..20c7101
@@ -0,0 +1,62 @@
+Kernel driver i2c-imx-hdmi
+
+Supported adapters:
+  * Freescale iMX6Quad HDMI controller
+  * Freescale iMX6DualLite HDMI controller
+  * Freescale iMX6Solo HDMI controller
+
+Datasheets:
+	Publicly available at the Freescale website
+
+Authors:
+	Vladimir Zapolskiy <[email protected]>
+
+
+Description
+-----------
+
+According to the iMX6 Reference Manual only two types of transactions
+are supported by HDMI I2C Master Interface in Normal Mode:
+
+A) one byte data write transaction (I2C spec write/write transmission):
+
+   master   S|slave addr[6:0]|0|     |slave reg[7:0]|     |data[7:0]|     |P
+   slave                       | ack |              | ack |         | ack |
+
+B) one byte data read transaction (I2C spec write/read combined format):
+
+   master   S|slave addr[6:0]|0|     |slave reg[7:0]|     | ...
+   slave                       | ack |              | ack | ...
+
+   master   ... Sr|slave addr[6:0]|1|     |         | ack |P
+   slave    ...                     | Ack |data[7:0]|
+
+HDMI I2C Master Interface Extended Read Mode allows to execute one
+more transaction pattern so called segment pointer-based read:
+
+C) segment pointer-based read (I2C spec write/write/read combined format):
+
+   master   S|seg addr[6:0]|0|     |seg pointer[7:0]|     | ...
+   slave                     | xxx |                | xxx | ...
+
+   master   ... Sr|slave addr[6:0]|0|     |slave reg[7:0]|     | ...
+   slave    ...                     | ack |              | ack | ...
+
+   master   ... Sr|slave addr[6:0]|1|     |         | ack |P
+   slave    ...                     | ack |data[7:0]|
+
+At the moment Extended Read Mode is not supported by the driver.
+
+The technical limitations of the iMX6 HDMI E-DDC bus does not allow
+to call it an I2C compatible bus, however relativery large subset of
+I2C transactions can be decomposed into aforementioned data read/write
+operations and many I2C devices correctly support those operations,
+but the primary goad of the device is to read EDID blob of a connected
+HDMI monitor.
+
+
+Notes
+-----
+
+The bus driver may be used independently on HDMI controller, but due
+to device limitations it can not support arbitrary slave devices.
Signature · 1 line
1.7.10.4
#12 lore raw

Re: [PATCH 0/3] i2c: i2c-imx-hdmi: add support of iMX6 HDMI DDC I2C bus

In reply to a message not in the archive
Quoted 29 lines · Vladimir Zapolskiy

Please review a proposed iMX6 HDMI DDC controller driver written on top of I2C framework.

Changes from RFC to v1 version:
* added I2C bus ducumentation,
* updated iMX6 HDMI device tree bindings documentation,
* device resource information is collected from parent HDMI phandle,
* minor clean-ups.

The driver intends to support HDMI on-controller I2C master bus with limited cababilities, however by nature of the sub-device it seems reasonable to separate it into a stand-alone driver, which also can be used independently on general HDMI controller driver, for example as an additional I2C bus on a board, but please be aware that the bus is not compliant to I2C specification.

In my practice I've met iMX6Q boards, where HDMI DDC lines are connected to iMX6 HDMI DDC pins and not to any of 3 I2C busses, so support of iMX6 HDMI I2C bus is important to have.

Main issues with the device/driver:
* iMX6 HDMI controller becomes a shared device (both interrupt and memory region) between HDMI driver itself and this I2C bus driver.
* Only two patterns of I2C transactions are supported due to hardware limitation, these patters are described in driver's code header.
* The bus controller supports one more multi-byte read pattern (so called Extended Read Mode), but Freescale documentation is too vague to easily add this mode into the driver.

Quoted 2 lines

The bus driver may be used independently on presence/absence of iMX6 HDMI controller driver, so build dependeny is not set.

I think there are now 3 drivers in my queue which are not fully I2C compatible but more supporting the very minimum to, say, read an eeprom. I am not feeling well to allow them to use I2C_FUNC_I2C. So, I want to think about ways how to communicate deficiencies like "only 255 byte" or "only WRRD messages" to users of that I2C controller. This is most likely not happening before 3.19. But assistance is very welcome.

#13 lore raw

Re: [PATCH 0/3] i2c: i2c-imx-hdmi: add support of iMX6 HDMI DDC I2C bus

Hi Wolfram,

Quoted 30 lines · Wolfram Sang
Quoted 29 lines · Vladimir Zapolskiy

Please review a proposed iMX6 HDMI DDC controller driver written on top of I2C framework.

Changes from RFC to v1 version:
* added I2C bus ducumentation,
* updated iMX6 HDMI device tree bindings documentation,
* device resource information is collected from parent HDMI phandle,
* minor clean-ups.

The driver intends to support HDMI on-controller I2C master bus with limited cababilities, however by nature of the sub-device it seems reasonable to separate it into a stand-alone driver, which also can be used independently on general HDMI controller driver, for example as an additional I2C bus on a board, but please be aware that the bus is not compliant to I2C specification.

In my practice I've met iMX6Q boards, where HDMI DDC lines are connected to iMX6 HDMI DDC pins and not to any of 3 I2C busses, so support of iMX6 HDMI I2C bus is important to have.

Main issues with the device/driver:
* iMX6 HDMI controller becomes a shared device (both interrupt and memory region) between HDMI driver itself and this I2C bus driver.
* Only two patterns of I2C transactions are supported due to hardware limitation, these patters are described in driver's code header.
* The bus controller supports one more multi-byte read pattern (so called Extended Read Mode), but Freescale documentation is too vague to easily add this mode into the driver.

Quoted 2 lines
Quoted 2 lines

The bus driver may be used independently on presence/absence of iMX6 HDMI controller driver, so build dependeny is not set.

thank you for review.

Quoted 7 lines

I think there are now 3 drivers in my queue which are not fully I2C compatible but more supporting the very minimum to, say, read an eeprom. I am not feeling well to allow them to use I2C_FUNC_I2C. So, I want to think about ways how to communicate deficiencies like "only 255 byte" or "only WRRD messages" to users of that I2C controller. This is most likely not happening before 3.19. But assistance is very welcome.

Yeah, it sounds absolutely correct *not* to allow such drivers (and this one in particular) to provide naked I2C_FUNC_I2C.

Is there any chance to extend I2C_FUNC_* list? It still has some free bits, not so many though.

Probably it might be possible to create another list of quirks or exceptions (in opposite to functionality) and export quirks of a particular I2C bus to userspace over some userspace to kernel channel (e.g. adding one more ioctl).

--
With best wishes,
Vladimir