Skip to contentSkip to conversation

ARM: sunxi: DT: Convert to device tree includes

PATCH New Maxime Ripard 3 participants 12 messages Dec 16, 2014 – Jan 6, 2015

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/6 ARM: sunxi: DT: Convert to device tree includes

Prepare the device trees to use the C preprocessor.

---
 arch/arm/boot/dts/sun4i-a10-a1000.dts            | 4 ++--
 arch/arm/boot/dts/sun4i-a10-ba10-tvbox.dts       | 4 ++--
 arch/arm/boot/dts/sun4i-a10-cubieboard.dts       | 4 ++--
 arch/arm/boot/dts/sun4i-a10-hackberry.dts        | 4 ++--
 arch/arm/boot/dts/sun4i-a10-inet97fv2.dts        | 4 ++--
 arch/arm/boot/dts/sun4i-a10-mini-xplus.dts       | 4 ++--
 arch/arm/boot/dts/sun4i-a10-olinuxino-lime.dts   | 4 ++--
 arch/arm/boot/dts/sun4i-a10-pcduino.dts          | 4 ++--
 arch/arm/boot/dts/sun4i-a10.dtsi                 | 2 +-
 arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts | 4 ++--
 arch/arm/boot/dts/sun5i-a10s-r7-tv-dongle.dts    | 4 ++--
 arch/arm/boot/dts/sun5i-a10s.dtsi                | 2 +-
 arch/arm/boot/dts/sun5i-a13-hsg-h702.dts         | 4 ++--
 arch/arm/boot/dts/sun5i-a13-olinuxino-micro.dts  | 4 ++--
 arch/arm/boot/dts/sun5i-a13-olinuxino.dts        | 4 ++--
 arch/arm/boot/dts/sun5i-a13.dtsi                 | 2 +-
 arch/arm/boot/dts/sun6i-a31-app4-evb1.dts        | 4 ++--
 arch/arm/boot/dts/sun6i-a31-colombus.dts         | 4 ++--
 arch/arm/boot/dts/sun6i-a31-hummingbird.dts      | 4 ++--
 arch/arm/boot/dts/sun6i-a31-m9.dts               | 4 ++--
 arch/arm/boot/dts/sun6i-a31.dtsi                 | 2 +-
 arch/arm/boot/dts/sun7i-a20-bananapi.dts         | 4 ++--
 arch/arm/boot/dts/sun7i-a20-cubieboard2.dts      | 4 ++--
 arch/arm/boot/dts/sun7i-a20-cubietruck.dts       | 4 ++--
 arch/arm/boot/dts/sun7i-a20-hummingbird.dts      | 4 ++--
 arch/arm/boot/dts/sun7i-a20-i12-tvbox.dts        | 4 ++--
 arch/arm/boot/dts/sun7i-a20-m3.dts               | 4 ++--
 arch/arm/boot/dts/sun7i-a20-olinuxino-lime.dts   | 4 ++--
 arch/arm/boot/dts/sun7i-a20-olinuxino-lime2.dts  | 4 ++--
 arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts  | 4 ++--
 arch/arm/boot/dts/sun7i-a20-pcduino3.dts         | 4 ++--
 arch/arm/boot/dts/sun7i-a20.dtsi                 | 2 +-
 arch/arm/boot/dts/sun8i-a23-ippo-q8h-v5.dts      | 4 ++--
 arch/arm/boot/dts/sun8i-a23.dtsi                 | 2 +-
 arch/arm/boot/dts/sun9i-a80-optimus.dts          | 2 +-
 arch/arm/boot/dts/sun9i-a80.dtsi                 | 2 +-
 36 files changed, 64 insertions(+), 64 deletions(-)
arch/arm/boot/dts/sun4i-a10-a1000.dts +2 -2
index 3bcfd81837f0..3bb636978582 100644
@@ -48,8 +48,8 @@
  */
 
 /dts-v1/;
