gpio: uniphier: import dt-binginds header from Linux
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Fri, 24 Nov 2017 15:25:34 +0000 (00:25 +0900)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Tue, 28 Nov 2017 15:28:59 +0000 (00:28 +0900)
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
drivers/gpio/gpio-uniphier.c
include/dt-bindings/gpio/uniphier-gpio.h [new file with mode: 0644]

index 107c3fcb10a5ab3a42d90778c2848197f6320ead..8d72ab8c4a1573f6ebcab077b1a8926e16278fa9 100644 (file)
@@ -13,8 +13,7 @@
 #include <linux/errno.h>
 #include <asm/global_data.h>
 #include <asm/gpio.h>
-
-#define UNIPHIER_GPIO_LINES_PER_BANK   8
+#include <dt-bindings/gpio/uniphier-gpio.h>
 
 #define UNIPHIER_GPIO_PORT_DATA                0x0     /* data */
 #define UNIPHIER_GPIO_PORT_DIR         0x4     /* direction (1:in, 0:out) */
diff --git a/include/dt-bindings/gpio/uniphier-gpio.h b/include/dt-bindings/gpio/uniphier-gpio.h
new file mode 100644 (file)
index 0000000..9f0ad17
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ * Copyright (C) 2017 Socionext Inc.
+ *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
+ */
+
+#ifndef _DT_BINDINGS_GPIO_UNIPHIER_H
+#define _DT_BINDINGS_GPIO_UNIPHIER_H
+
+#define UNIPHIER_GPIO_LINES_PER_BANK   8
+
+#define UNIPHIER_GPIO_IRQ_OFFSET       ((UNIPHIER_GPIO_LINES_PER_BANK) * 15)
+
+#define UNIPHIER_GPIO_PORT(bank, line) \
+                       ((UNIPHIER_GPIO_LINES_PER_BANK) * (bank) + (line))
+
+#define UNIPHIER_GPIO_IRQ(n)           ((UNIPHIER_GPIO_IRQ_OFFSET) + (n))
+
+#endif /* _DT_BINDINGS_GPIO_UNIPHIER_H */