Commit 55d70f5a authored by Ben Dooks's avatar Ben Dooks Committed by Pierre Ossman

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: default avatarBen Dooks <ben-linux@fluff.org>
Signed-off-by: default avatarPierre Ossman <drzeus@drzeus.cx>
parent 7c14450e
...@@ -1150,8 +1150,6 @@ static int __devinit s3cmci_probe(struct platform_device *pdev, int is2440) ...@@ -1150,8 +1150,6 @@ static int __devinit s3cmci_probe(struct platform_device *pdev, int is2440)
host->pio_active = XFER_NONE; host->pio_active = XFER_NONE;
host->dma = S3CMCI_DMA; host->dma = S3CMCI_DMA;
host->irq_cd = s3c2410_gpio_getirq(host->pdata->gpio_detect);
s3c2410_gpio_cfgpin(host->pdata->gpio_detect, S3C2410_GPIO_IRQ);
host->mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); host->mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!host->mem) { if (!host->mem) {
...@@ -1197,14 +1195,20 @@ static int __devinit s3cmci_probe(struct platform_device *pdev, int is2440) ...@@ -1197,14 +1195,20 @@ static int __devinit s3cmci_probe(struct platform_device *pdev, int is2440)
disable_irq(host->irq); disable_irq(host->irq);
s3c2410_gpio_cfgpin(host->pdata->gpio_detect, S3C2410_GPIO_IRQ); host->irq_cd = s3c2410_gpio_getirq(host->pdata->gpio_detect);
set_irq_type(host->irq_cd, IRQT_BOTHEDGE);
if (request_irq(host->irq_cd, s3cmci_irq_cd, 0, DRIVER_NAME, host)) { if (host->irq_cd >= 0) {
dev_err(&pdev->dev, if (request_irq(host->irq_cd, s3cmci_irq_cd,
"failed to request card detect interrupt.\n"); IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
ret = -ENOENT; DRIVER_NAME, host)) {
goto probe_free_irq; dev_err(&pdev->dev, "can't get card detect irq.\n");
ret = -ENOENT;
goto probe_free_irq;
}
} else {
dev_warn(&pdev->dev, "host detect has no irq available\n");
s3c2410_gpio_cfgpin(host->pdata->gpio_detect,
S3C2410_GPIO_INPUT);
} }
if (host->pdata->gpio_wprotect) if (host->pdata->gpio_wprotect)
...@@ -1273,7 +1277,8 @@ static int __devinit s3cmci_probe(struct platform_device *pdev, int is2440) ...@@ -1273,7 +1277,8 @@ static int __devinit s3cmci_probe(struct platform_device *pdev, int is2440)
clk_put(host->clk); clk_put(host->clk);
probe_free_irq_cd: probe_free_irq_cd:
free_irq(host->irq_cd, host); if (host->irq_cd >= 0)
free_irq(host->irq_cd, host);
probe_free_irq: probe_free_irq:
free_irq(host->irq, host); free_irq(host->irq, host);
...@@ -1303,7 +1308,8 @@ static int __devexit s3cmci_remove(struct platform_device *pdev) ...@@ -1303,7 +1308,8 @@ static int __devexit s3cmci_remove(struct platform_device *pdev)
tasklet_disable(&host->pio_tasklet); tasklet_disable(&host->pio_tasklet);
s3c2410_dma_free(S3CMCI_DMA, &s3cmci_dma_client); s3c2410_dma_free(S3CMCI_DMA, &s3cmci_dma_client);
free_irq(host->irq_cd, host); if (host->irq_cd >= 0)
free_irq(host->irq_cd, host);
free_irq(host->irq, host); free_irq(host->irq, host);
iounmap(host->base); iounmap(host->base);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment