linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Enable cc8540 pinctrl DT for uart and i2c
@ 2013-05-27 13:30 Gabriel Fernandez
  2013-05-27 13:30 ` [PATCH 1/3] ARM: ux500: use #include syntax to include *.dtsi Gabriel Fernandez
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Gabriel Fernandez @ 2013-05-27 13:30 UTC (permalink / raw)
  To: linux-kernel
  Cc: Lee Jones, Linus Walleij, Olivier Clergeaud, Gabriel Fernandez

From: Gabriel Fernandez <gabriel.fernandez@st.com>

Theses patches enable ccu8540 pintctrl DT for uart and i2c

Gabriel Fernandez (3):
  ARM: ux500: use #include syntax to include *.dtsi.
  ARM: u8540: Add Pinctrl Device Tree settings for uart0, uart2
  ARM: u8540: DT: Set pinctrl mapping to i2c0,1,2,4 & 5

 arch/arm/boot/dts/ccu8540-pinctrl.dtsi     | 192 +++++++++++++++++++++++++++++
 arch/arm/boot/dts/ccu8540.dts              |  39 +++++-
 arch/arm/boot/dts/ccu9540.dts              |   2 +-
 arch/arm/boot/dts/dbx5x0.dtsi              |   4 +-
 arch/arm/boot/dts/href.dtsi                |   2 +-
 arch/arm/boot/dts/hrefprev60.dts           |   6 +-
 arch/arm/boot/dts/hrefv60plus.dts          |   6 +-
 arch/arm/boot/dts/snowball.dts             |   2 +-
 arch/arm/boot/dts/ste-nomadik-pinctrl.dtsi |  95 ++++++++++++++
 include/dt-bindings/pinctrl/nomadik.h      |  36 ++++++
 10 files changed, 372 insertions(+), 12 deletions(-)
 create mode 100644 arch/arm/boot/dts/ccu8540-pinctrl.dtsi
 create mode 100644 arch/arm/boot/dts/ste-nomadik-pinctrl.dtsi
 create mode 100644 include/dt-bindings/pinctrl/nomadik.h

-- 
1.8.1.1


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 1/3] ARM: ux500: use #include syntax to include *.dtsi.
  2013-05-27 13:30 [PATCH 0/3] Enable cc8540 pinctrl DT for uart and i2c Gabriel Fernandez
@ 2013-05-27 13:30 ` Gabriel Fernandez
  2013-05-28 10:10   ` Lee Jones
  2013-05-29 16:39   ` Linus Walleij
  2013-05-27 13:30 ` [PATCH 2/3] ARM: u8540: Add Pinctrl Device Tree settings for uart0, uart2 Gabriel Fernandez
  2013-05-27 13:30 ` [PATCH 3/3] ARM: u8540: DT: Set pinctrl mapping to i2c0,1,2,4 & 5 Gabriel Fernandez
  2 siblings, 2 replies; 13+ messages in thread
From: Gabriel Fernandez @ 2013-05-27 13:30 UTC (permalink / raw)
  To: linux-kernel
  Cc: Lee Jones, Linus Walleij, Olivier Clergeaud, Gabriel Fernandez

From: Gabriel Fernandez <gabriel.fernandez@st.com>

This patch prepares the use of '#define' into dts files.

Signed-off-by: Gabriel Fernandez <gabriel.fernandez@st.com>
---
 arch/arm/boot/dts/ccu8540.dts     | 2 +-
 arch/arm/boot/dts/ccu9540.dts     | 2 +-
 arch/arm/boot/dts/dbx5x0.dtsi     | 2 +-
 arch/arm/boot/dts/href.dtsi       | 2 +-
 arch/arm/boot/dts/hrefprev60.dts  | 6 +++---
 arch/arm/boot/dts/hrefv60plus.dts | 6 +++---
 arch/arm/boot/dts/snowball.dts    | 2 +-
 7 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/arch/arm/boot/dts/ccu8540.dts b/arch/arm/boot/dts/ccu8540.dts
index 18daa01..5de9e1e 100644
--- a/arch/arm/boot/dts/ccu8540.dts
+++ b/arch/arm/boot/dts/ccu8540.dts
@@ -10,7 +10,7 @@
  */
 
 /dts-v1/;
