aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/ab8500-core.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2014-02-03 18:35:56 -0500
committerLinus Walleij <linus.walleij@linaro.org>2014-03-03 19:58:11 -0500
commitf864c46aae4cb6aed09e98615c427fcc4f1de104 (patch)
treee99dfede3907fff672ba55400ede7ab61868c406 /drivers/mfd/ab8500-core.c
parent8cc0071556c18bf3dc036a33fa989d0ebe537e33 (diff)
mfd: dbx500/abx500: root out hardcoded IRQ assignments
The DBx500 and ABx500 should be getting their IRQs from the device tree and nowhere else. Get rid of all the static assignments everywhere, delete it from the driver, platform data and the board files in one swift strike. Lots of cross-dependencies in the MFD drivers for PRCMU and AB8500 makes it necessary to strike everywhere at once to eradicate IRQs passed as resources and platform data to the left and right around the platform. Cc: Mark Brown <broonie@kernel.org> Cc: Samuel Ortiz <sameo@linux.intel.com> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/mfd/ab8500-core.c')
-rw-r--r--drivers/mfd/ab8500-core.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c
index aaff683cd37d..a8ee4a36a1d8 100644
--- a/drivers/mfd/ab8500-core.c
+++ b/drivers/mfd/ab8500-core.c
@@ -592,7 +592,7 @@ static int ab8500_irq_init(struct ab8500 *ab8500, struct device_node *np)
592 592
593 /* If ->irq_base is zero this will give a linear mapping */ 593 /* If ->irq_base is zero this will give a linear mapping */
594 ab8500->domain = irq_domain_add_simple(NULL, 594 ab8500->domain = irq_domain_add_simple(NULL,
595 num_irqs, ab8500->irq_base, 595 num_irqs, 0,
596 &ab8500_irq_ops, ab8500); 596 &ab8500_irq_ops, ab8500);
597 597
598 if (!ab8500->domain) { 598 if (!ab8500->domain) {
@@ -1583,14 +1583,13 @@ static int ab8500_probe(struct platform_device *pdev)
1583 if (!ab8500) 1583 if (!ab8500)
1584 return -ENOMEM; 1584 return -ENOMEM;
1585 1585
1586 if (plat)
1587 ab8500->irq_base = plat->irq_base;
1588
1589 ab8500->dev = &pdev->dev; 1586 ab8500->dev = &pdev->dev;
1590 1587
1591 resource = platform_get_resource(pdev, IORESOURCE_IRQ, 0); 1588 resource = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
1592 if (!resource) 1589 if (!resource) {
1590 dev_err(&pdev->dev, "no IRQ resource\n");
1593 return -ENODEV; 1591 return -ENODEV;
1592 }
1594 1593
1595 ab8500->irq = resource->start; 1594 ab8500->irq = resource->start;
1596 1595
@@ -1612,8 +1611,10 @@ static int ab8500_probe(struct platform_device *pdev)
1612 else { 1611 else {
1613 ret = get_register_interruptible(ab8500, AB8500_MISC, 1612 ret = get_register_interruptible(ab8500, AB8500_MISC,
1614 AB8500_IC_NAME_REG, &value); 1613 AB8500_IC_NAME_REG, &value);
1615 if (ret < 0) 1614 if (ret < 0) {
1615 dev_err(&pdev->dev, "could not probe HW\n");
1616 return ret; 1616 return ret;
1617 }
1617 1618
1618 ab8500->version = value; 1619 ab8500->version = value;
1619 } 1620 }
@@ -1759,30 +1760,30 @@ static int ab8500_probe(struct platform_device *pdev)
1759 if (is_ab9540(ab8500)) 1760 if (is_ab9540(ab8500))
1760 ret = mfd_add_devices(ab8500->dev, 0, ab9540_devs, 1761 ret = mfd_add_devices(ab8500->dev, 0, ab9540_devs,
1761 ARRAY_SIZE(ab9540_devs), NULL, 1762 ARRAY_SIZE(ab9540_devs), NULL,
1762 ab8500->irq_base, ab8500->domain); 1763 0, ab8500->domain);
1763 else if (is_ab8540(ab8500)) { 1764 else if (is_ab8540(ab8500)) {
1764 ret = mfd_add_devices(ab8500->dev, 0, ab8540_devs, 1765 ret = mfd_add_devices(ab8500->dev, 0, ab8540_devs,
1765 ARRAY_SIZE(ab8540_devs), NULL, 1766 ARRAY_SIZE(ab8540_devs), NULL,
1766 ab8500->irq_base, NULL); 1767 0, ab8500->domain);
1767 if (ret) 1768 if (ret)
1768 return ret; 1769 return ret;
1769 1770
1770 if (is_ab8540_1p2_or_earlier(ab8500)) 1771 if (is_ab8540_1p2_or_earlier(ab8500))
1771 ret = mfd_add_devices(ab8500->dev, 0, ab8540_cut1_devs, 1772 ret = mfd_add_devices(ab8500->dev, 0, ab8540_cut1_devs,
1772 ARRAY_SIZE(ab8540_cut1_devs), NULL, 1773 ARRAY_SIZE(ab8540_cut1_devs), NULL,
1773 ab8500->irq_base, NULL); 1774 0, ab8500->domain);
1774 else /* ab8540 >= cut2 */ 1775 else /* ab8540 >= cut2 */
1775 ret = mfd_add_devices(ab8500->dev, 0, ab8540_cut2_devs, 1776 ret = mfd_add_devices(ab8500->dev, 0, ab8540_cut2_devs,
1776 ARRAY_SIZE(ab8540_cut2_devs), NULL, 1777 ARRAY_SIZE(ab8540_cut2_devs), NULL,
1777 ab8500->irq_base, NULL); 1778 0, ab8500->domain);
1778 } else if (is_ab8505(ab8500)) 1779 } else if (is_ab8505(ab8500))
1779 ret = mfd_add_devices(ab8500->dev, 0, ab8505_devs, 1780 ret = mfd_add_devices(ab8500->dev, 0, ab8505_devs,
1780 ARRAY_SIZE(ab8505_devs), NULL, 1781 ARRAY_SIZE(ab8505_devs), NULL,
1781 ab8500->irq_base, ab8500->domain); 1782 0, ab8500->domain);
1782 else 1783 else
1783 ret = mfd_add_devices(ab8500->dev, 0, ab8500_devs, 1784 ret = mfd_add_devices(ab8500->dev, 0, ab8500_devs,
1784 ARRAY_SIZE(ab8500_devs), NULL, 1785 ARRAY_SIZE(ab8500_devs), NULL,
1785 ab8500->irq_base, ab8500->domain); 1786 0, ab8500->domain);
1786 if (ret) 1787 if (ret)
1787 return ret; 1788 return ret;
1788 1789
@@ -1790,7 +1791,7 @@ static int ab8500_probe(struct platform_device *pdev)
1790 /* Add battery management devices */ 1791 /* Add battery management devices */
1791 ret = mfd_add_devices(ab8500->dev, 0, ab8500_bm_devs, 1792 ret = mfd_add_devices(ab8500->dev, 0, ab8500_bm_devs,
1792 ARRAY_SIZE(ab8500_bm_devs), NULL, 1793 ARRAY_SIZE(ab8500_bm_devs), NULL,
1793 ab8500->irq_base, ab8500->domain); 1794 0, ab8500->domain);
1794 if (ret) 1795 if (ret)
1795 dev_err(ab8500->dev, "error adding bm devices\n"); 1796 dev_err(ab8500->dev, "error adding bm devices\n");
1796 } 1797 }