Skip to contentSkip to conversation

Add i2c dt-binding and device node for Mediatek MT2701 Soc

PATCH RESEND Superseded Jun Gao 4 participants 10 messages Mar 9, 2017 – May 23, 2017

Subsystems (3)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Jun Gao

author
#0 lore raw

v3 cover Add i2c dt-binding and device node for Mediatek MT2701 Soc

This patch series based on v4.11-rc1, include MT2701 i2c dt-binding and device node.

changes since v2:
- Modify commit message
- Revise dt-binding documentation

changes since v1:
- Modify commit message

Dependent on "Add clock and power domain DT nodes for Mediatek MT2701"[1].

[1] http://lists.infradead.org/pipermail/linux-mediatek/2016-December/007637.html

Jun Gao (2):
dt-bindings: i2c: Add Mediatek MT2701 i2c binding
arm: dts: Add Mediatek MT2701 i2c device node

 .../devicetree/bindings/i2c/i2c-mt6577.txt         |   11 ++---
 arch/arm/boot/dts/mt2701-evb.dts                   |   42 ++++++++++++++++++++
 arch/arm/boot/dts/mt2701.dtsi                      |   42 ++++++++++++++++++++
 3 files changed, 90 insertions(+), 5 deletions(-)

--
1.7.9.5

author
#1 lore raw

PATCH RESEND v3 1/2 dt-bindings: i2c: Add Mediatek MT2701 i2c binding

From: Jun Gao <[email protected]>

Add MT2701 i2c binding to i2c-mt6577.txt and there is no need to modify i2c driver.

---
 .../devicetree/bindings/i2c/i2c-mt6577.txt         |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
Documentation/devicetree/bindings/i2c/i2c-mt6577.txt +6 -5
index 0ce6fa3..27dbbf9 100644
@@ -4,11 +4,12 @@ The Mediatek's I2C controller is used to interface with I2C devices.
 
 Required properties:
   - compatible: value should be either of the following.
-      (a) "mediatek,mt6577-i2c", for i2c compatible with mt6577 i2c.
-      (b) "mediatek,mt6589-i2c", for i2c compatible with mt6589 i2c.
-      (c) "mediatek,mt8127-i2c", for i2c compatible with mt8127 i2c.
-      (d) "mediatek,mt8135-i2c", for i2c compatible with mt8135 i2c.
-      (e) "mediatek,mt8173-i2c", for i2c compatible with mt8173 i2c.
+	"mediatek,mt2701-i2c"
+	"mediatek,mt6577-i2c"
+	"mediatek,mt6589-i2c"
+	"mediatek,mt8127-i2c"
+	"mediatek,mt8135-i2c"
+	"mediatek,mt8173-i2c"
   - reg: physical base address of the controller and dma base, length of memory
     mapped region.
   - interrupts: interrupt number to the cpu.
Signature · 1 line
1.7.9.5
author
#9 lore raw

PATCH RESEND v3 2/2 arm: dts: Add Mediatek MT2701 i2c device node

In reply to Jun Gao

From: Jun Gao <[email protected]>

Add MT2701 i2c device node.

---
 arch/arm/boot/dts/mt2701-evb.dts |   42 ++++++++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/mt2701.dtsi    |   42 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 84 insertions(+)
arch/arm/boot/dts/mt2701-evb.dts +42 -0
index a483798..3f5a96c 100644
@@ -28,7 +28,49 @@
 	status = "okay";
 };
 