-/include/ "dbx5x0.dtsi"
+#include "dbx5x0.dtsi"
 
 / {
 	model = "ST-Ericsson U8540 platform with Device Tree";
diff --git a/arch/arm/boot/dts/ccu9540.dts b/arch/arm/boot/dts/ccu9540.dts
index c72d7aa..c76ec3a 100644
--- a/arch/arm/boot/dts/ccu9540.dts
+++ b/arch/arm/boot/dts/ccu9540.dts
@@ -10,7 +10,7 @@
  */
 
 /dts-v1/;
-/include/ "dbx5x0.dtsi"
+#include "dbx5x0.dtsi"
 
 / {
 	model = "ST-Ericsson CCU9540 platform with Device Tree";
diff --git a/arch/arm/boot/dts/dbx5x0.dtsi b/arch/arm/boot/dts/dbx5x0.dtsi
index cd5cd09..f85ff85 100644
--- a/arch/arm/boot/dts/dbx5x0.dtsi
+++ b/arch/arm/boot/dts/dbx5x0.dtsi
@@ -9,7 +9,7 @@
  * http://www.gnu.org/copyleft/gpl.html
  */
 
-/include/ "skeleton.dtsi"
+#include "skeleton.dtsi"
 
 / {
 	soc {
diff --git a/arch/arm/boot/dts/href.dtsi b/arch/arm/boot/dts/href.dtsi
index e315429..d01a8e1 100644
--- a/arch/arm/boot/dts/href.dtsi
+++ b/arch/arm/boot/dts/href.dtsi
@@ -9,7 +9,7 @@
  * http://www.gnu.org/copyleft/gpl.html
  */
 
-/include/ "dbx5x0.dtsi"
+#include "dbx5x0.dtsi"
 
 / {
 	memory {
diff --git a/arch/arm/boot/dts/hrefprev60.dts b/arch/arm/boot/dts/hrefprev60.dts
index 8a9357b..23c6dc1 100644
--- a/arch/arm/boot/dts/hrefprev60.dts
+++ b/arch/arm/boot/dts/hrefprev60.dts
@@ -10,9 +10,9 @@
  */
 
 /dts-v1/;
-/include/ "dbx5x0.dtsi"
-/include/ "href.dtsi"
-/include/ "stuib.dtsi"
+#include "dbx5x0.dtsi"
+#include "href.dtsi"
+#include "stuib.dtsi"
 
 / {
 	model = "ST-Ericsson HREF (pre-v60) platform with Device Tree";
diff --git a/arch/arm/boot/dts/hrefv60plus.dts b/arch/arm/boot/dts/hrefv60plus.dts
index 5dfc73a..9703a4f 100644
--- a/arch/arm/boot/dts/hrefv60plus.dts
+++ b/arch/arm/boot/dts/hrefv60plus.dts
@@ -10,9 +10,9 @@
  */
 
 /dts-v1/;
-/include/ "dbx5x0.dtsi"
-/include/ "href.dtsi"
-/include/ "stuib.dtsi"
+#include "dbx5x0.dtsi"
+#include "href.dtsi"
+#include "stuib.dtsi"
 
 / {
 	model = "ST-Ericsson HREF (v60+) platform with Device Tree";
diff --git a/arch/arm/boot/dts/snowball.dts b/arch/arm/boot/dts/snowball.dts
index e8219cc7..2504267 100644
--- a/arch/arm/boot/dts/snowball.dts
+++ b/arch/arm/boot/dts/snowball.dts
@@ -10,7 +10,7 @@
  */
 
 /dts-v1/;
-/include/ "dbx5x0.dtsi"
+#include "dbx5x0.dtsi"
 
 / {
 	model = "Calao Systems Snowball platform with device tree";
-- 
1.8.1.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 2/3] ARM: u8540: Add Pinctrl Device Tree settings for uart0, uart2
  2013-05-27 13:30 [PATCH 0/3] Enable cc8540 pinctrl DT for uart and i2c Gabriel Fernandez
  2013-05-27 13:30 ` [PATCH 1/3] ARM: ux500: use #include syntax to include *.dtsi Gabriel Fernandez
@ 2013-05-27 13:30 ` Gabriel Fernandez
  2013-05-28 10:09   ` Lee Jones
  2013-05-29  8:55   ` Gabriel Fernandez
  2013-05-27 13:30 ` [PATCH 3/3] ARM: u8540: DT: Set pinctrl mapping to i2c0,1,2,4 & 5 Gabriel Fernandez
  2 siblings, 2 replies; 13+ messages in thread
From: Gabriel Fernandez @ 2013-05-27 13:30 UTC (permalink / raw)
  To: linux-kernel
  Cc: Lee Jones, Linus Walleij, Olivier Clergeaud, Gabriel Fernandez

From: Gabriel Fernandez <gabriel.fernandez@st.com>

This patch adds pinctrl device tree settings for uart0 and uart2
for ccu8540 board.

Signed-off-by: Gabriel Fernandez <gabriel.fernandez@st.com>
---
 arch/arm/boot/dts/ccu8540-pinctrl.dtsi     | 77 ++++++++++++++++++++++++
 arch/arm/boot/dts/ccu8540.dts              |  7 +++
 arch/arm/boot/dts/dbx5x0.dtsi              |  2 +-
 arch/arm/boot/dts/ste-nomadik-pinctrl.dtsi | 95 ++++++++++++++++++++++++++++++
 include/dt-bindings/pinctrl/nomadik.h      | 36 +++++++++++
 5 files changed, 216 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/boot/dts/ccu8540-pinctrl.dtsi
 create mode 100644 arch/arm/boot/dts/ste-nomadik-pinctrl.dtsi
 create mode 100644 include/dt-bindings/pinctrl/nomadik.h

diff --git a/arch/arm/boot/dts/ccu8540-pinctrl.dtsi b/arch/arm/boot/dts/ccu8540-pinctrl.dtsi
new file mode 100644
index 0000000..26e718b
--- /dev/null
+++ b/arch/arm/boot/dts/ccu8540-pinctrl.dtsi
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2012 ST-Ericsson
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+#include "ste-nomadik-pinctrl.dtsi"
+
+&pinctrl_dbx500 {
+	uart0 {
+		uart0_default_mux: uart0_mux {
+			default_mux {
+				ste,function = "u0";
+				ste,pins = "u0_a_1";
+			};
+		};
+
+		uart0_default_mode: uart0_default {
+			default_cfg1 {
+				ste,pins = "GPIO0", "GPIO2";
+				ste,config = <&in_pu>;
+			};
+
+			default_cfg2 {
+				ste,pins = "GPIO1", "GPIO3";
+				ste,config = <&out_hi>;
+			};
+		};
+
+		uart0_sleep_mode: uart0_sleep {
+			sleep_cfg1 {
+				ste,pins = "GPIO0", "GPIO2";
+				ste,config = <&slpm_in_pu>;
+			};
+
+			sleep_cfg2 {
+				ste,pins = "GPIO1", "GPIO3";
+				ste,config = <&slpm_out_hi>;
+			};
+		};
+	};
+
+	uart2 {
+		uart2_default_mode: uart2_default {
+			default_mux {
+				ste,function = "u2";
+				ste,pins = "u2txrx_a_1";
+			};
+
+			default_cfg1 {
+				ste,pins = "GPIO120";
+				ste,config = <&in_pu>;
+			};
+
+			default_cfg2 {
+				ste,pins = "GPIO121";
+				ste,config = <&out_hi>;
+			};
+		};
+
+		uart2_sleep_mode: uart2_sleep {
+			sleep_cfg1 {
+				ste,pins = "GPIO120";
+				ste,config = <&slpm_in_pu>;
+			};
+
+			sleep_cfg2 {
+				ste,pins = "GPIO121";
+				ste,config = <&slpm_out_hi>;
+			};
+		};
+	};
+};
diff --git a/arch/arm/boot/dts/ccu8540.dts b/arch/arm/boot/dts/ccu8540.dts
index 5de9e1e..4f93795 100644
--- a/arch/arm/boot/dts/ccu8540.dts
+++ b/arch/arm/boot/dts/ccu8540.dts
@@ -11,6 +11,7 @@
 
 /dts-v1/;
 #include "dbx5x0.dtsi"
+#include "ccu8540-pinctrl.dtsi"
 
 / {
 	model = "ST-Ericsson U8540 platform with Device Tree";
@@ -27,6 +28,9 @@
 		};
 
 		uart@80120000 {
+			pinctrl-names = "default", "sleep";
+			pinctrl-0 = <&uart0_default_mux>, <&uart0_default_mode>;
+			pinctrl-1 = <&uart0_sleep_mode>;
 			status = "okay";
 		};
 
@@ -35,6 +39,9 @@
 		};
 
 		uart@80007000 {
+			pinctrl-names = "default", "sleep";
+			pinctrl-0 = <&uart2_default_mode>;
+			pinctrl-1 = <&uart2_sleep_mode>;
 			status = "okay";
 		};
 	};
diff --git a/arch/arm/boot/dts/dbx5x0.dtsi b/arch/arm/boot/dts/dbx5x0.dtsi
index f85ff85..7507148 100644
--- a/arch/arm/boot/dts/dbx5x0.dtsi
+++ b/arch/arm/boot/dts/dbx5x0.dtsi
@@ -170,7 +170,7 @@
 			gpio-bank = <8>;
 		};
 
-		pinctrl {
+		pinctrl_dbx500: pinctrl {
 			compatible = "stericsson,nmk-pinctrl";
 			prcm = <&prcmu>;
 		};
diff --git a/arch/arm/boot/dts/ste-nomadik-pinctrl.dtsi b/arch/arm/boot/dts/ste-nomadik-pinctrl.dtsi
new file mode 100644
index 0000000..efddee9
--- /dev/null
+++ b/arch/arm/boot/dts/ste-nomadik-pinctrl.dtsi
@@ -0,0 +1,95 @@
+/*
+ * Copyright 2012 ST-Ericsson
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+#include <dt-bindings/pinctrl/nomadik.h>
+
+/ {
+	in_nopull: in_nopull {
+		ste,input = <INPUT_NOPULL>;
+	};
+
+	in_pu: input_pull_up {
+		ste,input = <INPUT_PULLUP>;
+	};
+
+	in_pd: input_pull_down {
+		ste,input = <INPUT_PULLDOWN>;
+	};
+
+	out_hi: output_high {
+		ste,output = <OUTPUT_HIGH>;
+	};
+
+	out_lo: output_low {
+		ste,output = <OUTPUT_LOW>;
+	};
+
+	gpio_out_lo: gpio_output_low {
+		ste,gpio = <GPIOMODE_ENABLED>;
+		ste,output = <OUTPUT_LOW>;
+	};
+
+	slpm_in_pu: slpm_in_pu {
+		ste,sleep = <SLPM_ENABLED>;
+		ste,sleep-input = <SLPM_INPUT_PULLUP>;
+		ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
+	};
+
+	slpm_in_wkup_pdis: slpm_in_wkup_pdis {
+		ste,sleep = <SLPM_ENABLED>;
+		ste,sleep-input = <SLPM_DIR_INPUT>;
+		ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
+		ste,sleep-pull-disable = <SLPM_PDIS_DISABLED>;
+	};
+
+	slpm_out_lo: slpm_out_lo {
+		ste,sleep = <SLPM_ENABLED>;
+		ste,sleep-output = <SLPM_OUTPUT_LOW>;
+		ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
+	};
+
+	slpm_out_hi: slpm_out_hi {
+		ste,sleep = <SLPM_ENABLED>;
+		ste,sleep-output = <SLPM_OUTPUT_HIGH>;
+		ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
+	};
+
+	slpm_out_hi_wkup_pdis: slpm_out_hi_wkup_pdis {
+		ste,sleep = <SLPM_ENABLED>;
+		ste,sleep-output = <SLPM_OUTPUT_HIGH>;
+		ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
+		ste,sleep-pull-disable = <SLPM_PDIS_DISABLED>;
+	};
+
+	slpm_out_wkup_pdis: slpm_out_wkup_pdis {
+		ste,sleep = <SLPM_ENABLED>;
+		ste,sleep-output = <SLPM_DIR_OUTPUT>;
+		ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
+		ste,sleep-pull-disable = <SLPM_PDIS_DISABLED>;
+	};
+
+	in_wkup_pdis: in_wkup_pdis {
+		ste,sleep-input = <SLPM_DIR_INPUT>;
+		ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
+		ste,sleep-pull-disable = <SLPM_PDIS_DISABLED>;
+	};
+
+	out_hi_wkup_pdis: out_hi_wkup_pdis {
+		ste,sleep-output = <SLPM_OUTPUT_HIGH>;
+		ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
+		ste,sleep-pull-disable = <SLPM_PDIS_DISABLED>;
+	};
+
+	out_wkup_pdis: out_wkup_pdis {
+		ste,sleep-output = <SLPM_DIR_OUTPUT>;
+		ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
+		ste,sleep-pull-disable = <SLPM_PDIS_DISABLED>;
+	};
+};
diff --git a/include/dt-bindings/pinctrl/nomadik.h b/include/dt-bindings/pinctrl/nomadik.h
new file mode 100644
index 0000000..638fb32
--- /dev/null
+++ b/include/dt-bindings/pinctrl/nomadik.h
@@ -0,0 +1,36 @@
+/*
+ * nomadik.h
+ *
+ * Copyright (C) ST-Ericsson SA 2013
+ * Author: Gabriel Fernandez <gabriel.fernandez@st.com> for ST-Ericsson.
+ * License terms:  GNU General Public License (GPL), version 2
+ */
+
+#define INPUT_NOPULL		0
+#define INPUT_PULLUP		1
+#define INPUT_PULLDOWN		2
+
+#define OUTPUT_LOW		0
+#define OUTPUT_HIGH		1
+#define DIR_OUTPUT		2
+
+#define SLPM_DISABLED		0
+#define SLPM_ENABLED		1
+
+#define SLPM_INPUT_NOPULL	0
+#define SLPM_INPUT_PULLUP	1
+#define SLPM_INPUT_PULLDOWN	2
+#define SLPM_DIR_INPUT		3
+
+#define SLPM_OUTPUT_LOW		0
+#define SLPM_OUTPUT_HIGH	1
+#define SLPM_DIR_OUTPUT		2
+
+#define SLPM_WAKEUP_DISABLE	0
+#define SLPM_WAKEUP_ENABLE	1
+
+#define GPIOMODE_DISABLED	0
+#define GPIOMODE_ENABLED	1
+
+#define SLPM_PDIS_DISABLED	0
+#define SLPM_PDIS_ENABLED	1
-- 
1.8.1.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 3/3] ARM: u8540: DT: Set pinctrl mapping to i2c0,1,2,4 & 5
  2013-05-27 13:30 [PATCH 0/3] Enable cc8540 pinctrl DT for uart and i2c Gabriel Fernandez
  2013-05-27 13:30 ` [PATCH 1/3] ARM: ux500: use #include syntax to include *.dtsi Gabriel Fernandez
  2013-05-27 13:30 ` [PATCH 2/3] ARM: u8540: Add Pinctrl Device Tree settings for uart0, uart2 Gabriel Fernandez
@ 2013-05-27 13:30 ` Gabriel Fernandez
  2013-05-28 10:12   ` Lee Jones
  2 siblings, 1 reply; 13+ messages in thread
From: Gabriel Fernandez @ 2013-05-27 13:30 UTC (permalink / raw)
  To: linux-kernel
  Cc: Lee Jones, Linus Walleij, Olivier Clergeaud, Gabriel Fernandez

From: Gabriel Fernandez <gabriel.fernandez@st.com>

This patch configures pin map in device tree of i2c0,
1,2,4 & 5 for ccu8540 board.

Signed-off-by: Gabriel Fernandez <gabriel.fernandez@st.com>
---
 arch/arm/boot/dts/ccu8540-pinctrl.dtsi | 115 +++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/ccu8540.dts          |  30 +++++++++
 2 files changed, 145 insertions(+)

diff --git a/arch/arm/boot/dts/ccu8540-pinctrl.dtsi b/arch/arm/boot/dts/ccu8540-pinctrl.dtsi
index 26e718b..57e8165 100644
--- a/arch/arm/boot/dts/ccu8540-pinctrl.dtsi
+++ b/arch/arm/boot/dts/ccu8540-pinctrl.dtsi
@@ -74,4 +74,119 @@
 			};
 		};
 	};
+
+	i2c0 {
+		i2c0_default_mux: i2c_mux {
+			default_mux {
+				ste,function = "i2c0";
+				ste,pins = "i2c0_a_1";
+			};
+		};
+
+		i2c0_default_mode: i2c_default {
+			default_cfg1 {
+				ste,pins = "GPIO147", "GPIO148";
+				ste,config = <&in_pu>;
+			};
+		};
+
+		i2c0_sleep_mode: i2c_sleep {
+			sleep_cfg1 {
+				ste,pins = "GPIO147", "GPIO148";
+				ste,config = <&slpm_in_pu>;
+			};
+		};
+	};
+
+	i2c1 {
+		i2c1_default_mux: i2c_mux {
+			default_mux {
+				ste,function = "i2c1";
+				ste,pins = "i2c1_b_2";
+			};
+		};
+
+		i2c1_default_mode: i2c_default {
+			default_cfg1 {
+				ste,pins = "GPIO16", "GPIO17";
+				ste,config = <&in_pu>;
+			};
+		};
+
+		i2c1_sleep_mode: i2c_sleep {
+			sleep_cfg1 {
+				ste,pins = "GPIO16", "GPIO17";
+				ste,config = <&slpm_in_pu>;
+			};
+		};
+	};
+
+	i2c2 {
+		i2c2_default_mux: i2c_mux {
+			default_mux {
+				ste,function = "i2c2";
+				ste,pins = "i2c2_b_2";
+			};
+		};
+
+		i2c2_default_mode: i2c_default {
+			default_cfg1 {
+				ste,pins = "GPIO10", "GPIO11";
+				ste,config = <&in_pu>;
+			};
+		};
+
+		i2c2_sleep_mode: i2c_sleep {
+			sleep_cfg1 {
+				ste,pins = "GPIO11", "GPIO11";
+				ste,config = <&slpm_in_pu>;
+			};
+		};
+	};
+
+	i2c4 {
+		i2c4_default_mux: i2c_mux {
+			default_mux {
+				ste,function = "i2c4";
+				ste,pins = "i2c4_b_2";
+			};
+		};
+
+		i2c4_default_mode: i2c_default {
+			default_cfg1 {
+				ste,pins = "GPIO122", "GPIO123";
+				ste,config = <&in_pu>;
+			};
+		};
+
+		i2c4_sleep_mode: i2c_sleep {
+			sleep_cfg1 {
+				ste,pins = "GPIO122", "GPIO123";
+				ste,config = <&slpm_in_pu>;
+			};
+		};
+	};
+
+	i2c5 {
+		i2c5_default_mux: i2c_mux {
+			default_mux {
+				ste,function = "i2c5";
+				ste,pins = "i2c5_c_2";
+			};
+		};
+
+		i2c5_default_mode: i2c_default {
+			default_cfg1 {
+				ste,pins = "GPIO118", "GPIO119";
+				ste,config = <&in_pu>;
+			};
+		};
+
+		i2c5_sleep_mode: i2c_sleep {
+			sleep_cfg1 {
+				ste,pins = "GPIO118", "GPIO119";
+				ste,config = <&slpm_in_pu>;
+			};
+		};
+	};
 };
diff --git a/arch/arm/boot/dts/ccu8540.dts b/arch/arm/boot/dts/ccu8540.dts
index 4f93795..3e7142b 100644
--- a/arch/arm/boot/dts/ccu8540.dts
+++ b/arch/arm/boot/dts/ccu8540.dts
@@ -44,5 +44,35 @@
 			pinctrl-1 = <&uart2_sleep_mode>;
 			status = "okay";
 		};
+
+		i2c0: i2c@80004000 {
+			pinctrl-names = "default","sleep";
+			pinctrl-0 = <&i2c0_default_mux>,<&i2c0_default_mode>;
+			pinctrl-1 = <&i2c0_sleep_mode>;
+		};
+
+		i2c1: i2c@80122000 {
+			pinctrl-names = "default","sleep";
+			pinctrl-0 = <&i2c1_default_mux>,<&i2c1_default_mode>;
+			pinctrl-1 = <&i2c1_sleep_mode>;
+		};
+
+		i2c2: i2c@80128000 {
+			pinctrl-names = "default","sleep";
+			pinctrl-0 = <&i2c2_default_mux>,<&i2c2_default_mode>;
+			pinctrl-1 = <&i2c2_sleep_mode>;
+		};
+
+		i2c4: i2c@8012a000 {
+			pinctrl-names = "default","sleep";
+			pinctrl-0 = <&i2c4_default_mux>,<&i2c4_default_mode>;
+			pinctrl-1 = <&i2c4_sleep_mode>;
+		};
+
+		i2c5: i2c@80001000 {
+			pinctrl-names = "default","sleep";
+			pinctrl-0 = <&i2c5_default_mux>,<&i2c5_default_mode>;
+			pinctrl-1 = <&i2c5_sleep_mode>;
+		};
 	};
 };
-- 
1.8.1.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH 2/3] ARM: u8540: Add Pinctrl Device Tree settings for uart0, uart2
  2013-05-27 13:30 ` [PATCH 2/3] ARM: u8540: Add Pinctrl Device Tree settings for uart0, uart2 Gabriel Fernandez
@ 2013-05-28 10:09   ` Lee Jones
  2013-05-28 12:32     ` Gabriel Fernandez
  2013-05-29 16:48     ` Linus Walleij
  2013-05-29  8:55   ` Gabriel Fernandez
  1 sibling, 2 replies; 13+ messages in thread
From: Lee Jones @ 2013-05-28 10:09 UTC (permalink / raw)
  To: Gabriel Fernandez
  Cc: linux-kernel, Linus Walleij, Olivier Clergeaud, Gabriel Fernandez

On Mon, 27 May 2013, Gabriel Fernandez wrote:

> From: Gabriel Fernandez <gabriel.fernandez@st.com>
> 
> This patch adds pinctrl device tree settings for uart0 and uart2
> for ccu8540 board.
> 
> Signed-off-by: Gabriel Fernandez <gabriel.fernandez@st.com>
> ---
>  arch/arm/boot/dts/ccu8540-pinctrl.dtsi     | 77 ++++++++++++++++++++++++
>  arch/arm/boot/dts/ccu8540.dts              |  7 +++
>  arch/arm/boot/dts/dbx5x0.dtsi              |  2 +-
>  arch/arm/boot/dts/ste-nomadik-pinctrl.dtsi | 95 ++++++++++++++++++++++++++++++

This is starting to get a bit confusing. How intrusive would it be to
place the ccu8540-pinctrl information inside ccu8540.dts instead of
breaking it out into different files and convoluting the issue?

Also, please correct me if I'm wrong, but isn't what we call the
Nomadik Pinctrl/GPIO really the same as DBX500 Pinctrl/GPIO? I wonder
if this would be a better naming convention?

Linus, what do you think?

>  include/dt-bindings/pinctrl/nomadik.h      | 36 +++++++++++
>  5 files changed, 216 insertions(+), 1 deletion(-)
>  create mode 100644 arch/arm/boot/dts/ccu8540-pinctrl.dtsi
>  create mode 100644 arch/arm/boot/dts/ste-nomadik-pinctrl.dtsi
>  create mode 100644 include/dt-bindings/pinctrl/nomadik.h
> 
> diff --git a/arch/arm/boot/dts/ccu8540-pinctrl.dtsi b/arch/arm/boot/dts/ccu8540-pinctrl.dtsi
> new file mode 100644
> index 0000000..26e718b
> --- /dev/null
> +++ b/arch/arm/boot/dts/ccu8540-pinctrl.dtsi
> @@ -0,0 +1,77 @@
> +/*
> + * Copyright 2012 ST-Ericsson
> + *
> + * The code contained herein is licensed under the GNU General Public
> + * License. You may obtain a copy of the GNU General Public License
> + * Version 2 or later at the following locations:
> + *
> + * http://www.opensource.org/licenses/gpl-license.html
> + * http://www.gnu.org/copyleft/gpl.html
> + */
> +#include "ste-nomadik-pinctrl.dtsi"
> +
> +&pinctrl_dbx500 {

What does the '&' do?

> +	uart0 {
> +		uart0_default_mux: uart0_mux {
> +			default_mux {
> +				ste,function = "u0";
> +				ste,pins = "u0_a_1";
> +			};
> +		};
> +
> +		uart0_default_mode: uart0_default {
> +			default_cfg1 {
> +				ste,pins = "GPIO0", "GPIO2";
> +				ste,config = <&in_pu>;
> +			};
> +
> +			default_cfg2 {
> +				ste,pins = "GPIO1", "GPIO3";
> +				ste,config = <&out_hi>;
> +			};
> +		};
> +
> +		uart0_sleep_mode: uart0_sleep {
> +			sleep_cfg1 {
> +				ste,pins = "GPIO0", "GPIO2";
> +				ste,config = <&slpm_in_pu>;
> +			};
> +
> +			sleep_cfg2 {
> +				ste,pins = "GPIO1", "GPIO3";
> +				ste,config = <&slpm_out_hi>;
> +			};
> +		};
> +	};
> +
> +	uart2 {
> +		uart2_default_mode: uart2_default {
> +			default_mux {
> +				ste,function = "u2";
> +				ste,pins = "u2txrx_a_1";
> +			};
> +
> +			default_cfg1 {
> +				ste,pins = "GPIO120";
> +				ste,config = <&in_pu>;
> +			};
> +
> +			default_cfg2 {
> +				ste,pins = "GPIO121";
> +				ste,config = <&out_hi>;
> +			};
> +		};
> +
> +		uart2_sleep_mode: uart2_sleep {
> +			sleep_cfg1 {
> +				ste,pins = "GPIO120";
> +				ste,config = <&slpm_in_pu>;
> +			};
> +
> +			sleep_cfg2 {
> +				ste,pins = "GPIO121";
> +				ste,config = <&slpm_out_hi>;
> +			};
> +		};
> +	};
> +};
> diff --git a/arch/arm/boot/dts/ccu8540.dts b/arch/arm/boot/dts/ccu8540.dts
> index 5de9e1e..4f93795 100644
> --- a/arch/arm/boot/dts/ccu8540.dts
> +++ b/arch/arm/boot/dts/ccu8540.dts
> @@ -11,6 +11,7 @@
>  
>  /dts-v1/;
>  #include "dbx5x0.dtsi"
> +#include "ccu8540-pinctrl.dtsi"
>  
>  / {
>  	model = "ST-Ericsson U8540 platform with Device Tree";
> @@ -27,6 +28,9 @@
>  		};
>  
>  		uart@80120000 {
> +			pinctrl-names = "default", "sleep";
> +			pinctrl-0 = <&uart0_default_mux>, <&uart0_default_mode>;
> +			pinctrl-1 = <&uart0_sleep_mode>;
>  			status = "okay";
>  		};
>  
> @@ -35,6 +39,9 @@
>  		};
>  
>  		uart@80007000 {
> +			pinctrl-names = "default", "sleep";
> +			pinctrl-0 = <&uart2_default_mode>;
> +			pinctrl-1 = <&uart2_sleep_mode>;
>  			status = "okay";
>  		};
>  	};
> diff --git a/arch/arm/boot/dts/dbx5x0.dtsi b/arch/arm/boot/dts/dbx5x0.dtsi
> index f85ff85..7507148 100644
> --- a/arch/arm/boot/dts/dbx5x0.dtsi
> +++ b/arch/arm/boot/dts/dbx5x0.dtsi
> @@ -170,7 +170,7 @@
>  			gpio-bank = <8>;
>  		};
>  
> -		pinctrl {
> +		pinctrl_dbx500: pinctrl {
>  			compatible = "stericsson,nmk-pinctrl";
>  			prcm = <&prcmu>;
>  		};
> diff --git a/arch/arm/boot/dts/ste-nomadik-pinctrl.dtsi b/arch/arm/boot/dts/ste-nomadik-pinctrl.dtsi
> new file mode 100644
> index 0000000..efddee9
> --- /dev/null
> +++ b/arch/arm/boot/dts/ste-nomadik-pinctrl.dtsi
> @@ -0,0 +1,95 @@
> +/*
> + * Copyright 2012 ST-Ericsson
> + *
> + * The code contained herein is licensed under the GNU General Public
> + * License. You may obtain a copy of the GNU General Public License
> + * Version 2 or later at the following locations:
> + *
> + * http://www.opensource.org/licenses/gpl-license.html
> + * http://www.gnu.org/copyleft/gpl.html
> + */
> +#include <dt-bindings/pinctrl/nomadik.h>
> +
> +/ {
> +	in_nopull: in_nopull {
> +		ste,input = <INPUT_NOPULL>;
> +	};
> +
> +	in_pu: input_pull_up {
> +		ste,input = <INPUT_PULLUP>;
> +	};
> +
> +	in_pd: input_pull_down {
> +		ste,input = <INPUT_PULLDOWN>;
> +	};
> +
> +	out_hi: output_high {
> +		ste,output = <OUTPUT_HIGH>;
> +	};
> +
> +	out_lo: output_low {
> +		ste,output = <OUTPUT_LOW>;
> +	};
> +
> +	gpio_out_lo: gpio_output_low {
> +		ste,gpio = <GPIOMODE_ENABLED>;
> +		ste,output = <OUTPUT_LOW>;
> +	};
> +
> +	slpm_in_pu: slpm_in_pu {
> +		ste,sleep = <SLPM_ENABLED>;
> +		ste,sleep-input = <SLPM_INPUT_PULLUP>;
> +		ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
> +	};
> +
> +	slpm_in_wkup_pdis: slpm_in_wkup_pdis {
> +		ste,sleep = <SLPM_ENABLED>;
> +		ste,sleep-input = <SLPM_DIR_INPUT>;
> +		ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
> +		ste,sleep-pull-disable = <SLPM_PDIS_DISABLED>;
> +	};
> +
> +	slpm_out_lo: slpm_out_lo {
> +		ste,sleep = <SLPM_ENABLED>;
> +		ste,sleep-output = <SLPM_OUTPUT_LOW>;
> +		ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
> +	};
> +
> +	slpm_out_hi: slpm_out_hi {
> +		ste,sleep = <SLPM_ENABLED>;
> +		ste,sleep-output = <SLPM_OUTPUT_HIGH>;
> +		ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
> +	};
> +
> +	slpm_out_hi_wkup_pdis: slpm_out_hi_wkup_pdis {
> +		ste,sleep = <SLPM_ENABLED>;
> +		ste,sleep-output = <SLPM_OUTPUT_HIGH>;
> +		ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
> +		ste,sleep-pull-disable = <SLPM_PDIS_DISABLED>;
> +	};
> +
> +	slpm_out_wkup_pdis: slpm_out_wkup_pdis {
> +		ste,sleep = <SLPM_ENABLED>;
> +		ste,sleep-output = <SLPM_DIR_OUTPUT>;
> +		ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
> +		ste,sleep-pull-disable = <SLPM_PDIS_DISABLED>;
> +	};
> +
> +	in_wkup_pdis: in_wkup_pdis {
> +		ste,sleep-input = <SLPM_DIR_INPUT>;
> +		ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
> +		ste,sleep-pull-disable = <SLPM_PDIS_DISABLED>;
> +	};
> +
> +	out_hi_wkup_pdis: out_hi_wkup_pdis {
> +		ste,sleep-output = <SLPM_OUTPUT_HIGH>;
> +		ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
> +		ste,sleep-pull-disable = <SLPM_PDIS_DISABLED>;
> +	};
> +
> +	out_wkup_pdis: out_wkup_pdis {
> +		ste,sleep-output = <SLPM_DIR_OUTPUT>;
> +		ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
> +		ste,sleep-pull-disable = <SLPM_PDIS_DISABLED>;
> +	};
> +};

Nodes look pretty good, except shouldn't 'ste' really be 'stericsson'?

Yes, it's not as succinct, but it is the standard.

> diff --git a/include/dt-bindings/pinctrl/nomadik.h b/include/dt-bindings/pinctrl/nomadik.h
> new file mode 100644
> index 0000000..638fb32
> --- /dev/null
> +++ b/include/dt-bindings/pinctrl/nomadik.h
> @@ -0,0 +1,36 @@
> +/*
> + * nomadik.h
> + *
> + * Copyright (C) ST-Ericsson SA 2013
> + * Author: Gabriel Fernandez <gabriel.fernandez@st.com> for ST-Ericsson.
> + * License terms:  GNU General Public License (GPL), version 2
> + */
> +
> +#define INPUT_NOPULL		0
> +#define INPUT_PULLUP		1
> +#define INPUT_PULLDOWN		2
> +
> +#define OUTPUT_LOW		0
> +#define OUTPUT_HIGH		1
> +#define DIR_OUTPUT		2
> +
> +#define SLPM_DISABLED		0
> +#define SLPM_ENABLED		1
> +
> +#define SLPM_INPUT_NOPULL	0
> +#define SLPM_INPUT_PULLUP	1
> +#define SLPM_INPUT_PULLDOWN	2
> +#define SLPM_DIR_INPUT		3
> +
> +#define SLPM_OUTPUT_LOW		0
> +#define SLPM_OUTPUT_HIGH	1
> +#define SLPM_DIR_OUTPUT		2
> +
> +#define SLPM_WAKEUP_DISABLE	0
> +#define SLPM_WAKEUP_ENABLE	1
> +
> +#define GPIOMODE_DISABLED	0
> +#define GPIOMODE_ENABLED	1
> +
> +#define SLPM_PDIS_DISABLED	0
> +#define SLPM_PDIS_ENABLED	1

Some stray tabbing above.

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 1/3] ARM: ux500: use #include syntax to include *.dtsi.
  2013-05-27 13:30 ` [PATCH 1/3] ARM: ux500: use #include syntax to include *.dtsi Gabriel Fernandez
@ 2013-05-28 10:10   ` Lee Jones
  2013-05-29 16:39   ` Linus Walleij
  1 sibling, 0 replies; 13+ messages in thread
From: Lee Jones @ 2013-05-28 10:10 UTC (permalink / raw)
  To: Gabriel Fernandez
  Cc: linux-kernel, Linus Walleij, Olivier Clergeaud, Gabriel Fernandez

On Mon, 27 May 2013, Gabriel Fernandez wrote:

> From: Gabriel Fernandez <gabriel.fernandez@st.com>
> 
> This patch prepares the use of '#define' into dts files.
> 
> Signed-off-by: Gabriel Fernandez <gabriel.fernandez@st.com>
> ---
>  arch/arm/boot/dts/ccu8540.dts     | 2 +-
>  arch/arm/boot/dts/ccu9540.dts     | 2 +-
>  arch/arm/boot/dts/dbx5x0.dtsi     | 2 +-
>  arch/arm/boot/dts/href.dtsi       | 2 +-
>  arch/arm/boot/dts/hrefprev60.dts  | 6 +++---
>  arch/arm/boot/dts/hrefv60plus.dts | 6 +++---
>  arch/arm/boot/dts/snowball.dts    | 2 +-
>  7 files changed, 11 insertions(+), 11 deletions(-)

Nice.

Acked-by: Lee Jones <lee.jones@linaro.org>

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 3/3] ARM: u8540: DT: Set pinctrl mapping to i2c0,1,2,4 & 5
  2013-05-27 13:30 ` [PATCH 3/3] ARM: u8540: DT: Set pinctrl mapping to i2c0,1,2,4 & 5 Gabriel Fernandez
@ 2013-05-28 10:12   ` Lee Jones
  2013-05-28 12:32     ` Gabriel Fernandez
  0 siblings, 1 reply; 13+ messages in thread
From: Lee Jones @ 2013-05-28 10:12 UTC (permalink / raw)
  To: Gabriel Fernandez
  Cc: linux-kernel, Linus Walleij, Olivier Clergeaud, Gabriel Fernandez

On Mon, 27 May 2013, Gabriel Fernandez wrote:

> From: Gabriel Fernandez <gabriel.fernandez@st.com>
> 
> This patch configures pin map in device tree of i2c0,
> 1,2,4 & 5 for ccu8540 board.
> 
> Signed-off-by: Gabriel Fernandez <gabriel.fernandez@st.com>
> ---
>  arch/arm/boot/dts/ccu8540-pinctrl.dtsi | 115 +++++++++++++++++++++++++++++++++

Okay, I'm starting to see the justification of this seperate file now.

>  arch/arm/boot/dts/ccu8540.dts          |  30 +++++++++
>  2 files changed, 145 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/ccu8540-pinctrl.dtsi b/arch/arm/boot/dts/ccu8540-pinctrl.dtsi
> index 26e718b..57e8165 100644
> --- a/arch/arm/boot/dts/ccu8540-pinctrl.dtsi
> +++ b/arch/arm/boot/dts/ccu8540-pinctrl.dtsi
> @@ -74,4 +74,119 @@
>  			};
>  		};
>  	};
> +
> +	i2c0 {
> +		i2c0_default_mux: i2c_mux {
> +			default_mux {
> +				ste,function = "i2c0";

'stericsson'?

> +				ste,pins = "i2c0_a_1";
> +			};
> +		};
> +
> +		i2c0_default_mode: i2c_default {
> +			default_cfg1 {
> +				ste,pins = "GPIO147", "GPIO148";
> +				ste,config = <&in_pu>;
> +			};
> +		};
> +
> +		i2c0_sleep_mode: i2c_sleep {
> +			sleep_cfg1 {
> +				ste,pins = "GPIO147", "GPIO148";
> +				ste,config = <&slpm_in_pu>;
> +			};
> +		};
> +	};
> +
> +	i2c1 {
> +		i2c1_default_mux: i2c_mux {
> +			default_mux {
> +				ste,function = "i2c1";
> +				ste,pins = "i2c1_b_2";
> +			};
> +		};
> +
> +		i2c1_default_mode: i2c_default {
> +			default_cfg1 {
> +				ste,pins = "GPIO16", "GPIO17";
> +				ste,config = <&in_pu>;
> +			};
> +		};
> +
> +		i2c1_sleep_mode: i2c_sleep {
> +			sleep_cfg1 {
> +				ste,pins = "GPIO16", "GPIO17";
> +				ste,config = <&slpm_in_pu>;
> +			};
> +		};
> +	};
> +
> +	i2c2 {
> +		i2c2_default_mux: i2c_mux {
> +			default_mux {
> +				ste,function = "i2c2";
> +				ste,pins = "i2c2_b_2";
> +			};
> +		};
> +
> +		i2c2_default_mode: i2c_default {
> +			default_cfg1 {
> +				ste,pins = "GPIO10", "GPIO11";
> +				ste,config = <&in_pu>;
> +			};
> +		};
> +
> +		i2c2_sleep_mode: i2c_sleep {
> +			sleep_cfg1 {
> +				ste,pins = "GPIO11", "GPIO11";
> +				ste,config = <&slpm_in_pu>;
> +			};
> +		};
> +	};
> +
> +	i2c4 {
> +		i2c4_default_mux: i2c_mux {
> +			default_mux {
> +				ste,function = "i2c4";
> +				ste,pins = "i2c4_b_2";
> +			};
> +		};
> +
> +		i2c4_default_mode: i2c_default {
> +			default_cfg1 {
> +				ste,pins = "GPIO122", "GPIO123";
> +				ste,config = <&in_pu>;
> +			};
> +		};
> +
> +		i2c4_sleep_mode: i2c_sleep {
> +			sleep_cfg1 {
> +				ste,pins = "GPIO122", "GPIO123";
> +				ste,config = <&slpm_in_pu>;
> +			};
> +		};
> +	};
> +
> +	i2c5 {
> +		i2c5_default_mux: i2c_mux {
> +			default_mux {
> +				ste,function = "i2c5";
> +				ste,pins = "i2c5_c_2";
> +			};
> +		};
> +
> +		i2c5_default_mode: i2c_default {
> +			default_cfg1 {
> +				ste,pins = "GPIO118", "GPIO119";
> +				ste,config = <&in_pu>;
> +			};
> +		};
> +
> +		i2c5_sleep_mode: i2c_sleep {
> +			sleep_cfg1 {
> +				ste,pins = "GPIO118", "GPIO119";
> +				ste,config = <&slpm_in_pu>;
> +			};
> +		};
> +	};
>  };
> diff --git a/arch/arm/boot/dts/ccu8540.dts b/arch/arm/boot/dts/ccu8540.dts
> index 4f93795..3e7142b 100644
> --- a/arch/arm/boot/dts/ccu8540.dts
> +++ b/arch/arm/boot/dts/ccu8540.dts
> @@ -44,5 +44,35 @@
>  			pinctrl-1 = <&uart2_sleep_mode>;
>  			status = "okay";
>  		};
> +
> +		i2c0: i2c@80004000 {
> +			pinctrl-names = "default","sleep";

Can you place a ' ' after the ','?

> +			pinctrl-0 = <&i2c0_default_mux>,<&i2c0_default_mode>;

All the way down ...

> +			pinctrl-1 = <&i2c0_sleep_mode>;
> +		};
> +
> +		i2c1: i2c@80122000 {
> +			pinctrl-names = "default","sleep";
> +			pinctrl-0 = <&i2c1_default_mux>,<&i2c1_default_mode>;
> +			pinctrl-1 = <&i2c1_sleep_mode>;
> +		};
> +
> +		i2c2: i2c@80128000 {
> +			pinctrl-names = "default","sleep";
> +			pinctrl-0 = <&i2c2_default_mux>,<&i2c2_default_mode>;
> +			pinctrl-1 = <&i2c2_sleep_mode>;
> +		};
> +
> +		i2c4: i2c@8012a000 {
> +			pinctrl-names = "default","sleep";
> +			pinctrl-0 = <&i2c4_default_mux>,<&i2c4_default_mode>;
> +			pinctrl-1 = <&i2c4_sleep_mode>;
> +		};
> +
> +		i2c5: i2c@80001000 {
> +			pinctrl-names = "default","sleep";
> +			pinctrl-0 = <&i2c5_default_mux>,<&i2c5_default_mode>;
> +			pinctrl-1 = <&i2c5_sleep_mode>;
> +		};
>  	};
>  };

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 2/3] ARM: u8540: Add Pinctrl Device Tree settings for uart0, uart2
  2013-05-28 10:09   ` Lee Jones
@ 2013-05-28 12:32     ` Gabriel Fernandez
  2013-05-29 16:48     ` Linus Walleij
  1 sibling, 0 replies; 13+ messages in thread
From: Gabriel Fernandez @ 2013-05-28 12:32 UTC (permalink / raw)
  To: Lee Jones
  Cc: linux-kernel, Linus Walleij, Olivier Clergeaud, Gabriel Fernandez

On 28 May 2013 12:09, Lee Jones <lee.jones@linaro.org> wrote:
> On Mon, 27 May 2013, Gabriel Fernandez wrote:
>
>> From: Gabriel Fernandez <gabriel.fernandez@st.com>
>>
>> This patch adds pinctrl device tree settings for uart0 and uart2
>> for ccu8540 board.
>>
>> Signed-off-by: Gabriel Fernandez <gabriel.fernandez@st.com>
>> ---
>>  arch/arm/boot/dts/ccu8540-pinctrl.dtsi     | 77 ++++++++++++++++++++++++
>>  arch/arm/boot/dts/ccu8540.dts              |  7 +++
>>  arch/arm/boot/dts/dbx5x0.dtsi              |  2 +-
>>  arch/arm/boot/dts/ste-nomadik-pinctrl.dtsi | 95 ++++++++++++++++++++++++++++++
>
> This is starting to get a bit confusing. How intrusive would it be to
> place the ccu8540-pinctrl information inside ccu8540.dts instead of
> breaking it out into different files and convoluting the issue?
>
> Also, please correct me if I'm wrong, but isn't what we call the
> Nomadik Pinctrl/GPIO really the same as DBX500 Pinctrl/GPIO? I wonder
> if this would be a better naming convention?
>
> Linus, what do you think?
>
>>  include/dt-bindings/pinctrl/nomadik.h      | 36 +++++++++++
>>  5 files changed, 216 insertions(+), 1 deletion(-)
>>  create mode 100644 arch/arm/boot/dts/ccu8540-pinctrl.dtsi
>>  create mode 100644 arch/arm/boot/dts/ste-nomadik-pinctrl.dtsi
>>  create mode 100644 include/dt-bindings/pinctrl/nomadik.h
>>
>> diff --git a/arch/arm/boot/dts/ccu8540-pinctrl.dtsi b/arch/arm/boot/dts/ccu8540-pinctrl.dtsi
>> new file mode 100644
>> index 0000000..26e718b
>> --- /dev/null
>> +++ b/arch/arm/boot/dts/ccu8540-pinctrl.dtsi
>> @@ -0,0 +1,77 @@
>> +/*
>> + * Copyright 2012 ST-Ericsson
>> + *
>> + * The code contained herein is licensed under the GNU General Public
>> + * License. You may obtain a copy of the GNU General Public License
>> + * Version 2 or later at the following locations:
>> + *
>> + * http://www.opensource.org/licenses/gpl-license.html
>> + * http://www.gnu.org/copyleft/gpl.html
>> + */
>> +#include "ste-nomadik-pinctrl.dtsi"
>> +
>> +&pinctrl_dbx500 {
>
> What does the '&' do?
>
'&pinctrl_dbx500 {' is a shortcut, avoid writing :

soc {
    princtrl {
     ...
    };
};

>> +     uart0 {
>> +             uart0_default_mux: uart0_mux {
>> +                     default_mux {
>> +                             ste,function = "u0";
>> +                             ste,pins = "u0_a_1";
>> +                     };
>> +             };
>> +
>> +             uart0_default_mode: uart0_default {
>> +                     default_cfg1 {
>> +                             ste,pins = "GPIO0", "GPIO2";
>> +                             ste,config = <&in_pu>;
>> +                     };
>> +
>> +                     default_cfg2 {
>> +                             ste,pins = "GPIO1", "GPIO3";
>> +                             ste,config = <&out_hi>;
>> +                     };
>> +             };
>> +
>> +             uart0_sleep_mode: uart0_sleep {
>> +                     sleep_cfg1 {
>> +                             ste,pins = "GPIO0", "GPIO2";
>> +                             ste,config = <&slpm_in_pu>;
>> +                     };
>> +
>> +                     sleep_cfg2 {
>> +                             ste,pins = "GPIO1", "GPIO3";
>> +                             ste,config = <&slpm_out_hi>;
>> +                     };
>> +             };
>> +     };
>> +
>> +     uart2 {
>> +             uart2_default_mode: uart2_default {
>> +                     default_mux {
>> +                             ste,function = "u2";
>> +                             ste,pins = "u2txrx_a_1";
>> +                     };
>> +
>> +                     default_cfg1 {
>> +                             ste,pins = "GPIO120";
>> +                             ste,config = <&in_pu>;
>> +                     };
>> +
>> +                     default_cfg2 {
>> +                             ste,pins = "GPIO121";
>> +                             ste,config = <&out_hi>;
>> +                     };
>> +             };
>> +
>> +             uart2_sleep_mode: uart2_sleep {
>> +                     sleep_cfg1 {
>> +                             ste,pins = "GPIO120";
>> +                             ste,config = <&slpm_in_pu>;
>> +                     };
>> +
>> +                     sleep_cfg2 {
>> +                             ste,pins = "GPIO121";
>> +                             ste,config = <&slpm_out_hi>;
>> +                     };
>> +             };
>> +     };
>> +};
>> diff --git a/arch/arm/boot/dts/ccu8540.dts b/arch/arm/boot/dts/ccu8540.dts
>> index 5de9e1e..4f93795 100644
>> --- a/arch/arm/boot/dts/ccu8540.dts
>> +++ b/arch/arm/boot/dts/ccu8540.dts
>> @@ -11,6 +11,7 @@
>>
>>  /dts-v1/;
>>  #include "dbx5x0.dtsi"
>> +#include "ccu8540-pinctrl.dtsi"
>>
>>  / {
>>       model = "ST-Ericsson U8540 platform with Device Tree";
>> @@ -27,6 +28,9 @@
>>               };
>>
>>               uart@80120000 {
>> +                     pinctrl-names = "default", "sleep";
>> +                     pinctrl-0 = <&uart0_default_mux>, <&uart0_default_mode>;
>> +                     pinctrl-1 = <&uart0_sleep_mode>;
>>                       status = "okay";
>>               };
>>
>> @@ -35,6 +39,9 @@
>>               };
>>
>>               uart@80007000 {
>> +                     pinctrl-names = "default", "sleep";
>> +                     pinctrl-0 = <&uart2_default_mode>;
>> +                     pinctrl-1 = <&uart2_sleep_mode>;
>>                       status = "okay";
>>               };
>>       };
>> diff --git a/arch/arm/boot/dts/dbx5x0.dtsi b/arch/arm/boot/dts/dbx5x0.dtsi
>> index f85ff85..7507148 100644
>> --- a/arch/arm/boot/dts/dbx5x0.dtsi
>> +++ b/arch/arm/boot/dts/dbx5x0.dtsi
>> @@ -170,7 +170,7 @@
>>                       gpio-bank = <8>;
>>               };
>>
>> -             pinctrl {
>> +             pinctrl_dbx500: pinctrl {
>>                       compatible = "stericsson,nmk-pinctrl";
>>                       prcm = <&prcmu>;
>>               };
>> diff --git a/arch/arm/boot/dts/ste-nomadik-pinctrl.dtsi b/arch/arm/boot/dts/ste-nomadik-pinctrl.dtsi
>> new file mode 100644
>> index 0000000..efddee9
>> --- /dev/null
>> +++ b/arch/arm/boot/dts/ste-nomadik-pinctrl.dtsi
>> @@ -0,0 +1,95 @@
>> +/*
>> + * Copyright 2012 ST-Ericsson
>> + *
>> + * The code contained herein is licensed under the GNU General Public
>> + * License. You may obtain a copy of the GNU General Public License
>> + * Version 2 or later at the following locations:
>> + *
>> + * http://www.opensource.org/licenses/gpl-license.html
>> + * http://www.gnu.org/copyleft/gpl.html
>> + */
>> +#include <dt-bindings/pinctrl/nomadik.h>
>> +
>> +/ {
>> +     in_nopull: in_nopull {
>> +             ste,input = <INPUT_NOPULL>;
>> +     };
>> +
>> +     in_pu: input_pull_up {
>> +             ste,input = <INPUT_PULLUP>;
>> +     };
>> +
>> +     in_pd: input_pull_down {
>> +             ste,input = <INPUT_PULLDOWN>;
>> +     };
>> +
>> +     out_hi: output_high {
>> +             ste,output = <OUTPUT_HIGH>;
>> +     };
>> +
>> +     out_lo: output_low {
>> +             ste,output = <OUTPUT_LOW>;
>> +     };
>> +
>> +     gpio_out_lo: gpio_output_low {
>> +             ste,gpio = <GPIOMODE_ENABLED>;
>> +             ste,output = <OUTPUT_LOW>;
>> +     };
>> +
>> +     slpm_in_pu: slpm_in_pu {
>> +             ste,sleep = <SLPM_ENABLED>;
>> +             ste,sleep-input = <SLPM_INPUT_PULLUP>;
>> +             ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
>> +     };
>> +
>> +     slpm_in_wkup_pdis: slpm_in_wkup_pdis {
>> +             ste,sleep = <SLPM_ENABLED>;
>> +             ste,sleep-input = <SLPM_DIR_INPUT>;
>> +             ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
>> +             ste,sleep-pull-disable = <SLPM_PDIS_DISABLED>;
>> +     };
>> +
>> +     slpm_out_lo: slpm_out_lo {
>> +             ste,sleep = <SLPM_ENABLED>;
>> +             ste,sleep-output = <SLPM_OUTPUT_LOW>;
>> +             ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
>> +     };
>> +
>> +     slpm_out_hi: slpm_out_hi {
>> +             ste,sleep = <SLPM_ENABLED>;
>> +             ste,sleep-output = <SLPM_OUTPUT_HIGH>;
>> +             ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
>> +     };
>> +
>> +     slpm_out_hi_wkup_pdis: slpm_out_hi_wkup_pdis {
>> +             ste,sleep = <SLPM_ENABLED>;
>> +             ste,sleep-output = <SLPM_OUTPUT_HIGH>;
>> +             ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
>> +             ste,sleep-pull-disable = <SLPM_PDIS_DISABLED>;
>> +     };
>> +
>> +     slpm_out_wkup_pdis: slpm_out_wkup_pdis {
>> +             ste,sleep = <SLPM_ENABLED>;
>> +             ste,sleep-output = <SLPM_DIR_OUTPUT>;
>> +             ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
>> +             ste,sleep-pull-disable = <SLPM_PDIS_DISABLED>;
>> +     };
>> +
>> +     in_wkup_pdis: in_wkup_pdis {
>> +             ste,sleep-input = <SLPM_DIR_INPUT>;
>> +             ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
>> +             ste,sleep-pull-disable = <SLPM_PDIS_DISABLED>;
>> +     };
>> +
>> +     out_hi_wkup_pdis: out_hi_wkup_pdis {
>> +             ste,sleep-output = <SLPM_OUTPUT_HIGH>;
>> +             ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
>> +             ste,sleep-pull-disable = <SLPM_PDIS_DISABLED>;
>> +     };
>> +
>> +     out_wkup_pdis: out_wkup_pdis {
>> +             ste,sleep-output = <SLPM_DIR_OUTPUT>;
>> +             ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
>> +             ste,sleep-pull-disable = <SLPM_PDIS_DISABLED>;
>> +     };
>> +};
>
> Nodes look pretty good, except shouldn't 'ste' really be 'stericsson'?
>
> Yes, it's not as succinct, but it is the standard.
>
yes it's more succint...;)
in Documentation/devicetree/bindings/vendor-prefixes.txt we have both
(ste and stericsson for ST-Ericsson)

>> diff --git a/include/dt-bindings/pinctrl/nomadik.h b/include/dt-bindings/pinctrl/nomadik.h
>> new file mode 100644
>> index 0000000..638fb32
>> --- /dev/null
>> +++ b/include/dt-bindings/pinctrl/nomadik.h
>> @@ -0,0 +1,36 @@
>> +/*
>> + * nomadik.h
>> + *
>> + * Copyright (C) ST-Ericsson SA 2013
>> + * Author: Gabriel Fernandez <gabriel.fernandez@st.com> for ST-Ericsson.
>> + * License terms:  GNU General Public License (GPL), version 2
>> + */
>> +
>> +#define INPUT_NOPULL         0
>> +#define INPUT_PULLUP         1
>> +#define INPUT_PULLDOWN               2
>> +
>> +#define OUTPUT_LOW           0
>> +#define OUTPUT_HIGH          1
>> +#define DIR_OUTPUT           2
>> +
>> +#define SLPM_DISABLED                0
>> +#define SLPM_ENABLED         1
>> +
>> +#define SLPM_INPUT_NOPULL    0
>> +#define SLPM_INPUT_PULLUP    1
>> +#define SLPM_INPUT_PULLDOWN  2
>> +#define SLPM_DIR_INPUT               3
>> +
>> +#define SLPM_OUTPUT_LOW              0
>> +#define SLPM_OUTPUT_HIGH     1
>> +#define SLPM_DIR_OUTPUT              2
>> +
>> +#define SLPM_WAKEUP_DISABLE  0
>> +#define SLPM_WAKEUP_ENABLE   1
>> +
>> +#define GPIOMODE_DISABLED    0
>> +#define GPIOMODE_ENABLED     1
>> +
>> +#define SLPM_PDIS_DISABLED   0
>> +#define SLPM_PDIS_ENABLED    1
>
> Some stray tabbing above.

once the patch has been applied, all values are aligned in the source file.
(due to '+' character i think)

>
> --
> Lee Jones
> Linaro ST-Ericsson Landing Team Lead
> Linaro.org │ Open source software for ARM SoCs
> Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 3/3] ARM: u8540: DT: Set pinctrl mapping to i2c0,1,2,4 & 5
  2013-05-28 10:12   ` Lee Jones
