Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1d843a6c authored by Mian Yousaf Kaukab's avatar Mian Yousaf Kaukab Committed by Lee Jones
Browse files

mfd: ab8500-core: Allow the possibility to dump all AB8500 registers



Implement an API so that a user may dump all AB8500 registers
via debugfs file access.

Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
Signed-off-by: default avatarMian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
Reviewed-by: default avatarLinus WALLEIJ <linus.walleij@stericsson.com>
Reviewed-by: default avatarJonas ABERG <jonas.aberg@stericsson.com>
parent 42002c6d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -319,6 +319,7 @@ static struct abx500_ops ab8500_ops = {
	.mask_and_set_register = ab8500_mask_and_set_register,
	.event_registers_startup_state_get = NULL,
	.startup_irq_enabled = NULL,
	.dump_all_banks = ab8500_dump_all_banks,
};

static void ab8500_irq_lock(struct irq_data *data)
+13 −0
Original line number Diff line number Diff line
@@ -581,6 +581,19 @@ static int ab8500_print_all_banks(struct seq_file *s, void *p)
	return 0;
}

/* Dump registers to kernel log */
void ab8500_dump_all_banks(struct device *dev)
{
	unsigned int i;

	printk(KERN_INFO"ab8500 register values:\n");

	for (i = 1; i < AB8500_NUM_BANKS; i++) {
		printk(KERN_INFO" bank %u:\n", i);
		ab8500_registers_print(dev, i, NULL);
	}
}

static int ab8500_all_banks_open(struct inode *inode, struct file *file)
{
	struct seq_file *s;
+6 −0
Original line number Diff line number Diff line
@@ -345,4 +345,10 @@ static inline int is_ab8500_2p0(struct ab8500 *ab)
	return (is_ab8500(ab) && (ab->chip_id == AB8500_CUT2P0));
}

#ifdef CONFIG_AB8500_DEBUG
void ab8500_dump_all_banks(struct device *dev);
#else
static inline void ab8500_dump_all_banks(struct device *dev) {}
#endif

#endif /* MFD_AB8500_H */