diff mbox series

[v3,05/21] ARM: dts: add recovery for I2C for iMX7

Message ID 20190807082556.5013-6-philippe.schenker@toradex.com (mailing list archive)
State New, archived
Headers show
Series Common patches from downstream development | expand

Commit Message

Philippe Schenker Aug. 7, 2019, 8:26 a.m. UTC
From: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>

- add recovery mode for applicable i2c buses for
  Colibri iMX7 module.

Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
---

Changes in v3: None
Changes in v2: None

 arch/arm/boot/dts/imx7-colibri.dtsi | 25 +++++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)

Comments

Marcel Ziswiler Aug. 9, 2019, 2:45 p.m. UTC | #1
On Wed, 2019-08-07 at 08:26 +0000, Philippe Schenker wrote:
> From: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
> 
> - add recovery mode for applicable i2c buses for
>   Colibri iMX7 module.
> 
> Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
> Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>

Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>

> ---
> 
> Changes in v3: None
> Changes in v2: None
> 
>  arch/arm/boot/dts/imx7-colibri.dtsi | 25 +++++++++++++++++++++++--
>  1 file changed, 23 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/imx7-colibri.dtsi
> b/arch/arm/boot/dts/imx7-colibri.dtsi
> index a8d992f3e897..2480623c92ff 100644
> --- a/arch/arm/boot/dts/imx7-colibri.dtsi
> +++ b/arch/arm/boot/dts/imx7-colibri.dtsi
> @@ -140,8 +140,12 @@
>  
>  &i2c1 {
>  	clock-frequency = <100000>;
> -	pinctrl-names = "default";
> +	pinctrl-names = "default", "gpio";
>  	pinctrl-0 = <&pinctrl_i2c1 &pinctrl_i2c1_int>;
> +	pinctrl-1 = <&pinctrl_i2c1_recovery &pinctrl_i2c1_int>;
> +	scl-gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>;
> +	sda-gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>;
> +
>  	status = "okay";
>  
>  	codec: sgtl5000@a {
> @@ -242,8 +246,11 @@
>  
>  &i2c4 {
>  	clock-frequency = <100000>;
> -	pinctrl-names = "default";
> +	pinctrl-names = "default", "gpio";
>  	pinctrl-0 = <&pinctrl_i2c4>;
> +	pinctrl-1 = <&pinctrl_i2c4_recovery>;
> +	scl-gpios = <&gpio7 8 GPIO_ACTIVE_HIGH>;
> +	sda-gpios = <&gpio7 9 GPIO_ACTIVE_HIGH>;
>  };
>  
>  &lcdif {
> @@ -540,6 +547,13 @@
>  		>;
>  	};
>  
> +	pinctrl_i2c4_recovery: i2c4-recoverygrp {
> +		fsl,pins = <
> +			MX7D_PAD_ENET1_RGMII_TD2__GPIO7_IO8	0x400
> 0007f
> +			MX7D_PAD_ENET1_RGMII_TD3__GPIO7_IO9	0x400
> 0007f
> +		>;
> +	};
> +
>  	pinctrl_lcdif_dat: lcdif-dat-grp {
>  		fsl,pins = <
>  			MX7D_PAD_LCD_DATA00__LCD_DATA0		0x79
> @@ -740,6 +754,13 @@
>  		>;
>  	};
>  
> +	pinctrl_i2c1_recovery: i2c1-recoverygrp {
> +		fsl,pins = <
> +			MX7D_PAD_LPSR_GPIO1_IO04__GPIO1_IO4	0x400
> 0007f
> +			MX7D_PAD_LPSR_GPIO1_IO05__GPIO1_IO5	0x400
> 0007f
> +		>;
> +	};
> +
>  	pinctrl_cd_usdhc1: usdhc1-cd-grp {
>  		fsl,pins = <
>  			MX7D_PAD_LPSR_GPIO1_IO00__GPIO1_IO0	0x59
> /* CD */
André Draszik Aug. 10, 2019, 9:58 p.m. UTC | #2
On Wed, 07 Aug 2019 08:26:15 +0000, Philippe Schenker wrote:
> From: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
>
> - add recovery mode for applicable i2c buses for
>   Colibri iMX7 module.
>
> Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
> Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
> ---
>
> Changes in v3: None
> Changes in v2: None
>
>  arch/arm/boot/dts/imx7-colibri.dtsi | 25 +++++++++++++++++++++++--
>  1 file changed, 23 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/boot/dts/imx7-colibri.dtsi b/arch/arm/boot/dts/imx7-colibri.dtsi
> index a8d992f3e897..2480623c92ff 100644
> --- a/arch/arm/boot/dts/imx7-colibri.dtsi
> +++ b/arch/arm/boot/dts/imx7-colibri.dtsi
> @@ -140,8 +140,12 @@
>
>  &i2c1 {
>  	clock-frequency = <100000>;
> -	pinctrl-names = "default";
> +	pinctrl-names = "default", "gpio";
>  	pinctrl-0 = <&pinctrl_i2c1 &pinctrl_i2c1_int>;
> +	pinctrl-1 = <&pinctrl_i2c1_recovery &pinctrl_i2c1_int>;
> +	scl-gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>;

scl-gpios should be (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN) since
commit d2d0ad2aec4a ("i2c: imx: use open drain for recovery GPIO")

Otherwise you'll get a boot-time warning:
   enforced open drain please flag it properly in DT/ACPI DSDT/board file

> +	sda-gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>;
> +
>  	status = "okay";
>
>  	codec: sgtl5000@a {
> @@ -242,8 +246,11 @@
>
>  &i2c4 {
>  	clock-frequency = <100000>;
> -	pinctrl-names = "default";
> +	pinctrl-names = "default", "gpio";
>  	pinctrl-0 = <&pinctrl_i2c4>;
> +	pinctrl-1 = <&pinctrl_i2c4_recovery>;
> +	scl-gpios = <&gpio7 8 GPIO_ACTIVE_HIGH>;

and here, too.

Cheers,
André
Philippe Schenker Aug. 12, 2019, 8:50 a.m. UTC | #3
On Sat, 2019-08-10 at 22:58 +0100, André Draszik wrote:
> On Wed, 07 Aug 2019 08:26:15 +0000, Philippe Schenker wrote:
> > From: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
> > 
> > - add recovery mode for applicable i2c buses for
> >   Colibri iMX7 module.
> > 
> > Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
> > Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
> > ---
> > 
> > Changes in v3: None
> > Changes in v2: None
> > 
> >  arch/arm/boot/dts/imx7-colibri.dtsi | 25 +++++++++++++++++++++++--
> >  1 file changed, 23 insertions(+), 2 deletions(-)
> > 
> > diff --git a/arch/arm/boot/dts/imx7-colibri.dtsi
> > b/arch/arm/boot/dts/imx7-colibri.dtsi
> > index a8d992f3e897..2480623c92ff 100644
> > --- a/arch/arm/boot/dts/imx7-colibri.dtsi
> > +++ b/arch/arm/boot/dts/imx7-colibri.dtsi
> > @@ -140,8 +140,12 @@
> > 
> >  &i2c1 {
> >  	clock-frequency = <100000>;
> > -	pinctrl-names = "default";
> > +	pinctrl-names = "default", "gpio";
> >  	pinctrl-0 = <&pinctrl_i2c1 &pinctrl_i2c1_int>;
> > +	pinctrl-1 = <&pinctrl_i2c1_recovery &pinctrl_i2c1_int>;
> > +	scl-gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>;
> 
> scl-gpios should be (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN) since
> commit d2d0ad2aec4a ("i2c: imx: use open drain for recovery GPIO")
> 
> Otherwise you'll get a boot-time warning:
>    enforced open drain please flag it properly in DT/ACPI DSDT/board
> file

Thanks for pointing this out, I added this for v4.

Philippe
> 
> > +	sda-gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>;
> > +
> >  	status = "okay";
> > 
> >  	codec: sgtl5000@a {
> > @@ -242,8 +246,11 @@
> > 
> >  &i2c4 {
> >  	clock-frequency = <100000>;
> > -	pinctrl-names = "default";
> > +	pinctrl-names = "default", "gpio";
> >  	pinctrl-0 = <&pinctrl_i2c4>;
> > +	pinctrl-1 = <&pinctrl_i2c4_recovery>;
> > +	scl-gpios = <&gpio7 8 GPIO_ACTIVE_HIGH>;
> 
> and here, too.
> 
> Cheers,
> André
Michal Vokáč Aug. 12, 2019, 9:15 a.m. UTC | #4
On 07. 08. 19 10:26, Philippe Schenker wrote:
> From: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
> 
> - add recovery mode for applicable i2c buses for
>    Colibri iMX7 module.
> 
> Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
> Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
> ---
Hi Philippe,

since you are going to send v4 anyway I suggest you update the subject
to be consistent across all the patches.

	"ARM: dts: imx7-colibri: add recovery for I2C for iMX7"

fits better I think.

Thank you,
Michal

> 
> Changes in v3: None
> Changes in v2: None
> 
>   arch/arm/boot/dts/imx7-colibri.dtsi | 25 +++++++++++++++++++++++--
>   1 file changed, 23 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/imx7-colibri.dtsi b/arch/arm/boot/dts/imx7-colibri.dtsi
> index a8d992f3e897..2480623c92ff 100644
> --- a/arch/arm/boot/dts/imx7-colibri.dtsi
> +++ b/arch/arm/boot/dts/imx7-colibri.dtsi
> @@ -140,8 +140,12 @@
>   
>   &i2c1 {
>   	clock-frequency = <100000>;
> -	pinctrl-names = "default";
> +	pinctrl-names = "default", "gpio";
>   	pinctrl-0 = <&pinctrl_i2c1 &pinctrl_i2c1_int>;
> +	pinctrl-1 = <&pinctrl_i2c1_recovery &pinctrl_i2c1_int>;
> +	scl-gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>;
> +	sda-gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>;
> +
>   	status = "okay";
>   
>   	codec: sgtl5000@a {
> @@ -242,8 +246,11 @@
>   
>   &i2c4 {
>   	clock-frequency = <100000>;
> -	pinctrl-names = "default";
> +	pinctrl-names = "default", "gpio";
>   	pinctrl-0 = <&pinctrl_i2c4>;
> +	pinctrl-1 = <&pinctrl_i2c4_recovery>;
> +	scl-gpios = <&gpio7 8 GPIO_ACTIVE_HIGH>;
> +	sda-gpios = <&gpio7 9 GPIO_ACTIVE_HIGH>;
>   };
>   
>   &lcdif {
> @@ -540,6 +547,13 @@
>   		>;
>   	};
>   
> +	pinctrl_i2c4_recovery: i2c4-recoverygrp {
> +		fsl,pins = <
> +			MX7D_PAD_ENET1_RGMII_TD2__GPIO7_IO8	0x4000007f
> +			MX7D_PAD_ENET1_RGMII_TD3__GPIO7_IO9	0x4000007f
> +		>;
> +	};
> +
>   	pinctrl_lcdif_dat: lcdif-dat-grp {
>   		fsl,pins = <
>   			MX7D_PAD_LCD_DATA00__LCD_DATA0		0x79
> @@ -740,6 +754,13 @@
>   		>;
>   	};
>   
> +	pinctrl_i2c1_recovery: i2c1-recoverygrp {
> +		fsl,pins = <
> +			MX7D_PAD_LPSR_GPIO1_IO04__GPIO1_IO4	0x4000007f
> +			MX7D_PAD_LPSR_GPIO1_IO05__GPIO1_IO5	0x4000007f
> +		>;
> +	};
> +
>   	pinctrl_cd_usdhc1: usdhc1-cd-grp {
>   		fsl,pins = <
>   			MX7D_PAD_LPSR_GPIO1_IO00__GPIO1_IO0	0x59 /* CD */
>
Philippe Schenker Aug. 12, 2019, 10:59 a.m. UTC | #5
On Mon, 2019-08-12 at 11:15 +0200, Michal Vokáč wrote:
> On 07. 08. 19 10:26, Philippe Schenker wrote:
> > From: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
> > 
> > - add recovery mode for applicable i2c buses for
> >    Colibri iMX7 module.
> > 
> > Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
> > Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
> > ---
> Hi Philippe,
> 
> since you are going to send v4 anyway I suggest you update the subject
> to be consistent across all the patches.
> 
> 	"ARM: dts: imx7-colibri: add recovery for I2C for iMX7"
> 
> fits better I think.
> 
> Thank you,
> Michal

Okay, will do that for v4. I'll go over all messages then again and see
that it is consistent.

Philippe
> 
> > Changes in v3: None
> > Changes in v2: None
> > 
> >   arch/arm/boot/dts/imx7-colibri.dtsi | 25 +++++++++++++++++++++++--
> >   1 file changed, 23 insertions(+), 2 deletions(-)
> > 
> > diff --git a/arch/arm/boot/dts/imx7-colibri.dtsi
> > b/arch/arm/boot/dts/imx7-colibri.dtsi
> > index a8d992f3e897..2480623c92ff 100644
> > --- a/arch/arm/boot/dts/imx7-colibri.dtsi
> > +++ b/arch/arm/boot/dts/imx7-colibri.dtsi
> > @@ -140,8 +140,12 @@
> >   
> >   &i2c1 {
> >   	clock-frequency = <100000>;
> > -	pinctrl-names = "default";
> > +	pinctrl-names = "default", "gpio";
> >   	pinctrl-0 = <&pinctrl_i2c1 &pinctrl_i2c1_int>;
> > +	pinctrl-1 = <&pinctrl_i2c1_recovery &pinctrl_i2c1_int>;
> > +	scl-gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>;
> > +	sda-gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>;
> > +
> >   	status = "okay";
> >   
> >   	codec: sgtl5000@a {
> > @@ -242,8 +246,11 @@
> >   
> >   &i2c4 {
> >   	clock-frequency = <100000>;
> > -	pinctrl-names = "default";
> > +	pinctrl-names = "default", "gpio";
> >   	pinctrl-0 = <&pinctrl_i2c4>;
> > +	pinctrl-1 = <&pinctrl_i2c4_recovery>;
> > +	scl-gpios = <&gpio7 8 GPIO_ACTIVE_HIGH>;
> > +	sda-gpios = <&gpio7 9 GPIO_ACTIVE_HIGH>;
> >   };
> >   
> >   &lcdif {
> > @@ -540,6 +547,13 @@
> >   		>;
> >   	};
> >   
> > +	pinctrl_i2c4_recovery: i2c4-recoverygrp {
> > +		fsl,pins = <
> > +			MX7D_PAD_ENET1_RGMII_TD2__GPIO7_IO8	0x4000007f
> > +			MX7D_PAD_ENET1_RGMII_TD3__GPIO7_IO9	0x4000007f
> > +		>;
> > +	};
> > +
> >   	pinctrl_lcdif_dat: lcdif-dat-grp {
> >   		fsl,pins = <
> >   			MX7D_PAD_LCD_DATA00__LCD_DATA0		0x79
> > @@ -740,6 +754,13 @@
> >   		>;
> >   	};
> >   
> > +	pinctrl_i2c1_recovery: i2c1-recoverygrp {
> > +		fsl,pins = <
> > +			MX7D_PAD_LPSR_GPIO1_IO04__GPIO1_IO4	0x4000007f
> > +			MX7D_PAD_LPSR_GPIO1_IO05__GPIO1_IO5	0x4000007f
> > +		>;
> > +	};
> > +
> >   	pinctrl_cd_usdhc1: usdhc1-cd-grp {
> >   		fsl,pins = <
> >   			MX7D_PAD_LPSR_GPIO1_IO00__GPIO1_IO0	0x59 /* CD
> > */
> >
diff mbox series

Patch

diff --git a/arch/arm/boot/dts/imx7-colibri.dtsi b/arch/arm/boot/dts/imx7-colibri.dtsi
index a8d992f3e897..2480623c92ff 100644
--- a/arch/arm/boot/dts/imx7-colibri.dtsi
+++ b/arch/arm/boot/dts/imx7-colibri.dtsi
@@ -140,8 +140,12 @@ 
 
 &i2c1 {
 	clock-frequency = <100000>;
-	pinctrl-names = "default";
+	pinctrl-names = "default", "gpio";
 	pinctrl-0 = <&pinctrl_i2c1 &pinctrl_i2c1_int>;
+	pinctrl-1 = <&pinctrl_i2c1_recovery &pinctrl_i2c1_int>;
+	scl-gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>;
+	sda-gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>;
+
 	status = "okay";
 
 	codec: sgtl5000@a {
@@ -242,8 +246,11 @@ 
 
 &i2c4 {
 	clock-frequency = <100000>;
-	pinctrl-names = "default";
+	pinctrl-names = "default", "gpio";
 	pinctrl-0 = <&pinctrl_i2c4>;
+	pinctrl-1 = <&pinctrl_i2c4_recovery>;
+	scl-gpios = <&gpio7 8 GPIO_ACTIVE_HIGH>;
+	sda-gpios = <&gpio7 9 GPIO_ACTIVE_HIGH>;
 };
 
 &lcdif {
@@ -540,6 +547,13 @@ 
 		>;
 	};
 
+	pinctrl_i2c4_recovery: i2c4-recoverygrp {
+		fsl,pins = <
+			MX7D_PAD_ENET1_RGMII_TD2__GPIO7_IO8	0x4000007f
+			MX7D_PAD_ENET1_RGMII_TD3__GPIO7_IO9	0x4000007f
+		>;
+	};
+
 	pinctrl_lcdif_dat: lcdif-dat-grp {
 		fsl,pins = <
 			MX7D_PAD_LCD_DATA00__LCD_DATA0		0x79
@@ -740,6 +754,13 @@ 
 		>;
 	};
 
+	pinctrl_i2c1_recovery: i2c1-recoverygrp {
+		fsl,pins = <
+			MX7D_PAD_LPSR_GPIO1_IO04__GPIO1_IO4	0x4000007f
+			MX7D_PAD_LPSR_GPIO1_IO05__GPIO1_IO5	0x4000007f
+		>;
+	};
+
 	pinctrl_cd_usdhc1: usdhc1-cd-grp {
 		fsl,pins = <
 			MX7D_PAD_LPSR_GPIO1_IO00__GPIO1_IO0	0x59 /* CD */