Commit 2cd5b3e0 authored by Shinya Kuribayashi's avatar Shinya Kuribayashi Committed by Chris Ball

mmc: sh_mmcif: add support for bundled MMCIF IRQs

On newer SoCs like R-Mobile U2, MMCIF interrupts are bundled.
Signed-off-by: default avatarShinya Kuribayashi <shinya.kuribayashi.px@renesas.com>
Signed-off-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: default avatarChris Ball <cjb@laptop.org>
parent f8a8ced7
...@@ -1307,10 +1307,11 @@ static int sh_mmcif_probe(struct platform_device *pdev) ...@@ -1307,10 +1307,11 @@ static int sh_mmcif_probe(struct platform_device *pdev)
struct sh_mmcif_plat_data *pd = pdev->dev.platform_data; struct sh_mmcif_plat_data *pd = pdev->dev.platform_data;
struct resource *res; struct resource *res;
void __iomem *reg; void __iomem *reg;
const char *name;
irq[0] = platform_get_irq(pdev, 0); irq[0] = platform_get_irq(pdev, 0);
irq[1] = platform_get_irq(pdev, 1); irq[1] = platform_get_irq(pdev, 1);
if (irq[0] < 0 || irq[1] < 0) { if (irq[0] < 0) {
dev_err(&pdev->dev, "Get irq error\n"); dev_err(&pdev->dev, "Get irq error\n");
return -ENXIO; return -ENXIO;
} }
...@@ -1375,16 +1376,20 @@ static int sh_mmcif_probe(struct platform_device *pdev) ...@@ -1375,16 +1376,20 @@ static int sh_mmcif_probe(struct platform_device *pdev)
sh_mmcif_sync_reset(host); sh_mmcif_sync_reset(host);
sh_mmcif_writel(host->addr, MMCIF_CE_INT_MASK, MASK_ALL); sh_mmcif_writel(host->addr, MMCIF_CE_INT_MASK, MASK_ALL);
ret = request_threaded_irq(irq[0], sh_mmcif_intr, sh_mmcif_irqt, 0, "sh_mmc:error", host); name = irq[1] < 0 ? dev_name(&pdev->dev) : "sh_mmc:error";
ret = request_threaded_irq(irq[0], sh_mmcif_intr, sh_mmcif_irqt, 0, name, host);
if (ret) { if (ret) {
dev_err(&pdev->dev, "request_irq error (sh_mmc:error)\n"); dev_err(&pdev->dev, "request_irq error (%s)\n", name);
goto ereqirq0; goto ereqirq0;
} }
ret = request_threaded_irq(irq[1], sh_mmcif_intr, sh_mmcif_irqt, 0, "sh_mmc:int", host); if (irq[1] >= 0) {
ret = request_threaded_irq(irq[1], sh_mmcif_intr, sh_mmcif_irqt,
0, "sh_mmc:int", host);
if (ret) { if (ret) {
dev_err(&pdev->dev, "request_irq error (sh_mmc:int)\n"); dev_err(&pdev->dev, "request_irq error (sh_mmc:int)\n");
goto ereqirq1; goto ereqirq1;
} }
}
if (pd && pd->use_cd_gpio) { if (pd && pd->use_cd_gpio) {
ret = mmc_gpio_request_cd(mmc, pd->cd_gpio); ret = mmc_gpio_request_cd(mmc, pd->cd_gpio);
...@@ -1406,6 +1411,7 @@ static int sh_mmcif_probe(struct platform_device *pdev) ...@@ -1406,6 +1411,7 @@ static int sh_mmcif_probe(struct platform_device *pdev)
emmcaddh: emmcaddh:
erqcd: erqcd:
if (irq[1] >= 0)
free_irq(irq[1], host); free_irq(irq[1], host);
ereqirq1: ereqirq1:
free_irq(irq[0], host); free_irq(irq[0], host);
...@@ -1451,6 +1457,7 @@ static int sh_mmcif_remove(struct platform_device *pdev) ...@@ -1451,6 +1457,7 @@ static int sh_mmcif_remove(struct platform_device *pdev)
irq[1] = platform_get_irq(pdev, 1); irq[1] = platform_get_irq(pdev, 1);
free_irq(irq[0], host); free_irq(irq[0], host);
if (irq[1] >= 0)
free_irq(irq[1], host); free_irq(irq[1], host);
platform_set_drvdata(pdev, NULL); platform_set_drvdata(pdev, NULL);
......
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