summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Damm <damm@opensource.se>2011-05-06 11:02:45 +0000
committerChris Ball <cjb@laptop.org>2011-05-24 23:53:54 -0400
commitd6a1f863433bdf3f8406dedfa33fa79ee9259db3 (patch)
treea514e8b4db8f8842c7bad2174708f8c690e279c1
parent1f7d6819e56dda651a32b0193ff9e7929f62709f (diff)
downloadkernel-d6a1f863433bdf3f8406dedfa33fa79ee9259db3.tar.gz
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: Simon Horman <horms@verge.net.au> Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Chris Ball <cjb@laptop.org>
-rw-r--r--drivers/mmc/host/sh_mobile_sdhi.c39
1 files changed, 28 insertions, 11 deletions
diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index 2bd235b744df..d264bbeb529b 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -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 tmio_mmc_host *host;
char clk_name[8];
- int irq, ret;
+ int i, irq, ret;
priv = kzalloc(sizeof(struct sh_mobile_sdhi), GFP_KERNEL);
if (priv == NULL) {
@@ -116,16 +116,27 @@ static int __devinit sh_mobile_sdhi_probe(struct platform_device *pdev)
if (ret < 0)
goto eprobe;
- irq = platform_get_irq(pdev, 0);
- if (irq < 0) {
- ret = irq;
- goto eirq;
+ for (i = 0; i < 3; i++) {
+ irq = platform_get_irq(pdev, i);
+ if (irq < 0) {
+ 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",
mmc_hostname(host->mmc), (unsigned long)
(platform_get_resource(pdev,IORESOURCE_MEM, 0)->start),
@@ -148,8 +159,14 @@ static int sh_mobile_sdhi_remove(struct platform_device *pdev)
struct mmc_host *mmc = platform_get_drvdata(pdev);
struct tmio_mmc_host *host = mmc_priv(mmc);
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);
clk_disable(priv->clk);
clk_put(priv->clk);
dic()Viresh Kumar 2014-03-26tick: Fix spelling mistake in tick_handle_periodic()Viresh Kumar 2014-01-12Merge branch 'fortglx/3.14/time' of git://git.linaro.org/people/john.stultz/l...Ingo Molnar 2013-12-23tick/timekeeping: Call update_wall_time outside the jiffies lockJohn Stultz 2013-11-19tick: Document tick_do_timer_cpuAndrew Morton 2013-07-02tick: Sanitize broadcast control logicThomas Gleixner 2013-06-24clockevents: Prefer CPU local devices over global devicesStephen Boyd 2013-05-16clockevents: Implement unbind functionalityThomas Gleixner 2013-05-16clockevents: Split out selection logicThomas Gleixner 2013-05-16clockevents: Add module refcountThomas Gleixner 2013-05-16clockevents: Move the tick_notify() switch case to clockevents_notify()Thomas Gleixner 2013-05-16clockevents: Simplify lockingThomas Gleixner 2013-05-16clockevents: Get rid of the notifier chainThomas Gleixner 2013-05-05Merge branch 'timers-nohz-for-linus' of git://git.kernel.org/pub/scm/linux/ke...Linus Torvalds 2013-04-25clockevents: Set dummy handler on CPU_DEAD shutdownThomas Gleixner 2013-04-15nohz: Switch from "extended nohz" to "full nohz" based namingFrederic Weisbecker 2013-03-21nohz: Assign timekeeping duty to a CPU outside the full dynticks rangeFrederic Weisbecker 2013-03-07tick: Convert broadcast cpu bitmaps to cpumask_var_tThomas Gleixner