@ 2013-05-28 12:32     ` Gabriel Fernandez
  0 siblings, 0 replies; 13+ messages in thread
From: Gabriel Fernandez @ 2013-05-28 12:32 UTC (permalink / raw)
  To: Lee Jones
  Cc: linux-kernel, Linus Walleij, Olivier Clergeaud, Gabriel Fernandez

On 28 May 2013 12:12, Lee Jones <lee.jones@linaro.org> wrote:
> On Mon, 27 May 2013, Gabriel Fernandez wrote:
>
>> From: Gabriel Fernandez <gabriel.fernandez@st.com>
>>
>> This patch configures pin map in device tree of i2c0,
>> 1,2,4 & 5 for ccu8540 board.
>>
>> Signed-off-by: Gabriel Fernandez <gabriel.fernandez@st.com>
>> ---
>>  arch/arm/boot/dts/ccu8540-pinctrl.dtsi | 115 +++++++++++++++++++++++++++++++++
>
> Okay, I'm starting to see the justification of this seperate file now.
>
>>  arch/arm/boot/dts/ccu8540.dts          |  30 +++++++++
>>  2 files changed, 145 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/ccu8540-pinctrl.dtsi b/arch/arm/boot/dts/ccu8540-pinctrl.dtsi
>> index 26e718b..57e8165 100644
>> --- a/arch/arm/boot/dts/ccu8540-pinctrl.dtsi
>> +++ b/arch/arm/boot/dts/ccu8540-pinctrl.dtsi
>> @@ -74,4 +74,119 @@
>>                       };
>>               };
>>       };
>> +
>> +     i2c0 {
>> +             i2c0_default_mux: i2c_mux {
>> +                     default_mux {
>> +                             ste,function = "i2c0";
>
> 'stericsson'?
ditto

>
>> +                             ste,pins = "i2c0_a_1";
>> +                     };
>> +             };
>> +
>> +             i2c0_default_mode: i2c_default {
>> +                     default_cfg1 {
>> +                             ste,pins = "GPIO147", "GPIO148";
>> +                             ste,config = <&in_pu>;
>> +                     };
>> +             };
>> +
>> +             i2c0_sleep_mode: i2c_sleep {
>> +                     sleep_cfg1 {
>> +                             ste,pins = "GPIO147", "GPIO148";
>> +                             ste,config = <&slpm_in_pu>;
>> +                     };
>> +             };
>> +     };
>> +
>> +     i2c1 {
>> +             i2c1_default_mux: i2c_mux {
>> +                     default_mux {
>> +                             ste,function = "i2c1";
>> +                             ste,pins = "i2c1_b_2";
>> +                     };
>> +             };
>> +
>> +             i2c1_default_mode: i2c_default {
>> +                     default_cfg1 {
>> +                             ste,pins = "GPIO16", "GPIO17";
>> +                             ste,config = <&in_pu>;
>> +                     };
>> +             };
>> +
>> +             i2c1_sleep_mode: i2c_sleep {
>> +                     sleep_cfg1 {
>> +                             ste,pins = "GPIO16", "GPIO17";
>> +                             ste,config = <&slpm_in_pu>;
>> +                     };
>> +             };
>> +     };
>> +
>> +     i2c2 {
>> +             i2c2_default_mux: i2c_mux {
>> +                     default_mux {
>> +                             ste,function = "i2c2";
>> +                             ste,pins = "i2c2_b_2";
>> +                     };
>> +             };
>> +
>> +             i2c2_default_mode: i2c_default {
>> +                     default_cfg1 {
>> +                             ste,pins = "GPIO10", "GPIO11";
>> +                             ste,config = <&in_pu>;
>> +                     };
>> +             };
>> +
>> +             i2c2_sleep_mode: i2c_sleep {
>> +                     sleep_cfg1 {
>> +                             ste,pins = "GPIO11", "GPIO11";
>> +                             ste,config = <&slpm_in_pu>;
>> +                     };
>> +             };
>> +     };
>> +
>> +     i2c4 {
>> +             i2c4_default_mux: i2c_mux {
>> +                     default_mux {
>> +                             ste,function = "i2c4";
>> +                             ste,pins = "i2c4_b_2";
>> +                     };
>> +             };
>> +
>> +             i2c4_default_mode: i2c_default {
>> +                     default_cfg1 {
>> +                             ste,pins = "GPIO122", "GPIO123";
>> +                             ste,config = <&in_pu>;
>> +                     };
>> +             };
>> +
>> +             i2c4_sleep_mode: i2c_sleep {
>> +                     sleep_cfg1 {
>> +                             ste,pins = "GPIO122", "GPIO123";
>> +                             ste,config = <&slpm_in_pu>;
>> +                     };
>> +             };
>> +     };
>> +
>> +     i2c5 {
>> +             i2c5_default_mux: i2c_mux {
>> +                     default_mux {
>> +                             ste,function = "i2c5";
>> +                             ste,pins = "i2c5_c_2";
>> +                     };
>> +             };
>> +
>> +             i2c5_default_mode: i2c_default {
>> +                     default_cfg1 {
>> +                             ste,pins = "GPIO118", "GPIO119";
>> +                             ste,config = <&in_pu>;
>> +                     };
>> +             };
>> +
>> +             i2c5_sleep_mode: i2c_sleep {
>> +                     sleep_cfg1 {
>> +                             ste,pins = "GPIO118", "GPIO119";
>> +                             ste,config = <&slpm_in_pu>;
>> +                     };
>> +             };
>> +     };
>>  };
>> diff --git a/arch/arm/boot/dts/ccu8540.dts b/arch/arm/boot/dts/ccu8540.dts
>> index 4f93795..3e7142b 100644
>> --- a/arch/arm/boot/dts/ccu8540.dts
>> +++ b/arch/arm/boot/dts/ccu8540.dts
>> @@ -44,5 +44,35 @@
>>                       pinctrl-1 = <&uart2_sleep_mode>;
>>                       status = "okay";
>>               };
>> +
>> +             i2c0: i2c@80004000 {
>> +                     pinctrl-names = "default","sleep";
>
> Can you place a ' ' after the ','?
>
>> +                     pinctrl-0 = <&i2c0_default_mux>,<&i2c0_default_mode>;
>
> All the way down ...
ok


>
>> +                     pinctrl-1 = <&i2c0_sleep_mode>;
>> +             };
>> +
>> +             i2c1: i2c@80122000 {
>> +                     pinctrl-names = "default","sleep";
>> +                     pinctrl-0 = <&i2c1_default_mux>,<&i2c1_default_mode>;
>> +                     pinctrl-1 = <&i2c1_sleep_mode>;
>> +             };
>> +
>> +             i2c2: i2c@80128000 {
>> +                     pinctrl-names = "default","sleep";
>> +                     pinctrl-0 = <&i2c2_default_mux>,<&i2c2_default_mode>;
>> +                     pinctrl-1 = <&i2c2_sleep_mode>;
>> +             };
>> +
>> +             i2c4: i2c@8012a000 {
>> +                     pinctrl-names = "default","sleep";
>> +                     pinctrl-0 = <&i2c4_default_mux>,<&i2c4_default_mode>;
>> +                     pinctrl-1 = <&i2c4_sleep_mode>;
>> +             };
>> +
>> +             i2c5: i2c@80001000 {
>> +                     pinctrl-names = "default","sleep";
>> +                     pinctrl-0 = <&i2c5_default_mux>,<&i2c5_default_mode>;
>> +                     pinctrl-1 = <&i2c5_sleep_mode>;
>> +             };
>>       };
>>  };
>
> --
> Lee Jones
> Linaro ST-Ericsson Landing Team Lead
> Linaro.org │ Open source software for ARM SoCs
> Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 2/3] ARM: u8540: Add Pinctrl Device Tree settings for uart0, uart2
  2013-05-27 13:30 ` [PATCH 2/3] ARM: u8540: Add Pinctrl Device Tree settings for uart0, uart2 Gabriel Fernandez
  2013-05-28 10:09   ` Lee Jones
@ 2013-05-29  8:55   ` Gabriel Fernandez
  1 sibling, 0 replies; 13+ messages in thread
