diff options
author | Shinya Kuribayashi <shinya.kuribayashi.px@renesas.com> | 2013-01-14 14:12:36 -0500 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2013-02-11 12:51:24 -0500 |
commit | 2cd5b3e061e3742de6b3a50f45f7d3b96aa50964 (patch) | |
tree | a99a7ad540b4dec2921f7a0bccf8bec9ea36666a /drivers/mmc/host/sh_mmcif.c | |
parent | f8a8ced7f9e79916311c0ef08d1f6de7bf954807 (diff) |
mmc: sh_mmcif: add support for bundled MMCIF IRQs
On newer SoCs like R-Mobile U2, MMCIF interrupts are bundled.
Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi.px@renesas.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/host/sh_mmcif.c')
-rw-r--r-- | drivers/mmc/host/sh_mmcif.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c index 2ff3e4774b67..c7984bad8efc 100644 --- a/drivers/mmc/host/sh_mmcif.c +++ b/drivers/mmc/host/sh_mmcif.c | |||
@@ -1307,10 +1307,11 @@ static int sh_mmcif_probe(struct platform_device *pdev) | |||
1307 | struct sh_mmcif_plat_data *pd = pdev->dev.platform_data; | 1307 | struct sh_mmcif_plat_data *pd = pdev->dev.platform_data; |
1308 | struct resource *res; | 1308 | struct resource *res; |
1309 | void __iomem *reg; | 1309 | void __iomem *reg; |
1310 | const char *name; | ||
1310 | 1311 | ||
1311 | irq[0] = platform_get_irq(pdev, 0); | 1312 | irq[0] = platform_get_irq(pdev, 0); |
1312 | irq[1] = platform_get_irq(pdev, 1); | 1313 | irq[1] = platform_get_irq(pdev, 1); |
1313 | if (irq[0] < 0 || irq[1] < 0) { | 1314 | if (irq[0] < 0) { |
1314 | dev_err(&pdev->dev, "Get irq error\n"); | 1315 | dev_err(&pdev->dev, "Get irq error\n"); |
1315 | return -ENXIO; | 1316 | return -ENXIO; |
1316 | } | 1317 | } |
@@ -1375,15 +1376,19 @@ static int sh_mmcif_probe(struct platform_device *pdev) | |||
1375 | sh_mmcif_sync_reset(host); | 1376 | sh_mmcif_sync_reset(host); |
1376 | sh_mmcif_writel(host->addr, MMCIF_CE_INT_MASK, MASK_ALL); | 1377 | sh_mmcif_writel(host->addr, MMCIF_CE_INT_MASK, MASK_ALL); |
1377 | 1378 | ||
1378 | ret = request_threaded_irq(irq[0], sh_mmcif_intr, sh_mmcif_irqt, 0, "sh_mmc:error", host); | 1379 | name = irq[1] < 0 ? dev_name(&pdev->dev) : "sh_mmc:error"; |
1380 | ret = request_threaded_irq(irq[0], sh_mmcif_intr, sh_mmcif_irqt, 0, name, host); | ||
1379 | if (ret) { | 1381 | if (ret) { |
1380 | dev_err(&pdev->dev, "request_irq error (sh_mmc:error)\n"); | 1382 | dev_err(&pdev->dev, "request_irq error (%s)\n", name); |
1381 | goto ereqirq0; | 1383 | goto ereqirq0; |
1382 | } | 1384 | } |
1383 | ret = request_threaded_irq(irq[1], sh_mmcif_intr, sh_mmcif_irqt, 0, "sh_mmc:int", host); | 1385 | if (irq[1] >= 0) { |
1384 | if (ret) { | 1386 | ret = request_threaded_irq(irq[1], sh_mmcif_intr, sh_mmcif_irqt, |
1385 | dev_err(&pdev->dev, "request_irq error (sh_mmc:int)\n"); | 1387 | 0, "sh_mmc:int", host); |
1386 | goto ereqirq1; | 1388 | if (ret) { |
1389 | dev_err(&pdev->dev, "request_irq error (sh_mmc:int)\n"); | ||
1390 | goto ereqirq1; | ||
1391 | } | ||
1387 | } | 1392 | } |
1388 | 1393 | ||
1389 | if (pd && pd->use_cd_gpio) { | 1394 | if (pd && pd->use_cd_gpio) { |
@@ -1406,7 +1411,8 @@ static int sh_mmcif_probe(struct platform_device *pdev) | |||
1406 | 1411 | ||
1407 | emmcaddh: | 1412 | emmcaddh: |
1408 | erqcd: | 1413 | erqcd: |
1409 | free_irq(irq[1], host); | 1414 | if (irq[1] >= 0) |
1415 | free_irq(irq[1], host); | ||
1410 | ereqirq1: | 1416 | ereqirq1: |
1411 | free_irq(irq[0], host); | 1417 | free_irq(irq[0], host); |
1412 | ereqirq0: | 1418 | ereqirq0: |
@@ -1451,7 +1457,8 @@ static int sh_mmcif_remove(struct platform_device *pdev) | |||
1451 | irq[1] = platform_get_irq(pdev, 1); | 1457 | irq[1] = platform_get_irq(pdev, 1); |
1452 | 1458 | ||
1453 | free_irq(irq[0], host); | 1459 | free_irq(irq[0], host); |
1454 | free_irq(irq[1], host); | 1460 | if (irq[1] >= 0) |
1461 | free_irq(irq[1], host); | ||
1455 | 1462 | ||
1456 | platform_set_drvdata(pdev, NULL); | 1463 | platform_set_drvdata(pdev, NULL); |
1457 | 1464 | ||