* [PATCH 0/4] ARM: dts: AM3XXX: Use preprocessor for device trees
@ 2013-05-31 12:42 Florian Vaussard
[not found] ` <1370004142-30506-1-git-send-email-florian.vaussard-p8DiymsW2f8@public.gmane.org>
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Florian Vaussard @ 2013-05-31 12:42 UTC (permalink / raw)
To: Benoit Cousson
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
linux-omap-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
Hello,
Following my series for OMAP2+, this series makes use of the C preprocessor
when compiling AM3XXX DT files, and accomplishes some improvements to improve
overall readability.
The .dtb files were diff-tested before and after applying the series to
guarantee identity for all targets.
For the am335x boards, I spotted a few output pins with pullup selected, but
not enabled. Although it seems a bit strange to me, I left the state
untouched. Has someone a rational for this? Is the pullup later activated?
Or is it unintentional?
This series depends on my previous series "ARM: dts: OMAP2+: Use preprocessor
for device trees", itself based on Benoit's for_3.11/dts branch.
Regards,
Florian
Florian Vaussard (4):
ARM: dts: AM3XXX: Use #include for all device trees
ARM: dts: AM33XX: Use existing constants for GPIOs
ARM: dts: AM33XX: Specific pinctrl header
ARM: dts: AM33XX: Use pinctrl constants
arch/arm/boot/dts/am335x-bone.dts | 28 ++++++++++----------
arch/arm/boot/dts/am335x-evm.dts | 44 +++++++++++++++---------------
arch/arm/boot/dts/am335x-evmsk.dts | 44 +++++++++++++++---------------
arch/arm/boot/dts/am33xx.dtsi | 5 +++-
arch/arm/boot/dts/am3517-evm.dts | 2 +-
arch/arm/boot/dts/am3517_mt_ventoux.dts | 2 +-
include/dt-bindings/pinctrl/am33xx.h | 19 +++++++++++++
7 files changed, 83 insertions(+), 61 deletions(-)
create mode 100644 include/dt-bindings/pinctrl/am33xx.h
--
1.7.5.4
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/4] ARM: dts: AM3XXX: Use #include for all device trees
[not found] ` <1370004142-30506-1-git-send-email-florian.vaussard-p8DiymsW2f8@public.gmane.org>
@ 2013-05-31 12:42 ` Florian Vaussard
0 siblings, 0 replies; 6+ messages in thread
From: Florian Vaussard @ 2013-05-31 12:42 UTC (permalink / raw)
To: Benoit Cousson
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
linux-omap-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
Replace /include/ by #include for AM33XX and AM35XX device tree
files, in order to use the C pre-processor, making use of #define
features possible.
Signed-off-by: Florian Vaussard <florian.vaussard-p8DiymsW2f8@public.gmane.org>
---
arch/arm/boot/dts/am335x-bone.dts | 2 +-
arch/arm/boot/dts/am335x-evm.dts | 2 +-
arch/arm/boot/dts/am335x-evmsk.dts | 2 +-
arch/arm/boot/dts/am33xx.dtsi | 2 +-
arch/arm/boot/dts/am3517-evm.dts | 2 +-
arch/arm/boot/dts/am3517_mt_ventoux.dts | 2 +-
6 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/arch/arm/boot/dts/am335x-bone.dts b/arch/arm/boot/dts/am335x-bone.dts
index 74bfcc6..0365e56 100644
--- a/arch/arm/boot/dts/am335x-bone.dts
+++ b/arch/arm/boot/dts/am335x-bone.dts
@@ -7,7 +7,7 @@
*/
/dts-v1/;
-/include/ "am33xx.dtsi"
+#include "am33xx.dtsi"
/ {
model = "TI AM335x BeagleBone";
diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts
index 896d392..629476e 100644
--- a/arch/arm/boot/dts/am335x-evm.dts
+++ b/arch/arm/boot/dts/am335x-evm.dts
@@ -7,7 +7,7 @@
*/
/dts-v1/;
-/include/ "am33xx.dtsi"
+#include "am33xx.dtsi"
/ {
model = "TI AM335x EVM";
diff --git a/arch/arm/boot/dts/am335x-evmsk.dts b/arch/arm/boot/dts/am335x-evmsk.dts
index 4d81dbc..a339a76 100644
--- a/arch/arm/boot/dts/am335x-evmsk.dts
+++ b/arch/arm/boot/dts/am335x-evmsk.dts
@@ -13,7 +13,7 @@
/dts-v1/;
-/include/ "am33xx.dtsi"
+#include "am33xx.dtsi"
/ {
model = "TI AM335x EVM-SK";
diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
index a3daebb..016c460 100644
--- a/arch/arm/boot/dts/am33xx.dtsi
+++ b/arch/arm/boot/dts/am33xx.dtsi
@@ -8,7 +8,7 @@
* kind, whether express or implied.
*/
-/include/ "skeleton.dtsi"
+#include "skeleton.dtsi"
/ {
compatible = "ti,am33xx";
diff --git a/arch/arm/boot/dts/am3517-evm.dts b/arch/arm/boot/dts/am3517-evm.dts
index e9b5bda..e99dfaf 100644
--- a/arch/arm/boot/dts/am3517-evm.dts
+++ b/arch/arm/boot/dts/am3517-evm.dts
@@ -7,7 +7,7 @@
*/
/dts-v1/;
-/include/ "omap34xx.dtsi"
+#include "omap34xx.dtsi"
/ {
model = "TI AM3517 EVM (AM3517/05)";
diff --git a/arch/arm/boot/dts/am3517_mt_ventoux.dts b/arch/arm/boot/dts/am3517_mt_ventoux.dts
index 5568683..fdf5ce6 100644
--- a/arch/arm/boot/dts/am3517_mt_ventoux.dts
+++ b/arch/arm/boot/dts/am3517_mt_ventoux.dts
@@ -7,7 +7,7 @@
*/
/dts-v1/;
-/include/ "omap34xx.dtsi"
+#include "omap34xx.dtsi"
/ {
model = "TeeJet Mt.Ventoux";
--
1.7.5.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/4] ARM: dts: AM33XX: Use existing constants for GPIOs
2013-05-31 12:42 [PATCH 0/4] ARM: dts: AM3XXX: Use preprocessor for device trees Florian Vaussard
[not found] ` <1370004142-30506-1-git-send-email-florian.vaussard-p8DiymsW2f8@public.gmane.org>
@ 2013-05-31 12:42 ` Florian Vaussard
2013-05-31 12:42 ` [PATCH 3/4] ARM: dts: AM33XX: Specific pinctrl header Florian Vaussard
2013-05-31 12:42 ` [PATCH 4/4] ARM: dts: AM33XX: Use pinctrl constants Florian Vaussard
3 siblings, 0 replies; 6+ messages in thread
From: Florian Vaussard @ 2013-05-31 12:42 UTC (permalink / raw)
To: Benoit Cousson
Cc: Tony Lindgren, Vaibhav Hiremath, linux-omap, devicetree-discuss,
linux-arm-kernel, Florian Vaussard
Use standard GPIO constants to enhance the readability of DT GPIOs.
Signed-off-by: Florian Vaussard <florian.vaussard@epfl.ch>
---
arch/arm/boot/dts/am335x-bone.dts | 8 ++++----
arch/arm/boot/dts/am335x-evm.dts | 14 +++++++-------
arch/arm/boot/dts/am335x-evmsk.dts | 16 ++++++++--------
arch/arm/boot/dts/am33xx.dtsi | 2 ++
4 files changed, 21 insertions(+), 19 deletions(-)
diff --git a/arch/arm/boot/dts/am335x-bone.dts b/arch/arm/boot/dts/am335x-bone.dts
index 0365e56..5bfb7dd 100644
--- a/arch/arm/boot/dts/am335x-bone.dts
+++ b/arch/arm/boot/dts/am335x-bone.dts
@@ -88,27 +88,27 @@
led@2 {
label = "beaglebone:green:heartbeat";
- gpios = <&gpio1 21 0>;
+ gpios = <&gpio1 21 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "heartbeat";
default-state = "off";
};
led@3 {
label = "beaglebone:green:mmc0";
- gpios = <&gpio1 22 0>;
+ gpios = <&gpio1 22 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "mmc0";
default-state = "off";
};
led@4 {
label = "beaglebone:green:usr2";
- gpios = <&gpio1 23 0>;
+ gpios = <&gpio1 23 GPIO_ACTIVE_HIGH>;
default-state = "off";
};
led@5 {
label = "beaglebone:green:usr3";
- gpios = <&gpio1 24 0>;
+ gpios = <&gpio1 24 GPIO_ACTIVE_HIGH>;
default-state = "off";
};
};
diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts
index 629476e..0fbecfd 100644
--- a/arch/arm/boot/dts/am335x-evm.dts
+++ b/arch/arm/boot/dts/am335x-evm.dts
@@ -159,12 +159,12 @@
debounce-delay-ms = <5>;
col-scan-delay-us = <2>;
- row-gpios = <&gpio1 25 0 /* Bank1, pin25 */
- &gpio1 26 0 /* Bank1, pin26 */
- &gpio1 27 0>; /* Bank1, pin27 */
+ row-gpios = <&gpio1 25 GPIO_ACTIVE_HIGH /* Bank1, pin25 */
+ &gpio1 26 GPIO_ACTIVE_HIGH /* Bank1, pin26 */
+ &gpio1 27 GPIO_ACTIVE_HIGH>; /* Bank1, pin27 */
- col-gpios = <&gpio1 21 0 /* Bank1, pin21 */
- &gpio1 22 0>; /* Bank1, pin22 */
+ col-gpios = <&gpio1 21 GPIO_ACTIVE_HIGH /* Bank1, pin21 */
+ &gpio1 22 GPIO_ACTIVE_HIGH>; /* Bank1, pin22 */
linux,keymap = <0x0000008b /* MENU */
0x0100009e /* BACK */
@@ -183,14 +183,14 @@
switch@9 {
label = "volume-up";
linux,code = <115>;
- gpios = <&gpio0 2 1>;
+ gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
gpio-key,wakeup;
};
switch@10 {
label = "volume-down";
linux,code = <114>;
- gpios = <&gpio0 3 1>;
+ gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
gpio-key,wakeup;
};
};
diff --git a/arch/arm/boot/dts/am335x-evmsk.dts b/arch/arm/boot/dts/am335x-evmsk.dts
index a339a76..289ba2c 100644
--- a/arch/arm/boot/dts/am335x-evmsk.dts
+++ b/arch/arm/boot/dts/am335x-evmsk.dts
@@ -144,26 +144,26 @@
led@1 {
label = "evmsk:green:usr0";
- gpios = <&gpio1 4 0>;
+ gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>;
default-state = "off";
};
led@2 {
label = "evmsk:green:usr1";
- gpios = <&gpio1 5 0>;
+ gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>;
default-state = "off";
};
led@3 {
label = "evmsk:green:mmc0";
- gpios = <&gpio1 6 0>;
+ gpios = <&gpio1 6 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "mmc0";
default-state = "off";
};
led@4 {
label = "evmsk:green:heartbeat";
- gpios = <&gpio1 7 0>;
+ gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "heartbeat";
default-state = "off";
};
@@ -177,26 +177,26 @@
switch@1 {
label = "button0";
linux,code = <0x100>;
- gpios = <&gpio2 3 0>;
+ gpios = <&gpio2 3 GPIO_ACTIVE_HIGH>;
};
switch@2 {
label = "button1";
linux,code = <0x101>;
- gpios = <&gpio2 2 0>;
+ gpios = <&gpio2 2 GPIO_ACTIVE_HIGH>;
};
switch@3 {
label = "button2";
linux,code = <0x102>;
- gpios = <&gpio0 30 0>;
+ gpios = <&gpio0 30 GPIO_ACTIVE_HIGH>;
gpio-key,wakeup;
};
switch@4 {
label = "button3";
linux,code = <0x103>;
- gpios = <&gpio2 5 0>;
+ gpios = <&gpio2 5 GPIO_ACTIVE_HIGH>;
};
};
};
diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
index 016c460..f116c79 100644
--- a/arch/arm/boot/dts/am33xx.dtsi
+++ b/arch/arm/boot/dts/am33xx.dtsi
@@ -8,6 +8,8 @@
* kind, whether express or implied.
*/
+#include <dt-bindings/gpio/gpio.h>
+
#include "skeleton.dtsi"
/ {
--
1.7.5.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/4] ARM: dts: AM33XX: Specific pinctrl header
2013-05-31 12:42 [PATCH 0/4] ARM: dts: AM3XXX: Use preprocessor for device trees Florian Vaussard
[not found] ` <1370004142-30506-1-git-send-email-florian.vaussard-p8DiymsW2f8@public.gmane.org>
2013-05-31 12:42 ` [PATCH 2/4] ARM: dts: AM33XX: Use existing constants for GPIOs Florian Vaussard
@ 2013-05-31 12:42 ` Florian Vaussard
2013-05-31 12:42 ` [PATCH 4/4] ARM: dts: AM33XX: Use pinctrl constants Florian Vaussard
3 siblings, 0 replies; 6+ messages in thread
From: Florian Vaussard @ 2013-05-31 12:42 UTC (permalink / raw)
To: Benoit Cousson
Cc: Tony Lindgren, Vaibhav Hiremath, linux-omap, devicetree-discuss,
linux-arm-kernel, Florian Vaussard
The pinctrl IP inside the AM33XX family differs slightly from
what is found on OMAP2+. Define a specific header to take account
of the differences.
Signed-off-by: Florian Vaussard <florian.vaussard@epfl.ch>
---
include/dt-bindings/pinctrl/am33xx.h | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
create mode 100644 include/dt-bindings/pinctrl/am33xx.h
diff --git a/include/dt-bindings/pinctrl/am33xx.h b/include/dt-bindings/pinctrl/am33xx.h
new file mode 100644
index 0000000..9ffb6c2
--- /dev/null
+++ b/include/dt-bindings/pinctrl/am33xx.h
@@ -0,0 +1,19 @@
+/*
+ * This header provides constants specific to AM33XX pinctrl bindings.
+ */
+
+#include <include/dt-bindings/pinctrl/omap.h>
+
+/* am33xx specific mux bit defines */
+#undef INPUT_EN
+#define INPUT_EN (1 << 5)
+#define SLEWCTRL_FAST (1 << 6)
+
+/* update macro depending on INPUT_EN */
+#undef PIN_INPUT
+#undef PIN_INPUT_PULLUP
+#undef PIN_INPUT_PULLDOWN
+#define PIN_INPUT INPUT_EN
+#define PIN_INPUT_PULLUP (PULL_ENA | INPUT_EN | PULL_UP)
+#define PIN_INPUT_PULLDOWN (PULL_ENA | INPUT_EN)
+
--
1.7.5.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 4/4] ARM: dts: AM33XX: Use pinctrl constants
2013-05-31 12:42 [PATCH 0/4] ARM: dts: AM3XXX: Use preprocessor for device trees Florian Vaussard
` (2 preceding siblings ...)
2013-05-31 12:42 ` [PATCH 3/4] ARM: dts: AM33XX: Specific pinctrl header Florian Vaussard
@ 2013-05-31 12:42 ` Florian Vaussard
[not found] ` <1370004142-30506-5-git-send-email-florian.vaussard-p8DiymsW2f8@public.gmane.org>
3 siblings, 1 reply; 6+ messages in thread
From: Florian Vaussard @ 2013-05-31 12:42 UTC (permalink / raw)
To: Benoit Cousson
Cc: Tony Lindgren, Vaibhav Hiremath, linux-omap, devicetree-discuss,
linux-arm-kernel, Florian Vaussard
Using constants for pinctrl allows a better readability, and removes
redundancy with comments.
Signed-off-by: Florian Vaussard <florian.vaussard@epfl.ch>
---
arch/arm/boot/dts/am335x-bone.dts | 18 +++++++++---------
arch/arm/boot/dts/am335x-evm.dts | 28 ++++++++++++++--------------
arch/arm/boot/dts/am335x-evmsk.dts | 26 +++++++++++++-------------
arch/arm/boot/dts/am33xx.dtsi | 1 +
4 files changed, 37 insertions(+), 36 deletions(-)
diff --git a/arch/arm/boot/dts/am335x-bone.dts b/arch/arm/boot/dts/am335x-bone.dts
index 5bfb7dd..61d0793 100644
--- a/arch/arm/boot/dts/am335x-bone.dts
+++ b/arch/arm/boot/dts/am335x-bone.dts
@@ -30,30 +30,30 @@
user_leds_s0: user_leds_s0 {
pinctrl-single,pins = <
- 0x54 0x7 /* gpmc_a5.gpio1_21, OUTPUT | MODE7 */
- 0x58 0x17 /* gpmc_a6.gpio1_22, OUTPUT_PULLUP | MODE7 */
- 0x5c 0x7 /* gpmc_a7.gpio1_23, OUTPUT | MODE7 */
- 0x60 0x17 /* gpmc_a8.gpio1_24, OUTPUT_PULLUP | MODE7 */
+ 0x54 (PIN_OUTPUT | MUX_MODE7) /* gpmc_a5.gpio1_21 */
+ 0x58 (PIN_OUTPUT | PULL_UP | MUX_MODE7) /* gpmc_a6.gpio1_22 */
+ 0x5c (PIN_OUTPUT | MUX_MODE7) /* gpmc_a7.gpio1_23 */
+ 0x60 (PIN_OUTPUT | PULL_UP | MUX_MODE7) /* gpmc_a8.gpio1_24 */
>;
};
i2c0_pins: pinmux_i2c0_pins {
pinctrl-single,pins = <
- 0x188 0x30 /* i2c0_sda.i2c0_sda PULLUP | INPUTENABLE | MODE0 */
- 0x18c 0x30 /* i2c0_scl.i2c0_scl PULLUP | INPUTENABLE | MODE0 */
+ 0x188 (PIN_INPUT | PULL_UP | MUX_MODE0) /* i2c0_sda.i2c0_sda */
+ 0x18c (PIN_INPUT | PULL_UP | MUX_MODE0) /* i2c0_scl.i2c0_scl */
>;
};
uart0_pins: pinmux_uart0_pins {
pinctrl-single,pins = <
- 0x170 0x30 /* uart0_rxd.uart0_rxd PULLUP | INPUTENABLE | MODE0 */
- 0x174 0x00 /* uart0_txd.uart0_txd PULLDOWN | MODE0 */
+ 0x170 (PIN_INPUT | PULL_UP | MUX_MODE0) /* uart0_rxd.uart0_rxd */
+ 0x174 (PIN_OUTPUT | MUX_MODE0) /* uart0_txd.uart0_txd */
>;
};
clkout2_pin: pinmux_clkout2_pin {
pinctrl-single,pins = <
- 0x1b4 0x03 /* xdma_event_intr1.clkout2 OMAP_MUX_MODE3 | AM33XX_PIN_OUTPUT */
+ 0x1b4 (PIN_OUTPUT | MUX_MODE3) /* xdma_event_intr1.clkout2 */
>;
};
};
diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts
index 0fbecfd..0ee69ec 100644
--- a/arch/arm/boot/dts/am335x-evm.dts
+++ b/arch/arm/boot/dts/am335x-evm.dts
@@ -30,45 +30,45 @@
matrix_keypad_s0: matrix_keypad_s0 {
pinctrl-single,pins = <
- 0x54 0x7 /* gpmc_a5.gpio1_21, OUTPUT | MODE7 */
- 0x58 0x7 /* gpmc_a6.gpio1_22, OUTPUT | MODE7 */
- 0x64 0x27 /* gpmc_a9.gpio1_25, INPUT | MODE7 */
- 0x68 0x27 /* gpmc_a10.gpio1_26, INPUT | MODE7 */
- 0x6c 0x27 /* gpmc_a11.gpio1_27, INPUT | MODE7 */
+ 0x54 (PIN_OUTPUT | MUX_MODE7) /* gpmc_a5.gpio1_21 */
+ 0x58 (PIN_OUTPUT | MUX_MODE7) /* gpmc_a6.gpio1_22 */
+ 0x64 (PIN_INPUT | MUX_MODE7) /* gpmc_a9.gpio1_25 */
+ 0x68 (PIN_INPUT | MUX_MODE7) /* gpmc_a10.gpio1_26 */
+ 0x6c (PIN_INPUT | MUX_MODE7) /* gpmc_a11.gpio1_27 */
>;
};
volume_keys_s0: volume_keys_s0 {
pinctrl-single,pins = <
- 0x150 0x27 /* spi0_sclk.gpio0_2, INPUT | MODE7 */
- 0x154 0x27 /* spi0_d0.gpio0_3, INPUT | MODE7 */
+ 0x150 (PIN_INPUT | MUX_MODE7) /* spi0_sclk.gpio0_2 */
+ 0x154 (PIN_INPUT | MUX_MODE7) /* spi0_d0.gpio0_3 */
>;
};
i2c0_pins: pinmux_i2c0_pins {
pinctrl-single,pins = <
- 0x188 0x30 /* i2c0_sda.i2c0_sda PULLUP | INPUTENABLE | MODE0 */
- 0x18c 0x30 /* i2c0_scl.i2c0_scl PULLUP | INPUTENABLE | MODE0 */
+ 0x188 (PIN_INPUT | PULL_UP | MUX_MODE0) /* i2c0_sda.i2c0_sda */
+ 0x18c (PIN_INPUT | PULL_UP | MUX_MODE0) /* i2c0_scl.i2c0_scl */
>;
};
i2c1_pins: pinmux_i2c1_pins {
pinctrl-single,pins = <
- 0x158 0x32 /* spi0_d1.i2c1_sda PULLUP | INPUTENABLE | MODE2 */
- 0x15c 0x32 /* spi0_cs0.i2c1_scl PULLUP | INPUTENABLE | MODE2 */
+ 0x158 (PIN_INPUT | PULL_UP | MUX_MODE2) /* spi0_d1.i2c1_sda */
+ 0x15c (PIN_INPUT | PULL_UP | MUX_MODE2) /* spi0_cs0.i2c1_scl */
>;
};
uart0_pins: pinmux_uart0_pins {
pinctrl-single,pins = <
- 0x170 0x30 /* uart0_rxd.uart0_rxd PULLUP | INPUTENABLE | MODE0 */
- 0x174 0x00 /* uart0_txd.uart0_txd PULLDOWN | MODE0 */
+ 0x170 (PIN_INPUT | PULL_UP | MUX_MODE0) /* uart0_rxd.uart0_rxd */
+ 0x174 (PIN_OUTPUT | MUX_MODE0) /* uart0_txd.uart0_txd */
>;
};
clkout2_pin: pinmux_clkout2_pin {
pinctrl-single,pins = <
- 0x1b4 0x03 /* xdma_event_intr1.clkout2 OMAP_MUX_MODE3 | AM33XX_PIN_OUTPUT */
+ 0x1b4 (PIN_OUTPUT | MUX_MODE3) /* xdma_event_intr1.clkout2 */
>;
};
};
diff --git a/arch/arm/boot/dts/am335x-evmsk.dts b/arch/arm/boot/dts/am335x-evmsk.dts
index 289ba2c..5e0e709 100644
--- a/arch/arm/boot/dts/am335x-evmsk.dts
+++ b/arch/arm/boot/dts/am335x-evmsk.dts
@@ -36,39 +36,39 @@
user_leds_s0: user_leds_s0 {
pinctrl-single,pins = <
- 0x10 0x7 /* gpmc_ad4.gpio1_4, OUTPUT | MODE7 */
- 0x14 0x7 /* gpmc_ad5.gpio1_5, OUTPUT | MODE7 */
- 0x18 0x7 /* gpmc_ad6.gpio1_6, OUTPUT | MODE7 */
- 0x1c 0x7 /* gpmc_ad7.gpio1_7, OUTPUT | MODE7 */
+ 0x10 (PIN_OUTPUT | MUX_MODE7) /* gpmc_ad4.gpio1_4 */
+ 0x14 (PIN_OUTPUT | MUX_MODE7) /* gpmc_ad5.gpio1_5 */
+ 0x18 (PIN_OUTPUT | MUX_MODE7) /* gpmc_ad6.gpio1_6 */
+ 0x1c (PIN_OUTPUT | MUX_MODE7) /* gpmc_ad7.gpio1_7 */
>;
};
gpio_keys_s0: gpio_keys_s0 {
pinctrl-single,pins = <
- 0x94 0x27 /* gpmc_oen_ren.gpio2_3, INPUT | MODE7 */
- 0x90 0x27 /* gpmc_advn_ale.gpio2_2, INPUT | MODE7 */
- 0x70 0x27 /* gpmc_wait0.gpio0_30, INPUT | MODE7 */
- 0x9c 0x27 /* gpmc_ben0_cle.gpio2_5, INPUT | MODE7 */
+ 0x94 (PIN_INPUT | MUX_MODE7) /* gpmc_oen_ren.gpio2_3 */
+ 0x90 (PIN_INPUT | MUX_MODE7) /* gpmc_advn_ale.gpio2_2 */
+ 0x70 (PIN_INPUT | MUX_MODE7) /* gpmc_wait0.gpio0_30 */
+ 0x9c (PIN_INPUT | MUX_MODE7) /* gpmc_ben0_cle.gpio2_5 */
>;
};
i2c0_pins: pinmux_i2c0_pins {
pinctrl-single,pins = <
- 0x188 0x30 /* i2c0_sda.i2c0_sda PULLUP | INPUTENABLE | MODE0 */
- 0x18c 0x30 /* i2c0_scl.i2c0_scl PULLUP | INPUTENABLE | MODE0 */
+ 0x188 (PIN_INPUT | PULL_UP | MUX_MODE0) /* i2c0_sda.i2c0_sda */
+ 0x18c (PIN_INPUT | PULL_UP | MUX_MODE0) /* i2c0_scl.i2c0_scl */
>;
};
uart0_pins: pinmux_uart0_pins {
pinctrl-single,pins = <
- 0x170 0x30 /* uart0_rxd.uart0_rxd PULLUP | INPUTENABLE | MODE0 */
- 0x174 0x00 /* uart0_txd.uart0_txd PULLDOWN | MODE0 */
+ 0x170 (PIN_INPUT | PULL_UP | MUX_MODE0) /* uart0_rxd.uart0_rxd */
+ 0x174 (PIN_OUTPUT | MUX_MODE0) /* uart0_txd.uart0_txd */
>;
};
clkout2_pin: pinmux_clkout2_pin {
pinctrl-single,pins = <
- 0x1b4 0x03 /* xdma_event_intr1.clkout2 OMAP_MUX_MODE3 | AM33XX_PIN_OUTPUT */
+ 0x1b4 (PIN_OUTPUT | MUX_MODE3) /* xdma_event_intr1.clkout2 */
>;
};
};
diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
index f116c79..bdcc55f 100644
--- a/arch/arm/boot/dts/am33xx.dtsi
+++ b/arch/arm/boot/dts/am33xx.dtsi
@@ -9,6 +9,7 @@
*/
#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/am33xx.h>
#include "skeleton.dtsi"
--
1.7.5.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 4/4] ARM: dts: AM33XX: Use pinctrl constants
[not found] ` <1370004142-30506-5-git-send-email-florian.vaussard-p8DiymsW2f8@public.gmane.org>
@ 2013-06-02 17:43 ` Joel A Fernandes
0 siblings, 0 replies; 6+ messages in thread
From: Joel A Fernandes @ 2013-06-02 17:43 UTC (permalink / raw)
To: Florian Vaussard
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Linux OMAP List,
Linux ARM Kernel List
[-- Attachment #1.1: Type: text/plain, Size: 1975 bytes --]
Hi Florian,
This is very cool.. :-)
On Fri, May 31, 2013 at 7:42 AM, Florian Vaussard
<florian.vaussard-p8DiymsW2f8@public.gmane.org>wrote:
> Using constants for pinctrl allows a better readability, and removes
> redundancy with comments.
>
> Signed-off-by: Florian Vaussard <florian.vaussard-p8DiymsW2f8@public.gmane.org>
> ---
> arch/arm/boot/dts/am335x-bone.dts | 18 +++++++++---------
> arch/arm/boot/dts/am335x-evm.dts | 28 ++++++++++++++--------------
> arch/arm/boot/dts/am335x-evmsk.dts | 26 +++++++++++++-------------
> arch/arm/boot/dts/am33xx.dtsi | 1 +
> 4 files changed, 37 insertions(+), 36 deletions(-)
>
> diff --git a/arch/arm/boot/dts/am335x-bone.dts
> b/arch/arm/boot/dts/am335x-bone.dts
> index 5bfb7dd..61d0793 100644
> --- a/arch/arm/boot/dts/am335x-bone.dts
> +++ b/arch/arm/boot/dts/am335x-bone.dts
> @@ -30,30 +30,30 @@
>
> user_leds_s0: user_leds_s0 {
> pinctrl-single,pins = <
> - 0x54 0x7 /* gpmc_a5.gpio1_21,
> OUTPUT | MODE7 */
> - 0x58 0x17 /* gpmc_a6.gpio1_22,
> OUTPUT_PULLUP | MODE7 */
> - 0x5c 0x7 /* gpmc_a7.gpio1_23,
> OUTPUT | MODE7 */
> - 0x60 0x17 /* gpmc_a8.gpio1_24,
> OUTPUT_PULLUP | MODE7 */
> + 0x54 (PIN_OUTPUT | MUX_MODE7) /*
> gpmc_a5.gpio1_21 */
> + 0x58 (PIN_OUTPUT | PULL_UP | MUX_MODE7) /*
> gpmc_a6.gpio1_22 */
> + 0x5c (PIN_OUTPUT | MUX_MODE7) /*
> gpmc_a7.gpio1_23 */
> + 0x60 (PIN_OUTPUT | PULL_UP | MUX_MODE7) /*
> gpmc_a8.gpio1_24 */
>
>
Does it make sense to also replace the pinmux offets with constants?
Removal of the comment would mean looking at the DTS one still has to go
back to the TRM to figure out what is the name for a particular offset.
Thanks,
Joel
[-- Attachment #1.2: Type: text/html, Size: 2607 bytes --]
[-- Attachment #2: Type: text/plain, Size: 192 bytes --]
_______________________________________________
devicetree-discuss mailing list
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
https://lists.ozlabs.org/listinfo/devicetree-discuss
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-06-02 17:43 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-31 12:42 [PATCH 0/4] ARM: dts: AM3XXX: Use preprocessor for device trees Florian Vaussard
[not found] ` <1370004142-30506-1-git-send-email-florian.vaussard-p8DiymsW2f8@public.gmane.org>
2013-05-31 12:42 ` [PATCH 1/4] ARM: dts: AM3XXX: Use #include for all " Florian Vaussard
2013-05-31 12:42 ` [PATCH 2/4] ARM: dts: AM33XX: Use existing constants for GPIOs Florian Vaussard
2013-05-31 12:42 ` [PATCH 3/4] ARM: dts: AM33XX: Specific pinctrl header Florian Vaussard
2013-05-31 12:42 ` [PATCH 4/4] ARM: dts: AM33XX: Use pinctrl constants Florian Vaussard
[not found] ` <1370004142-30506-5-git-send-email-florian.vaussard-p8DiymsW2f8@public.gmane.org>
2013-06-02 17:43 ` Joel A Fernandes
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).