-/include/ "sun4i-a10.dtsi"
-/include/ "sunxi-common-regulators.dtsi"
+#include "sun4i-a10.dtsi"
+#include "sunxi-common-regulators.dtsi"
 
 / {
 	model = "Mele A1000";
arch/arm/boot/dts/sun4i-a10-ba10-tvbox.dts +2 -2
index f3f2974658e4..b2b45c4f7915 100644
@@ -46,8 +46,8 @@
  */
 
 /dts-v1/;
-/include/ "sun4i-a10.dtsi"
-/include/ "sunxi-common-regulators.dtsi"
+#include "sun4i-a10.dtsi"
+#include "sunxi-common-regulators.dtsi"
 
 / {
 	model = "BA10 tvbox";
arch/arm/boot/dts/sun4i-a10-cubieboard.dts +2 -2
index 6a310da53f18..c5691a8666c5 100644
@@ -47,8 +47,8 @@
  */
 
 /dts-v1/;
-/include/ "sun4i-a10.dtsi"
-/include/ "sunxi-common-regulators.dtsi"
+#include "sun4i-a10.dtsi"
+#include "sunxi-common-regulators.dtsi"
 
 / {
 	model = "Cubietech Cubieboard";
arch/arm/boot/dts/sun4i-a10-hackberry.dts +2 -2
index efc116287e0f..0c6c81a6b61b 100644
@@ -48,8 +48,8 @@
  */
 
 /dts-v1/;
-/include/ "sun4i-a10.dtsi"
-/include/ "sunxi-common-regulators.dtsi"
+#include "sun4i-a10.dtsi"
+#include "sunxi-common-regulators.dtsi"
 
 / {
 	model = "Miniand Hackberry";
arch/arm/boot/dts/sun4i-a10-inet97fv2.dts +2 -2
index 3e25ee4d3248..5980ad0e69e3 100644
@@ -48,8 +48,8 @@
  */
 
 /dts-v1/;
-/include/ "sun4i-a10.dtsi"
-/include/ "sunxi-common-regulators.dtsi"
+#include "sun4i-a10.dtsi"
+#include "sunxi-common-regulators.dtsi"
 
 / {
 	model = "INet-97F Rev 02";
arch/arm/boot/dts/sun4i-a10-mini-xplus.dts +2 -2
index 8b3f97470249..e55639988e5d 100644
@@ -48,8 +48,8 @@
  */
 
 /dts-v1/;
-/include/ "sun4i-a10.dtsi"
-/include/ "sunxi-common-regulators.dtsi"
+#include "sun4i-a10.dtsi"
+#include "sunxi-common-regulators.dtsi"
 
 / {
 	model = "PineRiver Mini X-Plus";
arch/arm/boot/dts/sun4i-a10-olinuxino-lime.dts +2 -2
index 88cf1a531155..3f607946abad 100644
@@ -46,8 +46,8 @@
  */
 
 /dts-v1/;
-/include/ "sun4i-a10.dtsi"
-/include/ "sunxi-common-regulators.dtsi"
+#include "sun4i-a10.dtsi"
+#include "sunxi-common-regulators.dtsi"
 
 / {
 	model = "Olimex A10-OLinuXino-LIME";
arch/arm/boot/dts/sun4i-a10-pcduino.dts +2 -2
index ce5994597407..7367eff79dea 100644
@@ -47,8 +47,8 @@
  */
 
 /dts-v1/;
-/include/ "sun4i-a10.dtsi"
-/include/ "sunxi-common-regulators.dtsi"
+#include "sun4i-a10.dtsi"
+#include "sunxi-common-regulators.dtsi"
 
 / {
 	model = "LinkSprite pcDuino";
arch/arm/boot/dts/sun4i-a10.dtsi +1 -1
index 7b4099fcf817..69d12ed92406 100644
@@ -10,7 +10,7 @@
  * http://www.gnu.org/copyleft/gpl.html
  */
 
-/include/ "skeleton.dtsi"
+#include "skeleton.dtsi"
 
 / {
 	interrupt-parent = <&intc>;
arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts +2 -2
index fe3c559ca6a8..29a47dd4bad5 100644
@@ -48,8 +48,8 @@
  */
 
 /dts-v1/;
-/include/ "sun5i-a10s.dtsi"
-/include/ "sunxi-common-regulators.dtsi"
+#include "sun5i-a10s.dtsi"
+#include "sunxi-common-regulators.dtsi"
 
 / {
 	model = "Olimex A10s-Olinuxino Micro";
arch/arm/boot/dts/sun5i-a10s-r7-tv-dongle.dts +2 -2
index 1fa2916eafc2..3a0d9dc39914 100644
@@ -46,8 +46,8 @@
  */
 
 /dts-v1/;
-/include/ "sun5i-a10s.dtsi"
-/include/ "sunxi-common-regulators.dtsi"
+#include "sun5i-a10s.dtsi"
+#include "sunxi-common-regulators.dtsi"
 
 / {
 	model = "R7 A10s hdmi tv-stick";
arch/arm/boot/dts/sun5i-a10s.dtsi +1 -1
index 1b76667f3182..98dbf4dd2db8 100644
@@ -11,7 +11,7 @@
  * http://www.gnu.org/copyleft/gpl.html
  */
 
-/include/ "skeleton.dtsi"
+#include "skeleton.dtsi"
 
 / {
 	interrupt-parent = <&intc>;
arch/arm/boot/dts/sun5i-a13-hsg-h702.dts +2 -2
index eeed1f236ee8..ca6b6dd30e47 100644
@@ -46,8 +46,8 @@
  */
 
 /dts-v1/;
-/include/ "sun5i-a13.dtsi"
-/include/ "sunxi-common-regulators.dtsi"
+#include "sun5i-a13.dtsi"
+#include "sunxi-common-regulators.dtsi"
 
 / {
 	model = "HSG H702";
arch/arm/boot/dts/sun5i-a13-olinuxino-micro.dts +2 -2
index 916ee8bb826f..729f02daf605 100644
@@ -47,8 +47,8 @@
  */
 
 /dts-v1/;
-/include/ "sun5i-a13.dtsi"
-/include/ "sunxi-common-regulators.dtsi"
+#include "sun5i-a13.dtsi"
+#include "sunxi-common-regulators.dtsi"
 
 / {
 	model = "Olimex A13-Olinuxino Micro";
arch/arm/boot/dts/sun5i-a13-olinuxino.dts +2 -2
index e31d291d14cb..0e9e17dcc936 100644
@@ -48,8 +48,8 @@
  */
 
 /dts-v1/;
-/include/ "sun5i-a13.dtsi"
-/include/ "sunxi-common-regulators.dtsi"
+#include "sun5i-a13.dtsi"
+#include "sunxi-common-regulators.dtsi"
 
 / {
 	model = "Olimex A13-Olinuxino";
arch/arm/boot/dts/sun5i-a13.dtsi +1 -1
index c35217ea1f64..c46549244786 100644
@@ -11,7 +11,7 @@
  * http://www.gnu.org/copyleft/gpl.html
  */
 
-/include/ "skeleton.dtsi"
+#include "skeleton.dtsi"
 
 / {
 	interrupt-parent = <&intc>;
arch/arm/boot/dts/sun6i-a31-app4-evb1.dts +2 -2
index c74a63a39531..42a11f4795f7 100644
@@ -48,8 +48,8 @@
  */
 
 /dts-v1/;
-/include/ "sun6i-a31.dtsi"
-/include/ "sunxi-common-regulators.dtsi"
+#include "sun6i-a31.dtsi"
+#include "sunxi-common-regulators.dtsi"
 
 / {
 	model = "Allwinner A31 APP4 EVB1 Evaluation Board";
arch/arm/boot/dts/sun6i-a31-colombus.dts +2 -2
index c36b4dc89c13..2e5bcaf6e860 100644
@@ -48,8 +48,8 @@
  */
 
 /dts-v1/;
-/include/ "sun6i-a31.dtsi"
-/include/ "sunxi-common-regulators.dtsi"
+#include "sun6i-a31.dtsi"
+#include "sunxi-common-regulators.dtsi"
 
 / {
 	model = "WITS A31 Colombus Evaluation Board";
arch/arm/boot/dts/sun6i-a31-hummingbird.dts +2 -2
index 55a367ac2a0a..a3bf20930d50 100644
@@ -48,8 +48,8 @@
  */
 
 /dts-v1/;
-/include/ "sun6i-a31.dtsi"
-/include/ "sunxi-common-regulators.dtsi"
+#include "sun6i-a31.dtsi"
+#include "sunxi-common-regulators.dtsi"
 
 / {
 	model = "Merrii A31 Hummingbird";
arch/arm/boot/dts/sun6i-a31-m9.dts +2 -2
index 3ab544f3af4a..9b47964dcc5a 100644
@@ -46,8 +46,8 @@
  */
 
 /dts-v1/;
-/include/ "sun6i-a31.dtsi"
-/include/ "sunxi-common-regulators.dtsi"
+#include "sun6i-a31.dtsi"
+#include "sunxi-common-regulators.dtsi"
 
 / {
 	model = "Mele M9 / A1000G Quad top set box";
arch/arm/boot/dts/sun6i-a31.dtsi +1 -1
index 0332d1c8b308..9c34e92ade87 100644
@@ -47,7 +47,7 @@
  *     OTHER DEALINGS IN THE SOFTWARE.
  */
 
-/include/ "skeleton.dtsi"
+#include "skeleton.dtsi"
 
 / {
 	interrupt-parent = <&gic>;
arch/arm/boot/dts/sun7i-a20-bananapi.dts +2 -2
index 1cf1214cc068..e9e96584bedd 100644
@@ -48,8 +48,8 @@
  */
 
 /dts-v1/;
-/include/ "sun7i-a20.dtsi"
-/include/ "sunxi-common-regulators.dtsi"
+#include "sun7i-a20.dtsi"
+#include "sunxi-common-regulators.dtsi"
 
 / {
 	model = "LeMaker Banana Pi";
arch/arm/boot/dts/sun7i-a20-cubieboard2.dts +2 -2
index 53680983461a..809d448ecf30 100644
@@ -12,8 +12,8 @@
  */
 
 /dts-v1/;
-/include/ "sun7i-a20.dtsi"
-/include/ "sunxi-common-regulators.dtsi"
+#include "sun7i-a20.dtsi"
+#include "sunxi-common-regulators.dtsi"
 
 / {
 	model = "Cubietech Cubieboard2";
arch/arm/boot/dts/sun7i-a20-cubietruck.dts +2 -2
index a281d259b9b8..9812a3a34831 100644
@@ -12,8 +12,8 @@
  */
 
 /dts-v1/;
-/include/ "sun7i-a20.dtsi"
-/include/ "sunxi-common-regulators.dtsi"
+#include "sun7i-a20.dtsi"
+#include "sunxi-common-regulators.dtsi"
 
 / {
 	model = "Cubietech Cubietruck";
arch/arm/boot/dts/sun7i-a20-hummingbird.dts +2 -2
index 0e4bfa3b2b85..add6d95a0246 100644
@@ -12,8 +12,8 @@
  */
 
 /dts-v1/;
-/include/ "sun7i-a20.dtsi"
-/include/ "sunxi-common-regulators.dtsi"
+#include "sun7i-a20.dtsi"
+#include "sunxi-common-regulators.dtsi"
 
 / {
 	model = "Merrii A20 Hummingbird";
arch/arm/boot/dts/sun7i-a20-i12-tvbox.dts +2 -2
index f38bb1a6656c..780f1aa98429 100644
@@ -46,8 +46,8 @@
  */
 
 /dts-v1/;
-/include/ "sun7i-a20.dtsi"
-/include/ "sunxi-common-regulators.dtsi"
+#include "sun7i-a20.dtsi"
+#include "sunxi-common-regulators.dtsi"
 
 / {
 	model = "I12 / Q5 / QT840A A20 tvbox";
arch/arm/boot/dts/sun7i-a20-m3.dts +2 -2
index b8e568c55271..82046234d9e8 100644
@@ -48,8 +48,8 @@
  */
 
 /dts-v1/;
-/include/ "sun7i-a20.dtsi"
-/include/ "sunxi-common-regulators.dtsi"
+#include "sun7i-a20.dtsi"
+#include "sunxi-common-regulators.dtsi"
 
 / {
 	model = "Mele M3";
arch/arm/boot/dts/sun7i-a20-olinuxino-lime.dts +2 -2
index 3f3ff9693992..996da8be0e44 100644
@@ -49,8 +49,8 @@
  */
 
 /dts-v1/;
-/include/ "sun7i-a20.dtsi"
-/include/ "sunxi-common-regulators.dtsi"
+#include "sun7i-a20.dtsi"
+#include "sunxi-common-regulators.dtsi"
 
 / {
 	model = "Olimex A20-OLinuXino-LIME";
arch/arm/boot/dts/sun7i-a20-olinuxino-lime2.dts +2 -2
index ed364d5e755e..5fda1e02acdb 100644
@@ -46,8 +46,8 @@
  */
 
 /dts-v1/;
-/include/ "sun7i-a20.dtsi"
-/include/ "sunxi-common-regulators.dtsi"
+#include "sun7i-a20.dtsi"
+#include "sunxi-common-regulators.dtsi"
 
 / {
 	model = "Olimex A20-OLinuXino-LIME2";
arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts +2 -2
index 9d669cdf031d..7ed510fe1872 100644
@@ -12,8 +12,8 @@
  */
 
 /dts-v1/;
-/include/ "sun7i-a20.dtsi"
-/include/ "sunxi-common-regulators.dtsi"
+#include "sun7i-a20.dtsi"
+#include "sunxi-common-regulators.dtsi"
 
 / {
 	model = "Olimex A20-Olinuxino Micro";
arch/arm/boot/dts/sun7i-a20-pcduino3.dts +2 -2
index 8dca49b2477b..2a9b610931c0 100644
@@ -47,8 +47,8 @@
  */
 
 /dts-v1/;
-/include/ "sun7i-a20.dtsi"
-/include/ "sunxi-common-regulators.dtsi"
+#include "sun7i-a20.dtsi"
+#include "sunxi-common-regulators.dtsi"
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
 
arch/arm/boot/dts/sun7i-a20.dtsi +1 -1
index e21ce5992d56..db45d85640ca 100644
@@ -47,7 +47,7 @@
  *     OTHER DEALINGS IN THE SOFTWARE.
  */
 
-/include/ "skeleton.dtsi"
+#include "skeleton.dtsi"
 
 / {
 	interrupt-parent = <&gic>;
arch/arm/boot/dts/sun8i-a23-ippo-q8h-v5.dts +2 -2
index 7f2117ce6985..491cd6ca4e31 100644
@@ -48,8 +48,8 @@
  */
 
 /dts-v1/;
-/include/ "sun8i-a23.dtsi"
-/include/ "sunxi-common-regulators.dtsi"
+#include "sun8i-a23.dtsi"
+#include "sunxi-common-regulators.dtsi"
 
 / {
 	model = "Ippo Q8H Dual Core Tablet (v5)";
arch/arm/boot/dts/sun8i-a23.dtsi +1 -1
index 2fcccf0cbcee..30ba73285680 100644
@@ -47,7 +47,7 @@
  *     OTHER DEALINGS IN THE SOFTWARE.
  */
 
-/include/ "skeleton.dtsi"
+#include "skeleton.dtsi"
 
 / {
 	interrupt-parent = <&gic>;
arch/arm/boot/dts/sun9i-a80-optimus.dts +1 -1
index 506948f582ee..7fe242a8134b 100644
@@ -48,7 +48,7 @@
  */
 
 /dts-v1/;
-/include/ "sun9i-a80.dtsi"
+#include "sun9i-a80.dtsi"
 
 / {
 	model = "Merrii A80 Optimus Board";
arch/arm/boot/dts/sun9i-a80.dtsi +1 -1
index 494714f67b57..90d0450850e9 100644
@@ -47,7 +47,7 @@
  *     OTHER DEALINGS IN THE SOFTWARE.
  */
 
-/include/ "skeleton64.dtsi"
+#include "skeleton64.dtsi"
 
 / {
 	interrupt-parent = <&gic>;
Signature · 1 line
2.2.0
#1 lore raw

PATCH 1/6 ARM: sunxi: DT: Convert to device tree includes

Quoted 3 lines · Maxime Ripard

Prepare the device trees to use the C preprocessor.

Applied all these patches

Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150106/616e119e/attachment-0001.sig>
#2 lore raw

PATCH 2/6 ARM: sunxi: DT: convert DTs to use common GPIOs includes

In reply to Maxime Ripard

Replace the various raw GPIO flags by their definition in the common dt-bindings header.

---
 arch/arm/boot/dts/sun4i-a10-a1000.dts            | 10 ++++++----
 arch/arm/boot/dts/sun4i-a10-ba10-tvbox.dts       |  6 ++++--
 arch/arm/boot/dts/sun4i-a10-cubieboard.dts       |  8 +++++---
 arch/arm/boot/dts/sun4i-a10-hackberry.dts        |  8 +++++---
 arch/arm/boot/dts/sun4i-a10-inet97fv2.dts        |  4 +++-
 arch/arm/boot/dts/sun4i-a10-mini-xplus.dts       |  4 +++-
 arch/arm/boot/dts/sun4i-a10-olinuxino-lime.dts   |  8 +++++---
 arch/arm/boot/dts/sun4i-a10-pcduino.dts          |  4 +++-
 arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts | 10 ++++++----
 arch/arm/boot/dts/sun5i-a10s-r7-tv-dongle.dts    |  8 +++++---
 arch/arm/boot/dts/sun5i-a13-hsg-h702.dts         |  4 +++-
 arch/arm/boot/dts/sun5i-a13-olinuxino-micro.dts  |  8 +++++---
 arch/arm/boot/dts/sun5i-a13-olinuxino.dts        |  8 +++++---
 arch/arm/boot/dts/sun6i-a31-app4-evb1.dts        |  4 +++-
 arch/arm/boot/dts/sun6i-a31-colombus.dts         |  6 ++++--
 arch/arm/boot/dts/sun6i-a31-hummingbird.dts      |  8 +++++---
 arch/arm/boot/dts/sun6i-a31-m9.dts               |  8 +++++---
 arch/arm/boot/dts/sun7i-a20-bananapi.dts         |  8 +++++---
 arch/arm/boot/dts/sun7i-a20-cubieboard2.dts      |  8 +++++---
 arch/arm/boot/dts/sun7i-a20-cubietruck.dts       | 18 ++++++++++--------
 arch/arm/boot/dts/sun7i-a20-hummingbird.dts      | 14 ++++++++------
 arch/arm/boot/dts/sun7i-a20-i12-tvbox.dts        | 14 ++++++++------
 arch/arm/boot/dts/sun7i-a20-m3.dts               |  6 ++++--
 arch/arm/boot/dts/sun7i-a20-olinuxino-lime.dts   |  8 +++++---
 arch/arm/boot/dts/sun7i-a20-olinuxino-lime2.dts  |  8 +++++---
 arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts  |  8 +++++---
 arch/arm/boot/dts/sun7i-a20-pcduino3.dts         |  4 ++--
 arch/arm/boot/dts/sun8i-a23-ippo-q8h-v5.dts      |  4 +++-
 arch/arm/boot/dts/sun9i-a80-optimus.dts          |  6 ++++--
 arch/arm/boot/dts/sunxi-common-regulators.dtsi   | 10 ++++++----
 30 files changed, 145 insertions(+), 87 deletions(-)
arch/arm/boot/dts/sun4i-a10-a1000.dts +6 -4
index 3bb636978582..532ab3bd9735 100644
@@ -51,6 +51,8 @@
 #include "sun4i-a10.dtsi"
 #include "sunxi-common-regulators.dtsi"
 
+#include <dt-bindings/gpio/gpio.h>
+
 / {
 	model = "Mele A1000";
 	compatible = "mele,a1000", "allwinner,sun4i-a10";
@@ -77,7 +79,7 @@
 			pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
 			vmmc-supply = <&reg_vcc3v3>;
 			bus-width = <4>;
-			cd-gpios = <&pio 7 1 0>; /* PH1 */
+			cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
 			cd-inverted;
 			status = "okay";
 		};
@@ -159,12 +161,12 @@
 
 		red {
 			label = "a1000:red:usr";
-			gpios = <&pio 7 10 0>;
+			gpios = <&pio 7 10 GPIO_ACTIVE_HIGH>;
 		};
 
 		blue {
 			label = "a1000:blue:usr";
-			gpios = <&pio 7 20 0>;
+			gpios = <&pio 7 20 GPIO_ACTIVE_HIGH>;
 		};
 	};
 
@@ -176,7 +178,7 @@
 		regulator-min-microvolt = <3300000>;
 		regulator-max-microvolt = <3300000>;
 		enable-active-high;
-		gpio = <&pio 7 15 0>;
+		gpio = <&pio 7 15 GPIO_ACTIVE_HIGH>;
 	};
 
 	reg_usb1_vbus: usb1-vbus {
arch/arm/boot/dts/sun4i-a10-ba10-tvbox.dts +4 -2
index b2b45c4f7915..490b77c9bb36 100644
@@ -49,6 +49,8 @@
 #include "sun4i-a10.dtsi"
 #include "sunxi-common-regulators.dtsi"
 
+#include <dt-bindings/gpio/gpio.h>
+
 / {
 	model = "BA10 tvbox";
 	compatible = "allwinner,ba10-tvbox", "allwinner,sun4i-a10";
@@ -74,7 +76,7 @@
 			pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
 			vmmc-supply = <&reg_vcc3v3>;
 			bus-width = <4>;
-			cd-gpios = <&pio 7 1 0>; /* PH1 */
+			cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
 			cd-inverted;
 			status = "okay";
 		};
@@ -140,7 +142,7 @@
 	};
 
 	reg_usb2_vbus: usb2-vbus {
-		gpio = <&pio 7 12 0>;
+		gpio = <&pio 7 12 GPIO_ACTIVE_HIGH>;
 		status = "okay";
 	};
 };
arch/arm/boot/dts/sun4i-a10-cubieboard.dts +5 -3
index c5691a8666c5..abc3c06677d2 100644
@@ -50,6 +50,8 @@
 #include "sun4i-a10.dtsi"
 #include "sunxi-common-regulators.dtsi"
 
+#include <dt-bindings/gpio/gpio.h>
+
 / {
 	model = "Cubietech Cubieboard";
 	compatible = "cubietech,a10-cubieboard", "allwinner,sun4i-a10";
@@ -75,7 +77,7 @@
 			pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
 			vmmc-supply = <&reg_vcc3v3>;
 			bus-width = <4>;
-			cd-gpios = <&pio 7 1 0>; /* PH1 */
+			cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
 			cd-inverted;
 			status = "okay";
 		};
@@ -157,12 +159,12 @@
 
 		blue {
 			label = "cubieboard:blue:usr";
-			gpios = <&pio 7 21 0>; /* LED1 */
+			gpios = <&pio 7 21 GPIO_ACTIVE_HIGH>; /* LED1 */
 		};
 
 		green {
 			label = "cubieboard:green:usr";
-			gpios = <&pio 7 20 0>; /* LED2 */
+			gpios = <&pio 7 20 GPIO_ACTIVE_HIGH>; /* LED2 */
 			linux,default-trigger = "heartbeat";
 		};
 	};
arch/arm/boot/dts/sun4i-a10-hackberry.dts +5 -3
index 0c6c81a6b61b..be1f29e50811 100644
@@ -51,6 +51,8 @@
 #include "sun4i-a10.dtsi"
 #include "sunxi-common-regulators.dtsi"
 
+#include <dt-bindings/gpio/gpio.h>
+
 / {
 	model = "Miniand Hackberry";
 	compatible = "miniand,hackberry", "allwinner,sun4i-a10";
@@ -77,7 +79,7 @@
 			pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
 			vmmc-supply = <&reg_vcc3v3>;
 			bus-width = <4>;
-			cd-gpios = <&pio 7 1 0>; /* PH1 */
+			cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
 			cd-inverted;
 			status = "okay";
 		};
@@ -157,7 +159,7 @@
 		regulator-min-microvolt = <3300000>;
 		regulator-max-microvolt = <3300000>;
 		enable-active-high;
-		gpio = <&pio 7 19 0>;
+		gpio = <&pio 7 19 GPIO_ACTIVE_HIGH>;
 	};
 
 	reg_usb1_vbus: usb1-vbus {
@@ -166,7 +168,7 @@
 
 	reg_usb2_vbus: usb2-vbus {
 		pinctrl-0 = <&usb2_vbus_pin_hackberry>;
-		gpio = <&pio 7 12 0>;
+		gpio = <&pio 7 12 GPIO_ACTIVE_HIGH>;
 		status = "okay";
 	};
 };
arch/arm/boot/dts/sun4i-a10-inet97fv2.dts +3 -1
index 5980ad0e69e3..482914333bba 100644
@@ -51,6 +51,8 @@
 #include "sun4i-a10.dtsi"
 #include "sunxi-common-regulators.dtsi"
 
+#include <dt-bindings/gpio/gpio.h>
+
 / {
 	model = "INet-97F Rev 02";
 	compatible = "primux,inet97fv2", "allwinner,sun4i-a10";
@@ -65,7 +67,7 @@
 			pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
 			vmmc-supply = <&reg_vcc3v3>;
 			bus-width = <4>;
-			cd-gpios = <&pio 7 1 0>; /* PH1 */
+			cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
 			cd-inverted;
 			status = "okay";
 		};
arch/arm/boot/dts/sun4i-a10-mini-xplus.dts +3 -1
index e55639988e5d..1db02eb3796c 100644
@@ -51,6 +51,8 @@
 #include "sun4i-a10.dtsi"
 #include "sunxi-common-regulators.dtsi"
 
+#include <dt-bindings/gpio/gpio.h>
+
 / {
 	model = "PineRiver Mini X-Plus";
 	compatible = "pineriver,mini-xplus", "allwinner,sun4i-a10";
@@ -61,7 +63,7 @@
 			pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
 			vmmc-supply = <&reg_vcc3v3>;
 			bus-width = <4>;
-			cd-gpios = <&pio 7 1 0>; /* PH1 */
+			cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
 			cd-inverted;
 			status = "okay";
 		};
arch/arm/boot/dts/sun4i-a10-olinuxino-lime.dts +5 -3
index 3f607946abad..5d9b86839f16 100644
@@ -49,6 +49,8 @@
 #include "sun4i-a10.dtsi"
 #include "sunxi-common-regulators.dtsi"
 
+#include <dt-bindings/gpio/gpio.h>
+
 / {
 	model = "Olimex A10-OLinuXino-LIME";
 	compatible = "olimex,a10-olinuxino-lime", "allwinner,sun4i-a10";
@@ -74,7 +76,7 @@
 			pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
 			vmmc-supply = <&reg_vcc3v3>;
 			bus-width = <4>;
-			cd-gpios = <&pio 7 1 0>; /* PH1 */
+			cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
 			cd-inverted;
 			status = "okay";
 		};
@@ -151,14 +153,14 @@
 
 		green {
 			label = "a10-olinuxino-lime:green:usr";
-			gpios = <&pio 7 2 0>;
+			gpios = <&pio 7 2 GPIO_ACTIVE_HIGH>;
 			default-state = "on";
 		};
 	};
 
 	reg_ahci_5v: ahci-5v {
 		pinctrl-0 = <&ahci_pwr_pin_olinuxinolime>;
-		gpio = <&pio 2 3 0>;
+		gpio = <&pio 2 3 GPIO_ACTIVE_HIGH>;
 		status = "okay";
 	};
 
arch/arm/boot/dts/sun4i-a10-pcduino.dts +3 -1
index 7367eff79dea..48161adfb32c 100644
@@ -50,6 +50,8 @@
 #include "sun4i-a10.dtsi"
 #include "sunxi-common-regulators.dtsi"
 
+#include <dt-bindings/gpio/gpio.h>
+
 / {
 	model = "LinkSprite pcDuino";
 	compatible = "linksprite,a10-pcduino", "allwinner,sun4i-a10";
@@ -75,7 +77,7 @@
 			pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
 			vmmc-supply = <&reg_vcc3v3>;
 			bus-width = <4>;
-			cd-gpios = <&pio 7 1 0>; /* PH1 */
+			cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
 			cd-inverted;
 			status = "okay";
 		};
arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts +6 -4
index 29a47dd4bad5..ab9b6c24efeb 100644
@@ -51,6 +51,8 @@
 #include "sun5i-a10s.dtsi"
 #include "sunxi-common-regulators.dtsi"
 
+#include <dt-bindings/gpio/gpio.h>
+
 / {
 	model = "Olimex A10s-Olinuxino Micro";
 	compatible = "olimex,a10s-olinuxino-micro", "allwinner,sun5i-a10s";
@@ -76,7 +78,7 @@
 			pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_olinuxino_micro>;
 			vmmc-supply = <&reg_vcc3v3>;
 			bus-width = <4>;
-			cd-gpios = <&pio 6 1 0>; /* PG1 */
+			cd-gpios = <&pio 6 1 GPIO_ACTIVE_HIGH>; /* PG1 */
 			cd-inverted;
 			status = "okay";
 		};
@@ -86,7 +88,7 @@
 			pinctrl-0 = <&mmc1_pins_a>, <&mmc1_cd_pin_olinuxino_micro>;
 			vmmc-supply = <&reg_vcc3v3>;
 			bus-width = <4>;
-			cd-gpios = <&pio 6 13 0>; /* PG13 */
+			cd-gpios = <&pio 6 13 GPIO_ACTIVE_HIGH>; /* PG13 */
 			cd-inverted;
 			status = "okay";
 		};
@@ -185,14 +187,14 @@
 
 		green {
 			label = "a10s-olinuxino-micro:green:usr";
-			gpios = <&pio 4 3 0>;
+			gpios = <&pio 4 3 GPIO_ACTIVE_HIGH>;
 			default-state = "on";
 		};
 	};
 
 	reg_usb1_vbus: usb1-vbus {
 		pinctrl-0 = <&usb1_vbus_pin_olinuxino_m>;
-		gpio = <&pio 1 10 0>;
+		gpio = <&pio 1 10 GPIO_ACTIVE_HIGH>;
 		status = "okay";
 	};
 };
arch/arm/boot/dts/sun5i-a10s-r7-tv-dongle.dts +5 -3
index 3a0d9dc39914..da2d2535b1bc 100644
@@ -49,6 +49,8 @@
 #include "sun5i-a10s.dtsi"
 #include "sunxi-common-regulators.dtsi"
 
+#include <dt-bindings/gpio/gpio.h>
+
 / {
 	model = "R7 A10s hdmi tv-stick";
 	compatible = "allwinner,r7-tv-dongle", "allwinner,sun5i-a10s";
@@ -59,7 +61,7 @@
 			pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_r7>;
 			vmmc-supply = <&reg_vcc3v3>;
 			bus-width = <4>;
-			cd-gpios = <&pio 6 1 0>; /* PG1 */
+			cd-gpios = <&pio 6 1 GPIO_ACTIVE_HIGH>; /* PG1 */
 			cd-inverted;
 			status = "okay";
 		};
@@ -123,14 +125,14 @@
 
 		green {
 			label = "r7-tv-dongle:green:usr";
-			gpios = <&pio 1 2 0>;
+			gpios = <&pio 1 2 GPIO_ACTIVE_HIGH>;
 			default-state = "on";
 		};
 	};
 
 	reg_usb1_vbus: usb1-vbus {
 		pinctrl-0 = <&usb1_vbus_pin_r7>;
-		gpio = <&pio 6 13 0>;
+		gpio = <&pio 6 13 GPIO_ACTIVE_HIGH>;
 		status = "okay";
 	};
 };
arch/arm/boot/dts/sun5i-a13-hsg-h702.dts +3 -1
index ca6b6dd30e47..bccc1bcaa868 100644
@@ -49,6 +49,8 @@
 #include "sun5i-a13.dtsi"
 #include "sunxi-common-regulators.dtsi"
 
+#include <dt-bindings/gpio/gpio.h>
+
 / {
 	model = "HSG H702";
 	compatible = "hsg,h702", "allwinner,sun5i-a13";
@@ -59,7 +61,7 @@
 			pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_h702>;
 			vmmc-supply = <&reg_vcc3v3>;
 			bus-width = <4>;
-			cd-gpios = <&pio 6 0 0>; /* PG0 */
+			cd-gpios = <&pio 6 0 GPIO_ACTIVE_HIGH>; /* PG0 */
 			cd-inverted;
 			status = "okay";
 		};
arch/arm/boot/dts/sun5i-a13-olinuxino-micro.dts +5 -3
index 729f02daf605..c30180794c54 100644
@@ -50,6 +50,8 @@
 #include "sun5i-a13.dtsi"
 #include "sunxi-common-regulators.dtsi"
 
+#include <dt-bindings/gpio/gpio.h>
+
 / {
 	model = "Olimex A13-Olinuxino Micro";
 	compatible = "olimex,a13-olinuxino-micro", "allwinner,sun5i-a13";
@@ -60,7 +62,7 @@
 			pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_olinuxinom>;
 			vmmc-supply = <&reg_vcc3v3>;
 			bus-width = <4>;
-			cd-gpios = <&pio 6 0 0>; /* PG0 */
+			cd-gpios = <&pio 6 0 GPIO_ACTIVE_HIGH>; /* PG0 */
 			cd-inverted;
 			status = "okay";
 		};
@@ -133,14 +135,14 @@
 
 		power {
 			label = "a13-olinuxino-micro:green:power";
-			gpios = <&pio 6 9 0>;
+			gpios = <&pio 6 9 GPIO_ACTIVE_HIGH>;
 			default-state = "on";
 		};
 	};
 
 	reg_usb1_vbus: usb1-vbus {
 		pinctrl-0 = <&usb1_vbus_pin_olinuxinom>;
-		gpio = <&pio 6 11 0>;
+		gpio = <&pio 6 11 GPIO_ACTIVE_HIGH>;
 		status = "okay";
 	};
 };
arch/arm/boot/dts/sun5i-a13-olinuxino.dts +5 -3
index 0e9e17dcc936..c2f6288083ae 100644
@@ -51,6 +51,8 @@
 #include "sun5i-a13.dtsi"
 #include "sunxi-common-regulators.dtsi"
 
+#include <dt-bindings/gpio/gpio.h>
+
 / {
 	model = "Olimex A13-Olinuxino";
 	compatible = "olimex,a13-olinuxino", "allwinner,sun5i-a13";
@@ -61,7 +63,7 @@
 			pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_olinuxino>;
 			vmmc-supply = <&reg_vcc3v3>;
 			bus-width = <4>;
-			cd-gpios = <&pio 6 0 0>; /* PG0 */
+			cd-gpios = <&pio 6 0 GPIO_ACTIVE_HIGH>; /* PG0 */
 			cd-inverted;
 			status = "okay";
 		};
@@ -133,14 +135,14 @@
 		pinctrl-0 = <&led_pins_olinuxino>;
 
 		power {
-			gpios = <&pio 6 9 0>;
+			gpios = <&pio 6 9 GPIO_ACTIVE_HIGH>;
 			default-state = "on";
 		};
 	};
 
 	reg_usb1_vbus: usb1-vbus {
 		pinctrl-0 = <&usb1_vbus_pin_olinuxino>;
-		gpio = <&pio 6 11 0>;
+		gpio = <&pio 6 11 GPIO_ACTIVE_HIGH>;
 		status = "okay";
 	};
 };
arch/arm/boot/dts/sun6i-a31-app4-evb1.dts +3 -1
index 42a11f4795f7..0d86e8cb2ca2 100644
@@ -51,6 +51,8 @@
 #include "sun6i-a31.dtsi"
 #include "sunxi-common-regulators.dtsi"
 
+#include <dt-bindings/gpio/gpio.h>
+
 / {
 	model = "Allwinner A31 APP4 EVB1 Evaluation Board";
 	compatible = "allwinner,app4-evb1", "allwinner,sun6i-a31";
@@ -87,7 +89,7 @@
 
 	reg_usb1_vbus: usb1-vbus {
 		pinctrl-0 = <&usb1_vbus_pin_a>;
-		gpio = <&pio 7 27 0>;
+		gpio = <&pio 7 27 GPIO_ACTIVE_HIGH>;
 		status = "okay";
 	};
 };
arch/arm/boot/dts/sun6i-a31-colombus.dts +4 -2
index 2e5bcaf6e860..deab8f357ad7 100644
@@ -51,6 +51,8 @@
 #include "sun6i-a31.dtsi"
 #include "sunxi-common-regulators.dtsi"
 
+#include <dt-bindings/gpio/gpio.h>
+
 / {
 	model = "WITS A31 Colombus Evaluation Board";
 	compatible = "wits,colombus", "allwinner,sun6i-a31";
@@ -65,7 +67,7 @@
 			pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_colombus>;
 			vmmc-supply = <&reg_vcc3v0>;
 			bus-width = <4>;
-			cd-gpios = <&pio 0 8 0>; /* PA8 */
+			cd-gpios = <&pio 0 8 GPIO_ACTIVE_HIGH>; /* PA8 */
 			cd-inverted;
 			status = "okay";
 		};
@@ -127,7 +129,7 @@
 	reg_usb2_vbus: usb2-vbus {
 		pinctrl-names = "default";
 		pinctrl-0 = <&usb2_vbus_pin_colombus>;
-		gpio = <&pio 7 24 0>;
+		gpio = <&pio 7 24 GPIO_ACTIVE_HIGH>;
 		status = "okay";
 	};
 };
arch/arm/boot/dts/sun6i-a31-hummingbird.dts +5 -3
index a3bf20930d50..7364d22b33dd 100644
@@ -51,6 +51,8 @@
 #include "sun6i-a31.dtsi"
 #include "sunxi-common-regulators.dtsi"
 
+#include <dt-bindings/gpio/gpio.h>
+
 / {
 	model = "Merrii A31 Hummingbird";
 	compatible = "merrii,a31-hummingbird", "allwinner,sun6i-a31";
@@ -65,7 +67,7 @@
 			pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_hummingbird>;
 			vmmc-supply = <&reg_vcc3v0>;
 			bus-width = <4>;
-			cd-gpios = <&pio 0 8 0>; /* PA8 */
+			cd-gpios = <&pio 0 8 GPIO_ACTIVE_HIGH>; /* PA8 */
 			cd-inverted;
 			status = "okay";
 		};
@@ -139,7 +141,7 @@
 			pinctrl-0 = <&gmac_pins_rgmii_a>;
 			phy = <&phy1>;
 			phy-mode = "rgmii";
-			snps,reset-gpio = <&pio 0 21 0>;
+			snps,reset-gpio = <&pio 0 21 GPIO_ACTIVE_HIGH>;
 			snps,reset-active-low;
 			snps,reset-delays-us = <0 10000 30000>;
 			status = "okay";
@@ -152,7 +154,7 @@
 
 	reg_usb1_vbus: usb1-vbus {
 		pinctrl-0 = <&usb1_vbus_pin_a>;
-		gpio = <&pio 7 24 0>; /* PH24 */
+		gpio = <&pio 7 24 GPIO_ACTIVE_HIGH>; /* PH24 */
 		status = "okay";
 	};
 };
arch/arm/boot/dts/sun6i-a31-m9.dts +5 -3
index 9b47964dcc5a..799040627ab7 100644
@@ -49,6 +49,8 @@
 #include "sun6i-a31.dtsi"
 #include "sunxi-common-regulators.dtsi"
 
+#include <dt-bindings/gpio/gpio.h>
+
 / {
 	model = "Mele M9 / A1000G Quad top set box";
 	compatible = "mele,m9", "allwinner,sun6i-a31";
@@ -63,7 +65,7 @@
 			pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_m9>;
 			vmmc-supply = <&reg_vcc3v3>;
 			bus-width = <4>;
-			cd-gpios = <&pio 7 22 0>; /* PH22 */
+			cd-gpios = <&pio 7 22 GPIO_ACTIVE_HIGH>; /* PH22 */
 			cd-inverted;
 			status = "okay";
 		};
@@ -130,14 +132,14 @@
 
 		blue {
 			label = "m9:blue:usr";
-			gpios = <&pio 7 13 0>;
+			gpios = <&pio 7 13 GPIO_ACTIVE_HIGH>;
 		};
 	};
 
 	reg_usb1_vbus: usb1-vbus {
 		pinctrl-names = "default";
 		pinctrl-0 = <&usb1_vbus_pin_m9>;
-		gpio = <&pio 2 27 0>;
+		gpio = <&pio 2 27 GPIO_ACTIVE_HIGH>;
 		status = "okay";
 	};
 };
arch/arm/boot/dts/sun7i-a20-bananapi.dts +5 -3
index e9e96584bedd..e273f0e0627a 100644
@@ -51,6 +51,8 @@
 #include "sun7i-a20.dtsi"
 #include "sunxi-common-regulators.dtsi"
 
+#include <dt-bindings/gpio/gpio.h>
+
 / {
 	model = "LeMaker Banana Pi";
 	compatible = "lemaker,bananapi", "allwinner,sun7i-a20";
@@ -67,7 +69,7 @@
 			pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_bananapi>;
 			vmmc-supply = <&reg_vcc3v3>;
 			bus-width = <4>;
-			cd-gpios = <&pio 7 10 0>; /* PH10 */
+			cd-gpios = <&pio 7 10 GPIO_ACTIVE_HIGH>; /* PH10 */
 			cd-inverted;
 			status = "okay";
 		};
@@ -188,7 +190,7 @@
 
 		green {
 			label = "bananapi:green:usr";
-			gpios = <&pio 7 24 0>;
+			gpios = <&pio 7 24 GPIO_ACTIVE_HIGH>;
 		};
 	};
 
@@ -209,6 +211,6 @@
 		regulator-max-microvolt = <3300000>;
 		startup-delay-us = <100000>;
 		enable-active-high;
-		gpio = <&pio 7 23 0>;
+		gpio = <&pio 7 23 GPIO_ACTIVE_HIGH>;
 	};
 };
arch/arm/boot/dts/sun7i-a20-cubieboard2.dts +5 -3
index 809d448ecf30..27ca1a16ca91 100644
@@ -15,6 +15,8 @@
 #include "sun7i-a20.dtsi"
 #include "sunxi-common-regulators.dtsi"
 
+#include <dt-bindings/gpio/gpio.h>
+
 / {
 	model = "Cubietech Cubieboard2";
 	compatible = "cubietech,cubieboard2", "allwinner,sun7i-a20";
@@ -25,7 +27,7 @@
 			pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
 			vmmc-supply = <&reg_vcc3v3>;
 			bus-width = <4>;
-			cd-gpios = <&pio 7 1 0>; /* PH1 */
+			cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
 			cd-inverted;
 			status = "okay";
 		};
@@ -120,12 +122,12 @@
 
 		blue {
 			label = "cubieboard2:blue:usr";
-			gpios = <&pio 7 21 0>;
+			gpios = <&pio 7 21 GPIO_ACTIVE_HIGH>;
 		};
 
 		green {
 			label = "cubieboard2:green:usr";
-			gpios = <&pio 7 20 0>;
+			gpios = <&pio 7 20 GPIO_ACTIVE_HIGH>;
 		};
 	};
 
arch/arm/boot/dts/sun7i-a20-cubietruck.dts +10 -8
index 9812a3a34831..a6e88f8ce533 100644
@@ -15,6 +15,8 @@
 #include "sun7i-a20.dtsi"
 #include "sunxi-common-regulators.dtsi"
 
+#include <dt-bindings/gpio/gpio.h>
+
 / {
 	model = "Cubietech Cubietruck";
 	compatible = "cubietech,cubietruck", "allwinner,sun7i-a20";
@@ -25,7 +27,7 @@
 			pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
 			vmmc-supply = <&reg_vcc3v3>;
 			bus-width = <4>;
-			cd-gpios = <&pio 7 1 0>; /* PH1 */
+			cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
 			cd-inverted;
 			status = "okay";
 		};
@@ -168,34 +170,34 @@
 
 		blue {
 			label = "cubietruck:blue:usr";
-			gpios = <&pio 7 21 0>;
+			gpios = <&pio 7 21 GPIO_ACTIVE_HIGH>;
 		};
 
 		orange {
 			label = "cubietruck:orange:usr";
-			gpios = <&pio 7 20 0>;
+			gpios = <&pio 7 20 GPIO_ACTIVE_HIGH>;
 		};
 
 		white {
 			label = "cubietruck:white:usr";
-			gpios = <&pio 7 11 0>;
+			gpios = <&pio 7 11 GPIO_ACTIVE_HIGH>;
 		};
 
 		green {
 			label = "cubietruck:green:usr";
-			gpios = <&pio 7 7 0>;
+			gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>;
 		};
 	};
 
 	reg_ahci_5v: ahci-5v {
 		pinctrl-0 = <&ahci_pwr_pin_cubietruck>;
-		gpio = <&pio 7 12 0>;
+		gpio = <&pio 7 12 GPIO_ACTIVE_HIGH>;
 		status = "okay";
 	};
 
 	reg_usb0_vbus: usb0-vbus {
 		pinctrl-0 = <&usb0_vbus_pin_a>;
-		gpio = <&pio 7 17 0>;
+		gpio = <&pio 7 17 GPIO_ACTIVE_HIGH>;
 		status = "okay";
 	};
 
@@ -215,6 +217,6 @@
 		regulator-min-microvolt = <3300000>;
 		regulator-max-microvolt = <3300000>;
 		enable-active-high;
-		gpio = <&pio 7 9 0>;
+		gpio = <&pio 7 9 GPIO_ACTIVE_HIGH>;
 	};
 };
arch/arm/boot/dts/sun7i-a20-hummingbird.dts +8 -6
index add6d95a0246..3b8bd22296e6 100644
@@ -15,6 +15,8 @@
 #include "sun7i-a20.dtsi"
 #include "sunxi-common-regulators.dtsi"
 
+#include <dt-bindings/gpio/gpio.h>
+
 / {
 	model = "Merrii A20 Hummingbird";
 	compatible = "merrii,a20-hummingbird", "allwinner,sun7i-a20";
@@ -25,7 +27,7 @@
 			pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
 			vmmc-supply = <&reg_vcc3v0>;
 			bus-width = <4>;
-			cd-gpios = <&pio 7 1 0>; /* PH1 */
+			cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
 			cd-inverted;
 			status = "okay";
 		};
@@ -184,7 +186,7 @@
 			phy-mode = "rgmii";
 			phy-supply = <&reg_gmac_vdd>;
 			/* phy reset config */
-			snps,reset-gpio = <&pio 0 17 0>; /* PA17 */
+			snps,reset-gpio = <&pio 0 17 GPIO_ACTIVE_HIGH>; /* PA17 */
 			snps,reset-active-low;
 			/* wait 1s after reset, otherwise fail to read phy id */
 			snps,reset-delays-us = <0 10000 1000000>;
@@ -198,13 +200,13 @@
 
 	reg_ahci_5v: ahci-5v {
 		pinctrl-0 = <&ahci_pwr_pin_a20_hummingbird>;
-		gpio = <&pio 7 15 0>; /* PH15 */
+		gpio = <&pio 7 15 GPIO_ACTIVE_HIGH>; /* PH15 */
 		status = "okay";
 	};
 
 	reg_usb1_vbus: usb1-vbus {
 		pinctrl-0 = <&usb1_vbus_pin_a20_hummingbird>;
-		gpio = <&pio 7 2 0>; /* PH2 */
+		gpio = <&pio 7 2 GPIO_ACTIVE_HIGH>; /* PH2 */
 		status = "okay";
 	};
 
@@ -220,7 +222,7 @@
 		regulator-min-microvolt = <3000000>;
 		regulator-max-microvolt = <3000000>;
 		enable-active-high;
-		gpio = <&pio 7 9 0>; /* PH9 */
+		gpio = <&pio 7 9 GPIO_ACTIVE_HIGH>; /* PH9 */
 	};
 
 	reg_gmac_vdd: gmac_vdd {
@@ -231,6 +233,6 @@
 		regulator-min-microvolt = <3000000>;
 		regulator-max-microvolt = <3000000>;
 		enable-active-high;
-		gpio = <&pio 7 16 0>; /* PH16 */
+		gpio = <&pio 7 16 GPIO_ACTIVE_HIGH>; /* PH16 */
 	};
 };
arch/arm/boot/dts/sun7i-a20-i12-tvbox.dts +8 -6
index 780f1aa98429..a422f19a0261 100644
@@ -49,6 +49,8 @@
 #include "sun7i-a20.dtsi"
 #include "sunxi-common-regulators.dtsi"
 
+#include <dt-bindings/gpio/gpio.h>
+
 / {
 	model = "I12 / Q5 / QT840A A20 tvbox";
 	compatible = "allwinner,i12-tvbox", "allwinner,sun7i-a20";
@@ -59,7 +61,7 @@
 			pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
 			vmmc-supply = <&reg_vcc3v3>;
 			bus-width = <4>;
-			cd-gpios = <&pio 7 1 0>; /* PH1 */
+			cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
 			cd-inverted;
 			status = "okay";
 		};
@@ -179,12 +181,12 @@
 
 		red {
 			label = "i12_tvbox:red:usr";
-			gpios = <&pio 7 9 1>;
+			gpios = <&pio 7 9 GPIO_ACTIVE_LOW>;
 		};
 
 		blue {
 			label = "i12_tvbox:blue:usr";
-			gpios = <&pio 7 20 0>;
+			gpios = <&pio 7 20 GPIO_ACTIVE_HIGH>;
 		};
 	};
 
@@ -204,7 +206,7 @@
 		regulator-min-microvolt = <3300000>;
 		regulator-max-microvolt = <3300000>;
 		enable-active-high;
-		gpio = <&pio 7 2 0>;
+		gpio = <&pio 7 2 GPIO_ACTIVE_HIGH>;
 	};
 
 	reg_vmmc3_io: vmmc3-io {
@@ -217,7 +219,7 @@
 		/* This controls VCC-PI, must be always on! */
 		regulator-always-on;
 		enable-active-high;
-		gpio = <&pio 7 12 0>;
+		gpio = <&pio 7 12 GPIO_ACTIVE_HIGH>;
 	};
 
 	reg_gmac_3v3: gmac-3v3 {
@@ -229,6 +231,6 @@
 		regulator-max-microvolt = <3300000>;
 		startup-delay-us = <50000>;
 		enable-active-high;
-		gpio = <&pio 7 21 0>;
+		gpio = <&pio 7 21 GPIO_ACTIVE_HIGH>;
 	};
 };
arch/arm/boot/dts/sun7i-a20-m3.dts +4 -2
index 82046234d9e8..3e40ae74f5e2 100644
@@ -51,6 +51,8 @@
 #include "sun7i-a20.dtsi"
 #include "sunxi-common-regulators.dtsi"
 
+#include <dt-bindings/gpio/gpio.h>
+
 / {
 	model = "Mele M3";
 	compatible = "mele,m3", "allwinner,sun7i-a20";
@@ -61,7 +63,7 @@
 			pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
 			vmmc-supply = <&reg_vcc3v3>;
 			bus-width = <4>;
-			cd-gpios = <&pio 7 1 0>; /* PH1 */
+			cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
 			cd-inverted;
 			status = "okay";
 		};
@@ -154,7 +156,7 @@
 
 		blue {
 			label = "m3:blue:usr";
-			gpios = <&pio 7 20 0>;
+			gpios = <&pio 7 20 GPIO_ACTIVE_HIGH>;
 		};
 	};
 
arch/arm/boot/dts/sun7i-a20-olinuxino-lime.dts +5 -3
index 996da8be0e44..0423b1cbb365 100644
@@ -52,6 +52,8 @@
 #include "sun7i-a20.dtsi"
 #include "sunxi-common-regulators.dtsi"
 
+#include <dt-bindings/gpio/gpio.h>
+
 / {
 	model = "Olimex A20-OLinuXino-LIME";
 	compatible = "olimex,a20-olinuxino-lime", "allwinner,sun7i-a20";
@@ -62,7 +64,7 @@
 			pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
 			vmmc-supply = <&reg_vcc3v3>;
 			bus-width = <4>;
-			cd-gpios = <&pio 7 1 0>; /* PH1 */
+			cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
 			cd-inverted;
 			status = "okay";
 		};
@@ -152,14 +154,14 @@
 
 		green {
 			label = "a20-olinuxino-lime:green:usr";
-			gpios = <&pio 7 2 0>;
+			gpios = <&pio 7 2 GPIO_ACTIVE_HIGH>;
 			default-state = "on";
 		};
 	};
 
 	reg_ahci_5v: ahci-5v {
 		pinctrl-0 = <&ahci_pwr_pin_olinuxinolime>;
-		gpio = <&pio 2 3 0>;
+		gpio = <&pio 2 3 GPIO_ACTIVE_HIGH>;
 		status = "okay";
 	};
 
arch/arm/boot/dts/sun7i-a20-olinuxino-lime2.dts +5 -3
index 5fda1e02acdb..ce1e28afa2fe 100644
@@ -49,6 +49,8 @@
 #include "sun7i-a20.dtsi"
 #include "sunxi-common-regulators.dtsi"
 
+#include <dt-bindings/gpio/gpio.h>
+
 / {
 	model = "Olimex A20-OLinuXino-LIME2";
 	compatible = "olimex,a20-olinuxino-lime2", "allwinner,sun7i-a20";
@@ -59,7 +61,7 @@
 			pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
 			vmmc-supply = <&reg_vcc3v3>;
 			bus-width = <4>;
-			cd-gpios = <&pio 7 1 0>; /* PH1 */
+			cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
 			cd-inverted;
 			status = "okay";
 		};
@@ -199,14 +201,14 @@
 
 		green {
 			label = "a20-olinuxino-lime2:green:usr";
-			gpios = <&pio 7 2 0>;
+			gpios = <&pio 7 2 GPIO_ACTIVE_HIGH>;
 			default-state = "on";
 		};
 	};
 
 	reg_ahci_5v: ahci-5v {
 		pinctrl-0 = <&ahci_pwr_pin_olinuxinolime>;
-		gpio = <&pio 2 3 0>;
+		gpio = <&pio 2 3 GPIO_ACTIVE_HIGH>;
 		status = "okay";
 	};
 
arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts +5 -3
index 7ed510fe1872..abfad90c28eb 100644
@@ -15,6 +15,8 @@
 #include "sun7i-a20.dtsi"
 #include "sunxi-common-regulators.dtsi"
 
+#include <dt-bindings/gpio/gpio.h>
+
 / {
 	model = "Olimex A20-Olinuxino Micro";
 	compatible = "olimex,a20-olinuxino-micro", "allwinner,sun7i-a20";
@@ -36,7 +38,7 @@
 			pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
 			vmmc-supply = <&reg_vcc3v3>;
 			bus-width = <4>;
-			cd-gpios = <&pio 7 1 0>; /* PH1 */
+			cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
 			cd-inverted;
 			status = "okay";
 		};
@@ -46,7 +48,7 @@
 			pinctrl-0 = <&mmc3_pins_a>, <&mmc3_cd_pin_olinuxinom>;
 			vmmc-supply = <&reg_vcc3v3>;
 			bus-width = <4>;
-			cd-gpios = <&pio 7 11 0>; /* PH11 */
+			cd-gpios = <&pio 7 11 GPIO_ACTIVE_HIGH>; /* PH11 */
 			cd-inverted;
 			status = "okay";
 		};