From: Gabriel Fernandez @ 2013-05-29  8:55 UTC (permalink / raw)
  To: linux-kernel
  Cc: Lee Jones, Linus Walleij, Olivier Clergeaud, Gabriel Fernandez

On 27 May 2013 15:30, Gabriel Fernandez <gabriel.fernandez.st@gmail.com> wrote:
> From: Gabriel Fernandez <gabriel.fernandez@st.com>
>
> This patch adds pinctrl device tree settings for uart0 and uart2
> for ccu8540 board.
>
> Signed-off-by: Gabriel Fernandez <gabriel.fernandez@st.com>
> ---
>  arch/arm/boot/dts/ccu8540-pinctrl.dtsi     | 77 ++++++++++++++++++++++++
>  arch/arm/boot/dts/ccu8540.dts              |  7 +++
>  arch/arm/boot/dts/dbx5x0.dtsi              |  2 +-
>  arch/arm/boot/dts/ste-nomadik-pinctrl.dtsi | 95 ++++++++++++++++++++++++++++++
>  include/dt-bindings/pinctrl/nomadik.h      | 36 +++++++++++
>  5 files changed, 216 insertions(+), 1 deletion(-)
>  create mode 100644 arch/arm/boot/dts/ccu8540-pinctrl.dtsi
>  create mode 100644 arch/arm/boot/dts/ste-nomadik-pinctrl.dtsi
>  create mode 100644 include/dt-bindings/pinctrl/nomadik.h
>
> diff --git a/arch/arm/boot/dts/ccu8540-pinctrl.dtsi b/arch/arm/boot/dts/ccu8540-pinctrl.dtsi
> new file mode 100644
> index 0000000..26e718b
> --- /dev/null
> +++ b/arch/arm/boot/dts/ccu8540-pinctrl.dtsi
> @@ -0,0 +1,77 @@
> +/*
> + * Copyright 2012 ST-Ericsson
> + *
> + * The code contained herein is licensed under the GNU General Public
> + * License. You may obtain a copy of the GNU General Public License
> + * Version 2 or later at the following locations:
> + *
> + * http://www.opensource.org/licenses/gpl-license.html
> + * http://www.gnu.org/copyleft/gpl.html
> + */
> +#include "ste-nomadik-pinctrl.dtsi"
> +
> +&pinctrl_dbx500 {
> +       uart0 {
> +               uart0_default_mux: uart0_mux {
> +                       default_mux {
> +                               ste,function = "u0";
> +                               ste,pins = "u0_a_1";
> +                       };
> +               };
> +
> +               uart0_default_mode: uart0_default {
> +                       default_cfg1 {
> +                               ste,pins = "GPIO0", "GPIO2";
> +                               ste,config = <&in_pu>;
> +                       };
> +
> +                       default_cfg2 {
> +                               ste,pins = "GPIO1", "GPIO3";
> +                               ste,config = <&out_hi>;
> +                       };
> +               };
> +
> +               uart0_sleep_mode: uart0_sleep {
> +                       sleep_cfg1 {
> +                               ste,pins = "GPIO0", "GPIO2";
> +                               ste,config = <&slpm_in_pu>;
> +                       };
> +
> +                       sleep_cfg2 {
> +                               ste,pins = "GPIO1", "GPIO3";
> +                               ste,config = <&slpm_out_hi>;
> +                       };
> +               };
> +       };
> +
> +       uart2 {
> +               uart2_default_mode: uart2_default {
> +                       default_mux {
> +                               ste,function = "u2";
> +                               ste,pins = "u2txrx_a_1";
> +                       };
> +
> +                       default_cfg1 {
> +                               ste,pins = "GPIO120";
> +                               ste,config = <&in_pu>;
> +                       };
> +
> +                       default_cfg2 {
> +                               ste,pins = "GPIO121";
> +                               ste,config = <&out_hi>;
> +                       };
> +               };
> +
> +               uart2_sleep_mode: uart2_sleep {
> +                       sleep_cfg1 {
> +                               ste,pins = "GPIO120";
> +                               ste,config = <&slpm_in_pu>;
> +                       };
> +
> +                       sleep_cfg2 {
> +                               ste,pins = "GPIO121";
> +                               ste,config = <&slpm_out_hi>;
> +                       };
> +               };
> +       };
> +};
> diff --git a/arch/arm/boot/dts/ccu8540.dts b/arch/arm/boot/dts/ccu8540.dts
> index 5de9e1e..4f93795 100644
> --- a/arch/arm/boot/dts/ccu8540.dts
> +++ b/arch/arm/boot/dts/ccu8540.dts
> @@ -11,6 +11,7 @@
>
>  /dts-v1/;
>  #include "dbx5x0.dtsi"
> +#include "ccu8540-pinctrl.dtsi"
>
>  / {
>         model = "ST-Ericsson U8540 platform with Device Tree";
> @@ -27,6 +28,9 @@
>                 };
>
i missed 	
	   pinctrl {
			compatible = "stericsson,db8540-pinctrl";
		};

