summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mx3/mx31moboard.c
diff options
context:
space:
mode:
authorSascha Hauer2009-05-06 12:55:50 +0200
committerSascha Hauer2009-05-07 16:20:52 +0200
commit4f163eb8811e8ea760d9fe654ecc6f17feecb477 (patch)
tree5772ca291eabad6335f52dc0a462761a6140e8ca /arch/arm/mach-mx3/mx31moboard.c
parentmx31: remove gpio_request calls from iomux code (diff)
downloadkernel-qcow2-linux-4f163eb8811e8ea760d9fe654ecc6f17feecb477.tar.gz
kernel-qcow2-linux-4f163eb8811e8ea760d9fe654ecc6f17feecb477.tar.xz
kernel-qcow2-linux-4f163eb8811e8ea760d9fe654ecc6f17feecb477.zip
mx31: calls to gpio_request moved into platform code
In order to use the gpiolib, we now have to call gpio_request in the plaform code since it is not done in iomux code anymore. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mx3/mx31moboard.c')
-rw-r--r--arch/arm/mach-mx3/mx31moboard.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/arch/arm/mach-mx3/mx31moboard.c b/arch/arm/mach-mx3/mx31moboard.c
index 2cca3f2e72b9..0df6ac610b65 100644
--- a/arch/arm/mach-mx3/mx31moboard.c
+++ b/arch/arm/mach-mx3/mx31moboard.c
@@ -112,14 +112,40 @@ static int moboard_sdhc1_get_ro(struct device *dev)
static int moboard_sdhc1_init(struct device *dev, irq_handler_t detect_irq,
void *data)
{
- return request_irq(gpio_to_irq(SDHC1_CD), detect_irq,
+ int ret;
+
+ ret = gpio_request(SDHC1_CD, "sdhc-detect");
+ if (ret)
+ return ret;
+
+ gpio_direction_input(SDHC1_CD);
+
+ ret = gpio_request(SDHC1_WP, "sdhc-wp");
+ if (ret)
+ goto err_gpio_free;
+ gpio_direction_input(SDHC1_WP);
+
+ ret = request_irq(gpio_to_irq(SDHC1_CD), detect_irq,
IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
"sdhc1-card-detect", data);
+ if (ret)
+ goto err_gpio_free_2;
+
+ return 0;
+
+err_gpio_free_2:
+ gpio_free(SDHC1_WP);
+err_gpio_free:
+ gpio_free(SDHC1_CD);
+
+ return ret;
}
static void moboard_sdhc1_exit(struct device *dev, void *data)
{
free_irq(gpio_to_irq(SDHC1_CD), data);
+ gpio_free(SDHC1_WP);
+ gpio_free(SDHC1_CD);
}
static struct imxmmc_platform_data sdhc1_pdata = {