@@ -166,7 +168,7 @@
 
 		green {
 			label = "a20-olinuxino-micro:green:usr";
-			gpios = <&pio 7 2 0>;
+			gpios = <&pio 7 2 GPIO_ACTIVE_HIGH>;
 			default-state = "on";
 		};
 	};
arch/arm/boot/dts/sun7i-a20-pcduino3.dts +2 -2
index 2a9b610931c0..e0aa97599cbf 100644
@@ -62,7 +62,7 @@
 			pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
 			vmmc-supply = <&reg_vcc3v3>;
 			bus-width = <4>;
-			cd-gpios = <&pio 7 1 0>; /* PH1 */
+			cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
 			cd-inverted;
 			status = "okay";
 		};
@@ -203,7 +203,7 @@
 	};
 
 	reg_ahci_5v: ahci-5v {
-		gpio = <&pio 7 2 0>;
+		gpio = <&pio 7 2 GPIO_ACTIVE_HIGH>;
 		status = "okay";
 	};
 };
arch/arm/boot/dts/sun8i-a23-ippo-q8h-v5.dts +3 -1
index 491cd6ca4e31..bca84ebde871 100644
@@ -51,6 +51,8 @@
 #include "sun8i-a23.dtsi"
 #include "sunxi-common-regulators.dtsi"
 
