diff options
author | Ćukasz Majewski <l.majewski@samsung.com> | 2012-09-04 21:47:46 (GMT) |
---|---|---|
committer | Minkyu Kang <mk7.kang@samsung.com> | 2012-11-15 12:08:18 (GMT) |
commit | 822593f02890f10e08c39ed82f926c9a80f7d533 (patch) | |
tree | 07e04295e200d15a18a8d09df807c444200d20de /arch/arm/include/asm/arch-exynos | |
parent | ccfa398547ce0b579f2e7874e78948246c739237 (diff) | |
download | u-boot-fsl-qoriq-822593f02890f10e08c39ed82f926c9a80f7d533.tar.xz |
gpio:fix: Proper handling of GPIO subsystem parts at Samsung devices
Now proper GPIO parts numbering is handled at Samsung devices.
This fix is necessary for code using GPIO located at other banks
than first.
Test HW:
- Exynos4210 - Trats
- S5PC110 - goni
Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
Diffstat (limited to 'arch/arm/include/asm/arch-exynos')
-rw-r--r-- | arch/arm/include/asm/arch-exynos/gpio.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/arm/include/asm/arch-exynos/gpio.h b/arch/arm/include/asm/arch-exynos/gpio.h index 97be4ea..4db8fd6 100644 --- a/arch/arm/include/asm/arch-exynos/gpio.h +++ b/arch/arm/include/asm/arch-exynos/gpio.h @@ -207,6 +207,25 @@ static inline unsigned int s5p_gpio_base(int nr) return 0; } +static inline unsigned int s5p_gpio_part_max(int nr) +{ + if (cpu_is_exynos5()) { + if (nr < EXYNOS5_GPIO_PART1_MAX) + return 0; + else if (nr < EXYNOS5_GPIO_PART2_MAX) + return EXYNOS5_GPIO_PART1_MAX; + else + return EXYNOS5_GPIO_PART2_MAX; + + } else if (cpu_is_exynos4()) { + if (nr < EXYNOS4_GPIO_PART1_MAX) + return 0; + else + return EXYNOS4_GPIO_PART1_MAX; + } + + return 0; +} #endif /* Pin configurations */ |