mfd: Add regmap cache support for wm8350
[cascardo/linux.git] / include / linux / mfd / wm8350 / core.h
index 9192b64..cba9bc8 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/mutex.h>
 #include <linux/interrupt.h>
 #include <linux/completion.h>
+#include <linux/regmap.h>
 
 #include <linux/mfd/wm8350/audio.h>
 #include <linux/mfd/wm8350/gpio.h>
@@ -66,6 +67,9 @@
 
 #define WM8350_MAX_REGISTER                     0xFF
 
+#define WM8350_UNLOCK_KEY              0x0013
+#define WM8350_LOCK_KEY                        0x0000
+
 /*
  * Field Definitions.
  */
 
 #define WM8350_NUM_IRQ_REGS 7
 
+extern const struct regmap_config wm8350_regmap;
 struct wm8350_reg_access {
        u16 readable;           /* Mask of readable bits */
        u16 writable;           /* Mask of writable bits */
@@ -602,7 +607,6 @@ extern const u16 wm8352_mode2_defaults[];
 extern const u16 wm8352_mode3_defaults[];
 
 struct wm8350;
-struct regmap;
 
 struct wm8350_hwmon {
        struct platform_device *pdev;
@@ -615,6 +619,7 @@ struct wm8350 {
        /* device IO */
        struct regmap *regmap;
        u16 *reg_cache;
+       bool unlocked;
 
        struct mutex auxadc_mutex;
        struct completion auxadc_done;