+#include <dt-bindings/gpio/gpio.h>
+
 / {
 	model = "Ippo Q8H Dual Core Tablet (v5)";
 	compatible = "ippo,q8h-v5", "allwinner,sun8i-a23";
@@ -65,7 +67,7 @@
 			pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_q8h>;
 			vmmc-supply = <&reg_vcc3v0>;
 			bus-width = <4>;
-			cd-gpios = <&pio 1 4 0>; /* PB4 */
+			cd-gpios = <&pio 1 4 GPIO_ACTIVE_HIGH>; /* PB4 */
 			cd-inverted;
 			status = "okay";
 		};
arch/arm/boot/dts/sun9i-a80-optimus.dts +4 -2
index 7fe242a8134b..8868c946e034 100644
@@ -50,6 +50,8 @@
 /dts-v1/;
 #include "sun9i-a80.dtsi"
 
+#include <dt-bindings/gpio/gpio.h>
+
 / {
 	model = "Merrii A80 Optimus Board";
 	compatible = "merrii,a80-optimus", "allwinner,sun9i-a80";
@@ -106,14 +108,14 @@
 
 		led2 {
 			label = "optimus:led2:usr";
-			gpios = <&pio 7 1 0>;
+			gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>;
 		};
 
 		/* led3 is on PM15, in R_PIO */
 
 		led4 {
 			label = "optimus:led4:usr";
-			gpios = <&pio 7 0 0>;
+			gpios = <&pio 7 0 GPIO_ACTIVE_HIGH>;
 		};
 	};
 };
arch/arm/boot/dts/sunxi-common-regulators.dtsi +6 -4
index d8876634f965..d6b7983cf16a 100644
@@ -47,6 +47,8 @@
  *     OTHER DEALINGS IN THE SOFTWARE.
  */
 
+#include <dt-bindings/gpio/gpio.h>
+
 / {
 	soc at 01c00000 {
 		pio: pinctrl at 01c20800 {
@@ -89,7 +91,7 @@
 		regulator-max-microvolt = <5000000>;
 		regulator-boot-on;
 		enable-active-high;
-		gpio = <&pio 1 8 0>;
+		gpio = <&pio 1 8 GPIO_ACTIVE_HIGH>;
 		status = "disabled";
 	};
 
@@ -101,7 +103,7 @@
 		regulator-min-microvolt = <5000000>;
 		regulator-max-microvolt = <5000000>;
 		enable-active-high;
-		gpio = <&pio 1 9 0>;
+		gpio = <&pio 1 9 GPIO_ACTIVE_HIGH>;
 		status = "disabled";
 	};
 
@@ -113,7 +115,7 @@
 		regulator-min-microvolt = <5000000>;
 		regulator-max-microvolt = <5000000>;
 		enable-active-high;
-		gpio = <&pio 7 6 0>;
+		gpio = <&pio 7 6 GPIO_ACTIVE_HIGH>;
 		status = "disabled";
 	};
 
@@ -125,7 +127,7 @@
 		regulator-min-microvolt = <5000000>;
 		regulator-max-microvolt = <5000000>;
 		enable-active-high;
-		gpio = <&pio 7 3 0>;
+		gpio = <&pio 7 3 GPIO_ACTIVE_HIGH>;
 		status = "disabled";
 	};
 
Signature · 1 line
2.2.0
#3 lore raw

PATCH 3/6 ARM: sunxi: DT: Convert the DTs to use a header for the DMA arguments

In reply to Maxime Ripard

The DMA engine for the A10/A20 and derivatives require an opaque extra argument.

Add a dt-bindings header, and convert the device trees to it.

---
 arch/arm/boot/dts/sun4i-a10.dtsi    | 14 +++++++---
 arch/arm/boot/dts/sun5i-a10s.dtsi   | 11 ++++++--
 arch/arm/boot/dts/sun5i-a13.dtsi    | 11 ++++++--
 arch/arm/boot/dts/sun7i-a20.dtsi    | 14 +++++++---
 include/dt-bindings/dma/sun4i-a10.h | 56 +++++++++++++++++++++++++++++++++++++
 5 files changed, 92 insertions(+), 14 deletions(-)
 create mode 100644 include/dt-bindings/dma/sun4i-a10.h
arch/arm/boot/dts/sun4i-a10.dtsi +10 -4
index 69d12ed92406..e78f00d77c00 100644
@@ -12,6 +12,8 @@
 
 #include "skeleton.dtsi"
 
