summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorƁukasz Majewski <l.majewski@samsung.com>2012-09-04 21:47:46 +0000
committerMinkyu Kang <mk7.kang@samsung.com>2012-11-15 21:08:18 +0900
commit822593f02890f10e08c39ed82f926c9a80f7d533 (patch)
tree07e04295e200d15a18a8d09df807c444200d20de /drivers
parentccfa398547ce0b579f2e7874e78948246c739237 (diff)
downloadu-boot-imx-822593f02890f10e08c39ed82f926c9a80f7d533.zip
u-boot-imx-822593f02890f10e08c39ed82f926c9a80f7d533.tar.gz
u-boot-imx-822593f02890f10e08c39ed82f926c9a80f7d533.tar.bz2
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 'drivers')
-rw-r--r--drivers/gpio/s5p_gpio.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpio/s5p_gpio.c b/drivers/gpio/s5p_gpio.c
index 47f3213..656bf4a 100644
--- a/drivers/gpio/s5p_gpio.c
+++ b/drivers/gpio/s5p_gpio.c
@@ -144,9 +144,11 @@ void s5p_gpio_set_rate(struct s5p_gpio_bank *bank, int gpio, int mode)
struct s5p_gpio_bank *s5p_gpio_get_bank(unsigned gpio)
{
- int bank = gpio / GPIO_PER_BANK;
- bank *= sizeof(struct s5p_gpio_bank);
+ int bank;
+ unsigned g = gpio - s5p_gpio_part_max(gpio);
+ bank = g / GPIO_PER_BANK;
+ bank *= sizeof(struct s5p_gpio_bank);
return (struct s5p_gpio_bank *) (s5p_gpio_base(gpio) + bank);
}