>                 uart@80120000 {
> +                       pinctrl-names = "default", "sleep";
> +                       pinctrl-0 = <&uart0_default_mux>, <&uart0_default_mode>;
> +                       pinctrl-1 = <&uart0_sleep_mode>;
>                         status = "okay";
>                 };
>
> @@ -35,6 +39,9 @@
>                 };
>
>                 uart@80007000 {
> +                       pinctrl-names = "default", "sleep";
> +                       pinctrl-0 = <&uart2_default_mode>;
> +                       pinctrl-1 = <&uart2_sleep_mode>;
>                         status = "okay";
>                 };
>         };
> diff --git a/arch/arm/boot/dts/dbx5x0.dtsi b/arch/arm/boot/dts/dbx5x0.dtsi
> index f85ff85..7507148 100644
> --- a/arch/arm/boot/dts/dbx5x0.dtsi
> +++ b/arch/arm/boot/dts/dbx5x0.dtsi
> @@ -170,7 +170,7 @@
>                         gpio-bank = <8>;
>                 };
>
> -               pinctrl {
> +               pinctrl_dbx500: pinctrl {
>                         compatible = "stericsson,nmk-pinctrl";
>                         prcm = <&prcmu>;
>                 };
> diff --git a/arch/arm/boot/dts/ste-nomadik-pinctrl.dtsi b/arch/arm/boot/dts/ste-nomadik-pinctrl.dtsi
> new file mode 100644
> index 0000000..efddee9
> --- /dev/null
> +++ b/arch/arm/boot/dts/ste-nomadik-pinctrl.dtsi
> @@ -0,0 +1,95 @@
> +/*
> + * Copyright 2012 ST-Ericsson
> + *
> + * The code contained herein is licensed under the GNU General Public
> + * License. You may obtain a copy of the GNU General Public License
> + * Version 2 or later at the following locations:
> + *
> + * http://www.opensource.org/licenses/gpl-license.html
> + * http://www.gnu.org/copyleft/gpl.html
> + */
> +#include <dt-bindings/pinctrl/nomadik.h>
> +
> +/ {
> +       in_nopull: in_nopull {
> +               ste,input = <INPUT_NOPULL>;
> +       };
> +
> +       in_pu: input_pull_up {
> +               ste,input = <INPUT_PULLUP>;
> +       };
> +
> +       in_pd: input_pull_down {
> +               ste,input = <INPUT_PULLDOWN>;
> +       };
> +
> +       out_hi: output_high {
> +               ste,output = <OUTPUT_HIGH>;
> +       };
> +
> +       out_lo: output_low {
> +               ste,output = <OUTPUT_LOW>;
> +       };
> +
> +       gpio_out_lo: gpio_output_low {
> +               ste,gpio = <GPIOMODE_ENABLED>;
> +               ste,output = <OUTPUT_LOW>;
> +       };
> +
> +       slpm_in_pu: slpm_in_pu {
> +               ste,sleep = <SLPM_ENABLED>;
> +               ste,sleep-input = <SLPM_INPUT_PULLUP>;
> +               ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
> +       };
> +
> +       slpm_in_wkup_pdis: slpm_in_wkup_pdis {
> +               ste,sleep = <SLPM_ENABLED>;
> +               ste,sleep-input = <SLPM_DIR_INPUT>;
> +               ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
> +               ste,sleep-pull-disable = <SLPM_PDIS_DISABLED>;
> +       };
> +
> +       slpm_out_lo: slpm_out_lo {
> +               ste,sleep = <SLPM_ENABLED>;
> +               ste,sleep-output = <SLPM_OUTPUT_LOW>;
> +               ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
> +       };
> +
> +       slpm_out_hi: slpm_out_hi {
> +               ste,sleep = <SLPM_ENABLED>;
> +               ste,sleep-output = <SLPM_OUTPUT_HIGH>;
> +               ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
> +       };
> +
> +       slpm_out_hi_wkup_pdis: slpm_out_hi_wkup_pdis {
> +               ste,sleep = <SLPM_ENABLED>;
> +               ste,sleep-output = <SLPM_OUTPUT_HIGH>;
> +               ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
> +               ste,sleep-pull-disable = <SLPM_PDIS_DISABLED>;
> +       };
> +
> +       slpm_out_wkup_pdis: slpm_out_wkup_pdis {
> +               ste,sleep = <SLPM_ENABLED>;
> +               ste,sleep-output = <SLPM_DIR_OUTPUT>;
> +               ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
> +               ste,sleep-pull-disable = <SLPM_PDIS_DISABLED>;
> +       };
> +
> +       in_wkup_pdis: in_wkup_pdis {
> +               ste,sleep-input = <SLPM_DIR_INPUT>;
> +               ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
> +               ste,sleep-pull-disable = <SLPM_PDIS_DISABLED>;
> +       };
> +
> +       out_hi_wkup_pdis: out_hi_wkup_pdis {
> +               ste,sleep-output = <SLPM_OUTPUT_HIGH>;
> +               ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
> +               ste,sleep-pull-disable = <SLPM_PDIS_DISABLED>;
> +       };
> +
> +       out_wkup_pdis: out_wkup_pdis {
> +               ste,sleep-output = <SLPM_DIR_OUTPUT>;
> +               ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
> +               ste,sleep-pull-disable = <SLPM_PDIS_DISABLED>;
> +       };
> +};
> diff --git a/include/dt-bindings/pinctrl/nomadik.h b/include/dt-bindings/pinctrl/nomadik.h
> new file mode 100644
> index 0000000..638fb32
> --- /dev/null
> +++ b/include/dt-bindings/pinctrl/nomadik.h
> @@ -0,0 +1,36 @@
> +/*
> + * nomadik.h
> + *
> + * Copyright (C) ST-Ericsson SA 2013
> + * Author: Gabriel Fernandez <gabriel.fernandez@st.com> for ST-Ericsson.
> + * License terms:  GNU General Public License (GPL), version 2
> + */
> +
> +#define INPUT_NOPULL           0
> +#define INPUT_PULLUP           1
> +#define INPUT_PULLDOWN         2
> +
> +#define OUTPUT_LOW             0
> +#define OUTPUT_HIGH            1
> +#define DIR_OUTPUT             2
> +
> +#define SLPM_DISABLED          0
> +#define SLPM_ENABLED           1
> +
> +#define SLPM_INPUT_NOPULL      0
> +#define SLPM_INPUT_PULLUP      1
> +#define SLPM_INPUT_PULLDOWN    2
> +#define SLPM_DIR_INPUT         3
> +
> +#define SLPM_OUTPUT_LOW                0
> +#define SLPM_OUTPUT_HIGH       1
> +#define SLPM_DIR_OUTPUT                2
> +
> +#define SLPM_WAKEUP_DISABLE    0
> +#define SLPM_WAKEUP_ENABLE     1
> +
> +#define GPIOMODE_DISABLED      0
> +#define GPIOMODE_ENABLED       1
> +
> +#define SLPM_PDIS_DISABLED     0
> +#define SLPM_PDIS_ENABLED      1
> --
> 1.8.1.1
>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 1/3] ARM: ux500: use #include syntax to include *.dtsi.
  2013-05-27 13:30 ` [PATCH 1/3] ARM: ux500: use #include syntax to include *.dtsi Gabriel Fernandez
  2013-05-28 10:10   ` Lee Jones
