aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonas Aaberg <jonas.aberg@stericsson.com>2012-05-31 01:57:07 -0400
committerLee Jones <lee.jones@linaro.org>2013-03-06 23:27:57 -0500
commit2cf64e264828aa0be841751d41fcd7f13a98d778 (patch)
tree3465a8d46daee50242792e6798f16242cbfba4fb
parent222460cb4b2fe1c1e84f3302a8d8dbc4a94f6837 (diff)
mfd: ab8500-debug: Add wake-up info
Add information regarding what ab interrupt that caused a wake-up from suspend in <debugfs>/ab8500/interrupts. Also print the name of the interrupts, not just the numbers. Signed-off-by: Jonas Aaberg <jonas.aberg@stericsson.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Reviewed-by: Per FORLIN <per.forlin@stericsson.com> Tested-by: Mattias WALLIN <mattias.wallin@stericsson.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com>
-rw-r--r--drivers/mfd/ab8500-debugfs.c35
1 files changed, 30 insertions, 5 deletions
diff --git a/drivers/mfd/ab8500-debugfs.c b/drivers/mfd/ab8500-debugfs.c
index 1e76a2f35066..55d0ff4f5b23 100644
--- a/drivers/mfd/ab8500-debugfs.c
+++ b/drivers/mfd/ab8500-debugfs.c
@@ -80,6 +80,7 @@
80#include <linux/interrupt.h> 80#include <linux/interrupt.h>
81#include <linux/kobject.h> 81#include <linux/kobject.h>
82#include <linux/slab.h> 82#include <linux/slab.h>
83#include <linux/irq.h>
83 84
84#include <linux/mfd/abx500.h> 85#include <linux/mfd/abx500.h>
85#include <linux/mfd/abx500/ab8500.h> 86#include <linux/mfd/abx500/ab8500.h>
@@ -803,22 +804,46 @@ static ssize_t ab8500_val_write(struct file *file,
803 * Interrupt status 804 * Interrupt status
804 */ 805 */
805static u32 num_interrupts[AB8500_MAX_NR_IRQS]; 806static u32 num_interrupts[AB8500_MAX_NR_IRQS];
807static u32 num_wake_interrupts[AB8500_MAX_NR_IRQS];
806static int num_interrupt_lines; 808static int num_interrupt_lines;
807 809
810bool __attribute__((weak)) suspend_test_wake_cause_interrupt_is_mine(u32 my_int)
811{
812 return false;
813}
814
808void ab8500_debug_register_interrupt(int line) 815void ab8500_debug_register_interrupt(int line)
809{ 816{
810 if (line < num_interrupt_lines) 817 if (line < num_interrupt_lines) {
811 num_interrupts[line]++; 818 num_interrupts[line]++;
819 if (suspend_test_wake_cause_interrupt_is_mine(IRQ_DB8500_AB8500))
820 num_wake_interrupts[line]++;
821 }
812} 822}
813 823
814static int ab8500_interrupts_print(struct seq_file *s, void *p) 824static int ab8500_interrupts_print(struct seq_file *s, void *p)
815{ 825{
816 int line; 826 int line;
817 827
818 seq_printf(s, "irq: number of\n"); 828 seq_printf(s, "name: number: number of: wake:\n");
829
830 for (line = 0; line < num_interrupt_lines; line++) {
831 struct irq_desc *desc = irq_to_desc(line + irq_first);
832 struct irqaction *action = desc->action;
819 833
820 for (line = 0; line < num_interrupt_lines; line++) 834 seq_printf(s, "%3i: %6i %4i", line,
821 seq_printf(s, "%3i: %6i\n", line, num_interrupts[line]); 835 num_interrupts[line],
836 num_wake_interrupts[line]);
837
838 if (desc && desc->name)
839 seq_printf(s, "-%-8s", desc->name);
840 if (action) {
841 seq_printf(s, " %s", action->name);
842 while ((action = action->next) != NULL)
843 seq_printf(s, ", %s", action->name);
844 }
845 seq_putc(s, '\n');
846 }
822 847
823 return 0; 848 return 0;
824} 849}
@@ -1870,7 +1895,7 @@ static int ab8500_debug_probe(struct platform_device *plf)
1870 dev_err(&plf->dev, "Last irq not found, err %d\n", 1895 dev_err(&plf->dev, "Last irq not found, err %d\n",
1871 irq_last); 1896 irq_last);
1872 ret = irq_last; 1897 ret = irq_last;
1873 goto out_freeevent_name; 1898 goto out_freeevent_name;
1874 } 1899 }
1875 1900
1876 ab8500_dir = debugfs_create_dir(AB8500_NAME_STRING, NULL); 1901 ab8500_dir = debugfs_create_dir(AB8500_NAME_STRING, NULL);