Skip to content

Commit e0f4fec

Browse files
Mian Yousaf KaukabLee Jones
authored andcommitted
mfd: abx500-core: Provide an API to dump all ABx500 registers
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>
1 parent c73db9f commit e0f4fec

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

‎drivers/mfd/abx500-core.c‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,22 @@ int abx500_startup_irq_enabled(struct device *dev, unsigned int irq)
153153
}
154154
EXPORT_SYMBOL(abx500_startup_irq_enabled);
155155

156+
void abx500_dump_all_banks(void)
157+
{
158+
struct abx500_ops *ops;
159+
struct device dummy_child = {0};
160+
struct abx500_device_entry *dev_entry;
161+
162+
list_for_each_entry(dev_entry, &abx500_list, list) {
163+
dummy_child.parent = dev_entry->dev;
164+
ops = &dev_entry->ops;
165+
166+
if ((ops != NULL) && (ops->dump_all_banks != NULL))
167+
ops->dump_all_banks(&dummy_child);
168+
}
169+
}
170+
EXPORT_SYMBOL(abx500_dump_all_banks);
171+
156172
MODULE_AUTHOR("Mattias Wallin <mattias.wallin@stericsson.com>");
157173
MODULE_DESCRIPTION("ABX500 core driver");
158174
MODULE_LICENSE("GPL");

‎include/linux/mfd/abx500.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ int abx500_mask_and_set_register_interruptible(struct device *dev, u8 bank,
308308
int abx500_get_chip_id(struct device *dev);
309309
int abx500_event_registers_startup_state_get(struct device *dev, u8 *event);
310310
int abx500_startup_irq_enabled(struct device *dev, unsigned int irq);
311+
void abx500_dump_all_banks(void);
311312

312313
struct abx500_ops {
313314
int (*get_chip_id) (struct device *);
@@ -318,6 +319,7 @@ struct abx500_ops {
318319
int (*mask_and_set_register) (struct device *, u8, u8, u8, u8);
319320
int (*event_registers_startup_state_get) (struct device *, u8 *);
320321
int (*startup_irq_enabled) (struct device *, unsigned int);
322+
void (*dump_all_banks) (struct device *);
321323
};
322324

323325
int abx500_register_ops(struct device *core_dev, struct abx500_ops *ops);

0 commit comments

Comments
 (0)