diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2009-05-06 06:55:50 -0400 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2009-05-07 10:20:52 -0400 |
commit | 4f163eb8811e8ea760d9fe654ecc6f17feecb477 (patch) | |
tree | 5772ca291eabad6335f52dc0a462761a6140e8ca /arch/arm/mach-mx3/mx31moboard-marxbot.c | |
parent | ef754d635820102ec7719486d40ede3c94ba44c8 (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-marxbot.c')
-rw-r--r-- | arch/arm/mach-mx3/mx31moboard-marxbot.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/arch/arm/mach-mx3/mx31moboard-marxbot.c b/arch/arm/mach-mx3/mx31moboard-marxbot.c index 4fc271145b0c..53ce7ff0637c 100644 --- a/arch/arm/mach-mx3/mx31moboard-marxbot.c +++ b/arch/arm/mach-mx3/mx31moboard-marxbot.c | |||
@@ -60,14 +60,40 @@ static int marxbot_sdhc2_get_ro(struct device *dev) | |||
60 | static int marxbot_sdhc2_init(struct device *dev, irq_handler_t detect_irq, | 60 | static int marxbot_sdhc2_init(struct device *dev, irq_handler_t detect_irq, |
61 | void *data) | 61 | void *data) |
62 | { | 62 | { |
63 | return request_irq(gpio_to_irq(SDHC2_CD), detect_irq, | 63 | int ret; |
64 | |||
65 | ret = gpio_request(SDHC2_CD, "sdhc-detect"); | ||
66 | if (ret) | ||
67 | return ret; | ||
68 | |||
69 | gpio_direction_input(SDHC2_CD); | ||
70 | |||
71 | ret = gpio_request(SDHC2_WP, "sdhc-wp"); | ||
72 | if (ret) | ||
73 | goto err_gpio_free; | ||
74 | gpio_direction_input(SDHC2_WP); | ||
75 | |||
76 | ret = request_irq(gpio_to_irq(SDHC2_CD), detect_irq, | ||
64 | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, | 77 | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, |
65 | "sdhc2-card-detect", data); | 78 | "sdhc2-card-detect", data); |
79 | if (ret) | ||
80 | goto err_gpio_free_2; | ||
81 | |||
82 | return 0; | ||
83 | |||
84 | err_gpio_free_2: | ||
85 | gpio_free(SDHC2_WP); | ||
86 | err_gpio_free: | ||
87 | gpio_free(SDHC2_CD); | ||
88 | |||
89 | return ret; | ||
66 | } | 90 | } |
67 | 91 | ||
68 | static void marxbot_sdhc2_exit(struct device *dev, void *data) | 92 | static void marxbot_sdhc2_exit(struct device *dev, void *data) |
69 | { | 93 | { |
70 | free_irq(gpio_to_irq(SDHC2_CD), data); | 94 | free_irq(gpio_to_irq(SDHC2_CD), data); |
95 | gpio_free(SDHC2_WP); | ||
96 | gpio_free(SDHC2_CD); | ||
71 | } | 97 | } |
72 | 98 | ||
73 | static struct imxmmc_platform_data sdhc2_pdata = { | 99 | static struct imxmmc_platform_data sdhc2_pdata = { |