@ 2013-05-29 16:39   ` Linus Walleij
  1 sibling, 0 replies; 13+ messages in thread
From: Linus Walleij @ 2013-05-29 16:39 UTC (permalink / raw)
  To: Gabriel Fernandez
  Cc: linux-kernel@vger.kernel.org, Lee Jones, Olivier Clergeaud,
	Gabriel Fernandez

On Mon, May 27, 2013 at 3:30 PM, Gabriel Fernandez
<gabriel.fernandez.st@gmail.com> wrote:

> From: Gabriel Fernandez <gabriel.fernandez@st.com>
>
> This patch prepares the use of '#define' into dts files.
>
> Signed-off-by: Gabriel Fernandez <gabriel.fernandez@st.com>

Applied to my ux500-devicetree branch with Lee's ACK.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 2/3] ARM: u8540: Add Pinctrl Device Tree settings for uart0, uart2
  2013-05-28 10:09   ` Lee Jones
  2013-05-28 12:32     ` Gabriel Fernandez
@ 2013-05-29 16:48     ` Linus Walleij
  2013-05-29 19:05       ` Lee Jones
  1 sibling, 1 reply; 13+ messages in thread
From: Linus Walleij @ 2013-05-29 16:48 UTC (permalink / raw)
  To: Lee Jones
  Cc: Gabriel Fernandez, linux-kernel@vger.kernel.org,
	Olivier Clergeaud, Gabriel Fernandez

On Tue, May 28, 2013 at 12:09 PM, Lee Jones <lee.jones@linaro.org> wrote:
> On Mon, 27 May 2013, Gabriel Fernandez wrote:
>> From: Gabriel Fernandez <gabriel.fernandez@st.com>
>>
>> This patch adds pinctrl device tree settings for uart0 and uart2
>> for ccu8540 board.
>>
>> Signed-off-by: Gabriel Fernandez <gabriel.fernandez@st.com>
>> ---
>>  arch/arm/boot/dts/ccu8540-pinctrl.dtsi     | 77 ++++++++++++++++++++++++
>>  arch/arm/boot/dts/ccu8540.dts              |  7 +++
>>  arch/arm/boot/dts/dbx5x0.dtsi              |  2 +-
>>  arch/arm/boot/dts/ste-nomadik-pinctrl.dtsi | 95 ++++++++++++++++++++++++++++++
>
> This is starting to get a bit confusing. How intrusive would it be to
> place the ccu8540-pinctrl information inside ccu8540.dts instead of
> breaking it out into different files and convoluting the issue?
>
> Also, please correct me if I'm wrong, but isn't what we call the
> Nomadik Pinctrl/GPIO really the same as DBX500 Pinctrl/GPIO? I wonder
> if this would be a better naming convention?
>
> Linus, what do you think?

I think the definitions can live in their own file like this since it
saves a lot of
lines... And the use of <dt-bindings/*> is really nice.

> Nodes look pretty good, except shouldn't 'ste' really be 'stericsson'?

I started to use ste-* on the Nomadik and U300 stuff to avoid all too
long filenames.

I would actually like to rename all the ux500-related files ste-*
so they get grouped together in the filelist, but I've heard that there
was a plan to create per-vendor subdirs in arch/arm/boot/dts
so maybe I should go for that instead?

[Gabriel]
> i missed
>           pinctrl {
>                        compatible = "stericsson,db8540-pinctrl";

Are you sending a v2?

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 2/3] ARM: u8540: Add Pinctrl Device Tree settings for uart0, uart2
  2013-05-29 16:48     ` Linus Walleij
