summaryrefslogtreecommitdiffstats
path: root/drivers/mfd/wm8350-core.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2008-10-10 15:58:13 +0100
committerLiam Girdwood <lrg@slimlogic.co.uk>2008-10-13 21:51:56 +0100
commitbcdd4efc1b6b8b98f30e127115f4bc7bbcd6f7ce (patch)
tree5f58a36bcfefb07cc9a44faf38c91b8bc7e3c1c1 /drivers/mfd/wm8350-core.c
parent0e7203933224cbe09b5a9125f55b177b8dd5b1bd (diff)
downloadtalos-obmc-linux-bcdd4efc1b6b8b98f30e127115f4bc7bbcd6f7ce.tar.gz
talos-obmc-linux-bcdd4efc1b6b8b98f30e127115f4bc7bbcd6f7ce.zip
mfd: Add initialisation callback for WM8350
Some functions of the WM8350 require board-specific initialisation on startup. Provide a callback to the WM8350 driver in platform data for platforms to use to configure the chip. Use of a callback allows platforms to control the ordering of initialisation which can be important. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Samuel Ortiz <sameo@openedhand.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'drivers/mfd/wm8350-core.c')
-rw-r--r--drivers/mfd/wm8350-core.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/mfd/wm8350-core.c b/drivers/mfd/wm8350-core.c
index c7552c0b7797..071834ba6954 100644
--- a/drivers/mfd/wm8350-core.c
+++ b/drivers/mfd/wm8350-core.c
@@ -388,7 +388,8 @@ out:
}
EXPORT_SYMBOL_GPL(wm8350_create_cache);
-int wm8350_device_init(struct wm8350 *wm8350)
+int wm8350_device_init(struct wm8350 *wm8350,
+ struct wm8350_platform_data *pdata)
{
int ret = -EINVAL;
u16 id1, id2, mask, mode;
@@ -439,6 +440,15 @@ int wm8350_device_init(struct wm8350 *wm8350)
return ret;
}
+ if (pdata->init) {
+ ret = pdata->init(wm8350);
+ if (ret != 0) {
+ dev_err(wm8350->dev, "Platform init() failed: %d\n",
+ ret);
+ goto err;
+ }
+ }
+
return 0;
err:
OpenPOWER on IntegriCloud