+#include <dt-bindings/dma/sun4i-a10.h>
+
 / {
 	interrupt-parent = <&intc>;
 
@@ -359,7 +361,8 @@
 			interrupts = <10>;
 			clocks = <&ahb_gates 20>, <&spi0_clk>;
 			clock-names = "ahb", "mod";
-			dmas = <&dma 1 27>, <&dma 1 26>;
+			dmas = <&dma SUN4I_DMA_DEDICATED 27>,
+			       <&dma SUN4I_DMA_DEDICATED 26>;
 			dma-names = "rx", "tx";
 			status = "disabled";
 			#address-cells = <1>;
@@ -372,7 +375,8 @@
 			interrupts = <11>;
 			clocks = <&ahb_gates 21>, <&spi1_clk>;
 			clock-names = "ahb", "mod";
-			dmas = <&dma 1 9>, <&dma 1 8>;
+			dmas = <&dma SUN4I_DMA_DEDICATED 9>,
+			       <&dma SUN4I_DMA_DEDICATED 8>;
 			dma-names = "rx", "tx";
 			status = "disabled";
 			#address-cells = <1>;
@@ -469,7 +473,8 @@
 			interrupts = <12>;
 			clocks = <&ahb_gates 22>, <&spi2_clk>;
 			clock-names = "ahb", "mod";
-			dmas = <&dma 1 29>, <&dma 1 28>;
+			dmas = <&dma SUN4I_DMA_DEDICATED 29>,
+			       <&dma SUN4I_DMA_DEDICATED 28>;
 			dma-names = "rx", "tx";
 			status = "disabled";
 			#address-cells = <1>;
@@ -510,7 +515,8 @@
 			interrupts = <50>;
 			clocks = <&ahb_gates 23>, <&spi3_clk>;
 			clock-names = "ahb", "mod";
-			dmas = <&dma 1 31>, <&dma 1 30>;
+			dmas = <&dma SUN4I_DMA_DEDICATED 31>,
+			       <&dma SUN4I_DMA_DEDICATED 30>;
 			dma-names = "rx", "tx";
 			status = "disabled";
 			#address-cells = <1>;
arch/arm/boot/dts/sun5i-a10s.dtsi +8 -3
index 98dbf4dd2db8..1bda98868a3c 100644
@@ -13,6 +13,8 @@
 
 #include "skeleton.dtsi"
 
+#include <dt-bindings/dma/sun4i-a10.h>
+
 / {
 	interrupt-parent = <&intc>;
 
@@ -320,7 +322,8 @@
 			interrupts = <10>;
 			clocks = <&ahb_gates 20>, <&spi0_clk>;
 			clock-names = "ahb", "mod";
-			dmas = <&dma 1 27>, <&dma 1 26>;
+			dmas = <&dma SUN4I_DMA_DEDICATED 27>,
+			       <&dma SUN4I_DMA_DEDICATED 26>;
 			dma-names = "rx", "tx";
 			status = "disabled";
 			#address-cells = <1>;
@@ -333,7 +336,8 @@
 			interrupts = <11>;
 			clocks = <&ahb_gates 21>, <&spi1_clk>;
 			clock-names = "ahb", "mod";
-			dmas = <&dma 1 9>, <&dma 1 8>;
+			dmas = <&dma SUN4I_DMA_DEDICATED 9>,
+			       <&dma SUN4I_DMA_DEDICATED 8>;
 			dma-names = "rx", "tx";
 			status = "disabled";
 			#address-cells = <1>;
@@ -421,7 +425,8 @@
 			interrupts = <12>;
 			clocks = <&ahb_gates 22>, <&spi2_clk>;
 			clock-names = "ahb", "mod";
-			dmas = <&dma 1 29>, <&dma 1 28>;
+			dmas = <&dma SUN4I_DMA_DEDICATED 29>,
+			       <&dma SUN4I_DMA_DEDICATED 28>;
 			dma-names = "rx", "tx";
 			status = "disabled";
 			#address-cells = <1>;
arch/arm/boot/dts/sun5i-a13.dtsi +8 -3
index c46549244786..9a9241e9f3dd 100644
@@ -13,6 +13,8 @@
 
 #include "skeleton.dtsi"
 
+#include <dt-bindings/dma/sun4i-a10.h>
+
 / {
 	interrupt-parent = <&intc>;
 
@@ -304,7 +306,8 @@
 			interrupts = <10>;
 			clocks = <&ahb_gates 20>, <&spi0_clk>;
 			clock-names = "ahb", "mod";
-			dmas = <&dma 1 27>, <&dma 1 26>;
+			dmas = <&dma SUN4I_DMA_DEDICATED 27>,
+			       <&dma SUN4I_DMA_DEDICATED 26>;
 			dma-names = "rx", "tx";
 			status = "disabled";
 			#address-cells = <1>;
@@ -317,7 +320,8 @@
 			interrupts = <11>;
 			clocks = <&ahb_gates 21>, <&spi1_clk>;
 			clock-names = "ahb", "mod";
-			dmas = <&dma 1 9>, <&dma 1 8>;
+			dmas = <&dma SUN4I_DMA_DEDICATED 9>,
+			       <&dma SUN4I_DMA_DEDICATED 8>;
 			dma-names = "rx", "tx";
 			status = "disabled";
 			#address-cells = <1>;
@@ -380,7 +384,8 @@
 			interrupts = <12>;
 			clocks = <&ahb_gates 22>, <&spi2_clk>;
 			clock-names = "ahb", "mod";
-			dmas = <&dma 1 29>, <&dma 1 28>;
+			dmas = <&dma SUN4I_DMA_DEDICATED 29>,
+			       <&dma SUN4I_DMA_DEDICATED 28>;
 			dma-names = "rx", "tx";
 			status = "disabled";
 			#address-cells = <1>;
arch/arm/boot/dts/sun7i-a20.dtsi +10 -4
index db45d85640ca..4ec6dfc87a02 100644
@@ -49,6 +49,8 @@
 
 #include "skeleton.dtsi"
 
+#include <dt-bindings/dma/sun4i-a10.h>
+
 / {
 	interrupt-parent = <&gic>;
 
@@ -479,7 +481,8 @@
 			interrupts = <0 10 4>;
 			clocks = <&ahb_gates 20>, <&spi0_clk>;
 			clock-names = "ahb", "mod";
-			dmas = <&dma 1 27>, <&dma 1 26>;
+			dmas = <&dma SUN4I_DMA_DEDICATED 27>,
+			       <&dma SUN4I_DMA_DEDICATED 26>;
 			dma-names = "rx", "tx";
 			status = "disabled";
 			#address-cells = <1>;
@@ -492,7 +495,8 @@
 			interrupts = <0 11 4>;
 			clocks = <&ahb_gates 21>, <&spi1_clk>;
 			clock-names = "ahb", "mod";
-			dmas = <&dma 1 9>, <&dma 1 8>;
+			dmas = <&dma SUN4I_DMA_DEDICATED 9>,
+			       <&dma SUN4I_DMA_DEDICATED 8>;
 			dma-names = "rx", "tx";
 			status = "disabled";
 			#address-cells = <1>;
@@ -589,7 +593,8 @@
 			interrupts = <0 12 4>;
 			clocks = <&ahb_gates 22>, <&spi2_clk>;
 			clock-names = "ahb", "mod";
-			dmas = <&dma 1 29>, <&dma 1 28>;
+			dmas = <&dma SUN4I_DMA_DEDICATED 29>,
+			       <&dma SUN4I_DMA_DEDICATED 28>;
 			dma-names = "rx", "tx";
 			status = "disabled";
 			#address-cells = <1>;
@@ -630,7 +635,8 @@
 			interrupts = <0 50 4>;
 			clocks = <&ahb_gates 23>, <&spi3_clk>;
 			clock-names = "ahb", "mod";
-			dmas = <&dma 1 31>, <&dma 1 30>;
+			dmas = <&dma SUN4I_DMA_DEDICATED 31>,
+			       <&dma SUN4I_DMA_DEDICATED 30>;
 			dma-names = "rx", "tx";
 			status = "disabled";
 			#address-cells = <1>;
include/dt-bindings/dma/sun4i-a10.h new file +56 -0

56 lines not on this page · raw message

Signature · 1 line
2.2.0
#4 lore raw

PATCH 4/6 ARM: sunxi: DT: Convert the DTs to use a header for the pinctrl nodes

In reply to Maxime Ripard

The pinctrl nodes require some extra opaque arguments for the pull up and drive strength values.

Introduce a new header file and convert the device trees to replace these opaque numbers by defines.

---
 arch/arm/boot/dts/sun4i-a10-a1000.dts            |   9 +-
 arch/arm/boot/dts/sun4i-a10-cubieboard.dts       |   5 +-
 arch/arm/boot/dts/sun4i-a10-hackberry.dts        |   9 +-
 arch/arm/boot/dts/sun4i-a10-mini-xplus.dts       |   3 +-
 arch/arm/boot/dts/sun4i-a10-olinuxino-lime.dts   |   9 +-
 arch/arm/boot/dts/sun4i-a10.dtsi                 |  53 +++++-----
 arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts |  17 ++--
 arch/arm/boot/dts/sun5i-a10s-r7-tv-dongle.dts    |  13 +--
 arch/arm/boot/dts/sun5i-a10s.dtsi                |  37 +++----
 arch/arm/boot/dts/sun5i-a13-hsg-h702.dts         |   5 +-
 arch/arm/boot/dts/sun5i-a13-olinuxino-micro.dts  |  13 +--
 arch/arm/boot/dts/sun5i-a13-olinuxino.dts        |  13 +--
 arch/arm/boot/dts/sun5i-a13.dtsi                 |  25 ++---
 arch/arm/boot/dts/sun6i-a31-app4-evb1.dts        |   5 +-
 arch/arm/boot/dts/sun6i-a31-colombus.dts         |  11 ++-
 arch/arm/boot/dts/sun6i-a31-hummingbird.dts      |  11 ++-
 arch/arm/boot/dts/sun6i-a31-m9.dts               |  13 +--
 arch/arm/boot/dts/sun6i-a31.dtsi                 |  38 ++++----
 arch/arm/boot/dts/sun7i-a20-bananapi.dts         |  13 +--
 arch/arm/boot/dts/sun7i-a20-cubieboard2.dts      |   5 +-
 arch/arm/boot/dts/sun7i-a20-cubietruck.dts       |  19 ++--
 arch/arm/boot/dts/sun7i-a20-hummingbird.dts      |  17 ++--
 arch/arm/boot/dts/sun7i-a20-i12-tvbox.dts        |  19 ++--
 arch/arm/boot/dts/sun7i-a20-m3.dts               |   5 +-
 arch/arm/boot/dts/sun7i-a20-olinuxino-lime.dts   |   9 +-
 arch/arm/boot/dts/sun7i-a20-olinuxino-lime2.dts  |   9 +-
 arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts  |   9 +-
 arch/arm/boot/dts/sun7i-a20-pcduino3.dts         |  11 ++-
 arch/arm/boot/dts/sun7i-a20.dtsi                 | 117 ++++++++++++-----------
 arch/arm/boot/dts/sun8i-a23-ippo-q8h-v5.dts      |   5 +-
 arch/arm/boot/dts/sun8i-a23.dtsi                 |  30 +++---
 arch/arm/boot/dts/sun9i-a80-optimus.dts          |   9 +-
 arch/arm/boot/dts/sun9i-a80.dtsi                 |  14 +--
 arch/arm/boot/dts/sunxi-common-regulators.dtsi   |  17 ++--
 include/dt-bindings/pinctrl/sun4i-a10.h          |  62 ++++++++++++
 35 files changed, 380 insertions(+), 279 deletions(-)
 create mode 100644 include/dt-bindings/pinctrl/sun4i-a10.h
arch/arm/boot/dts/sun4i-a10-a1000.dts +5 -4
index 532ab3bd9735..b67e5be618cf 100644
@@ -52,6 +52,7 @@
 #include "sunxi-common-regulators.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
 
 / {
 	model = "Mele A1000";
@@ -114,15 +115,15 @@
 			emac_power_pin_a1000: emac_power_pin at 0 {
 				allwinner,pins = "PH15";
 				allwinner,function = "gpio_out";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			led_pins_a1000: led_pins at 0 {
 				allwinner,pins = "PH10", "PH20";
 				allwinner,function = "gpio_out";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 		};
 
arch/arm/boot/dts/sun4i-a10-cubieboard.dts +3 -2
index abc3c06677d2..ba8c2e2f97b0 100644
@@ -51,6 +51,7 @@
 #include "sunxi-common-regulators.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
 
 / {
 	model = "Cubietech Cubieboard";
@@ -113,8 +114,8 @@
 			led_pins_cubieboard: led_pins at 0 {
 				allwinner,pins = "PH20", "PH21";
 				allwinner,function = "gpio_out";
-				allwinner,drive = <1>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_20_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 		};
 
arch/arm/boot/dts/sun4i-a10-hackberry.dts +5 -4
index be1f29e50811..d3f73ea25567 100644
@@ -52,6 +52,7 @@
 #include "sunxi-common-regulators.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
 
 / {
 	model = "Miniand Hackberry";
@@ -113,15 +114,15 @@
 			hackberry_hogs: hogs at 0 {
 				allwinner,pins = "PH19";
 				allwinner,function = "gpio_out";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			usb2_vbus_pin_hackberry: usb2_vbus_pin at 0 {
 					allwinner,pins = "PH12";
 					allwinner,function = "gpio_out";
-					allwinner,drive = <0>;
-					allwinner,pull = <0>;
+					allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+					allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 		};
 
arch/arm/boot/dts/sun4i-a10-mini-xplus.dts +2 -1
index 1db02eb3796c..eb5fd6904a69 100644
@@ -52,6 +52,7 @@
 #include "sunxi-common-regulators.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
 
 / {
 	model = "PineRiver Mini X-Plus";
@@ -93,7 +94,7 @@
 		pinctrl at 01c20800 {
 			ir0_pins_a: ir0 at 0 {
 				/* The ir receiver is not always populated */
-				allwinner,pull = <1>;
+				allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
 			};
 		};
 
arch/arm/boot/dts/sun4i-a10-olinuxino-lime.dts +5 -4
index 5d9b86839f16..ab7891c43231 100644
@@ -50,6 +50,7 @@
 #include "sunxi-common-regulators.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
 
 / {
 	model = "Olimex A10-OLinuXino-LIME";
@@ -112,15 +113,15 @@
 			ahci_pwr_pin_olinuxinolime: ahci_pwr_pin at 1 {
 				allwinner,pins = "PC3";
 				allwinner,function = "gpio_out";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			led_pins_olinuxinolime: led_pins at 0 {
 				allwinner,pins = "PH2";
 				allwinner,function = "gpio_out";
-				allwinner,drive = <1>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_20_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 		};
 
arch/arm/boot/dts/sun4i-a10.dtsi +27 -26

126 lines not on this page · raw message

arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts +9 -8
index ab9b6c24efeb..34d207cfb879 100644
@@ -52,6 +52,7 @@
 #include "sunxi-common-regulators.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
 
 / {
 	model = "Olimex A10s-Olinuxino Micro";
@@ -110,29 +111,29 @@
 			mmc0_cd_pin_olinuxino_micro: mmc0_cd_pin at 0 {
 				allwinner,pins = "PG1";
 				allwinner,function = "gpio_in";
-				allwinner,drive = <0>;
-				allwinner,pull = <1>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
 			};
 
 			mmc1_cd_pin_olinuxino_micro: mmc1_cd_pin at 0 {
 				allwinner,pins = "PG13";
 				allwinner,function = "gpio_in";
-				allwinner,drive = <0>;
-				allwinner,pull = <1>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
 			};
 
 			led_pins_olinuxino: led_pins at 0 {
 				allwinner,pins = "PE3";
 				allwinner,function = "gpio_out";
-				allwinner,drive = <1>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_20_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			usb1_vbus_pin_olinuxino_m: usb1_vbus_pin at 0 {
 				allwinner,pins = "PB10";
 				allwinner,function = "gpio_out";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 		};
 
arch/arm/boot/dts/sun5i-a10s-r7-tv-dongle.dts +7 -6
index da2d2535b1bc..7deddfc9df8b 100644
@@ -50,6 +50,7 @@
 #include "sunxi-common-regulators.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
 
 / {
 	model = "R7 A10s hdmi tv-stick";
@@ -92,22 +93,22 @@
 			mmc0_cd_pin_r7: mmc0_cd_pin at 0 {
 				allwinner,pins = "PG1";
 				allwinner,function = "gpio_in";
-				allwinner,drive = <0>;
-				allwinner,pull = <1>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
 			};
 
 			led_pins_r7: led_pins at 0 {
 				allwinner,pins = "PB2";
 				allwinner,function = "gpio_out";
-				allwinner,drive = <1>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_20_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			usb1_vbus_pin_r7: usb1_vbus_pin at 0 {
 				allwinner,pins = "PG13";
 				allwinner,function = "gpio_out";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 		};
 
arch/arm/boot/dts/sun5i-a10s.dtsi +19 -18
index 1bda98868a3c..2af76954d73c 100644
@@ -14,6 +14,7 @@
 #include "skeleton.dtsi"
 
 #include <dt-bindings/dma/sun4i-a10.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
 
 / {
 	interrupt-parent = <&intc>;
@@ -454,22 +455,22 @@
 			uart0_pins_a: uart0 at 0 {
 				allwinner,pins = "PB19", "PB20";
 				allwinner,function = "uart0";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			uart2_pins_a: uart2 at 0 {
 				allwinner,pins = "PC18", "PC19";
 				allwinner,function = "uart2";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			uart3_pins_a: uart3 at 0 {
 				allwinner,pins = "PG9", "PG10";
 				allwinner,function = "uart3";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			emac_pins_a: emac0 at 0 {
@@ -479,43 +480,43 @@
 						"PA11", "PA12", "PA13", "PA14",
 						"PA15", "PA16";
 				allwinner,function = "emac";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			i2c0_pins_a: i2c0 at 0 {
 				allwinner,pins = "PB0", "PB1";
 				allwinner,function = "i2c0";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			i2c1_pins_a: i2c1 at 0 {
 				allwinner,pins = "PB15", "PB16";
 				allwinner,function = "i2c1";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			i2c2_pins_a: i2c2 at 0 {
 				allwinner,pins = "PB17", "PB18";
 				allwinner,function = "i2c2";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			mmc0_pins_a: mmc0 at 0 {
 				allwinner,pins = "PF0","PF1","PF2","PF3","PF4","PF5";
 				allwinner,function = "mmc0";
-				allwinner,drive = <2>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_30_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			mmc1_pins_a: mmc1 at 0 {
 				allwinner,pins = "PG3","PG4","PG5","PG6","PG7","PG8";
 				allwinner,function = "mmc1";
-				allwinner,drive = <2>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_30_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 		};
 
arch/arm/boot/dts/sun5i-a13-hsg-h702.dts +3 -2
index bccc1bcaa868..99a5968720b4 100644
@@ -50,6 +50,7 @@
 #include "sunxi-common-regulators.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
 
 / {
 	model = "HSG H702";
@@ -87,8 +88,8 @@
 			mmc0_cd_pin_h702: mmc0_cd_pin at 0 {
 				allwinner,pins = "PG0";
 				allwinner,function = "gpio_in";
-				allwinner,drive = <0>;
-				allwinner,pull = <1>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
 			};
 		};
 
arch/arm/boot/dts/sun5i-a13-olinuxino-micro.dts +7 -6
index c30180794c54..64d516200dae 100644
@@ -51,6 +51,7 @@
 #include "sunxi-common-regulators.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
 
 / {
 	model = "Olimex A13-Olinuxino Micro";
@@ -84,22 +85,22 @@
 			mmc0_cd_pin_olinuxinom: mmc0_cd_pin at 0 {
 				allwinner,pins = "PG0";
 				allwinner,function = "gpio_in";
-				allwinner,drive = <0>;
-				allwinner,pull = <1>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
 			};
 
 			led_pins_olinuxinom: led_pins at 0 {
 				allwinner,pins = "PG9";
 				allwinner,function = "gpio_out";
-				allwinner,drive = <1>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_20_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			usb1_vbus_pin_olinuxinom: usb1_vbus_pin at 0 {
 				allwinner,pins = "PG11";
 				allwinner,function = "gpio_out";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 		};
 
arch/arm/boot/dts/sun5i-a13-olinuxino.dts +7 -6
index c2f6288083ae..752d6d7f0722 100644
@@ -52,6 +52,7 @@
 #include "sunxi-common-regulators.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
 
 / {
 	model = "Olimex A13-Olinuxino";
@@ -85,22 +86,22 @@
 			mmc0_cd_pin_olinuxino: mmc0_cd_pin at 0 {
 				allwinner,pins = "PG0";
 				allwinner,function = "gpio_in";
-				allwinner,drive = <0>;
-				allwinner,pull = <1>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
 			};
 
 			led_pins_olinuxino: led_pins at 0 {
 				allwinner,pins = "PG9";
 				allwinner,function = "gpio_out";
-				allwinner,drive = <1>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_20_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			usb1_vbus_pin_olinuxino: usb1_vbus_pin at 0 {
 				allwinner,pins = "PG11";
 				allwinner,function = "gpio_out";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 		};
 
arch/arm/boot/dts/sun5i-a13.dtsi +13 -12
index 9a9241e9f3dd..1a1c4b4c4499 100644
@@ -14,6 +14,7 @@
 #include "skeleton.dtsi"
 
 #include <dt-bindings/dma/sun4i-a10.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
 
 / {
 	interrupt-parent = <&intc>;
@@ -413,43 +414,43 @@
 			uart1_pins_a: uart1 at 0 {
 				allwinner,pins = "PE10", "PE11";
 				allwinner,function = "uart1";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			uart1_pins_b: uart1 at 1 {
 				allwinner,pins = "PG3", "PG4";
 				allwinner,function = "uart1";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			i2c0_pins_a: i2c0 at 0 {
 				allwinner,pins = "PB0", "PB1";
 				allwinner,function = "i2c0";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			i2c1_pins_a: i2c1 at 0 {
 				allwinner,pins = "PB15", "PB16";
 				allwinner,function = "i2c1";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			i2c2_pins_a: i2c2 at 0 {
 				allwinner,pins = "PB17", "PB18";
 				allwinner,function = "i2c2";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			mmc0_pins_a: mmc0 at 0 {
 				allwinner,pins = "PF0","PF1","PF2","PF3","PF4","PF5";
 				allwinner,function = "mmc0";
-				allwinner,drive = <2>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_30_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 		};
 
arch/arm/boot/dts/sun6i-a31-app4-evb1.dts +3 -2
index 0d86e8cb2ca2..be9f5ee6b59e 100644
@@ -52,6 +52,7 @@
 #include "sunxi-common-regulators.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
 
 / {
 	model = "Allwinner A31 APP4 EVB1 Evaluation Board";
@@ -66,8 +67,8 @@
 			usb1_vbus_pin_a: usb1_vbus_pin at 0 {
 				allwinner,pins = "PH27";
 				allwinner,function = "gpio_out";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 		};
 
arch/arm/boot/dts/sun6i-a31-colombus.dts +6 -5
index deab8f357ad7..84630e56acd7 100644
@@ -52,6 +52,7 @@
 #include "sunxi-common-regulators.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
 
 / {
 	model = "WITS A31 Colombus Evaluation Board";
@@ -83,21 +84,21 @@
 
 		pio: pinctrl at 01c20800 {
 			mmc0_pins_a: mmc0 at 0 {
-				allwinner,pull = <1>;
+				allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
 			};
 
 			mmc0_cd_pin_colombus: mmc0_cd_pin at 0 {
 				allwinner,pins = "PA8";
 				allwinner,function = "gpio_in";
-				allwinner,drive = <0>;
-				allwinner,pull = <1>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
 			};
 
 			usb2_vbus_pin_colombus: usb2_vbus_pin at 0 {
 				allwinner,pins = "PH24";
 				allwinner,function = "gpio_out";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 		};
 
arch/arm/boot/dts/sun6i-a31-hummingbird.dts +6 -5
index 7364d22b33dd..ebd5f7854b1b 100644
@@ -52,6 +52,7 @@
 #include "sunxi-common-regulators.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
 
 / {
 	model = "Merrii A31 Hummingbird";
@@ -88,21 +89,21 @@
 		pio: pinctrl at 01c20800 {
 			mmc0_pins_a: mmc0 at 0 {
 				/* external pull-ups missing for some pins */
-				allwinner,pull = <1>;
+				allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
 			};
 
 			mmc0_cd_pin_hummingbird: mmc0_cd_pin at 0 {
 				allwinner,pins = "PA8";
 				allwinner,function = "gpio_in";
-				allwinner,drive = <0>;
-				allwinner,pull = <1>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
 			};
 
 			usb1_vbus_pin_a: usb1_vbus_pin at 0 {
 				allwinner,pins = "PH24";
 				allwinner,function = "gpio_out";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 		};
 
arch/arm/boot/dts/sun6i-a31-m9.dts +7 -6
index 799040627ab7..517586b92e32 100644
@@ -50,6 +50,7 @@
 #include "sunxi-common-regulators.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
 
 / {
 	model = "Mele M9 / A1000G Quad top set box";
@@ -87,22 +88,22 @@
 			led_pins_m9: led_pins at 0 {
 				allwinner,pins = "PH13";
 				allwinner,function = "gpio_out";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			mmc0_cd_pin_m9: mmc0_cd_pin at 0 {
 				allwinner,pins = "PH22";
 				allwinner,function = "gpio_in";
-				allwinner,drive = <0>;
-				allwinner,pull = <1>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
 			};
 
 			usb1_vbus_pin_m9: usb1_vbus_pin at 0 {
 				allwinner,pins = "PC27";
 				allwinner,function = "gpio_out";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 		};
 
arch/arm/boot/dts/sun6i-a31.dtsi +20 -18
index 9c34e92ade87..00b7e03d5d98 100644
@@ -49,6 +49,8 @@
 
 #include "skeleton.dtsi"
 
+#include <dt-bindings/pinctrl/sun4i-a10.h>
+
 / {
 	interrupt-parent = <&gic>;
 
@@ -501,36 +503,36 @@
 			uart0_pins_a: uart0 at 0 {
 				allwinner,pins = "PH20", "PH21";
 				allwinner,function = "uart0";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			i2c0_pins_a: i2c0 at 0 {
 				allwinner,pins = "PH14", "PH15";
 				allwinner,function = "i2c0";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			i2c1_pins_a: i2c1 at 0 {
 				allwinner,pins = "PH16", "PH17";
 				allwinner,function = "i2c1";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			i2c2_pins_a: i2c2 at 0 {
 				allwinner,pins = "PH18", "PH19";
 				allwinner,function = "i2c2";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			mmc0_pins_a: mmc0 at 0 {
 				allwinner,pins = "PF0","PF1","PF2","PF3","PF4","PF5";
 				allwinner,function = "mmc0";
-				allwinner,drive = <2>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_30_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			gmac_pins_mii_a: gmac_mii at 0 {
@@ -540,8 +542,8 @@
 						"PA20", "PA21", "PA22", "PA23",
 						"PA24", "PA26", "PA27";
 				allwinner,function = "gmac";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			gmac_pins_gmii_a: gmac_gmii at 0 {
@@ -557,8 +559,8 @@
 				 * data lines in GMII mode run at 125MHz and
 				 * might need a higher signal drive strength
 				 */
-				allwinner,drive = <2>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_30_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			gmac_pins_rgmii_a: gmac_rgmii at 0 {
@@ -571,8 +573,8 @@
 				 * data lines in RGMII mode use DDR mode
 				 * and need a higher signal drive strength
 				 */
-				allwinner,drive = <3>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_40_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 		};
 
@@ -897,8 +899,8 @@
 			ir_pins_a: ir at 0 {
 				allwinner,pins = "PL4";
 				allwinner,function = "s_ir";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 		};
 	};
arch/arm/boot/dts/sun7i-a20-bananapi.dts +7 -6
index e273f0e0627a..d5e5d39ff3c0 100644
@@ -52,6 +52,7 @@
 #include "sunxi-common-regulators.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
 
 / {
 	model = "LeMaker Banana Pi";
@@ -104,22 +105,22 @@
 			mmc0_cd_pin_bananapi: mmc0_cd_pin at 0 {
 				allwinner,pins = "PH10";
 				allwinner,function = "gpio_in";
-				allwinner,drive = <0>;
-				allwinner,pull = <1>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
 			};
 
 			gmac_power_pin_bananapi: gmac_power_pin at 0 {
 				allwinner,pins = "PH23";
 				allwinner,function = "gpio_out";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			led_pins_bananapi: led_pins at 0 {
 				allwinner,pins = "PH24";
 				allwinner,function = "gpio_out";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 		};
 
arch/arm/boot/dts/sun7i-a20-cubieboard2.dts +3 -2
index 27ca1a16ca91..9dc4c10f682e 100644
@@ -16,6 +16,7 @@
 #include "sunxi-common-regulators.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
 
 / {
 	model = "Cubietech Cubieboard2";
@@ -63,8 +64,8 @@
 			led_pins_cubieboard2: led_pins at 0 {
 				allwinner,pins = "PH20", "PH21";
 				allwinner,function = "gpio_out";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 		};
 
arch/arm/boot/dts/sun7i-a20-cubietruck.dts +10 -9
index a6e88f8ce533..673846245cd9 100644
@@ -16,6 +16,7 @@
 #include "sunxi-common-regulators.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
 
 / {
 	model = "Cubietech Cubietruck";
@@ -72,35 +73,35 @@
 		pinctrl at 01c20800 {
 			mmc3_pins_a: mmc3 at 0 {
 				/* AP6210 requires pull-up */
-				allwinner,pull = <1>;
+				allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
 			};
 
 			vmmc3_pin_cubietruck: vmmc3_pin at 0 {
 				allwinner,pins = "PH9";
 				allwinner,function = "gpio_out";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			ahci_pwr_pin_cubietruck: ahci_pwr_pin at 1 {
 				allwinner,pins = "PH12";
 				allwinner,function = "gpio_out";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			led_pins_cubietruck: led_pins at 0 {
 				allwinner,pins = "PH7", "PH11", "PH20", "PH21";
 				allwinner,function = "gpio_out";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			usb0_vbus_pin_a: usb0_vbus_pin at 0 {
 				allwinner,pins = "PH17";
 				allwinner,function = "gpio_out";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 		};
 
arch/arm/boot/dts/sun7i-a20-hummingbird.dts +9 -8
index 3b8bd22296e6..4356a1709559 100644
@@ -16,6 +16,7 @@
 #include "sunxi-common-regulators.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
 
 / {
 	model = "Merrii A20 Hummingbird";
@@ -72,29 +73,29 @@
 			ahci_pwr_pin_a20_hummingbird: ahci_pwr_pin at 0 {
 				allwinner,pins = "PH15";
 				allwinner,function = "gpio_out";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			usb1_vbus_pin_a20_hummingbird: usb1_vbus_pin at 0 {
 				allwinner,pins = "PH2";
 				allwinner,function = "gpio_out";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			mmc3_vdd_pin_a20_hummingbird: mmc3_vdd_pin at 0 {
 				allwinner,pins = "PH9";
 				allwinner,function = "gpio_out";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			gmac_vdd_pin_a20_hummingbird: gmac_vdd_pin at 0 {
 				allwinner,pins = "PH16";
 				allwinner,function = "gpio_out";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 		};
 
arch/arm/boot/dts/sun7i-a20-i12-tvbox.dts +10 -9
index a422f19a0261..275e49ffb78b 100644
@@ -50,6 +50,7 @@
 #include "sunxi-common-regulators.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
 
 / {
 	model = "I12 / Q5 / QT840A A20 tvbox";
@@ -100,35 +101,35 @@
 		pinctrl at 01c20800 {
 			mmc3_pins_a: mmc3 at 0 {
 				/* AP6210 / AP6330 requires pull-up */
-				allwinner,pull = <1>;
+				allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
 			};
 
 			vmmc3_pin_i12_tvbox: vmmc3_pin at 0 {
 				allwinner,pins = "PH2";
 				allwinner,function = "gpio_out";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			vmmc3_io_pin_i12_tvbox: vmmc3_io_pin at 0 {
 				allwinner,pins = "PH12";
 				allwinner,function = "gpio_out";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			gmac_power_pin_i12_tvbox: gmac_power_pin at 0 {
 				allwinner,pins = "PH21";
 				allwinner,function = "gpio_out";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			led_pins_i12_tvbox: led_pins at 0 {
 				allwinner,pins = "PH9", "PH20";
 				allwinner,function = "gpio_out";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 		};
 
arch/arm/boot/dts/sun7i-a20-m3.dts +3 -2
index 3e40ae74f5e2..15be3ea80088 100644
@@ -52,6 +52,7 @@
 #include "sunxi-common-regulators.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
 
 / {
 	model = "Mele M3";
@@ -103,8 +104,8 @@
 			led_pins_m3: led_pins at 0 {
 				allwinner,pins = "PH20";
 				allwinner,function = "gpio_out";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 		};
 
arch/arm/boot/dts/sun7i-a20-olinuxino-lime.dts +5 -4
index 0423b1cbb365..f74405cd18b6 100644
@@ -53,6 +53,7 @@
 #include "sunxi-common-regulators.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
 
 / {
 	model = "Olimex A20-OLinuXino-LIME";
@@ -100,15 +101,15 @@
 			ahci_pwr_pin_olinuxinolime: ahci_pwr_pin at 1 {
 				allwinner,pins = "PC3";
 				allwinner,function = "gpio_out";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			led_pins_olinuxinolime: led_pins at 0 {
 				allwinner,pins = "PH2";
 				allwinner,function = "gpio_out";
-				allwinner,drive = <1>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_20_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 		};
 
arch/arm/boot/dts/sun7i-a20-olinuxino-lime2.dts +5 -4
index ce1e28afa2fe..7176721f6c6b 100644
@@ -50,6 +50,7 @@
 #include "sunxi-common-regulators.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
 
 / {
 	model = "Olimex A20-OLinuXino-LIME2";
@@ -97,15 +98,15 @@
 			ahci_pwr_pin_olinuxinolime: ahci_pwr_pin at 1 {
 				allwinner,pins = "PC3";
 				allwinner,function = "gpio_out";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			led_pins_olinuxinolime: led_pins at 0 {
 				allwinner,pins = "PH2";
 				allwinner,function = "gpio_out";
-				allwinner,drive = <1>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_20_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 		};
 
arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts +5 -4
index abfad90c28eb..3e2979b03cf6 100644
@@ -16,6 +16,7 @@
 #include "sunxi-common-regulators.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
 
 / {
 	model = "Olimex A20-Olinuxino Micro";
@@ -90,15 +91,15 @@
 			mmc3_cd_pin_olinuxinom: mmc3_cd_pin at 0 {
 				allwinner,pins = "PH11";
 				allwinner,function = "gpio_in";
-				allwinner,drive = <0>;
-				allwinner,pull = <1>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
 			};
 
 			led_pins_olinuxino: led_pins at 0 {
 				allwinner,pins = "PH2";
 				allwinner,function = "gpio_out";
-				allwinner,drive = <1>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_20_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 		};
 
arch/arm/boot/dts/sun7i-a20-pcduino3.dts +7 -4
index e0aa97599cbf..30f7a11a0017 100644
@@ -49,9 +49,12 @@
 /dts-v1/;
 #include "sun7i-a20.dtsi"
 #include "sunxi-common-regulators.dtsi"
+
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
 
+#include <dt-bindings/pinctrl/sun4i-a10.h>
+
 / {
 	model = "LinkSprite pcDuino3";
 	compatible = "linksprite,pcduino3", "allwinner,sun7i-a20";
@@ -102,15 +105,15 @@
 			led_pins_pcduino3: led_pins at 0 {
 				allwinner,pins = "PH15", "PH16";
 				allwinner,function = "gpio_out";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			key_pins_pcduino3: key_pins at 0 {
 				allwinner,pins = "PH17", "PH18", "PH19";
 				allwinner,function = "gpio_in";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 		};
 
arch/arm/boot/dts/sun7i-a20.dtsi +59 -58

272 lines not on this page · raw message

arch/arm/boot/dts/sun8i-a23-ippo-q8h-v5.dts +3 -2
index bca84ebde871..4fca7a237139 100644
@@ -52,6 +52,7 @@
 #include "sunxi-common-regulators.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
 
 / {
 	model = "Ippo Q8H Dual Core Tablet (v5)";
@@ -76,8 +77,8 @@
 			mmc0_cd_pin_q8h: mmc0_cd_pin at 0 {
 				allwinner,pins = "PB4";
 				allwinner,function = "gpio_in";
-				allwinner,drive = <0>;
-				allwinner,pull = <1>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
 			};
 		};
 
arch/arm/boot/dts/sun8i-a23.dtsi +16 -14
index 30ba73285680..508efea9686f 100644
@@ -49,6 +49,8 @@
 
 #include "skeleton.dtsi"
 
+#include <dt-bindings/pinctrl/sun4i-a10.h>
+
 / {
 	interrupt-parent = <&gic>;
 
@@ -305,43 +307,43 @@
 			uart0_pins_a: uart0 at 0 {
 				allwinner,pins = "PF2", "PF4";
 				allwinner,function = "uart0";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			mmc0_pins_a: mmc0 at 0 {
 				allwinner,pins = "PF0","PF1","PF2","PF3","PF4","PF5";
 				allwinner,function = "mmc0";
-				allwinner,drive = <2>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_30_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			mmc1_pins_a: mmc1 at 0 {
 				allwinner,pins = "PG0","PG1","PG2","PG3","PG4","PG5";
 				allwinner,function = "mmc1";
-				allwinner,drive = <2>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_30_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			i2c0_pins_a: i2c0 at 0 {
 				allwinner,pins = "PH2", "PH3";
 				allwinner,function = "i2c0";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			i2c1_pins_a: i2c1 at 0 {
 				allwinner,pins = "PH4", "PH5";
 				allwinner,function = "i2c1";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			i2c2_pins_a: i2c2 at 0 {
 				allwinner,pins = "PE12", "PE13";
 				allwinner,function = "i2c2";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 		};
 
@@ -562,8 +564,8 @@
 			r_uart_pins_a: r_uart at 0 {
 				allwinner,pins = "PL2", "PL3";
 				allwinner,function = "s_uart";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 		};
 	};
arch/arm/boot/dts/sun9i-a80-optimus.dts +5 -4
index 8868c946e034..58f5cb346519 100644
@@ -51,6 +51,7 @@
 #include "sun9i-a80.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
 
 / {
 	model = "Merrii A80 Optimus Board";
@@ -64,19 +65,19 @@
 		pio: pinctrl at 06000800 {
 			i2c3_pins_a: i2c3 at 0 {
 				/* Enable internal pull-up */
-				allwinner,pull = <1>;
+				allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
 			};
 
 			led_pins_optimus: led-pins at 0 {
 				allwinner,pins = "PH0", "PH1";
 				allwinner,function = "gpio_out";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			uart4_pins_a: uart4 at 0 {
 				/* Enable internal pull-up */
-				allwinner,pull = <1>;
+				allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
 			};
 		};
 
arch/arm/boot/dts/sun9i-a80.dtsi +8 -6
index 90d0450850e9..de31b210e2c1 100644
@@ -49,6 +49,8 @@
 
 #include "skeleton64.dtsi"
 
+#include <dt-bindings/pinctrl/sun4i-a10.h>
+
 / {
 	interrupt-parent = <&gic>;
 
@@ -355,22 +357,22 @@
 			i2c3_pins_a: i2c3 at 0 {
 				allwinner,pins = "PG10", "PG11";
 				allwinner,function = "i2c3";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			uart0_pins_a: uart0 at 0 {
 				allwinner,pins = "PH12", "PH13";
 				allwinner,function = "uart0";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			uart4_pins_a: uart4 at 0 {
 				allwinner,pins = "PG12", "PG13", "PG14", "PG15";
 				allwinner,function = "uart4";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 		};
 
arch/arm/boot/dts/sunxi-common-regulators.dtsi +9 -8
index d6b7983cf16a..b1d64dd183f4 100644
@@ -48,6 +48,7 @@
  */
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
 
 / {
 	soc at 01c00000 {
@@ -55,29 +56,29 @@
 			ahci_pwr_pin_a: ahci_pwr_pin at 0 {
 				allwinner,pins = "PB8";
 				allwinner,function = "gpio_out";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			usb0_vbus_pin_a: usb0_vbus_pin at 0 {
 				allwinner,pins = "PB9";
 				allwinner,function = "gpio_out";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			usb1_vbus_pin_a: usb1_vbus_pin at 0 {
 				allwinner,pins = "PH6";
 				allwinner,function = "gpio_out";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 
 			usb2_vbus_pin_a: usb2_vbus_pin at 0 {
 				allwinner,pins = "PH3";
 				allwinner,function = "gpio_out";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
 			};
 		};
 	};
include/dt-bindings/pinctrl/sun4i-a10.h new file +62 -0

62 lines not on this page · raw message

Signature · 1 line
2.2.0
#5 lore raw

PATCH 4/6 ARM: sunxi: DT: Convert the DTs to use a header for the pinctrl nodes

Hey Maxime!

Quoted 2 lines · Maxime Ripard <maxime.ripard <at> free-electrons.com> writes:

The pinctrl nodes require some extra opaque arguments for the pull up and

drive

Quoted 4 lines

strength values.

Introduce a new header file and convert the device trees to replace these opaque numbers by defines.

<snip>

Review

Quoted 2 lines
(quoted diff) +0 -0

b/arch/arm/boot/dts/sun4i-a10-a1000.dts

Quoted 8 lines

index 532ab3bd9735..b67e5be618cf 100644

arch/arm/boot/dts/sun4i-a10-a1000.dts +1 -0
 <at>  <at>  -52,6 +52,7  <at>  <at> 
 #include "sunxi-common-regulators.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>

arch/arm/boot/dts/sun4i-a10-a1000.dts

Quoted 10 lines
arch/arm/boot/dts/sun4i-a10-a1000.dts +1 -2
 
 / {
 	model = "Mele A1000";
 <at>  <at>  -114,15 +115,15  <at>  <at> 
 			emac_power_pin_a1000: emac_power_pin <at> 0 {
 				allwinner,pins = "PH15";
 				allwinner,function = "gpio_out";
-				allwinner,drive = <0>;
-				allwinner,pull = <0>;
+				allwinner,drive = <SUN4I_PINCTRL_10_MA>;

May I query why you used Mega Ampere's for the drive strength? ;) I know it's quite obvious it means mili-amps, but I recall reading that small letters in defines is 'acceptable' in the case of mA, which is already used in the dts files for the imx.

I doubt we will ever see MegaAmp in any dts ;) but technically not impossible.

Olliver

#6 lore raw

PATCH 5/6 ARM: sunxi: DT: Convert the DTs to use the GIC headers

In reply to Maxime Ripard

The GIC requires some extra opaque arguments to set the IRQ type and flags.

Convert the DTs to using the common defines.

---
 arch/arm/boot/dts/sun6i-a31.dtsi |  97 ++++++++++++++++++-----------------
 arch/arm/boot/dts/sun7i-a20.dtsi | 106 ++++++++++++++++++++-------------------
 arch/arm/boot/dts/sun8i-a23.dtsi |  47 +++++++++--------
 arch/arm/boot/dts/sun9i-a80.dtsi |  52 ++++++++++---------
 4 files changed, 156 insertions(+), 146 deletions(-)
arch/arm/boot/dts/sun6i-a31.dtsi +50 -47
index 00b7e03d5d98..6fc124ee764f 100644
@@ -49,6 +49,8 @@
 
 #include "skeleton.dtsi"
 
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+
 #include <dt-bindings/pinctrl/sun4i-a10.h>
 
 / {
@@ -113,10 +115,10 @@
 
 	pmu {
 		compatible = "arm,cortex-a7-pmu", "arm,cortex-a15-pmu";
-		interrupts = <0 120 4>,
-			     <0 121 4>,
-			     <0 122 4>,
-			     <0 123 4>;
+		interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>;
 	};
 
 	clocks {
@@ -355,7 +357,7 @@
 		dma: dma-controller at 01c02000 {
 			compatible = "allwinner,sun6i-a31-dma";
 			reg = <0x01c02000 0x1000>;
-			interrupts = <0 50 4>;
+			interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
 			clocks = <&ahb1_gates 6>;
 			resets = <&ahb1_rst 6>;
 			#dma-cells = <1>;
@@ -372,7 +374,7 @@
 			clock-names = "ahb", "mmc";
 			resets = <&ahb1_rst 8>;
 			reset-names = "ahb";
-			interrupts = <0 60 4>;
+			interrupts = <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>;
 			status = "disabled";
 		};
 
@@ -383,7 +385,7 @@
 			clock-names = "ahb", "mmc";
 			resets = <&ahb1_rst 9>;
 			reset-names = "ahb";
-			interrupts = <0 61 4>;
+			interrupts = <GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH>;
 			status = "disabled";
 		};
 
@@ -394,7 +396,7 @@
 			clock-names = "ahb", "mmc";
 			resets = <&ahb1_rst 10>;
 			reset-names = "ahb";
-			interrupts = <0 62 4>;
+			interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>;
 			status = "disabled";
 		};
 
@@ -405,7 +407,7 @@
 			clock-names = "ahb", "mmc";
 			resets = <&ahb1_rst 11>;
 			reset-names = "ahb";
-			interrupts = <0 63 4>;
+			interrupts = <GIC_SPI 63 IRQ_TYPE_LEVEL_HIGH>;
 			status = "disabled";
 		};
 
@@ -436,7 +438,7 @@
 		ehci0: usb at 01c1a000 {
 			compatible = "allwinner,sun6i-a31-ehci", "generic-ehci";
 			reg = <0x01c1a000 0x100>;
-			interrupts = <0 72 4>;
+			interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>;
 			clocks = <&ahb1_gates 26>;
 			resets = <&ahb1_rst 26>;
 			phys = <&usbphy 1>;
@@ -447,7 +449,7 @@
 		ohci0: usb at 01c1a400 {
 			compatible = "allwinner,sun6i-a31-ohci", "generic-ohci";
 			reg = <0x01c1a400 0x100>;
-			interrupts = <0 73 4>;
+			interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;
 			clocks = <&ahb1_gates 29>, <&usb_clk 16>;
 			resets = <&ahb1_rst 29>;
 			phys = <&usbphy 1>;
@@ -458,7 +460,7 @@
 		ehci1: usb at 01c1b000 {
 			compatible = "allwinner,sun6i-a31-ehci", "generic-ehci";
 			reg = <0x01c1b000 0x100>;
-			interrupts = <0 74 4>;
+			interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
 			clocks = <&ahb1_gates 27>;
 			resets = <&ahb1_rst 27>;
 			phys = <&usbphy 2>;
@@ -469,7 +471,7 @@
 		ohci1: usb at 01c1b400 {
 			compatible = "allwinner,sun6i-a31-ohci", "generic-ohci";
 			reg = <0x01c1b400 0x100>;
-			interrupts = <0 75 4>;
+			interrupts = <GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH>;
 			clocks = <&ahb1_gates 30>, <&usb_clk 17>;
 			resets = <&ahb1_rst 30>;
 			phys = <&usbphy 2>;
@@ -480,7 +482,7 @@
 		ohci2: usb at 01c1c400 {
 			compatible = "allwinner,sun6i-a31-ohci", "generic-ohci";
 			reg = <0x01c1c400 0x100>;
-			interrupts = <0 77 4>;
+			interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>;
 			clocks = <&ahb1_gates 31>, <&usb_clk 18>;
 			resets = <&ahb1_rst 31>;
 			status = "disabled";
@@ -489,10 +491,10 @@
 		pio: pinctrl at 01c20800 {
 			compatible = "allwinner,sun6i-a31-pinctrl";
 			reg = <0x01c20800 0x400>;
-			interrupts = <0 11 4>,
-				     <0 15 4>,
-				     <0 16 4>,
-				     <0 17 4>;
+			interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
 			clocks = <&apb1_gates 5>;
 			gpio-controller;
 			interrupt-controller;
@@ -599,11 +601,11 @@
 		timer at 01c20c00 {
 			compatible = "allwinner,sun4i-a10-timer";
 			reg = <0x01c20c00 0xa0>;
-			interrupts = <0 18 4>,
-				     <0 19 4>,
-				     <0 20 4>,
-				     <0 21 4>,
-				     <0 22 4>;
+			interrupts = <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>;
 			clocks = <&osc24M>;
 		};
 
@@ -615,7 +617,7 @@
 		uart0: serial at 01c28000 {
 			compatible = "snps,dw-apb-uart";
 			reg = <0x01c28000 0x400>;
-			interrupts = <0 0 4>;
+			interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
 			reg-shift = <2>;
 			reg-io-width = <4>;
 			clocks = <&apb2_gates 16>;
@@ -628,7 +630,7 @@
 		uart1: serial at 01c28400 {
 			compatible = "snps,dw-apb-uart";
 			reg = <0x01c28400 0x400>;
-			interrupts = <0 1 4>;
+			interrupts = <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>;
 			reg-shift = <2>;
 			reg-io-width = <4>;
 			clocks = <&apb2_gates 17>;
@@ -641,7 +643,7 @@
 		uart2: serial at 01c28800 {
 			compatible = "snps,dw-apb-uart";
 			reg = <0x01c28800 0x400>;
-			interrupts = <0 2 4>;
+			interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
 			reg-shift = <2>;
 			reg-io-width = <4>;
 			clocks = <&apb2_gates 18>;
@@ -654,7 +656,7 @@
 		uart3: serial at 01c28c00 {
 			compatible = "snps,dw-apb-uart";
 			reg = <0x01c28c00 0x400>;
-			interrupts = <0 3 4>;
+			interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>;
 			reg-shift = <2>;
 			reg-io-width = <4>;
 			clocks = <&apb2_gates 19>;
@@ -667,7 +669,7 @@
 		uart4: serial at 01c29000 {
 			compatible = "snps,dw-apb-uart";
 			reg = <0x01c29000 0x400>;
-			interrupts = <0 4 4>;
+			interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>;
 			reg-shift = <2>;
 			reg-io-width = <4>;
 			clocks = <&apb2_gates 20>;
@@ -680,7 +682,7 @@
 		uart5: serial at 01c29400 {
 			compatible = "snps,dw-apb-uart";
 			reg = <0x01c29400 0x400>;
-			interrupts = <0 5 4>;
+			interrupts = <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>;
 			reg-shift = <2>;
 			reg-io-width = <4>;
 			clocks = <&apb2_gates 21>;
@@ -693,7 +695,7 @@
 		i2c0: i2c at 01c2ac00 {
 			compatible = "allwinner,sun6i-a31-i2c";
 			reg = <0x01c2ac00 0x400>;
-			interrupts = <0 6 4>;
+			interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
 			clocks = <&apb2_gates 0>;
 			resets = <&apb2_rst 0>;
 			status = "disabled";
@@ -704,7 +706,7 @@
 		i2c1: i2c at 01c2b000 {
 			compatible = "allwinner,sun6i-a31-i2c";
 			reg = <0x01c2b000 0x400>;
-			interrupts = <0 7 4>;
+			interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
 			clocks = <&apb2_gates 1>;
 			resets = <&apb2_rst 1>;
 			status = "disabled";
@@ -715,7 +717,7 @@
 		i2c2: i2c at 01c2b400 {
 			compatible = "allwinner,sun6i-a31-i2c";
 			reg = <0x01c2b400 0x400>;
-			interrupts = <0 8 4>;
+			interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>;
 			clocks = <&apb2_gates 2>;
 			resets = <&apb2_rst 2>;
 			status = "disabled";
@@ -726,7 +728,7 @@
 		i2c3: i2c at 01c2b800 {
 			compatible = "allwinner,sun6i-a31-i2c";
 			reg = <0x01c2b800 0x400>;
-			interrupts = <0 9 4>;
+			interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>;
 			clocks = <&apb2_gates 3>;
 			resets = <&apb2_rst 3>;
 			status = "disabled";
@@ -737,7 +739,7 @@
 		gmac: ethernet at 01c30000 {
 			compatible = "allwinner,sun7i-a20-gmac";
 			reg = <0x01c30000 0x1054>;
-			interrupts = <0 82 4>;
+			interrupts = <GIC_SPI 82 IRQ_TYPE_LEVEL_HIGH>;
 			interrupt-names = "macirq";
 			clocks = <&ahb1_gates 17>, <&gmac_tx_clk>;
 			clock-names = "stmmaceth", "allwinner_gmac_tx";
@@ -754,10 +756,10 @@
 		timer at 01c60000 {
 			compatible = "allwinner,sun6i-a31-hstimer", "allwinner,sun7i-a20-hstimer";
 			reg = <0x01c60000 0x1000>;
-			interrupts = <0 51 4>,
-				     <0 52 4>,
-				     <0 53 4>,
-				     <0 54 4>;
+			interrupts = <GIC_SPI 51 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>;
 			clocks = <&ahb1_gates 19>;
 			resets = <&ahb1_rst 19>;
 		};
@@ -765,7 +767,7 @@
 		spi0: spi at 01c68000 {
 			compatible = "allwinner,sun6i-a31-spi";
 			reg = <0x01c68000 0x1000>;
-			interrupts = <0 65 4>;
+			interrupts = <GIC_SPI 65 IRQ_TYPE_LEVEL_HIGH>;
 			clocks = <&ahb1_gates 20>, <&spi0_clk>;
 			clock-names = "ahb", "mod";
 			dmas = <&dma 23>, <&dma 23>;
@@ -777,7 +779,7 @@
 		spi1: spi at 01c69000 {
 			compatible = "allwinner,sun6i-a31-spi";
 			reg = <0x01c69000 0x1000>;
-			interrupts = <0 66 4>;
+			interrupts = <GIC_SPI 66 IRQ_TYPE_LEVEL_HIGH>;
 			clocks = <&ahb1_gates 21>, <&spi1_clk>;
 			clock-names = "ahb", "mod";
 			dmas = <&dma 24>, <&dma 24>;
@@ -789,7 +791,7 @@
 		spi2: spi at 01c6a000 {
 			compatible = "allwinner,sun6i-a31-spi";
 			reg = <0x01c6a000 0x1000>;
-			interrupts = <0 67 4>;
+			interrupts = <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>;
 			clocks = <&ahb1_gates 22>, <&spi2_clk>;
 			clock-names = "ahb", "mod";
 			dmas = <&dma 25>, <&dma 25>;
@@ -801,7 +803,7 @@
 		spi3: spi at 01c6b000 {
 			compatible = "allwinner,sun6i-a31-spi";
 			reg = <0x01c6b000 0x1000>;
-			interrupts = <0 68 4>;
+			interrupts = <GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>;
 			clocks = <&ahb1_gates 23>, <&spi3_clk>;
 			clock-names = "ahb", "mod";
 			dmas = <&dma 26>, <&dma 26>;
@@ -818,13 +820,14 @@
 			      <0x01c86000 0x2000>;
 			interrupt-controller;
 			#interrupt-cells = <3>;
-			interrupts = <1 9 0xf04>;
+			interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
 		};
 
 		rtc: rtc at 01f00000 {
 			compatible = "allwinner,sun6i-a31-rtc";
 			reg = <0x01f00000 0x54>;
-			interrupts = <0 40 4>, <0 41 4>;
+			interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>;
 		};
 
 		nmi_intc: interrupt-controller at 01f00c0c {
@@ -832,7 +835,7 @@
 			interrupt-controller;
 			#interrupt-cells = <2>;
 			reg = <0x01f00c0c 0x38>;
-			interrupts = <0 32 4>;
+			interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
 		};
 
 		prcm at 01f01400 {
@@ -886,8 +889,8 @@
 		r_pio: pinctrl at 01f02c00 {
 			compatible = "allwinner,sun6i-a31-r-pinctrl";
 			reg = <0x01f02c00 0x400>;
-			interrupts = <0 45 4>,
-				     <0 46 4>;
+			interrupts = <GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>;
 			clocks = <&apb0_gates 0>;
 			resets = <&apb0_rst 0>;
 			gpio-controller;
arch/arm/boot/dts/sun7i-a20.dtsi +54 -52

348 lines not on this page · raw message

arch/arm/boot/dts/sun8i-a23.dtsi +25 -22

165 lines not on this page · raw message

arch/arm/boot/dts/sun9i-a80.dtsi +27 -25

153 lines not on this page · raw message

Signature · 1 line
2.2.0
#7 lore raw

PATCH 1/6 ARM: sunxi: DT: Convert to device tree includes

In reply to Maxime Ripard
Quoted 3 lines · On Tuesday 16 December 2014 22:59:54 Maxime Ripard wrote:

Prepare the device trees to use the C preprocessor.

Hi Maxime,

Since you are doing a number of changes to all the sunxi files, I have one more request for something that has been bugging me a while:

In your .dtsi files, you define devices like this:

                uart0: serial at 01c28000 {
                        compatible = "snps,dw-apb-uart";
                        reg = <0x01c28000 0x400>;
                        interrupts = <0 1 4>;
                        reg-shift = <2>;
                        reg-io-width = <4>;
                        clocks = <&apb1_gates 16>;
                        status = "disabled";
                };

and in the .dts files, you extend them like this:

                uart0: serial at 01c28000 {
                        pinctrl-names = "default";
                        pinctrl-0 = <&uart0_pins_a>;
                        status = "okay";
                };

which duplicates both the node names with their full path, and the labels. Please use one or the other, but not both. I don't mind you having the full path to each device in the dts files, just drop all the labels in that case. Most other maintainers these days just use the labels like this in the dts files however:

&uart0 {
	status = "okay";
};

which also seems completely fine.

I'm also a bit puzzled by all the pinctrl references you add in the .dts files, but it's possible I'm missing something there. Why can't you move these to the .dtsi files and avoid duplicating the pinctrl-0 and pinctrl-names properties for every .dts file? I would assume that they are not referenced for disabled devices.

Arnd

#8 lore raw

PATCH 1/6 ARM: sunxi: DT: Convert to device tree includes

Hi Arnd,

Quoted 31 lines · Arnd Bergmann
Quoted 3 lines · On Tuesday 16 December 2014 22:59:54 Maxime Ripard wrote:

Prepare the device trees to use the C preprocessor.

Hi Maxime,

Since you are doing a number of changes to all the sunxi files, I have one more request for something that has been bugging me a while:

In your .dtsi files, you define devices like this:

                uart0: serial at 01c28000 {
                        compatible = "snps,dw-apb-uart";
                        reg = <0x01c28000 0x400>;
                        interrupts = <0 1 4>;
                        reg-shift = <2>;
                        reg-io-width = <4>;
                        clocks = <&apb1_gates 16>;
                        status = "disabled";
                };

and in the .dts files, you extend them like this:

                uart0: serial at 01c28000 {
                        pinctrl-names = "default";
                        pinctrl-0 = <&uart0_pins_a>;
                        status = "okay";
                };
Quoted 4 lines

which duplicates both the node names with their full path, and the labels. Please use one or the other, but not both. I don't mind you having the full path to each device in the dts files, just drop all the labels in that case.

I don't know, maybe it's just a matter of personnal taste, but I do find convenient to have the labels in the DTS as well, so that whenever you need to use a label (for a phandle for example), you don't have to lookup in the DTSI if you have the node in the DTS.

Quoted 8 lines

Most other maintainers these days just use the labels like this in the dts files however:

&uart0 {
	status = "okay";
};

which also seems completely fine.

If that's the current trend, I'll add that to my todo-list, but I believe it's orthogonal to these patches.

Quoted 5 lines

I'm also a bit puzzled by all the pinctrl references you add in the .dts files, but it's possible I'm missing something there. Why can't you move these to the .dtsi files and avoid duplicating the pinctrl-0 and pinctrl-names properties for every .dts file? I would assume that they are not referenced for disabled devices.

The pinctrl nodes we reference are in the DTS. However, each pin of each controller is most of the time available on several pins of the package, so we don't have any way to enforce a default at the SoC level.

Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141217/064f02c7/attachment-0001.sig>
#9 lore raw

PATCH 1/6 ARM: sunxi: DT: Convert to device tree includes

Quoted 39 lines · On Wednesday 17 December 2014 22:33:58 Maxime Ripard wrote:

Hi Arnd,

Quoted 31 lines · Arnd Bergmann
Quoted 3 lines · On Tuesday 16 December 2014 22:59:54 Maxime Ripard wrote:

Prepare the device trees to use the C preprocessor.

Hi Maxime,

Since you are doing a number of changes to all the sunxi files, I have one more request for something that has been bugging me a while:

In your .dtsi files, you define devices like this:

                uart0: serial at 01c28000 {
                        compatible = "snps,dw-apb-uart";
                        reg = <0x01c28000 0x400>;
                        interrupts = <0 1 4>;
                        reg-shift = <2>;
                        reg-io-width = <4>;
                        clocks = <&apb1_gates 16>;
                        status = "disabled";
                };

and in the .dts files, you extend them like this:

                uart0: serial at 01c28000 {
                        pinctrl-names = "default";
                        pinctrl-0 = <&uart0_pins_a>;
                        status = "okay";
                };
Quoted 4 lines

which duplicates both the node names with their full path, and the labels. Please use one or the other, but not both. I don't mind you having the full path to each device in the dts files, just drop all the labels in that case.

Quoted 4 lines

I don't know, maybe it's just a matter of personnal taste, but I do find convenient to have the labels in the DTS as well, so that whenever you need to use a label (for a phandle for example), you don't have to lookup in the DTSI if you have the node in the DTS.

But the redundancy seems overly redundant and unnecessary ;-)

What you describe will only work for nodes you already list in the dts file, not for those that are left untouched.

As far as I can tell, almost all phandle references you have are either pointing to devices you never define in a dts file, or those you never define in a dtsi file:

git grep \& arch/arm/boot/dts/sun*.dts | cut -f 2 -d\& | cut -f 1 -d\ | cut -f 1 -d \> | sort -u | while read i ; do echo git grep -w $i: arch/arm/boot/dts/sun*.dts | wc -l git grep -w $i: arch/arm/boot/dts/sun*.dtsi | wc -l $i ; done

Quoted 11 lines
Quoted 8 lines

Most other maintainers these days just use the labels like this in the dts files however:

&uart0 {
	status = "okay";
};

which also seems completely fine.

If that's the current trend, I'll add that to my todo-list, but I believe it's orthogonal to these patches.

It's orthogonal, I'm just mentioning it because it makes me cringe whenever I look at these files, and because you already touch almost every device in your dts files, so you will have to deal with merge conflicts already, and it's better to do it all at once.

Quoted 10 lines
Quoted 5 lines

I'm also a bit puzzled by all the pinctrl references you add in the .dts files, but it's possible I'm missing something there. Why can't you move these to the .dtsi files and avoid duplicating the pinctrl-0 and pinctrl-names properties for every .dts file? I would assume that they are not referenced for disabled devices.

The pinctrl nodes we reference are in the DTS. However, each pin of each controller is most of the time available on several pins of the package, so we don't have any way to enforce a default at the SoC level.

Ah, makes sense.

Arnd

#10 lore raw

PATCH 1/6 ARM: sunxi: DT: Convert to device tree includes

Quoted 47 lines · Arnd Bergmann
Quoted 39 lines · On Wednesday 17 December 2014 22:33:58 Maxime Ripard wrote:

Hi Arnd,

Quoted 31 lines · Arnd Bergmann
Quoted 3 lines · On Tuesday 16 December 2014 22:59:54 Maxime Ripard wrote:

Prepare the device trees to use the C preprocessor.

Hi Maxime,

Since you are doing a number of changes to all the sunxi files, I have one more request for something that has been bugging me a while:

In your .dtsi files, you define devices like this:

                uart0: serial at 01c28000 {
                        compatible = "snps,dw-apb-uart";
                        reg = <0x01c28000 0x400>;
                        interrupts = <0 1 4>;
                        reg-shift = <2>;
                        reg-io-width = <4>;
                        clocks = <&apb1_gates 16>;
                        status = "disabled";
                };

and in the .dts files, you extend them like this:

                uart0: serial at 01c28000 {
                        pinctrl-names = "default";
                        pinctrl-0 = <&uart0_pins_a>;
                        status = "okay";
                };
Quoted 4 lines

which duplicates both the node names with their full path, and the labels. Please use one or the other, but not both. I don't mind you having the full path to each device in the dts files, just drop all the labels in that case.

Quoted 4 lines

I don't know, maybe it's just a matter of personnal taste, but I do find convenient to have the labels in the DTS as well, so that whenever you need to use a label (for a phandle for example), you don't have to lookup in the DTSI if you have the node in the DTS.

But the redundancy seems overly redundant and unnecessary ;-)

Quoted 8 lines

What you describe will only work for nodes you already list in the dts file, not for those that are left untouched.

As far as I can tell, almost all phandle references you have are either pointing to devices you never define in a dts file, or those you never define in a dtsi file:

git grep \& arch/arm/boot/dts/sun*.dts | cut -f 2 -d\& | cut -f 1 -d\ | cut -f 1 -d \> | sort -u | while read i ; do echo git grep -w $i: arch/arm/boot/dts/sun*.dts | wc -l git grep -w $i: arch/arm/boot/dts/sun*.dtsi | wc -l $i ; done

Indeed, there's some minor exceptions, mostly for the pinctrl nodes when we want to change the drive strength or pullup/pulldown configuration of a pinctrl node already defined in the DTSI. IR and MMC pins are in this case.

Quoted 9 lines
Quoted 9 lines
Quoted 8 lines

Most other maintainers these days just use the labels like this in the dts files however:

&uart0 {
	status = "okay";
};

which also seems completely fine.

Quoted 7 lines
Quoted 2 lines

If that's the current trend, I'll add that to my todo-list, but I believe it's orthogonal to these patches.

It's orthogonal, I'm just mentioning it because it makes me cringe whenever I look at these files, and because you already touch almost every device in your dts files, so you will have to deal with merge conflicts already, and it's better to do it all at once.

Okay, I'll come up with a patch to modify that then.

Thanks!
Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141219/72fd2e78/attachment-0001.sig>
#11 lore raw

PATCH 6/6 ARM: sunxi: DT: Convert the DTs to use the generic interrupt header

In reply to Maxime Ripard

The NMI IRQ controller uses the standard flags definition for the IRQ level and edges.

Use the common header to use defines instead of opaque numbers.

---
 arch/arm/boot/dts/sun7i-a20-bananapi.dts        | 4 +++-
 arch/arm/boot/dts/sun7i-a20-cubieboard2.dts     | 4 +++-
 arch/arm/boot/dts/sun7i-a20-cubietruck.dts      | 4 +++-
 arch/arm/boot/dts/sun7i-a20-hummingbird.dts     | 4 +++-
 arch/arm/boot/dts/sun7i-a20-i12-tvbox.dts       | 4 +++-
 arch/arm/boot/dts/sun7i-a20-m3.dts              | 4 +++-
 arch/arm/boot/dts/sun7i-a20-olinuxino-lime.dts  | 4 +++-
 arch/arm/boot/dts/sun7i-a20-olinuxino-lime2.dts | 4 +++-
 arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts | 4 +++-
 arch/arm/boot/dts/sun7i-a20-pcduino3.dts        | 3 ++-
 10 files changed, 29 insertions(+), 10 deletions(-)
arch/arm/boot/dts/sun7i-a20-bananapi.dts +3 -1
index d5e5d39ff3c0..6ee352b852bf 100644
@@ -52,6 +52,8 @@
 #include "sunxi-common-regulators.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+
 #include <dt-bindings/pinctrl/sun4i-a10.h>
 
 / {
@@ -157,7 +159,7 @@
 				compatible = "x-powers,axp209";
 				reg = <0x34>;
 				interrupt-parent = <&nmi_intc>;
-				interrupts = <0 8>;
+				interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
 
 				interrupt-controller;
 				#interrupt-cells = <1>;
arch/arm/boot/dts/sun7i-a20-cubieboard2.dts +3 -1
index 9dc4c10f682e..94344d2a87e0 100644
@@ -16,6 +16,8 @@
 #include "sunxi-common-regulators.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+
 #include <dt-bindings/pinctrl/sun4i-a10.h>
 
 / {
@@ -90,7 +92,7 @@
 				compatible = "x-powers,axp209";
 				reg = <0x34>;
 				interrupt-parent = <&nmi_intc>;
-				interrupts = <0 8>;
+				interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
 
 				interrupt-controller;
 				#interrupt-cells = <1>;
arch/arm/boot/dts/sun7i-a20-cubietruck.dts +3 -1
index 673846245cd9..811749672158 100644
@@ -16,6 +16,8 @@
 #include "sunxi-common-regulators.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+
 #include <dt-bindings/pinctrl/sun4i-a10.h>
 
 / {
@@ -132,7 +134,7 @@
 				compatible = "x-powers,axp209";
 				reg = <0x34>;
 				interrupt-parent = <&nmi_intc>;
-				interrupts = <0 8>;
+				interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
 
 				interrupt-controller;
 				#interrupt-cells = <1>;
arch/arm/boot/dts/sun7i-a20-hummingbird.dts +3 -1
index 4356a1709559..f5b02ec6016d 100644
@@ -16,6 +16,8 @@
 #include "sunxi-common-regulators.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+
 #include <dt-bindings/pinctrl/sun4i-a10.h>
 
 / {
@@ -150,7 +152,7 @@
 				compatible = "x-powers,axp209";
 				reg = <0x34>;
 				interrupt-parent = <&nmi_intc>;
-				interrupts = <0 8>;
+				interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
 				interrupt-controller;
 				#interrupt-cells = <1>;
 			};
arch/arm/boot/dts/sun7i-a20-i12-tvbox.dts +3 -1
index 275e49ffb78b..a4fcd479e0e7 100644
@@ -50,6 +50,8 @@
 #include "sunxi-common-regulators.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+
 #include <dt-bindings/pinctrl/sun4i-a10.h>
 
 / {
@@ -154,7 +156,7 @@
 				compatible = "x-powers,axp209";
 				reg = <0x34>;
 				interrupt-parent = <&nmi_intc>;
-				interrupts = <0 8>;
+				interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
 
 				interrupt-controller;
 				#interrupt-cells = <1>;
arch/arm/boot/dts/sun7i-a20-m3.dts +3 -1
index 15be3ea80088..693ae780aa99 100644
@@ -52,6 +52,8 @@
 #include "sunxi-common-regulators.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+
 #include <dt-bindings/pinctrl/sun4i-a10.h>
 
 / {
@@ -130,7 +132,7 @@
 				compatible = "x-powers,axp209";
 				reg = <0x34>;
 				interrupt-parent = <&nmi_intc>;
-				interrupts = <0 8>;
+				interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
 
 				interrupt-controller;
 				#interrupt-cells = <1>;
arch/arm/boot/dts/sun7i-a20-olinuxino-lime.dts +3 -1
index f74405cd18b6..14c46cfcccb8 100644
@@ -53,6 +53,8 @@
 #include "sunxi-common-regulators.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+
 #include <dt-bindings/pinctrl/sun4i-a10.h>
 
 / {
@@ -128,7 +130,7 @@
 				compatible = "x-powers,axp209";
 				reg = <0x34>;
 				interrupt-parent = <&nmi_intc>;
-				interrupts = <0 8>;
+				interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
 
 				interrupt-controller;
 				#interrupt-cells = <1>;
arch/arm/boot/dts/sun7i-a20-olinuxino-lime2.dts +3 -1
index 7176721f6c6b..263b95572d74 100644
@@ -50,6 +50,8 @@
 #include "sunxi-common-regulators.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+
 #include <dt-bindings/pinctrl/sun4i-a10.h>
 
 / {
@@ -125,7 +127,7 @@
 				compatible = "x-powers,axp209";
 				reg = <0x34>;
 				interrupt-parent = <&nmi_intc>;
-				interrupts = <0 8>;
+				interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
 
 				interrupt-controller;
 				#interrupt-cells = <1>;
arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts +3 -1
index 3e2979b03cf6..85023f8dcc75 100644
@@ -16,6 +16,8 @@
 #include "sunxi-common-regulators.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+
 #include <dt-bindings/pinctrl/sun4i-a10.h>
 
 / {
@@ -130,7 +132,7 @@
 				compatible = "x-powers,axp209";
 				reg = <0x34>;
 				interrupt-parent = <&nmi_intc>;
-				interrupts = <0 8>;
+				interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
 
 				interrupt-controller;
 				#interrupt-cells = <1>;
arch/arm/boot/dts/sun7i-a20-pcduino3.dts +2 -1
index 30f7a11a0017..f27d8e765c14 100644
@@ -52,6 +52,7 @@
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/interrupt-controller/irq.h>
 
 #include <dt-bindings/pinctrl/sun4i-a10.h>
 
@@ -138,7 +139,7 @@
 				compatible = "x-powers,axp209";
 				reg = <0x34>;
 				interrupt-parent = <&nmi_intc>;
-				interrupts = <0 8>;
+				interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
 
 				interrupt-controller;
 				#interrupt-cells = <1>;
Signature · 1 line
2.2.0