diff options
author | Linus Walleij <linus.walleij@stericsson.com> | 2009-09-28 07:36:18 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-10-01 11:26:15 -0400 |
commit | ee17962e249024ebba72acbfe7cf54f8ea5b72f8 (patch) | |
tree | 2e13e55fa2023e5b841b342d942ee358ccb37266 | |
parent | aa45ee8fc0ee87c1711b5fe8eb3556d06530c39e (diff) |
ARM: 5731/2: Fix U300 generic GPIO, remove ifdefs from MMCI v3
The #ifdefs in the MMCI driver were erroneous and just masking
a bug in the U300 generic GPIO implementation. This removes the
ifdefs and fixes the U300 generic GPIO instead.
Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | arch/arm/mach-u300/gpio.c | 10 | ||||
-rw-r--r-- | arch/arm/mach-u300/include/mach/gpio.h | 1 | ||||
-rw-r--r-- | drivers/mmc/host/mmci.c | 2 |
3 files changed, 11 insertions, 2 deletions
diff --git a/arch/arm/mach-u300/gpio.c b/arch/arm/mach-u300/gpio.c index 63c8f27fb15a..0b35826b7d1d 100644 --- a/arch/arm/mach-u300/gpio.c +++ b/arch/arm/mach-u300/gpio.c | |||
@@ -281,6 +281,16 @@ int gpio_unregister_callback(unsigned gpio) | |||
281 | } | 281 | } |
282 | EXPORT_SYMBOL(gpio_unregister_callback); | 282 | EXPORT_SYMBOL(gpio_unregister_callback); |
283 | 283 | ||
284 | /* Non-zero means valid */ | ||
285 | int gpio_is_valid(int number) | ||
286 | { | ||
287 | if (number >= 0 && | ||
288 | number < (U300_GPIO_NUM_PORTS * U300_GPIO_PINS_PER_PORT)) | ||
289 | return 1; | ||
290 | return 0; | ||
291 | } | ||
292 | EXPORT_SYMBOL(gpio_is_valid); | ||
293 | |||
284 | int gpio_request(unsigned gpio, const char *label) | 294 | int gpio_request(unsigned gpio, const char *label) |
285 | { | 295 | { |
286 | if (gpio_pin[gpio].users) | 296 | if (gpio_pin[gpio].users) |
diff --git a/arch/arm/mach-u300/include/mach/gpio.h b/arch/arm/mach-u300/include/mach/gpio.h index c8174128d7eb..7b1fc984abb6 100644 --- a/arch/arm/mach-u300/include/mach/gpio.h +++ b/arch/arm/mach-u300/include/mach/gpio.h | |||
@@ -258,6 +258,7 @@ | |||
258 | #define PIN_TO_PORT(val) (val >> 3) | 258 | #define PIN_TO_PORT(val) (val >> 3) |
259 | 259 | ||
260 | /* These can be found in arch/arm/mach-u300/gpio.c */ | 260 | /* These can be found in arch/arm/mach-u300/gpio.c */ |
261 | extern int gpio_is_valid(int number); | ||
261 | extern int gpio_request(unsigned gpio, const char *label); | 262 | extern int gpio_request(unsigned gpio, const char *label); |
262 | extern void gpio_free(unsigned gpio); | 263 | extern void gpio_free(unsigned gpio); |
263 | extern int gpio_direction_input(unsigned gpio); | 264 | extern int gpio_direction_input(unsigned gpio); |
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 3d1e5329da12..705a5894a6bb 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c | |||
@@ -678,7 +678,6 @@ static int __devinit mmci_probe(struct amba_device *dev, struct amba_id *id) | |||
678 | writel(0, host->base + MMCIMASK1); | 678 | writel(0, host->base + MMCIMASK1); |
679 | writel(0xfff, host->base + MMCICLEAR); | 679 | writel(0xfff, host->base + MMCICLEAR); |
680 | 680 | ||
681 | #ifdef CONFIG_GPIOLIB | ||
682 | if (gpio_is_valid(plat->gpio_cd)) { | 681 | if (gpio_is_valid(plat->gpio_cd)) { |
683 | ret = gpio_request(plat->gpio_cd, DRIVER_NAME " (cd)"); | 682 | ret = gpio_request(plat->gpio_cd, DRIVER_NAME " (cd)"); |
684 | if (ret == 0) | 683 | if (ret == 0) |
@@ -697,7 +696,6 @@ static int __devinit mmci_probe(struct amba_device *dev, struct amba_id *id) | |||
697 | else if (ret != -ENOSYS) | 696 | else if (ret != -ENOSYS) |
698 | goto err_gpio_wp; | 697 | goto err_gpio_wp; |
699 | } | 698 | } |
700 | #endif | ||
701 | 699 | ||
702 | ret = request_irq(dev->irq[0], mmci_irq, IRQF_SHARED, DRIVER_NAME " (cmd)", host); | 700 | ret = request_irq(dev->irq[0], mmci_irq, IRQF_SHARED, DRIVER_NAME " (cmd)", host); |
703 | if (ret) | 701 | if (ret) |