aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mx3/mx31moboard-devboard.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2009-05-06 06:55:50 -0400
committerSascha Hauer <s.hauer@pengutronix.de>2009-05-07 10:20:52 -0400
commit4f163eb8811e8ea760d9fe654ecc6f17feecb477 (patch)
tree5772ca291eabad6335f52dc0a462761a6140e8ca /arch/arm/mach-mx3/mx31moboard-devboard.c
parentef754d635820102ec7719486d40ede3c94ba44c8 (diff)
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-devboard.c')
-rw-r--r--arch/arm/mach-mx3/mx31moboard-devboard.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/arch/arm/mach-mx3/mx31moboard-devboard.c b/arch/arm/mach-mx3/mx31moboard-devboard.c
index 0a69a4f212a3..b3e8f251ac79 100644
--- a/arch/arm/mach-mx3/mx31moboard-devboard.c
+++ b/arch/arm/mach-mx3/mx31moboard-devboard.c
@@ -56,14 +56,40 @@ static int devboard_sdhc2_get_ro(struct device *dev)
56static int devboard_sdhc2_init(struct device *dev, irq_handler_t detect_irq, 56static int devboard_sdhc2_init(struct device *dev, irq_handler_t detect_irq,
57 void *data) 57 void *data)
58{ 58{
59 return request_irq(gpio_to_irq(SDHC2_CD), detect_irq, 59 int ret;
60
61 ret = gpio_request(SDHC2_CD, "sdhc-detect");
62 if (ret)
63 return ret;
64
65 gpio_direction_input(SDHC2_CD);
66
67 ret = gpio_request(SDHC2_WP, "sdhc-wp");
68 if (ret)
69 goto err_gpio_free;
70 gpio_direction_input(SDHC2_WP);
71
72 ret = request_irq(gpio_to_irq(SDHC2_CD), detect_irq,
60 IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, 73 IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
61 "sdhc2-card-detect", data); 74 "sdhc2-card-detect", data);
75 if (ret)
76 goto err_gpio_free_2;
77
78 return 0;
79
80err_gpio_free_2:
81 gpio_free(SDHC2_WP);
82err_gpio_free:
83 gpio_free(SDHC2_CD);
84
85 return ret;
62} 86}
63 87
64static void devboard_sdhc2_exit(struct device *dev, void *data) 88static void devboard_sdhc2_exit(struct device *dev, void *data)
65{ 89{
66 free_irq(gpio_to_irq(SDHC2_CD), data); 90 free_irq(gpio_to_irq(SDHC2_CD), data);
91 gpio_free(SDHC2_WP);
92 gpio_free(SDHC2_CD);
67} 93}
68 94
69static struct imxmmc_platform_data sdhc2_pdata = { 95static struct imxmmc_platform_data sdhc2_pdata = {