+&i2c0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c0_pins_a>;
+	status = "okay";
+};
+
+&i2c1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c1_pins_a>;
+	status = "okay";
+};
+
+&i2c2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c2_pins_a>;
+	status = "okay";
+};
+
 &pio {
+	i2c0_pins_a: i2c0 at 0 {
+		pins1 {
+			pinmux = <MT2701_PIN_75_SDA0__FUNC_SDA0>,
+				 <MT2701_PIN_76_SCL0__FUNC_SCL0>;
+			bias-disable;
+		};
+	};
+
+	i2c1_pins_a: i2c1 at 0 {
+		pins1 {
+			pinmux = <MT2701_PIN_57_SDA1__FUNC_SDA1>,
+				 <MT2701_PIN_58_SCL1__FUNC_SCL1>;
+			bias-disable;
+		};
+	};
+
+	i2c2_pins_a: i2c2 at 0 {
+		pins1 {
+			pinmux = <MT2701_PIN_77_SDA2__FUNC_SDA2>,
+				 <MT2701_PIN_78_SCL2__FUNC_SCL2>;
+			bias-disable;
+		};
+	};
+
 	spi_pins_a: spi0 at 0 {
 		pins_spi {
 			pinmux = <MT2701_PIN_53_SPI0_CSN__FUNC_SPI0_CS>,
arch/arm/boot/dts/mt2701.dtsi +42 -0

48 lines not on this page · raw message

Signature · 1 line
1.7.9.5
maintainer Acked-by on v3 1/2
#2 lore raw

Re: [RESEND PATCH v3 1/2] dt-bindings: i2c: Add Mediatek MT2701 i2c binding

In reply to Jun Gao
Quoted 9 lines · Jun Gao

From: Jun Gao <[email protected]>

Add MT2701 i2c binding to i2c-mt6577.txt and there is no need to modify i2c driver.

---
 .../devicetree/bindings/i2c/i2c-mt6577.txt         |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
#3 lore raw

Re: [RESEND PATCH v3 1/2] dt-bindings: i2c: Add Mediatek MT2701 i2c binding

In reply to Jun Gao
Quoted 6 lines · Jun Gao

From: Jun Gao <[email protected]>

Add MT2701 i2c binding to i2c-mt6577.txt and there is no need to modify i2c driver.

There is still the issue which Matthias Brugger pointed out on January, 24th: you need to describe the fallback compatibles.

Quoted 29 lines
---
 .../devicetree/bindings/i2c/i2c-mt6577.txt         |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
Documentation/devicetree/bindings/i2c/i2c-mt6577.txt +6 -5
index 0ce6fa3..27dbbf9 100644
@@ -4,11 +4,12 @@ The Mediatek's I2C controller is used to interface with I2C devices.
 
 Required properties:
   - compatible: value should be either of the following.
-      (a) "mediatek,mt6577-i2c", for i2c compatible with mt6577 i2c.
-      (b) "mediatek,mt6589-i2c", for i2c compatible with mt6589 i2c.
-      (c) "mediatek,mt8127-i2c", for i2c compatible with mt8127 i2c.
-      (d) "mediatek,mt8135-i2c", for i2c compatible with mt8135 i2c.
-      (e) "mediatek,mt8173-i2c", for i2c compatible with mt8173 i2c.
+	"mediatek,mt2701-i2c"
+	"mediatek,mt6577-i2c"
+	"mediatek,mt6589-i2c"
+	"mediatek,mt8127-i2c"
+	"mediatek,mt8135-i2c"
+	"mediatek,mt8173-i2c"
   - reg: physical base address of the controller and dma base, length of memory
     mapped region.
   - interrupts: interrupt number to the cpu.
Signature · 1 line
1.7.9.5

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20170322/701862c6/attachment.sig>

author
#4 lore raw

Re: [RESEND PATCH v3 1/2] dt-bindings: i2c: Add Mediatek MT2701 i2c binding

Quoted 11 lines · Wolfram Sang
Quoted 6 lines · Jun Gao

From: Jun Gao <[email protected]>

Add MT2701 i2c binding to i2c-mt6577.txt and there is no need to modify i2c driver.

There is still the issue which Matthias Brugger pointed out on January, 24th: you need to describe the fallback compatibles.

IMHO the value under compatible are just inputs which can be accepted. It's little strange to add fallback information in binding. Some other bindings do not describe so detailedly.
Is it OK to make binding as minimum standard?
If we describe it very detailedly, we will have to modify binding if there are some changes for mt2701.

Rob, could you give some suggestions? Thanks!

Quoted 29 lines
Quoted 29 lines
---
 .../devicetree/bindings/i2c/i2c-mt6577.txt         |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
Documentation/devicetree/bindings/i2c/i2c-mt6577.txt +6 -5
index 0ce6fa3..27dbbf9 100644
@@ -4,11 +4,12 @@ The Mediatek's I2C controller is used to interface with I2C devices.
 
 Required properties:
   - compatible: value should be either of the following.
-      (a) "mediatek,mt6577-i2c", for i2c compatible with mt6577 i2c.
-      (b) "mediatek,mt6589-i2c", for i2c compatible with mt6589 i2c.
-      (c) "mediatek,mt8127-i2c", for i2c compatible with mt8127 i2c.
-      (d) "mediatek,mt8135-i2c", for i2c compatible with mt8135 i2c.
-      (e) "mediatek,mt8173-i2c", for i2c compatible with mt8173 i2c.
+	"mediatek,mt2701-i2c"
+	"mediatek,mt6577-i2c"
+	"mediatek,mt6589-i2c"
+	"mediatek,mt8127-i2c"
+	"mediatek,mt8135-i2c"
+	"mediatek,mt8173-i2c"
   - reg: physical base address of the controller and dma base, length of memory
     mapped region.
   - interrupts: interrupt number to the cpu.
Signature · 1 line
1.7.9.5
#5 lore raw

Re: [RESEND PATCH v3 1/2] dt-bindings: i2c: Add Mediatek MT2701 i2c binding

Quoted 13 lines · Jun Gao
Quoted 11 lines · Wolfram Sang
Quoted 6 lines · Jun Gao

From: Jun Gao <[email protected]>

Add MT2701 i2c binding to i2c-mt6577.txt and there is no need to modify i2c driver.

There is still the issue which Matthias Brugger pointed out on January, 24th: you need to describe the fallback compatibles.

Quoted 6 lines

IMHO the value under compatible are just inputs which can be accepted. It's little strange to add fallback information in binding. Some other bindings do not describe so detailedly.
Is it OK to make binding as minimum standard?
If we describe it very detailedly, we will have to modify binding if there are some changes for mt2701.

My reading of the below is that I could simply use "mediatek,mt2701-i2c" as compatible and things will work. But it won't, we don't have that in the driver IIRC. So, we need a fallback for that to work.

Quoted 1 line

Rob, could you give some suggestions? Thanks!

Would be welcome, yes. I lost track what the preferred solution is.

Quoted 22 lines
Quoted 22 lines
Quoted 22 lines
---
 .../devicetree/bindings/i2c/i2c-mt6577.txt         |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
Documentation/devicetree/bindings/i2c/i2c-mt6577.txt +4 -5
index 0ce6fa3..27dbbf9 100644
@@ -4,11 +4,12 @@ The Mediatek's I2C controller is used to interface with I2C devices.
 
 Required properties:
   - compatible: value should be either of the following.
-      (a) "mediatek,mt6577-i2c", for i2c compatible with mt6577 i2c.
-      (b) "mediatek,mt6589-i2c", for i2c compatible with mt6589 i2c.
-      (c) "mediatek,mt8127-i2c", for i2c compatible with mt8127 i2c.
-      (d) "mediatek,mt8135-i2c", for i2c compatible with mt8135 i2c.
-      (e) "mediatek,mt8173-i2c", for i2c compatible with mt8173 i2c.
+	"mediatek,mt2701-i2c"
+	"mediatek,mt6577-i2c"
+	"mediatek,mt6589-i2c"
+	"mediatek,mt8127-i2c"
Quoted 10 lines
Quoted 8 lines
Quoted 8 lines
Documentation/devicetree/bindings/i2c/i2c-mt6577.txt +2 -0
+	"mediatek,mt8135-i2c"
+	"mediatek,mt8173-i2c"
   - reg: physical base address of the controller and dma base, length of memory
     mapped region.
   - interrupts: interrupt number to the cpu.
Signature · 1 line
1.7.9.5

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20170328/b09df465/attachment.sig>

maintainer
#6 lore raw

Re: [RESEND PATCH v3 1/2] dt-bindings: i2c: Add Mediatek MT2701 i2c binding

Quoted 21 lines · Wolfram Sang
Quoted 13 lines · Jun Gao
Quoted 11 lines · Wolfram Sang
Quoted 6 lines · Jun Gao

From: Jun Gao <[email protected]>

Add MT2701 i2c binding to i2c-mt6577.txt and there is no need to modify i2c driver.

There is still the issue which Matthias Brugger pointed out on January, 24th: you need to describe the fallback compatibles.

Quoted 6 lines

IMHO the value under compatible are just inputs which can be accepted. It's little strange to add fallback information in binding. Some other bindings do not describe so detailedly.
Is it OK to make binding as minimum standard?
If we describe it very detailedly, we will have to modify binding if there are some changes for mt2701.

Quoted 8 lines

My reading of the below is that I could simply use "mediatek,mt2701-i2c" as compatible and things will work. But it won't, we don't have that in the driver IIRC. So, we need a fallback for that to work.

Quoted 1 line

Rob, could you give some suggestions? Thanks!

Would be welcome, yes. I lost track what the preferred solution is.

We will need to define the fallback binding for each SoC. As example take the rockchip mmc:
http://elixir.free-electrons.com/linux/latest/source/Documentation/devicetree/bindings/mmc/rockchip-dw-mshc.txt

Regards,
Matthias

Quoted 32 lines
Quoted 32 lines
Quoted 30 lines
Quoted 30 lines
---
  .../devicetree/bindings/i2c/i2c-mt6577.txt         |   11 ++++++-----
  1 file changed, 6 insertions(+), 5 deletions(-)
Documentation/devicetree/bindings/i2c/i2c-mt6577.txt +6 -5
index 0ce6fa3..27dbbf9 100644
@@ -4,11 +4,12 @@ The Mediatek's I2C controller is used to interface with I2C devices.
 
  Required properties:
    - compatible: value should be either of the following.
-      (a) "mediatek,mt6577-i2c", for i2c compatible with mt6577 i2c.
-      (b) "mediatek,mt6589-i2c", for i2c compatible with mt6589 i2c.
-      (c) "mediatek,mt8127-i2c", for i2c compatible with mt8127 i2c.
-      (d) "mediatek,mt8135-i2c", for i2c compatible with mt8135 i2c.
-      (e) "mediatek,mt8173-i2c", for i2c compatible with mt8173 i2c.
+	"mediatek,mt2701-i2c"
+	"mediatek,mt6577-i2c"
+	"mediatek,mt6589-i2c"
+	"mediatek,mt8127-i2c"
+	"mediatek,mt8135-i2c"
+	"mediatek,mt8173-i2c"
    - reg: physical base address of the controller and dma base, length of memory
      mapped region.
    - interrupts: interrupt number to the cpu.
Signature · 1 line
1.7.9.5
author
#7 lore raw

Re: [RESEND PATCH v3 1/2] dt-bindings: i2c: Add Mediatek MT2701 i2c binding

Quoted 32 lines · Matthias Brugger
Quoted 21 lines · Wolfram Sang
Quoted 13 lines · Jun Gao
Quoted 11 lines · Wolfram Sang
Quoted 6 lines · Jun Gao

From: Jun Gao <[email protected]>

Add MT2701 i2c binding to i2c-mt6577.txt and there is no need to modify i2c driver.

There is still the issue which Matthias Brugger pointed out on January, 24th: you need to describe the fallback compatibles.

Quoted 6 lines

IMHO the value under compatible are just inputs which can be accepted. It's little strange to add fallback information in binding. Some other bindings do not describe so detailedly.
Is it OK to make binding as minimum standard?
If we describe it very detailedly, we will have to modify binding if there are some changes for mt2701.

Quoted 8 lines

My reading of the below is that I could simply use "mediatek,mt2701-i2c" as compatible and things will work. But it won't, we don't have that in the driver IIRC. So, we need a fallback for that to work.

Quoted 1 line

Rob, could you give some suggestions? Thanks!

Would be welcome, yes. I lost track what the preferred solution is.

Quoted 7 lines

We will need to define the fallback binding for each SoC. As example take the rockchip mmc:
http://elixir.free-electrons.com/linux/latest/source/Documentation/devicetree/bindings/mmc/rockchip-dw-mshc.txt

Regards,
Matthias

Hi Rob,

There is no such requirement for other components. Could you give us some suggestions? Thanks!

Quoted 32 lines
Quoted 32 lines
Quoted 32 lines
Quoted 30 lines
Quoted 30 lines
---
  .../devicetree/bindings/i2c/i2c-mt6577.txt         |   11 ++++++-----
  1 file changed, 6 insertions(+), 5 deletions(-)
Documentation/devicetree/bindings/i2c/i2c-mt6577.txt +6 -5
index 0ce6fa3..27dbbf9 100644
@@ -4,11 +4,12 @@ The Mediatek's I2C controller is used to interface with I2C devices.
 
  Required properties:
    - compatible: value should be either of the following.
-      (a) "mediatek,mt6577-i2c", for i2c compatible with mt6577 i2c.
-      (b) "mediatek,mt6589-i2c", for i2c compatible with mt6589 i2c.
-      (c) "mediatek,mt8127-i2c", for i2c compatible with mt8127 i2c.
-      (d) "mediatek,mt8135-i2c", for i2c compatible with mt8135 i2c.
-      (e) "mediatek,mt8173-i2c", for i2c compatible with mt8173 i2c.
+	"mediatek,mt2701-i2c"
+	"mediatek,mt6577-i2c"
+	"mediatek,mt6589-i2c"
+	"mediatek,mt8127-i2c"
+	"mediatek,mt8135-i2c"
+	"mediatek,mt8173-i2c"
    - reg: physical base address of the controller and dma base, length of memory
      mapped region.
    - interrupts: interrupt number to the cpu.
Signature · 1 line
1.7.9.5
maintainer
#8 lore raw

Re: [RESEND PATCH v3 1/2] dt-bindings: i2c: Add Mediatek MT2701 i2c binding

Quoted 37 lines · Jun Gao
Quoted 36 lines · Matthias Brugger
Quoted 21 lines · Wolfram Sang
Quoted 13 lines · Jun Gao
Quoted 11 lines · Wolfram Sang
Quoted 6 lines · Jun Gao

From: Jun Gao <[email protected]>

Add MT2701 i2c binding to i2c-mt6577.txt and there is no need to modify i2c driver.

There is still the issue which Matthias Brugger pointed out on January, 24th: you need to describe the fallback compatibles.

Quoted 6 lines

IMHO the value under compatible are just inputs which can be accepted. It's little strange to add fallback information in binding. Some other bindings do not describe so detailedly.
Is it OK to make binding as minimum standard?
If we describe it very detailedly, we will have to modify binding if there are some changes for mt2701.

Quoted 8 lines

My reading of the below is that I could simply use "mediatek,mt2701-i2c" as compatible and things will work. But it won't, we don't have that in the driver IIRC. So, we need a fallback for that to work.

Quoted 1 line

Rob, could you give some suggestions? Thanks!

Would be welcome, yes. I lost track what the preferred solution is.

We will need to define the fallback binding for each SoC. As example take the rockchip mmc:
http://elixir.free-electrons.com/linux/latest/source/Documentation/devicetree/bindings/mmc/rockchip-dw-mshc.txt

Quoted 7 lines
Quoted 3 lines

Regards,
Matthias

Hi Rob,

There is no such requirement for other components.

The requirement is that the binding description reflects a compatible the driver is able to consume. Right now if you pass "mediatek,mt2701-i2c" the driver won't recognize this, therefor you need the fallback compatible. Which point isn't clear to you?

Regards,
Matthias

Quoted 38 lines

Could you give us some suggestions?
Thanks!

Quoted 32 lines
Quoted 32 lines
Quoted 32 lines
Quoted 30 lines
Quoted 30 lines
---
   .../devicetree/bindings/i2c/i2c-mt6577.txt         |   11 ++++++-----
   1 file changed, 6 insertions(+), 5 deletions(-)
Documentation/devicetree/bindings/i2c/i2c-mt6577.txt +6 -5
index 0ce6fa3..27dbbf9 100644
@@ -4,11 +4,12 @@ The Mediatek's I2C controller is used to interface with I2C devices.
 
   Required properties:
     - compatible: value should be either of the following.
-      (a) "mediatek,mt6577-i2c", for i2c compatible with mt6577 i2c.
-      (b) "mediatek,mt6589-i2c", for i2c compatible with mt6589 i2c.
-      (c) "mediatek,mt8127-i2c", for i2c compatible with mt8127 i2c.
-      (d) "mediatek,mt8135-i2c", for i2c compatible with mt8135 i2c.
-      (e) "mediatek,mt8173-i2c", for i2c compatible with mt8173 i2c.
+	"mediatek,mt2701-i2c"
+	"mediatek,mt6577-i2c"
+	"mediatek,mt6589-i2c"
+	"mediatek,mt8127-i2c"
+	"mediatek,mt8135-i2c"
+	"mediatek,mt8173-i2c"
     - reg: physical base address of the controller and dma base, length of memory
       mapped region.
     - interrupts: interrupt number to the cpu.
Signature · 1 line
1.7.9.5