diff mbox

[4/5] arm: shmobile: genmai: adapt dts to use native i2c driver

Message ID 1387316678-10174-5-git-send-email-wsa@the-dreams.de (mailing list archive)
State Changes Requested
Headers show

Commit Message

Wolfram Sang Dec. 17, 2013, 9:44 p.m. UTC
From: Wolfram Sang <wsa@sang-engineering.com>

Switch from the gpio-driver to the shiny new native driver. Tested by
accessing the eeprom on the genmai board.

Signed-off-by: Wolfram Sang <wsa@sang-engineering.com>
Acked-by: Magnus Damm <damm@opensource.se>
---
 arch/arm/boot/dts/r7s72100-genmai-reference.dts | 29 ++++++++++---------------
 1 file changed, 11 insertions(+), 18 deletions(-)

Comments

Laurent Pinchart Dec. 17, 2013, 9:57 p.m. UTC | #1
Hi Wolfram,

Thank you for the patch.

On Tuesday 17 December 2013 22:44:37 Wolfram Sang wrote:
> From: Wolfram Sang <wsa@sang-engineering.com>
> 
> Switch from the gpio-driver to the shiny new native driver. Tested by
> accessing the eeprom on the genmai board.
> 
> Signed-off-by: Wolfram Sang <wsa@sang-engineering.com>
> Acked-by: Magnus Damm <damm@opensource.se>
> ---
>  arch/arm/boot/dts/r7s72100-genmai-reference.dts | 29 +++++++++-------------
>  1 file changed, 11 insertions(+), 18 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/r7s72100-genmai-reference.dts
> b/arch/arm/boot/dts/r7s72100-genmai-reference.dts index ce5da0b..739448a
> 100644
> --- a/arch/arm/boot/dts/r7s72100-genmai-reference.dts
> +++ b/arch/arm/boot/dts/r7s72100-genmai-reference.dts
> @@ -39,24 +39,6 @@
>  			gpios = <&port4 11 GPIO_ACTIVE_LOW>;
>  		};
>  	};
> -
> -	i2c@0 {
> -		compatible = "i2c-gpio";
> -		gpios = <&port1 5 GPIO_ACTIVE_HIGH /* sda */
> -			 &port1 4 GPIO_ACTIVE_HIGH /* scl */
> -			>;
> -		i2c-gpio,sda-open-drain;
> -		i2c-gpio,scl-open-drain;
> -		i2c-gpio,delay-us = <5>;	/* ~100 kHz */
> -		#address-cells = <1>;
> -		#size-cells = <0>;
> -
> -		flash@50 {
> -			compatible = "renesas,24c128";
> -			reg = <0x50>;
> -			pagesize = <64>;
> -		};
> -	};
>  };
> 
>  &pfc {
> @@ -68,3 +50,14 @@
>  		renesas,function = "scif2";
>  	};
>  };
> +
> +&i2c2 {
> +	status = "okay";
> +	clock-frequency = <400000>;
> +
> +	eeprom: 24c128@50 {

That should be "24c128: eeprom@50". You can actually omit the "24c128:" alias 
until it gets needed.

> +		compatible = "renesas,24c128";
> +		reg = <0x50>;
> +		pagesize = <64>;
> +	};
> +};
Sergei Shtylyov Dec. 18, 2013, 11:41 a.m. UTC | #2
Hello.

On 18-12-2013 1:44, Wolfram Sang wrote:

> From: Wolfram Sang <wsa@sang-engineering.com>

> Switch from the gpio-driver to the shiny new native driver. Tested by
> accessing the eeprom on the genmai board.

> Signed-off-by: Wolfram Sang <wsa@sang-engineering.com>
> Acked-by: Magnus Damm <damm@opensource.se>
> ---
>   arch/arm/boot/dts/r7s72100-genmai-reference.dts | 29 ++++++++++---------------
>   1 file changed, 11 insertions(+), 18 deletions(-)

> diff --git a/arch/arm/boot/dts/r7s72100-genmai-reference.dts b/arch/arm/boot/dts/r7s72100-genmai-reference.dts
> index ce5da0b..739448a 100644
> --- a/arch/arm/boot/dts/r7s72100-genmai-reference.dts
> +++ b/arch/arm/boot/dts/r7s72100-genmai-reference.dts
> @@ -39,24 +39,6 @@
>   			gpios = <&port4 11 GPIO_ACTIVE_LOW>;
>   		};
>   	};
> -
> -	i2c@0 {
> -		compatible = "i2c-gpio";
> -		gpios = <&port1 5 GPIO_ACTIVE_HIGH /* sda */
> -			 &port1 4 GPIO_ACTIVE_HIGH /* scl */
> -			>;
> -		i2c-gpio,sda-open-drain;
> -		i2c-gpio,scl-open-drain;
> -		i2c-gpio,delay-us = <5>;	/* ~100 kHz */
> -		#address-cells = <1>;
> -		#size-cells = <0>;
> -
> -		flash@50 {
> -			compatible = "renesas,24c128";
> -			reg = <0x50>;
> -			pagesize = <64>;
> -		};
> -	};
>   };
>
>   &pfc {
> @@ -68,3 +50,14 @@
>   		renesas,function = "scif2";
>   	};
>   };
> +
> +&i2c2 {
> +	status = "okay";
> +	clock-frequency = <400000>;
> +
> +	eeprom: 24c128@50 {

    The node was called "flash@50" for a reason: according to ePAPR spec,  for 
node names the generic device names should be used, not chip-specific.

> +		compatible = "renesas,24c128";
> +		reg = <0x50>;
> +		pagesize = <64>;
> +	};
> +};

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/arm/boot/dts/r7s72100-genmai-reference.dts b/arch/arm/boot/dts/r7s72100-genmai-reference.dts
index ce5da0b..739448a 100644
--- a/arch/arm/boot/dts/r7s72100-genmai-reference.dts
+++ b/arch/arm/boot/dts/r7s72100-genmai-reference.dts
@@ -39,24 +39,6 @@ 
 			gpios = <&port4 11 GPIO_ACTIVE_LOW>;
 		};
 	};
-
-	i2c@0 {
-		compatible = "i2c-gpio";
-		gpios = <&port1 5 GPIO_ACTIVE_HIGH /* sda */
-			 &port1 4 GPIO_ACTIVE_HIGH /* scl */
-			>;
-		i2c-gpio,sda-open-drain;
-		i2c-gpio,scl-open-drain;
-		i2c-gpio,delay-us = <5>;	/* ~100 kHz */
-		#address-cells = <1>;
-		#size-cells = <0>;
-
-		flash@50 {
-			compatible = "renesas,24c128";
-			reg = <0x50>;
-			pagesize = <64>;
-		};
-	};
 };
 
 &pfc {
@@ -68,3 +50,14 @@ 
 		renesas,function = "scif2";
 	};
 };
+
+&i2c2 {
+	status = "okay";
+	clock-frequency = <400000>;
+
+	eeprom: 24c128@50 {
+		compatible = "renesas,24c128";
+		reg = <0x50>;
+		pagesize = <64>;
+	};
+};