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.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.c')
-rw-r--r-- | arch/arm/mach-mx3/mx31moboard.c | 28 |
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) | |||
112 | static int moboard_sdhc1_init(struct device *dev, irq_handler_t detect_irq, | 112 | static int moboard_sdhc1_init(struct device *dev, irq_handler_t detect_irq, |
113 | void *data) | 113 | void *data) |
114 | { | 114 | { |
115 | return request_irq(gpio_to_irq(SDHC1_CD), detect_irq, | 115 | int ret; |
116 | |||
117 | ret = gpio_request(SDHC1_CD, "sdhc-detect"); | ||
118 | if (ret) | ||
119 | return ret; | ||
120 | |||
121 | gpio_direction_input(SDHC1_CD); | ||
122 | |||
123 | ret = gpio_request(SDHC1_WP, "sdhc-wp"); | ||
124 | if (ret) | ||
125 | goto err_gpio_free; | ||
126 | gpio_direction_input(SDHC1_WP); | ||
127 | |||
128 | ret = request_irq(gpio_to_irq(SDHC1_CD), detect_irq, | ||
116 | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, | 129 | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, |
117 | "sdhc1-card-detect", data); | 130 | "sdhc1-card-detect", data); |
131 | if (ret) | ||
132 | goto err_gpio_free_2; | ||
133 | |||
134 | return 0; | ||
135 | |||
136 | err_gpio_free_2: | ||
137 | gpio_free(SDHC1_WP); | ||
138 | err_gpio_free: | ||
139 | gpio_free(SDHC1_CD); | ||
140 | |||
141 | return ret; | ||
118 | } | 142 | } |
119 | 143 | ||
120 | static void moboard_sdhc1_exit(struct device *dev, void *data) | 144 | static void moboard_sdhc1_exit(struct device *dev, void *data) |
121 | { | 145 | { |
122 | free_irq(gpio_to_irq(SDHC1_CD), data); | 146 | free_irq(gpio_to_irq(SDHC1_CD), data); |
147 | gpio_free(SDHC1_WP); | ||
148 | gpio_free(SDHC1_CD); | ||
123 | } | 149 | } |
124 | 150 | ||
125 | static struct imxmmc_platform_data sdhc1_pdata = { | 151 | static struct imxmmc_platform_data sdhc1_pdata = { |