diff options
| author | Linus Walleij <linus.walleij@linaro.org> | 2013-12-06 06:46:27 -0500 |
|---|---|---|
| committer | Linus Walleij <linus.walleij@linaro.org> | 2013-12-20 12:19:36 -0500 |
| commit | 41c3548e6da67786bcaf8ee7b406f6f85ddd816b (patch) | |
| tree | a1d57c285d2113ce97ca8bfd817a6e42c400474e /include/linux/platform_data | |
| parent | c67d0f29262bf6f863ce74d0756618bbd9ba80fd (diff) | |
ARM: s3c64xx: get rid of custom <mach/gpio.h>
This isolates the custom S3C64xx GPIO definition table to
<linux/platform_data/gpio-samsung-s3x64xx.h> as this is
used in a few different places in the kernel, removing the
need to depend on the implicit inclusion of <mach/gpio.h>
from <linux/gpio.h> and thus getting rid of a few nasty
cross-dependencies.
Also delete the CONFIG_SAMSUNG_GPIO_EXTRA stuff. Instead
roof the number of GPIOs for this platform:
First sum up all the GPIO banks from A to Q: 187 GPIOs.
Add the 16 "board GPIOs" and the roof for SAMSUNG_GPIO_EXTRA,
128, so in total maximum 187+16+128 = 331 GPIOs, so let's
take the same roof as for S3C24XX: 512. This way we can do
away with the GPIO calculation macros for GPIO_BOARD_START,
BOARD_NR_GPIOS and the definition of ARCH_NR_GPIOS.
Cc: Mark Brown <broonie@kernel.org>
[on Mini6410 board]
Tested-by: Tomasz Figa <t.figa@samsung.com>
[for changes in mach-s3c64xx]
Acked-by: Tomasz Figa <t.figa@samsung.com>
Tested-by: Mark Brown <broonie@linaro.org>
Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'include/linux/platform_data')
| -rw-r--r-- | include/linux/platform_data/gpio-samsung-s3c64xx.h | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/include/linux/platform_data/gpio-samsung-s3c64xx.h b/include/linux/platform_data/gpio-samsung-s3c64xx.h new file mode 100644 index 000000000000..9c81fac3b2d5 --- /dev/null +++ b/include/linux/platform_data/gpio-samsung-s3c64xx.h | |||
| @@ -0,0 +1,94 @@ | |||
| 1 | /* | ||
| 2 | * Copyright 2008 Openmoko, Inc. | ||
| 3 | * Copyright 2008 Simtec Electronics | ||
| 4 | * http://armlinux.simtec.co.uk/ | ||
| 5 | * Ben Dooks <ben@simtec.co.uk> | ||
| 6 | * | ||
| 7 | * S3C6400 - GPIO lib support | ||
| 8 | * | ||
| 9 | * This program is free software; you can redistribute it and/or modify | ||
| 10 | * it under the terms of the GNU General Public License version 2 as | ||
| 11 | * published by the Free Software Foundation. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef GPIO_SAMSUNG_S3C64XX_H | ||
| 15 | #define GPIO_SAMSUNG_S3C64XX_H | ||
| 16 | |||
| 17 | /* GPIO bank sizes */ | ||
| 18 | #define S3C64XX_GPIO_A_NR (8) | ||
| 19 | #define S3C64XX_GPIO_B_NR (7) | ||
| 20 | #define S3C64XX_GPIO_C_NR (8) | ||
| 21 | #define S3C64XX_GPIO_D_NR (5) | ||
| 22 | #define S3C64XX_GPIO_E_NR (5) | ||
| 23 | #define S3C64XX_GPIO_F_NR (16) | ||
| 24 | #define S3C64XX_GPIO_G_NR (7) | ||
| 25 | #define S3C64XX_GPIO_H_NR (10) | ||
| 26 | #define S3C64XX_GPIO_I_NR (16) | ||
| 27 | #define S3C64XX_GPIO_J_NR (12) | ||
| 28 | #define S3C64XX_GPIO_K_NR (16) | ||
| 29 | #define S3C64XX_GPIO_L_NR (15) | ||
| 30 | #define S3C64XX_GPIO_M_NR (6) | ||
| 31 | #define S3C64XX_GPIO_N_NR (16) | ||
| 32 | #define S3C64XX_GPIO_O_NR (16) | ||
| 33 | #define S3C64XX_GPIO_P_NR (15) | ||
| 34 | #define S3C64XX_GPIO_Q_NR (9) | ||
| 35 | |||
| 36 | /* GPIO bank numbes */ | ||
| 37 | |||
| 38 | /* CONFIG_S3C_GPIO_SPACE allows the user to select extra | ||
| 39 | * space for debugging purposes so that any accidental | ||
| 40 | * change from one gpio bank to another can be caught. | ||
| 41 | */ | ||
| 42 | |||
| 43 | #define S3C64XX_GPIO_NEXT(__gpio) \ | ||
| 44 | ((__gpio##_START) + (__gpio##_NR) + CONFIG_S3C_GPIO_SPACE + 1) | ||
| 45 | |||
| 46 | enum s3c_gpio_number { | ||
| 47 | S3C64XX_GPIO_A_START = 0, | ||
| 48 | S3C64XX_GPIO_B_START = S3C64XX_GPIO_NEXT(S3C64XX_GPIO_A), | ||
| 49 | S3C64XX_GPIO_C_START = S3C64XX_GPIO_NEXT(S3C64XX_GPIO_B), | ||
| 50 | S3C64XX_GPIO_D_START = S3C64XX_GPIO_NEXT(S3C64XX_GPIO_C), | ||
| 51 | S3C64XX_GPIO_E_START = S3C64XX_GPIO_NEXT(S3C64XX_GPIO_D), | ||
| 52 | S3C64XX_GPIO_F_START = S3C64XX_GPIO_NEXT(S3C64XX_GPIO_E), | ||
| 53 | S3C64XX_GPIO_G_START = S3C64XX_GPIO_NEXT(S3C64XX_GPIO_F), | ||
| 54 | S3C64XX_GPIO_H_START = S3C64XX_GPIO_NEXT(S3C64XX_GPIO_G), | ||
| 55 | S3C64XX_GPIO_I_START = S3C64XX_GPIO_NEXT(S3C64XX_GPIO_H), | ||
| 56 | S3C64XX_GPIO_J_START = S3C64XX_GPIO_NEXT(S3C64XX_GPIO_I), | ||
| 57 | S3C64XX_GPIO_K_START = S3C64XX_GPIO_NEXT(S3C64XX_GPIO_J), | ||
| 58 | S3C64XX_GPIO_L_START = S3C64XX_GPIO_NEXT(S3C64XX_GPIO_K), | ||
| 59 | S3C64XX_GPIO_M_START = S3C64XX_GPIO_NEXT(S3C64XX_GPIO_L), | ||
| 60 | S3C64XX_GPIO_N_START = S3C64XX_GPIO_NEXT(S3C64XX_GPIO_M), | ||
| 61 | S3C64XX_GPIO_O_START = S3C64XX_GPIO_NEXT(S3C64XX_GPIO_N), | ||
| 62 | S3C64XX_GPIO_P_START = S3C64XX_GPIO_NEXT(S3C64XX_GPIO_O), | ||
| 63 | S3C64XX_GPIO_Q_START = S3C64XX_GPIO_NEXT(S3C64XX_GPIO_P), | ||
| 64 | }; | ||
| 65 | |||
| 66 | /* S3C64XX GPIO number definitions. */ | ||
| 67 | |||
| 68 | #define S3C64XX_GPA(_nr) (S3C64XX_GPIO_A_START + (_nr)) | ||
| 69 | #define S3C64XX_GPB(_nr) (S3C64XX_GPIO_B_START + (_nr)) | ||
| 70 | #define S3C64XX_GPC(_nr) (S3C64XX_GPIO_C_START + (_nr)) | ||
| 71 | #define S3C64XX_GPD(_nr) (S3C64XX_GPIO_D_START + (_nr)) | ||
| 72 | #define S3C64XX_GPE(_nr) (S3C64XX_GPIO_E_START + (_nr)) | ||
| 73 | #define S3C64XX_GPF(_nr) (S3C64XX_GPIO_F_START + (_nr)) | ||
| 74 | #define S3C64XX_GPG(_nr) (S3C64XX_GPIO_G_START + (_nr)) | ||
| 75 | #define S3C64XX_GPH(_nr) (S3C64XX_GPIO_H_START + (_nr)) | ||
| 76 | #define S3C64XX_GPI(_nr) (S3C64XX_GPIO_I_START + (_nr)) | ||
| 77 | #define S3C64XX_GPJ(_nr) (S3C64XX_GPIO_J_START + (_nr)) | ||
| 78 | #define S3C64XX_GPK(_nr) (S3C64XX_GPIO_K_START + (_nr)) | ||
| 79 | #define S3C64XX_GPL(_nr) (S3C64XX_GPIO_L_START + (_nr)) | ||
| 80 | #define S3C64XX_GPM(_nr) (S3C64XX_GPIO_M_START + (_nr)) | ||
| 81 | #define S3C64XX_GPN(_nr) (S3C64XX_GPIO_N_START + (_nr)) | ||
| 82 | #define S3C64XX_GPO(_nr) (S3C64XX_GPIO_O_START + (_nr)) | ||
| 83 | #define S3C64XX_GPP(_nr) (S3C64XX_GPIO_P_START + (_nr)) | ||
| 84 | #define S3C64XX_GPQ(_nr) (S3C64XX_GPIO_Q_START + (_nr)) | ||
| 85 | |||
| 86 | /* the end of the S3C64XX specific gpios */ | ||
| 87 | #define S3C64XX_GPIO_END (S3C64XX_GPQ(S3C64XX_GPIO_Q_NR) + 1) | ||
| 88 | #define S3C_GPIO_END S3C64XX_GPIO_END | ||
| 89 | |||
| 90 | /* define the number of gpios we need to the one after the GPQ() range */ | ||
| 91 | #define GPIO_BOARD_START (S3C64XX_GPQ(S3C64XX_GPIO_Q_NR) + 1) | ||
| 92 | |||
| 93 | #endif /* GPIO_SAMSUNG_S3C64XX_H */ | ||
| 94 | |||
