Commit d6a1f863 authored by Magnus Damm's avatar Magnus Damm Committed by Chris Ball

mmc: sdhi: support up to 3 interrupt sources

Convert the SDHI code to support more than a single interrupt source.
Needed to support hardware that uses GIC instead of INTC as interrupt
controller.

Will also allow us to remove the irq forwarding workaround from the
INTC code in the future.
Signed-off-by: default avatarSimon Horman <horms@verge.net.au>
Signed-off-by: default avatarMagnus Damm <damm@opensource.se>
Signed-off-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: default avatarChris Ball <cjb@laptop.org>
parent 1f7d6819
...@@ -62,7 +62,7 @@ static int __devinit sh_mobile_sdhi_probe(struct platform_device *pdev) ...@@ -62,7 +62,7 @@ static int __devinit sh_mobile_sdhi_probe(struct platform_device *pdev)
struct sh_mobile_sdhi_info *p = pdev->dev.platform_data; struct sh_mobile_sdhi_info *p = pdev->dev.platform_data;
struct tmio_mmc_host *host; struct tmio_mmc_host *host;
char clk_name[8]; char clk_name[8];
int irq, ret; int i, irq, ret;
priv = kzalloc(sizeof(struct sh_mobile_sdhi), GFP_KERNEL); priv = kzalloc(sizeof(struct sh_mobile_sdhi), GFP_KERNEL);
if (priv == NULL) { if (priv == NULL) {
...@@ -116,16 +116,27 @@ static int __devinit sh_mobile_sdhi_probe(struct platform_device *pdev) ...@@ -116,16 +116,27 @@ static int __devinit sh_mobile_sdhi_probe(struct platform_device *pdev)
if (ret < 0) if (ret < 0)
goto eprobe; goto eprobe;
irq = platform_get_irq(pdev, 0); for (i = 0; i < 3; i++) {
if (irq < 0) { irq = platform_get_irq(pdev, i);
ret = irq; if (irq < 0) {
goto eirq; if (i) {
continue;
} else {
ret = irq;
goto eirq;
}
}
ret = request_irq(irq, tmio_mmc_irq, 0,
dev_name(&pdev->dev), host);
if (ret) {
while (i--) {
irq = platform_get_irq(pdev, i);
if (irq >= 0)
free_irq(irq, host);
}
goto eirq;
}
} }
ret = request_irq(irq, tmio_mmc_irq, 0, dev_name(&pdev->dev), host);
if (ret)
goto eirq;
dev_info(&pdev->dev, "%s base at 0x%08lx clock rate %u MHz\n", dev_info(&pdev->dev, "%s base at 0x%08lx clock rate %u MHz\n",
mmc_hostname(host->mmc), (unsigned long) mmc_hostname(host->mmc), (unsigned long)
(platform_get_resource(pdev,IORESOURCE_MEM, 0)->start), (platform_get_resource(pdev,IORESOURCE_MEM, 0)->start),
...@@ -148,8 +159,14 @@ static int sh_mobile_sdhi_remove(struct platform_device *pdev) ...@@ -148,8 +159,14 @@ static int sh_mobile_sdhi_remove(struct platform_device *pdev)
struct mmc_host *mmc = platform_get_drvdata(pdev); struct mmc_host *mmc = platform_get_drvdata(pdev);
struct tmio_mmc_host *host = mmc_priv(mmc); struct tmio_mmc_host *host = mmc_priv(mmc);
struct sh_mobile_sdhi *priv = container_of(host->pdata, struct sh_mobile_sdhi, mmc_data); struct sh_mobile_sdhi *priv = container_of(host->pdata, struct sh_mobile_sdhi, mmc_data);
int i, irq;
for (i = 0; i < 3; i++) {
irq = platform_get_irq(pdev, i);
if (irq >= 0)
free_irq(irq, host);
}
free_irq(platform_get_irq(pdev, 0), host);
tmio_mmc_host_remove(host); tmio_mmc_host_remove(host);
clk_disable(priv->clk); clk_disable(priv->clk);
clk_put(priv->clk); clk_put(priv->clk);
......
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