mfd: Add initialisation callback for WM8350
[linux-2.6.git] / drivers / mfd / wm8350-core.c
index c7552c0b7797c86c97e3a71e8a28cbaac9ff8eab..071834ba6954fc4d9daf2c274b021988aedacb8d 100644 (file)
@@ -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: