|
@@ -88,6 +88,35 @@ unsigned int s5p_gpio_get_value(struct s5p_gpio_bank *bank, int gpio);
|
|
|
void s5p_gpio_set_pull(struct s5p_gpio_bank *bank, int gpio, int mode);
|
|
|
void s5p_gpio_set_drv(struct s5p_gpio_bank *bank, int gpio, int mode);
|
|
|
void s5p_gpio_set_rate(struct s5p_gpio_bank *bank, int gpio, int mode);
|
|
|
+
|
|
|
+/* GPIO pins per bank */
|
|
|
+#define GPIO_PER_BANK 8
|
|
|
+
|
|
|
+#define s5pc210_gpio_part1_get_nr(bank, pin) \
|
|
|
+ ((((((unsigned int) &(((struct s5pc210_gpio_part1 *) \
|
|
|
+ S5PC210_GPIO_PART1_BASE)->bank)) \
|
|
|
+ - S5PC210_GPIO_PART1_BASE) / sizeof(struct s5p_gpio_bank)) \
|
|
|
+ * GPIO_PER_BANK) + pin)
|
|
|
+
|
|
|
+#define GPIO_PART1_MAX ((sizeof(struct s5pc210_gpio_part1) \
|
|
|
+ / sizeof(struct s5p_gpio_bank)) * GPIO_PER_BANK)
|
|
|
+
|
|
|
+#define s5pc210_gpio_part2_get_nr(bank, pin) \
|
|
|
+ (((((((unsigned int) &(((struct s5pc210_gpio_part2 *) \
|
|
|
+ S5PC210_GPIO_PART2_BASE)->bank)) \
|
|
|
+ - S5PC210_GPIO_PART2_BASE) / sizeof(struct s5p_gpio_bank)) \
|
|
|
+ * GPIO_PER_BANK) + pin) + GPIO_PART1_MAX)
|
|
|
+
|
|
|
+static inline unsigned int s5p_gpio_base(int nr)
|
|
|
+{
|
|
|
+ if (nr < GPIO_PART1_MAX)
|
|
|
+ return S5PC210_GPIO_PART1_BASE;
|
|
|
+ else
|
|
|
+ return S5PC210_GPIO_PART2_BASE;
|
|
|
+
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
#endif
|
|
|
|
|
|
/* Pin configurations */
|