diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-12-01 13:55:49 +0000 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-12-13 00:11:49 +0800 |
commit | 7ed5849c2861faf9c13f027868f635bd782a50e5 (patch) | |
tree | e95a181de00ee76fac4e574993dea738638b5589 /drivers/mfd/wm8994-core.c | |
parent | 19f9557174d61fcfe132a6846a83c36437ff014e (diff) | |
download | op-kernel-dev-7ed5849c2861faf9c13f027868f635bd782a50e5.zip op-kernel-dev-7ed5849c2861faf9c13f027868f635bd782a50e5.tar.gz |
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-core.c')
-rw-r--r-- | drivers/mfd/wm8994-core.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/mfd/wm8994-core.c b/drivers/mfd/wm8994-core.c index 8b4f22a..93f8599 100644 --- a/drivers/mfd/wm8994-core.c +++ b/drivers/mfd/wm8994-core.c @@ -446,15 +446,16 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq) ret); goto err_enable; } + wm8994->revision = ret; switch (wm8994->type) { case WM8994: - switch (ret) { + switch (wm8994->revision) { case 0: case 1: dev_warn(wm8994->dev, "revision %c not fully supported\n", - 'A' + ret); + 'A' + wm8994->revision); break; default: break; @@ -462,14 +463,15 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq) break; case WM1811: /* Revision C did not change the relevant layer */ - if (ret > 1) - ret++; + if (wm8994->revision > 1) + wm8994->revision++; break; default: break; } - dev_info(wm8994->dev, "%s revision %c\n", devname, 'A' + ret); + dev_info(wm8994->dev, "%s revision %c\n", devname, + 'A' + wm8994->revision); switch (wm8994->type) { case WM1811: |