diff options
author | Shawn Guo <shawn.guo@linaro.org> | 2012-06-13 02:07:31 -0400 |
---|---|---|
committer | Shawn Guo <shawn.guo@linaro.org> | 2012-07-01 09:57:43 -0400 |
commit | 88289c80d419897c03f7f43b35e3730d8fb6825b (patch) | |
tree | 026e38319b74258f490e52350af6bc86eaf3ad2b /drivers/dma/ipu | |
parent | 544496ab5cbdae312351da4c742ae70cab08dbf2 (diff) |
dma: ipu: remove the use of ipu_platform_data
The struct ipu_platform_data is used by platform code to pass
MXC_IPU_IRQ_START to ipu-core driver. We can save it by having
ipu-core driver call irq_alloc_descs to get the irq_base.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Dong Aisheng <dong.aisheng@linaro.org>
Diffstat (limited to 'drivers/dma/ipu')
-rw-r--r-- | drivers/dma/ipu/ipu_idmac.c | 8 | ||||
-rw-r--r-- | drivers/dma/ipu/ipu_irq.c | 14 |
2 files changed, 12 insertions, 10 deletions
diff --git a/drivers/dma/ipu/ipu_idmac.c b/drivers/dma/ipu/ipu_idmac.c index 5ec72044ea4c..c7573e50aa14 100644 --- a/drivers/dma/ipu/ipu_idmac.c +++ b/drivers/dma/ipu/ipu_idmac.c | |||
@@ -1663,7 +1663,6 @@ static void __exit ipu_idmac_exit(struct ipu *ipu) | |||
1663 | 1663 | ||
1664 | static int __init ipu_probe(struct platform_device *pdev) | 1664 | static int __init ipu_probe(struct platform_device *pdev) |
1665 | { | 1665 | { |
1666 | struct ipu_platform_data *pdata = pdev->dev.platform_data; | ||
1667 | struct resource *mem_ipu, *mem_ic; | 1666 | struct resource *mem_ipu, *mem_ic; |
1668 | int ret; | 1667 | int ret; |
1669 | 1668 | ||
@@ -1671,7 +1670,7 @@ static int __init ipu_probe(struct platform_device *pdev) | |||
1671 | 1670 | ||
1672 | mem_ipu = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 1671 | mem_ipu = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
1673 | mem_ic = platform_get_resource(pdev, IORESOURCE_MEM, 1); | 1672 | mem_ic = platform_get_resource(pdev, IORESOURCE_MEM, 1); |
1674 | if (!pdata || !mem_ipu || !mem_ic) | 1673 | if (!mem_ipu || !mem_ic) |
1675 | return -EINVAL; | 1674 | return -EINVAL; |
1676 | 1675 | ||
1677 | ipu_data.dev = &pdev->dev; | 1676 | ipu_data.dev = &pdev->dev; |
@@ -1688,10 +1687,9 @@ static int __init ipu_probe(struct platform_device *pdev) | |||
1688 | goto err_noirq; | 1687 | goto err_noirq; |
1689 | 1688 | ||
1690 | ipu_data.irq_err = ret; | 1689 | ipu_data.irq_err = ret; |
1691 | ipu_data.irq_base = pdata->irq_base; | ||
1692 | 1690 | ||
1693 | dev_dbg(&pdev->dev, "fn irq %u, err irq %u, irq-base %u\n", | 1691 | dev_dbg(&pdev->dev, "fn irq %u, err irq %u\n", |
1694 | ipu_data.irq_fn, ipu_data.irq_err, ipu_data.irq_base); | 1692 | ipu_data.irq_fn, ipu_data.irq_err); |
1695 | 1693 | ||
1696 | /* Remap IPU common registers */ | 1694 | /* Remap IPU common registers */ |
1697 | ipu_data.reg_ipu = ioremap(mem_ipu->start, resource_size(mem_ipu)); | 1695 | ipu_data.reg_ipu = ioremap(mem_ipu->start, resource_size(mem_ipu)); |
diff --git a/drivers/dma/ipu/ipu_irq.c b/drivers/dma/ipu/ipu_irq.c index a71f55e72be9..fa95bcc3de1f 100644 --- a/drivers/dma/ipu/ipu_irq.c +++ b/drivers/dma/ipu/ipu_irq.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/clk.h> | 14 | #include <linux/clk.h> |
15 | #include <linux/irq.h> | 15 | #include <linux/irq.h> |
16 | #include <linux/io.h> | 16 | #include <linux/io.h> |
17 | #include <linux/module.h> | ||
17 | 18 | ||
18 | #include <mach/ipu.h> | 19 | #include <mach/ipu.h> |
19 | 20 | ||
@@ -354,10 +355,12 @@ static struct irq_chip ipu_irq_chip = { | |||
354 | /* Install the IRQ handler */ | 355 | /* Install the IRQ handler */ |
355 | int __init ipu_irq_attach_irq(struct ipu *ipu, struct platform_device *dev) | 356 | int __init ipu_irq_attach_irq(struct ipu *ipu, struct platform_device *dev) |
356 | { | 357 | { |
357 | struct ipu_platform_data *pdata = dev->dev.platform_data; | 358 | unsigned int irq, i; |
358 | unsigned int irq, irq_base, i; | 359 | int irq_base = irq_alloc_descs(-1, 0, CONFIG_MX3_IPU_IRQS, |
360 | numa_node_id()); | ||
359 | 361 | ||
360 | irq_base = pdata->irq_base; | 362 | if (irq_base < 0) |
363 | return irq_base; | ||
361 | 364 | ||
362 | for (i = 0; i < IPU_IRQ_NR_BANKS; i++) | 365 | for (i = 0; i < IPU_IRQ_NR_BANKS; i++) |
363 | irq_bank[i].ipu = ipu; | 366 | irq_bank[i].ipu = ipu; |
@@ -387,15 +390,16 @@ int __init ipu_irq_attach_irq(struct ipu *ipu, struct platform_device *dev) | |||
387 | irq_set_handler_data(ipu->irq_err, ipu); | 390 | irq_set_handler_data(ipu->irq_err, ipu); |
388 | irq_set_chained_handler(ipu->irq_err, ipu_irq_err); | 391 | irq_set_chained_handler(ipu->irq_err, ipu_irq_err); |
389 | 392 | ||
393 | ipu->irq_base = irq_base; | ||
394 | |||
390 | return 0; | 395 | return 0; |
391 | } | 396 | } |
392 | 397 | ||
393 | void ipu_irq_detach_irq(struct ipu *ipu, struct platform_device *dev) | 398 | void ipu_irq_detach_irq(struct ipu *ipu, struct platform_device *dev) |
394 | { | 399 | { |
395 | struct ipu_platform_data *pdata = dev->dev.platform_data; | ||
396 | unsigned int irq, irq_base; | 400 | unsigned int irq, irq_base; |
397 | 401 | ||
398 | irq_base = pdata->irq_base; | 402 | irq_base = ipu->irq_base; |
399 | 403 | ||
400 | irq_set_chained_handler(ipu->irq_fn, NULL); | 404 | irq_set_chained_handler(ipu->irq_fn, NULL); |
401 | irq_set_handler_data(ipu->irq_fn, NULL); | 405 | irq_set_handler_data(ipu->irq_fn, NULL); |