summaryrefslogtreecommitdiff
path: root/drivers/mfd/wm8994-regmap.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-12-01 17:55:49 +0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-12-12 20:11:49 +0400
commit7ed5849c2861faf9c13f027868f635bd782a50e5 (patch)
treee95a181de00ee76fac4e574993dea738638b5589 /drivers/mfd/wm8994-regmap.c
parent19f9557174d61fcfe132a6846a83c36437ff014e (diff)
downloadlinux-7ed5849c2861faf9c13f027868f635bd782a50e5.tar.xz
mfd: Mark WM1811 GPIO6 register volatile for later revisions
For later chip revisions the WM1811 GPIO6 register is always volatile so store the device revision when initialising the driver and then check at runtime if we're running on a newer device. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/wm8994-regmap.c')
-rw-r--r--drivers/mfd/wm8994-regmap.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/drivers/mfd/wm8994-regmap.c b/drivers/mfd/wm8994-regmap.c
index 03594c257ef2..c598ae69b8ff 100644
--- a/drivers/mfd/wm8994-regmap.c
+++ b/drivers/mfd/wm8994-regmap.c
@@ -12,6 +12,7 @@
*
*/
+#include <linux/mfd/wm8994/core.h>
#include <linux/mfd/wm8994/registers.h>
#include <linux/regmap.h>
@@ -210,7 +211,6 @@ static struct reg_default wm1811_defaults[] = {
{ 0x0702, 0xA101 }, /* R1794 - Pull Control (BCLK2) */
{ 0x0703, 0xA101 }, /* R1795 - Pull Control (DACLRCLK2) */
{ 0x0704, 0xA101 }, /* R1796 - Pull Control (DACDAT2) */
- { 0x0705, 0xA101 }, /* R1797 - GPIO 6 */
{ 0x0707, 0xA101 }, /* R1799 - GPIO 8 */
{ 0x0708, 0xA101 }, /* R1800 - GPIO 9 */
{ 0x0709, 0xA101 }, /* R1801 - GPIO 10 */
@@ -1145,6 +1145,21 @@ static bool wm8994_volatile_register(struct device *dev, unsigned int reg)
}
}
+static bool wm1811_volatile_register(struct device *dev, unsigned int reg)
+{
+ struct wm8994 *wm8994 = dev_get_drvdata(dev);
+
+ switch (reg) {
+ case WM8994_GPIO_6:
+ if (wm8994->revision > 1)
+ return true;
+ else
+ return false;
+ default:
+ return wm8994_volatile_register(dev, reg);
+ }
+}
+
static bool wm8958_volatile_register(struct device *dev, unsigned int reg)
{
switch (reg) {
@@ -1185,7 +1200,7 @@ struct regmap_config wm1811_regmap_config = {
.num_reg_defaults = ARRAY_SIZE(wm1811_defaults),
.max_register = WM8994_MAX_REGISTER,
- .volatile_reg = wm8994_volatile_register,
+ .volatile_reg = wm1811_volatile_register,
.readable_reg = wm1811_readable_register,
};