diff options
author | Ben Dooks <ben-linux@fluff.org> | 2008-06-30 17:40:32 -0400 |
---|---|---|
committer | Pierre Ossman <drzeus@drzeus.cx> | 2008-07-15 08:14:47 -0400 |
commit | 55d70f5a7b25800fc8376cdd81d42d6c201fa91d (patch) | |
tree | 1fb14e103d427724846c3757cab073f5e44c0aed | |
parent | 7c14450ed6ab4ed453b2bf216ca3aaa7a5402af3 (diff) |
MMC: S3C24XX: Allow card-detect on non-IRQ capable pin
Add support to the S3C24XX MMC driver to have the card detect be on
a pin that is not IRQ capable.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
-rw-r--r-- | drivers/mmc/host/s3cmci.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/drivers/mmc/host/s3cmci.c b/drivers/mmc/host/s3cmci.c index ffd9269a1874..aa9a8b44b5ea 100644 --- a/drivers/mmc/host/s3cmci.c +++ b/drivers/mmc/host/s3cmci.c | |||
@@ -1150,8 +1150,6 @@ static int __devinit s3cmci_probe(struct platform_device *pdev, int is2440) | |||
1150 | host->pio_active = XFER_NONE; | 1150 | host->pio_active = XFER_NONE; |
1151 | 1151 | ||
1152 | host->dma = S3CMCI_DMA; | 1152 | host->dma = S3CMCI_DMA; |
1153 | host->irq_cd = s3c2410_gpio_getirq(host->pdata->gpio_detect); | ||
1154 | s3c2410_gpio_cfgpin(host->pdata->gpio_detect, S3C2410_GPIO_IRQ); | ||
1155 | 1153 | ||
1156 | host->mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 1154 | host->mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
1157 | if (!host->mem) { | 1155 | if (!host->mem) { |
@@ -1197,14 +1195,20 @@ static int __devinit s3cmci_probe(struct platform_device *pdev, int is2440) | |||
1197 | 1195 | ||
1198 | disable_irq(host->irq); | 1196 | disable_irq(host->irq); |
1199 | 1197 | ||
1200 | s3c2410_gpio_cfgpin(host->pdata->gpio_detect, S3C2410_GPIO_IRQ); | 1198 | host->irq_cd = s3c2410_gpio_getirq(host->pdata->gpio_detect); |
1201 | set_irq_type(host->irq_cd, IRQT_BOTHEDGE); | ||
1202 | 1199 | ||
1203 | if (request_irq(host->irq_cd, s3cmci_irq_cd, 0, DRIVER_NAME, host)) { | 1200 | if (host->irq_cd >= 0) { |
1204 | dev_err(&pdev->dev, | 1201 | if (request_irq(host->irq_cd, s3cmci_irq_cd, |
1205 | "failed to request card detect interrupt.\n"); | 1202 | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, |
1206 | ret = -ENOENT; | 1203 | DRIVER_NAME, host)) { |
1207 | goto probe_free_irq; | 1204 | dev_err(&pdev->dev, "can't get card detect irq.\n"); |
1205 | ret = -ENOENT; | ||
1206 | goto probe_free_irq; | ||
1207 | } | ||
1208 | } else { | ||
1209 | dev_warn(&pdev->dev, "host detect has no irq available\n"); | ||
1210 | s3c2410_gpio_cfgpin(host->pdata->gpio_detect, | ||
1211 | S3C2410_GPIO_INPUT); | ||
1208 | } | 1212 | } |
1209 | 1213 | ||
1210 | if (host->pdata->gpio_wprotect) | 1214 | if (host->pdata->gpio_wprotect) |
@@ -1273,7 +1277,8 @@ static int __devinit s3cmci_probe(struct platform_device *pdev, int is2440) | |||
1273 | clk_put(host->clk); | 1277 | clk_put(host->clk); |
1274 | 1278 | ||
1275 | probe_free_irq_cd: | 1279 | probe_free_irq_cd: |
1276 | free_irq(host->irq_cd, host); | 1280 | if (host->irq_cd >= 0) |
1281 | free_irq(host->irq_cd, host); | ||
1277 | 1282 | ||
1278 | probe_free_irq: | 1283 | probe_free_irq: |
1279 | free_irq(host->irq, host); | 1284 | free_irq(host->irq, host); |
@@ -1303,7 +1308,8 @@ static int __devexit s3cmci_remove(struct platform_device *pdev) | |||
1303 | tasklet_disable(&host->pio_tasklet); | 1308 | tasklet_disable(&host->pio_tasklet); |
1304 | s3c2410_dma_free(S3CMCI_DMA, &s3cmci_dma_client); | 1309 | s3c2410_dma_free(S3CMCI_DMA, &s3cmci_dma_client); |
1305 | 1310 | ||
1306 | free_irq(host->irq_cd, host); | 1311 | if (host->irq_cd >= 0) |
1312 | free_irq(host->irq_cd, host); | ||
1307 | free_irq(host->irq, host); | 1313 | free_irq(host->irq, host); |
1308 | 1314 | ||
1309 | iounmap(host->base); | 1315 | iounmap(host->base); |