summaryrefslogtreecommitdiffstats
path: root/include/mfd
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2014-05-08 08:36:19 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2014-05-19 08:36:33 +0200
commit214f0d9264f9b8c3b847a2ba2286c5ca5a33ab10 (patch)
tree5db3b7224c0c2f7a26e0b730e2af8d1b80e33a09 /include/mfd
parent85c29d2860f664e589dc3fd5d5478082de7c7e85 (diff)
downloadbarebox-214f0d9264f9b8c3b847a2ba2286c5ca5a33ab10.tar.gz
barebox-214f0d9264f9b8c3b847a2ba2286c5ca5a33ab10.tar.xz
mfd: mc13xxx: Allow to set callback for mc13xxx
Some boards have to initialize the PMIC before other devices can be initialized. This requires three levels of initcalls: one level in which the PMIC is probed, one in which the board can call mc13xxx_get() and the third one to initialize the PMIC dependent devices. Allow to register a callback which is called once the PMIC is initialized. This way mc13xxx_get() is no longer necessary and the number of required initcalls levels is reduced to two. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/mfd')
-rw-r--r--include/mfd/mc13xxx.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/mfd/mc13xxx.h b/include/mfd/mc13xxx.h
index 1946b1a1c3..96a32e4dad 100644
--- a/include/mfd/mc13xxx.h
+++ b/include/mfd/mc13xxx.h
@@ -171,6 +171,7 @@ extern int mc13xxx_revision(struct mc13xxx *mc13xxx);
extern int mc13xxx_reg_read(struct mc13xxx *mc13xxx, u8 reg, u32 *val);
extern int mc13xxx_reg_write(struct mc13xxx *mc13xxx, u8 reg, u32 val);
extern int mc13xxx_set_bits(struct mc13xxx *mc13xxx, u8 reg, u32 mask, u32 val);
+int mc13xxx_register_init_callback(void(*callback)(struct mc13xxx *mc13xxx));
#else
static inline struct mc13xxx *mc13xxx_get(void)
{
@@ -196,6 +197,11 @@ static inline int mc13xxx_set_bits(struct mc13xxx *mc13xxx, u8 reg, u32 mask, u3
{
return -ENODEV;
}
+
+static inline int mc13xxx_register_init_callback(void(*callback)(struct mc13xxx *mc13xxx))
+{
+ return -ENODEV;
+}
#endif
#endif /* __MFD_MC13XXX_H */