aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorDmitry Baryshkov <dbaryshkov@gmail.com>2008-06-09 08:23:50 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-07-07 08:21:57 -0400
commitc4d5f8d43a5423a6bbba4eec1fab9c46e8d53c5d (patch)
tree3a4316dc0accea04220324b6336e67f6a48f864c /arch
parentc867155cde9905dfbcb16fcadb1840b06f8869d4 (diff)
[ARM] 5081/1: tosa: fix SD GPIOs
This changes SD-related GPIO names to be more informative, and allocates two more SD-related GPIOs. Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-pxa/tosa.c32
1 files changed, 29 insertions, 3 deletions
diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c
index 8bf947dcb2e8..ba95cd66b988 100644
--- a/arch/arm/mach-pxa/tosa.c
+++ b/arch/arm/mach-pxa/tosa.c
@@ -87,7 +87,7 @@ static unsigned long tosa_pin_config[] = {
87 GPIO6_MMC_CLK, 87 GPIO6_MMC_CLK,
88 GPIO8_MMC_CS0, 88 GPIO8_MMC_CS0,
89 GPIO9_GPIO, /* Detect */ 89 GPIO9_GPIO, /* Detect */
90 // GPIO10 nSD_INT 90 GPIO10_GPIO, /* nSD_INT */
91 91
92 /* CF */ 92 /* CF */
93 GPIO13_GPIO, /* CD_IRQ */ 93 GPIO13_GPIO, /* CD_IRQ */
@@ -250,6 +250,15 @@ static int tosa_mci_init(struct device *dev, irq_handler_t tosa_detect_int, void
250 250
251 tosa_mci_platform_data.detect_delay = msecs_to_jiffies(250); 251 tosa_mci_platform_data.detect_delay = msecs_to_jiffies(250);
252 252
253 err = gpio_request(TOSA_GPIO_nSD_DETECT, "MMC/SD card detect");
254 if (err) {
255 printk(KERN_ERR "tosa_mci_init: can't request nSD_DETECT gpio\n");
256 goto err_gpio_detect;
257 }
258 err = gpio_direction_input(TOSA_GPIO_nSD_DETECT);
259 if (err)
260 goto err_gpio_detect_dir;
261
253 err = request_irq(TOSA_IRQ_GPIO_nSD_DETECT, tosa_detect_int, 262 err = request_irq(TOSA_IRQ_GPIO_nSD_DETECT, tosa_detect_int,
254 IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, 263 IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
255 "MMC/SD card detect", data); 264 "MMC/SD card detect", data);
@@ -258,7 +267,7 @@ static int tosa_mci_init(struct device *dev, irq_handler_t tosa_detect_int, void
258 goto err_irq; 267 goto err_irq;
259 } 268 }
260 269
261 err = gpio_request(TOSA_GPIO_SD_WP, "sd_wp"); 270 err = gpio_request(TOSA_GPIO_SD_WP, "SD Write Protect");
262 if (err) { 271 if (err) {
263 printk(KERN_ERR "tosa_mci_init: can't request SD_WP gpio\n"); 272 printk(KERN_ERR "tosa_mci_init: can't request SD_WP gpio\n");
264 goto err_gpio_wp; 273 goto err_gpio_wp;
@@ -267,7 +276,7 @@ static int tosa_mci_init(struct device *dev, irq_handler_t tosa_detect_int, void
267 if (err) 276 if (err)
268 goto err_gpio_wp_dir; 277 goto err_gpio_wp_dir;
269 278
270 err = gpio_request(TOSA_GPIO_PWR_ON, "sd_pwr"); 279 err = gpio_request(TOSA_GPIO_PWR_ON, "SD Power");
271 if (err) { 280 if (err) {
272 printk(KERN_ERR "tosa_mci_init: can't request SD_PWR gpio\n"); 281 printk(KERN_ERR "tosa_mci_init: can't request SD_PWR gpio\n");
273 goto err_gpio_pwr; 282 goto err_gpio_pwr;
@@ -276,8 +285,20 @@ static int tosa_mci_init(struct device *dev, irq_handler_t tosa_detect_int, void
276 if (err) 285 if (err)
277 goto err_gpio_pwr_dir; 286 goto err_gpio_pwr_dir;
278 287
288 err = gpio_request(TOSA_GPIO_nSD_INT, "SD Int");
289 if (err) {
290 printk(KERN_ERR "tosa_mci_init: can't request SD_PWR gpio\n");
291 goto err_gpio_int;
292 }
293 err = gpio_direction_input(TOSA_GPIO_nSD_INT);
294 if (err)
295 goto err_gpio_int_dir;
296
279 return 0; 297 return 0;
280 298
299err_gpio_int_dir:
300 gpio_free(TOSA_GPIO_nSD_INT);
301err_gpio_int:
281err_gpio_pwr_dir: 302err_gpio_pwr_dir:
282 gpio_free(TOSA_GPIO_PWR_ON); 303 gpio_free(TOSA_GPIO_PWR_ON);
283err_gpio_pwr: 304err_gpio_pwr:
@@ -286,6 +307,9 @@ err_gpio_wp_dir:
286err_gpio_wp: 307err_gpio_wp:
287 free_irq(TOSA_IRQ_GPIO_nSD_DETECT, data); 308 free_irq(TOSA_IRQ_GPIO_nSD_DETECT, data);
288err_irq: 309err_irq:
310err_gpio_detect_dir:
311 gpio_free(TOSA_GPIO_nSD_DETECT);
312err_gpio_detect:
289 return err; 313 return err;
290} 314}
291 315
@@ -307,9 +331,11 @@ static int tosa_mci_get_ro(struct device *dev)
307 331
308static void tosa_mci_exit(struct device *dev, void *data) 332static void tosa_mci_exit(struct device *dev, void *data)
309{ 333{
334 gpio_free(TOSA_GPIO_nSD_INT);
310 gpio_free(TOSA_GPIO_PWR_ON); 335 gpio_free(TOSA_GPIO_PWR_ON);
311 gpio_free(TOSA_GPIO_SD_WP); 336 gpio_free(TOSA_GPIO_SD_WP);
312 free_irq(TOSA_IRQ_GPIO_nSD_DETECT, data); 337 free_irq(TOSA_IRQ_GPIO_nSD_DETECT, data);
338 gpio_free(TOSA_GPIO_nSD_DETECT);
313} 339}
314 340
315static struct pxamci_platform_data tosa_mci_platform_data = { 341static struct pxamci_platform_data tosa_mci_platform_data = {