aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2013-04-12 11:02:09 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2013-05-16 18:42:31 -0400
commit6999181eecb11863b78030c68037a9f851522735 (patch)
treefb0efde78f52e36a6493ab71cb0f387e85997a97 /drivers
parent33a0d1907fb442cd59b8e2eb83be79c4ab1cb791 (diff)
mfd: ab8500: Pass AB8500 IRQ to debugfs code by resource
The AB8500 debug code which was merged in parallell with the multiplatform work incidentally introduced a new instance using the <mach/irqs.h> header which is now deleted, causing this build regression: drivers/mfd/ab8500-debugfs.c:95:23: fatal error: mach/irqs.h: No such file or directory compilation terminated. make[4]: *** [drivers/mfd/ab8500-debugfs.o] Error 1 The code most certainly never worked with device tree either since that does not rely on this kind of hard-coded interrupt numbers. Fix the problem at the root by passing it as a named resource from the ab8500-core driver. Use an untyped resource to stop the MFD core from remapping this IRQ relative to the AB8500 irqdomain. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mfd/ab8500-core.c15
-rw-r--r--drivers/mfd/ab8500-debugfs.c16
2 files changed, 27 insertions, 4 deletions
diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c
index 8e8a016effe9..65cd46bbe336 100644
--- a/drivers/mfd/ab8500-core.c
+++ b/drivers/mfd/ab8500-core.c
@@ -868,6 +868,15 @@ static struct resource ab8500_chargalg_resources[] = {};
868#ifdef CONFIG_DEBUG_FS 868#ifdef CONFIG_DEBUG_FS
869static struct resource ab8500_debug_resources[] = { 869static struct resource ab8500_debug_resources[] = {
870 { 870 {
871 .name = "IRQ_AB8500",
872 /*
873 * Number will be filled in. NOTE: this is deliberately
874 * not flagged as an IRQ in ordet to avoid remapping using
875 * the irqdomain in the MFD core, so that this IRQ passes
876 * unremapped to the debug code.
877 */
878 },
879 {
871 .name = "IRQ_FIRST", 880 .name = "IRQ_FIRST",
872 .start = AB8500_INT_MAIN_EXT_CH_NOT_OK, 881 .start = AB8500_INT_MAIN_EXT_CH_NOT_OK,
873 .end = AB8500_INT_MAIN_EXT_CH_NOT_OK, 882 .end = AB8500_INT_MAIN_EXT_CH_NOT_OK,
@@ -1712,6 +1721,12 @@ static int ab8500_probe(struct platform_device *pdev)
1712 if (ret) 1721 if (ret)
1713 return ret; 1722 return ret;
1714 1723
1724#if CONFIG_DEBUG_FS
1725 /* Pass to debugfs */
1726 ab8500_debug_resources[0].start = ab8500->irq;
1727 ab8500_debug_resources[0].end = ab8500->irq;
1728#endif
1729
1715 if (is_ab9540(ab8500)) 1730 if (is_ab9540(ab8500))
1716 ret = mfd_add_devices(ab8500->dev, 0, ab9540_devs, 1731 ret = mfd_add_devices(ab8500->dev, 0, ab9540_devs,
1717 ARRAY_SIZE(ab9540_devs), NULL, 1732 ARRAY_SIZE(ab9540_devs), NULL,
diff --git a/drivers/mfd/ab8500-debugfs.c b/drivers/mfd/ab8500-debugfs.c
index b88bbbc15f1e..37b7ce4c7c3b 100644
--- a/drivers/mfd/ab8500-debugfs.c
+++ b/drivers/mfd/ab8500-debugfs.c
@@ -91,12 +91,10 @@
91#include <linux/ctype.h> 91#include <linux/ctype.h>
92#endif 92#endif
93 93
94/* TODO: this file should not reference IRQ_DB8500_AB8500! */
95#include <mach/irqs.h>
96
97static u32 debug_bank; 94static u32 debug_bank;
98static u32 debug_address; 95static u32 debug_address;
99 96
97static int irq_ab8500;
100static int irq_first; 98static int irq_first;
101static int irq_last; 99static int irq_last;
102static u32 *irq_count; 100static u32 *irq_count;
@@ -1589,7 +1587,7 @@ void ab8500_debug_register_interrupt(int line)
1589{ 1587{
1590 if (line < num_interrupt_lines) { 1588 if (line < num_interrupt_lines) {
1591 num_interrupts[line]++; 1589 num_interrupts[line]++;
1592 if (suspend_test_wake_cause_interrupt_is_mine(IRQ_DB8500_AB8500)) 1590 if (suspend_test_wake_cause_interrupt_is_mine(irq_ab8500))
1593 num_wake_interrupts[line]++; 1591 num_wake_interrupts[line]++;
1594 } 1592 }
1595} 1593}
@@ -2941,6 +2939,7 @@ static int ab8500_debug_probe(struct platform_device *plf)
2941 struct dentry *file; 2939 struct dentry *file;
2942 int ret = -ENOMEM; 2940 int ret = -ENOMEM;
2943 struct ab8500 *ab8500; 2941 struct ab8500 *ab8500;
2942 struct resource *res;
2944 debug_bank = AB8500_MISC; 2943 debug_bank = AB8500_MISC;
2945 debug_address = AB8500_REV_REG & 0x00FF; 2944 debug_address = AB8500_REV_REG & 0x00FF;
2946 2945
@@ -2959,6 +2958,15 @@ static int ab8500_debug_probe(struct platform_device *plf)
2959 if (!event_name) 2958 if (!event_name)
2960 goto out_freedev_attr; 2959 goto out_freedev_attr;
2961 2960
2961 res = platform_get_resource_byname(plf, 0, "IRQ_AB8500");
2962 if (!res) {
2963 dev_err(&plf->dev, "AB8500 irq not found, err %d\n",
2964 irq_first);
2965 ret = -ENXIO;
2966 goto out_freeevent_name;
2967 }
2968 irq_ab8500 = res->start;
2969
2962 irq_first = platform_get_irq_byname(plf, "IRQ_FIRST"); 2970 irq_first = platform_get_irq_byname(plf, "IRQ_FIRST");
2963 if (irq_first < 0) { 2971 if (irq_first < 0) {
2964 dev_err(&plf->dev, "First irq not found, err %d\n", 2972 dev_err(&plf->dev, "First irq not found, err %d\n",