From: Masahiro Yamada Date: Fri, 24 Nov 2017 15:25:34 +0000 (+0900) Subject: gpio: uniphier: import dt-binginds header from Linux X-Git-Tag: v2018.01-rc1~61^2~2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e9986a4fa772f1d129725c5712e60298ee14f5b2;p=u-boot gpio: uniphier: import dt-binginds header from Linux Signed-off-by: Masahiro Yamada --- diff --git a/drivers/gpio/gpio-uniphier.c b/drivers/gpio/gpio-uniphier.c index 107c3fcb10..8d72ab8c4a 100644 --- a/drivers/gpio/gpio-uniphier.c +++ b/drivers/gpio/gpio-uniphier.c @@ -13,8 +13,7 @@ #include #include #include - -#define UNIPHIER_GPIO_LINES_PER_BANK 8 +#include #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 index 0000000000..9f0ad174f6 --- /dev/null +++ b/include/dt-bindings/gpio/uniphier-gpio.h @@ -0,0 +1,18 @@ +/* + * Copyright (C) 2017 Socionext Inc. + * Author: Masahiro Yamada + */ + +#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 */