Skip to content

Commit f864c46

Browse files
author
Linus Walleij
committed
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>
1 parent 8cc0071 commit f864c46

9 files changed

Lines changed: 36 additions & 263 deletions

File tree

‎arch/arm/mach-ux500/board-mop500-audio.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#include <linux/gpio.h>
1010
#include <linux/platform_data/dma-ste-dma40.h>
1111

12-
#include "irqs.h"
1312
#include <linux/platform_data/asoc-ux500-msp.h>
1413

1514
#include "ste-dma40-db8500.h"

‎arch/arm/mach-ux500/cpu-db8500.c‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,18 @@
2727
#include <asm/mach/map.h>
2828

2929
#include "setup.h"
30-
#include "irqs.h"
3130

3231
#include "board-mop500-regulators.h"
3332
#include "board-mop500.h"
3433
#include "db8500-regs.h"
3534
#include "id.h"
3635

3736
struct ab8500_platform_data ab8500_platdata = {
38-
.irq_base = MOP500_AB8500_IRQ_BASE,
3937
.regulator = &ab8500_regulator_plat_data,
4038
};
4139

4240
struct prcmu_pdata db8500_prcmu_pdata = {
4341
.ab_platdata = &ab8500_platdata,
44-
.ab_irq = IRQ_DB8500_AB8500,
45-
.irq_base = IRQ_PRCMU_BASE,
4642
.version_offset = DB8500_PRCMU_FW_VERSION_OFFSET,
4743
.legacy_offset = DB8500_PRCMU_LEGACY_OFFSET,
4844
};

‎arch/arm/mach-ux500/irqs-board-mop500.h‎

Lines changed: 0 additions & 55 deletions
This file was deleted.

‎arch/arm/mach-ux500/irqs-db8500.h‎

Lines changed: 0 additions & 125 deletions
This file was deleted.

‎arch/arm/mach-ux500/irqs.h‎

Lines changed: 0 additions & 49 deletions
This file was deleted.

‎drivers/mfd/ab8500-core.c‎

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ static int ab8500_irq_init(struct ab8500 *ab8500, struct device_node *np)
592592

593593
/* If ->irq_base is zero this will give a linear mapping */
594594
ab8500->domain = irq_domain_add_simple(NULL,
595-
num_irqs, ab8500->irq_base,
595+
num_irqs, 0,
596596
&ab8500_irq_ops, ab8500);
597597

598598
if (!ab8500->domain) {
@@ -1583,14 +1583,13 @@ static int ab8500_probe(struct platform_device *pdev)
15831583
if (!ab8500)
15841584
return -ENOMEM;
15851585

1586-
if (plat)
1587-
ab8500->irq_base = plat->irq_base;
1588-
15891586
ab8500->dev = &pdev->dev;
15901587

15911588
resource = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
1592-
if (!resource)
1589+
if (!resource) {
1590+
dev_err(&pdev->dev, "no IRQ resource\n");
15931591
return -ENODEV;
1592+
}
15941593

15951594
ab8500->irq = resource->start;
15961595

@@ -1612,8 +1611,10 @@ static int ab8500_probe(struct platform_device *pdev)
16121611
else {
16131612
ret = get_register_interruptible(ab8500, AB8500_MISC,
16141613
AB8500_IC_NAME_REG, &value);
1615-
if (ret < 0)
1614+
if (ret < 0) {
1615+
dev_err(&pdev->dev, "could not probe HW\n");
16161616
return ret;
1617+
}
16171618

16181619
ab8500->version = value;
16191620
}
@@ -1759,38 +1760,38 @@ static int ab8500_probe(struct platform_device *pdev)
17591760
if (is_ab9540(ab8500))
17601761
ret = mfd_add_devices(ab8500->dev, 0, ab9540_devs,
17611762
ARRAY_SIZE(ab9540_devs), NULL,
1762-
ab8500->irq_base, ab8500->domain);
1763+
0, ab8500->domain);
17631764
else if (is_ab8540(ab8500)) {
17641765
ret = mfd_add_devices(ab8500->dev, 0, ab8540_devs,
17651766
ARRAY_SIZE(ab8540_devs), NULL,
1766-
ab8500->irq_base, NULL);
1767+
0, ab8500->domain);
17671768
if (ret)
17681769
return ret;
17691770

17701771
if (is_ab8540_1p2_or_earlier(ab8500))
17711772
ret = mfd_add_devices(ab8500->dev, 0, ab8540_cut1_devs,
17721773
ARRAY_SIZE(ab8540_cut1_devs), NULL,
1773-
ab8500->irq_base, NULL);
1774+
0, ab8500->domain);
17741775
else /* ab8540 >= cut2 */
17751776
ret = mfd_add_devices(ab8500->dev, 0, ab8540_cut2_devs,
17761777
ARRAY_SIZE(ab8540_cut2_devs), NULL,
1777-
ab8500->irq_base, NULL);
1778+
0, ab8500->domain);
17781779
} else if (is_ab8505(ab8500))
17791780
ret = mfd_add_devices(ab8500->dev, 0, ab8505_devs,
17801781
ARRAY_SIZE(ab8505_devs), NULL,
1781-
ab8500->irq_base, ab8500->domain);
1782+
0, ab8500->domain);
17821783
else
17831784
ret = mfd_add_devices(ab8500->dev, 0, ab8500_devs,
17841785
ARRAY_SIZE(ab8500_devs), NULL,
1785-
ab8500->irq_base, ab8500->domain);
1786+
0, ab8500->domain);
17861787
if (ret)
17871788
return ret;
17881789

17891790
if (!no_bm) {
17901791
/* Add battery management devices */
17911792
ret = mfd_add_devices(ab8500->dev, 0, ab8500_bm_devs,
17921793
ARRAY_SIZE(ab8500_bm_devs), NULL,
1793-
ab8500->irq_base, ab8500->domain);
1794+
0, ab8500->domain);
17941795
if (ret)
17951796
dev_err(ab8500->dev, "error adding bm devices\n");
17961797
}

0 commit comments

Comments
 (0)