]> git.karo-electronics.de Git - linux-beck.git/commitdiff
mfd: abx500-core: Provide an API to dump all ABx500 registers
authorMian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
Fri, 27 Jan 2012 10:22:16 +0000 (11:22 +0100)
committerLee Jones <lee.jones@linaro.org>
Mon, 4 Feb 2013 08:31:34 +0000 (08:31 +0000)
Some drivers can detect subsystem failures e.g. shared memory driver
can detect modem sub system failures. It would be helpful in analyzing
these failures if AB register dump is available at that point. This
patch adds the API for the drivers to dump AB registers in the kernel
log.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
Reviewed-by: Linus WALLEIJ <linus.walleij@stericsson.com>
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
drivers/mfd/abx500-core.c
include/linux/mfd/abx500.h

index 7ce65f49480f1bfb4b68d7c693a27451e797e27b..9818afba25153b377cf2b64b54b18bccc02f3e2c 100644 (file)
@@ -153,6 +153,22 @@ int abx500_startup_irq_enabled(struct device *dev, unsigned int irq)
 }
 EXPORT_SYMBOL(abx500_startup_irq_enabled);
 
+void abx500_dump_all_banks(void)
+{
+       struct abx500_ops *ops;
+       struct device dummy_child = {0};
+       struct abx500_device_entry *dev_entry;
+
+       list_for_each_entry(dev_entry, &abx500_list, list) {
+               dummy_child.parent = dev_entry->dev;
+               ops = &dev_entry->ops;
+
+               if ((ops != NULL) && (ops->dump_all_banks != NULL))
+                       ops->dump_all_banks(&dummy_child);
+       }
+}
+EXPORT_SYMBOL(abx500_dump_all_banks);
+
 MODULE_AUTHOR("Mattias Wallin <mattias.wallin@stericsson.com>");
 MODULE_DESCRIPTION("ABX500 core driver");
 MODULE_LICENSE("GPL");
index 2138bd33021a629f59b868d5a3938aefa4f87449..bd480b248c622cfcb8448250a6d9c10382418aa8 100644 (file)
@@ -308,6 +308,7 @@ int abx500_mask_and_set_register_interruptible(struct device *dev, u8 bank,
 int abx500_get_chip_id(struct device *dev);
 int abx500_event_registers_startup_state_get(struct device *dev, u8 *event);
 int abx500_startup_irq_enabled(struct device *dev, unsigned int irq);
+void abx500_dump_all_banks(void);
 
 struct abx500_ops {
        int (*get_chip_id) (struct device *);
@@ -318,6 +319,7 @@ struct abx500_ops {
        int (*mask_and_set_register) (struct device *, u8, u8, u8, u8);
        int (*event_registers_startup_state_get) (struct device *, u8 *);
        int (*startup_irq_enabled) (struct device *, unsigned int);
+       void (*dump_all_banks) (struct device *);
 };
 
 int abx500_register_ops(struct device *core_dev, struct abx500_ops *ops);