EXYNOS: EXYNOS5250: add gpio structure for EXYNOS5250
Subsystems (2)
PATCH 2/2 EXYNOS: EXYNOS5250: add gpio structure for EXYNOS5250
This patch add gpio structure of exynos5250.
Exynos5xxx series has each different gpio bank, so it is needed to separate. After separation task, useless variables will be removed.
--- arch/arm/include/asm/arch-exynos/gpio.h | 80 +++++++++++++++++++++++++++++++ 1 files changed, 80 insertions(+), 0 deletions(-)
(quoted diff) +0 -0
b/arch/arm/include/asm/arch-exynos/gpio.h
index cfe1024..be84b87 100644
arch/arm/include/asm/arch-exynos/gpio.h +56 -0
62 lines not on this page · raw message
int en);
@@ -272,6 +328,30 @@ void s5p_gpio_set_rate(struct s5p_gpio_bank *bank, int gpio, int mode);
- EXYNOS5_GPIO_PART3_BASE) / sizeof(struct s5p_gpio_bank)) \
* GPIO_PER_BANK) + pin) + EXYNOS5_GPIO_PART2_MAX)
+#define exynos5250_gpio_part1_get_nr(bank, pin) \
+ ((((((unsigned int) &(((struct exynos5250_gpio_part1 *) \
+ EXYNOS5250_GPIO_PART1_BASE)->bank)) \
+ - EXYNOS5250_GPIO_PART1_BASE) / sizeof(struct s5p_gpio_bank)) \
+ * GPIO_PER_BANK) + pin)
+
+#define EXYNOS5250_GPIO_PART1_MAX ((sizeof(struct exynos5250_gpio_part1) \
+ / sizeof(struct s5p_gpio_bank)) * GPIO_PER_BANK)
+
+#define exynos5250_gpio_part2_get_nr(bank, pin) \
+ (((((((unsigned int) &(((struct exynos5250_gpio_part2 *) \
+ EXYNOS5250_GPIO_PART2_BASE)->bank)) \
+ - EXYNOS52590_GPIO_PART2_BASE) / sizeof(struct s5p_gpio_bank)) \
+ * GPIO_PER_BANK) + pin) + EXYNOS5250_GPIO_PART1_MAX)
+
+#define EXYNOS5250_GPIO_PART2_MAX ((sizeof(struct exynos5250_gpio_part2) \
+ / sizeof(struct s5p_gpio_bank)) * GPIO_PER_BANK)
+
+#define exynos5250_gpio_part3_get_nr(bank, pin) \
+ (((((((unsigned int) &(((struct exynos5250_gpio_part3 *) \
+ EXYNOS5250_GPIO_PART3_BASE)->bank)) \
+ - EXYNOS5250_GPIO_PART3_BASE) / sizeof(struct s5p_gpio_bank)) \
+ * GPIO_PER_BANK) + pin) + EXYNOS5250_GPIO_PART2_MAX)
+
static inline unsigned int s5p_gpio_base(int nr)
{
if (cpu_is_exynos5()) {Signature · 1 line
1.7.4.1