@ 2013-05-29 19:05       ` Lee Jones
  0 siblings, 0 replies; 13+ messages in thread
From: Lee Jones @ 2013-05-29 19:05 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Gabriel Fernandez, linux-kernel@vger.kernel.org,
	Olivier Clergeaud, Gabriel Fernandez

> I would actually like to rename all the ux500-related files ste-*
> so they get grouped together in the filelist, but I've heard that there
> was a plan to create per-vendor subdirs in arch/arm/boot/dts
> so maybe I should go for that instead?

Yes, I too thought about doing this. I'll wait for the new folders though.

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2013-05-29 19:05 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-27 13:30 [PATCH 0/3] Enable cc8540 pinctrl DT for uart and i2c Gabriel Fernandez
2013-05-27 13:30 ` [PATCH 1/3] ARM: ux500: use #include syntax to include *.dtsi Gabriel Fernandez
2013-05-28 10:10   ` Lee Jones
2013-05-29 16:39   ` Linus Walleij
2013-05-27 13:30 ` [PATCH 2/3] ARM: u8540: Add Pinctrl Device Tree settings for uart0, uart2 Gabriel Fernandez
2013-05-28 10:09   ` Lee Jones
2013-05-28 12:32     ` Gabriel Fernandez
2013-05-29 16:48     ` Linus Walleij
2013-05-29 19:05       ` Lee Jones
2013-05-29  8:55   ` Gabriel Fernandez
2013-05-27 13:30 ` [PATCH 3/3] ARM: u8540: DT: Set pinctrl mapping to i2c0,1,2,4 & 5 Gabriel Fernandez
2013-05-28 10:12   ` Lee Jones
2013-05-28 12:32     ` Gabriel Fernandez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).