2017-03-09 03:14:10

by Jun Gao

[permalink] [raw]
Subject: [RESEND PATCH v3 0/2] 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


2017-03-09 03:14:09

by Jun Gao

[permalink] [raw]
Subject: [RESEND PATCH v3 2/2] arm: dts: Add Mediatek MT2701 i2c device node

From: Jun Gao <[email protected]>

Add MT2701 i2c device node.

Signed-off-by: Jun Gao <[email protected]>
---
arch/arm/boot/dts/mt2701-evb.dts | 42 ++++++++++++++++++++++++++++++++++++++
arch/arm/boot/dts/mt2701.dtsi | 42 ++++++++++++++++++++++++++++++++++++++
2 files changed, 84 insertions(+)

diff --git a/arch/arm/boot/dts/mt2701-evb.dts b/arch/arm/boot/dts/mt2701-evb.dts
index a483798..3f5a96c 100644
--- a/arch/arm/boot/dts/mt2701-evb.dts
+++ b/arch/arm/boot/dts/mt2701-evb.dts
@@ -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@0 {
+ pins1 {
+ pinmux = <MT2701_PIN_75_SDA0__FUNC_SDA0>,
+ <MT2701_PIN_76_SCL0__FUNC_SCL0>;
+ bias-disable;
+ };
+ };
+
+ i2c1_pins_a: i2c1@0 {
+ pins1 {
+ pinmux = <MT2701_PIN_57_SDA1__FUNC_SDA1>,
+ <MT2701_PIN_58_SCL1__FUNC_SCL1>;
+ bias-disable;
+ };
+ };
+
+ i2c2_pins_a: i2c2@0 {
+ pins1 {
+ pinmux = <MT2701_PIN_77_SDA2__FUNC_SDA2>,
+ <MT2701_PIN_78_SCL2__FUNC_SCL2>;
+ bias-disable;
+ };
+ };
+
spi_pins_a: spi0@0 {
pins_spi {
pinmux = <MT2701_PIN_53_SPI0_CSN__FUNC_SPI0_CS>,
diff --git a/arch/arm/boot/dts/mt2701.dtsi b/arch/arm/boot/dts/mt2701.dtsi
index 8037210..1b6157e 100644
--- a/arch/arm/boot/dts/mt2701.dtsi
+++ b/arch/arm/boot/dts/mt2701.dtsi
@@ -286,6 +286,48 @@
status = "disabled";
};

+ i2c0: i2c@11007000 {
+ compatible = "mediatek,mt2701-i2c",
+ "mediatek,mt6577-i2c";
+ reg = <0 0x11007000 0 0x70>,
+ <0 0x11000200 0 0x80>;
+ interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_LOW>;
+ clock-div = <16>;
+ clocks = <&pericfg CLK_PERI_I2C0>, <&pericfg CLK_PERI_AP_DMA>;
+ clock-names = "main", "dma";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+ };
+
+ i2c1: i2c@11008000 {
+ compatible = "mediatek,mt2701-i2c",
+ "mediatek,mt6577-i2c";
+ reg = <0 0x11008000 0 0x70>,
+ <0 0x11000280 0 0x80>;
+ interrupts = <GIC_SPI 45 IRQ_TYPE_LEVEL_LOW>;
+ clock-div = <16>;
+ clocks = <&pericfg CLK_PERI_I2C1>, <&pericfg CLK_PERI_AP_DMA>;
+ clock-names = "main", "dma";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+ };
+
+ i2c2: i2c@11009000 {
+ compatible = "mediatek,mt2701-i2c",
+ "mediatek,mt6577-i2c";
+ reg = <0 0x11009000 0 0x70>,
+ <0 0x11000300 0 0x80>;
+ interrupts = <GIC_SPI 46 IRQ_TYPE_LEVEL_LOW>;
+ clock-div = <16>;
+ clocks = <&pericfg CLK_PERI_I2C2>, <&pericfg CLK_PERI_AP_DMA>;
+ clock-names = "main", "dma";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+ };
+
spi0: spi@1100a000 {
compatible = "mediatek,mt2701-spi";
#address-cells = <1>;
--
1.7.9.5

2017-03-09 03:14:07

by Jun Gao

[permalink] [raw]
Subject: [RESEND PATCH 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.

Signed-off-by: Jun Gao <[email protected]>
---
.../devicetree/bindings/i2c/i2c-mt6577.txt | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/Documentation/devicetree/bindings/i2c/i2c-mt6577.txt b/Documentation/devicetree/bindings/i2c/i2c-mt6577.txt
index 0ce6fa3..27dbbf9 100644
--- a/Documentation/devicetree/bindings/i2c/i2c-mt6577.txt
+++ b/Documentation/devicetree/bindings/i2c/i2c-mt6577.txt
@@ -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.
--
1.7.9.5

2017-03-15 20:26:35

by Rob Herring (Arm)

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

On Thu, Mar 09, 2017 at 11:13:04AM +0800, Jun Gao wrote:
> From: Jun Gao <[email protected]>
>
> Add MT2701 i2c binding to i2c-mt6577.txt and there is no need to
> modify i2c driver.
>
> Signed-off-by: Jun Gao <[email protected]>
> ---
> .../devicetree/bindings/i2c/i2c-mt6577.txt | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)

Acked-by: Rob Herring <[email protected]>

2017-03-22 09:06:51

by Wolfram Sang

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

On Thu, Mar 09, 2017 at 11:13:04AM +0800, Jun Gao wrote:
> From: Jun Gao <[email protected]>
>
> Add MT2701 i2c binding to i2c-mt6577.txt and there is no need to
> modify i2c driver.
>
> Signed-off-by: Jun Gao <[email protected]>

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

> ---
> .../devicetree/bindings/i2c/i2c-mt6577.txt | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/i2c/i2c-mt6577.txt b/Documentation/devicetree/bindings/i2c/i2c-mt6577.txt
> index 0ce6fa3..27dbbf9 100644
> --- a/Documentation/devicetree/bindings/i2c/i2c-mt6577.txt
> +++ b/Documentation/devicetree/bindings/i2c/i2c-mt6577.txt
> @@ -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.
> --
> 1.7.9.5
>


Attachments:
(No filename) (1.60 kB)
signature.asc (833.00 B)
Download all attachments

2017-03-28 09:50:41

by Jun Gao

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

On Wed, 2017-03-22 at 10:05 +0100, Wolfram Sang wrote:
> On Thu, Mar 09, 2017 at 11:13:04AM +0800, Jun Gao wrote:
> > From: Jun Gao <[email protected]>
> >
> > Add MT2701 i2c binding to i2c-mt6577.txt and there is no need to
> > modify i2c driver.
> >
> > Signed-off-by: Jun Gao <[email protected]>
>
> 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!

> > ---
> > .../devicetree/bindings/i2c/i2c-mt6577.txt | 11 ++++++-----
> > 1 file changed, 6 insertions(+), 5 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/i2c/i2c-mt6577.txt b/Documentation/devicetree/bindings/i2c/i2c-mt6577.txt
> > index 0ce6fa3..27dbbf9 100644
> > --- a/Documentation/devicetree/bindings/i2c/i2c-mt6577.txt
> > +++ b/Documentation/devicetree/bindings/i2c/i2c-mt6577.txt
> > @@ -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.
> > --
> > 1.7.9.5
> >


2017-03-28 19:23:04

by Wolfram Sang

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

On Tue, Mar 28, 2017 at 05:50:12PM +0800, Jun Gao wrote:
> On Wed, 2017-03-22 at 10:05 +0100, Wolfram Sang wrote:
> > On Thu, Mar 09, 2017 at 11:13:04AM +0800, Jun Gao wrote:
> > > From: Jun Gao <[email protected]>
> > >
> > > Add MT2701 i2c binding to i2c-mt6577.txt and there is no need to
> > > modify i2c driver.
> > >
> > > Signed-off-by: Jun Gao <[email protected]>
> >
> > 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.

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.

> Rob, could you give some suggestions? Thanks!

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

>
> > > ---
> > > .../devicetree/bindings/i2c/i2c-mt6577.txt | 11 ++++++-----
> > > 1 file changed, 6 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/Documentation/devicetree/bindings/i2c/i2c-mt6577.txt b/Documentation/devicetree/bindings/i2c/i2c-mt6577.txt
> > > index 0ce6fa3..27dbbf9 100644
> > > --- a/Documentation/devicetree/bindings/i2c/i2c-mt6577.txt
> > > +++ b/Documentation/devicetree/bindings/i2c/i2c-mt6577.txt
> > > @@ -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.
> > > --
> > > 1.7.9.5
> > >
>
>


Attachments:
(No filename) (2.53 kB)
signature.asc (819.00 B)
Download all attachments