aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-06-07 06:49:42 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2011-07-31 17:28:21 -0400
commit98ae1ccaf62d5006884e01159bf7a63174b0fc03 (patch)
treea0c293451f24aad6a823d7b1e7a12e49878c69ff /drivers/mfd
parent78bb3688ea1830672b8095fb6388593f582cd591 (diff)
mfd: Fix WM8994 IRQ register cache restore on resume
When the byte swap was factored out into the per-register I/O functions the register restore for the IRQ mask cache (which we use and store in CPU native format for the interrupt handler) was not updated to do a byte swap when it uses the bulk I/O. Fix this by writing the cache out one register at a time. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/wm8994-core.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/mfd/wm8994-core.c b/drivers/mfd/wm8994-core.c
index 18f19b7198a0..7caf0d82a9a2 100644
--- a/drivers/mfd/wm8994-core.c
+++ b/drivers/mfd/wm8994-core.c
@@ -316,7 +316,7 @@ static int wm8994_suspend(struct device *dev)
316static int wm8994_resume(struct device *dev) 316static int wm8994_resume(struct device *dev)
317{ 317{
318 struct wm8994 *wm8994 = dev_get_drvdata(dev); 318 struct wm8994 *wm8994 = dev_get_drvdata(dev);
319 int ret; 319 int ret, i;
320 320
321 /* We may have lied to the PM core about suspending */ 321 /* We may have lied to the PM core about suspending */
322 if (!wm8994->suspended) 322 if (!wm8994->suspended)
@@ -329,10 +329,16 @@ static int wm8994_resume(struct device *dev)
329 return ret; 329 return ret;
330 } 330 }
331 331
332 ret = wm8994_write(wm8994, WM8994_INTERRUPT_STATUS_1_MASK, 332 /* Write register at a time as we use the cache on the CPU so store
333 WM8994_NUM_IRQ_REGS * 2, &wm8994->irq_masks_cur); 333 * it in native endian.
334 if (ret < 0) 334 */
335 dev_err(dev, "Failed to restore interrupt masks: %d\n", ret); 335 for (i = 0; i < ARRAY_SIZE(wm8994->irq_masks_cur); i++) {
336 ret = wm8994_reg_write(wm8994, WM8994_INTERRUPT_STATUS_1_MASK
337 + i, wm8994->irq_masks_cur[i]);
338 if (ret < 0)
339 dev_err(dev, "Failed to restore interrupt masks: %d\n",
340 ret);
341 }
336 342
337 ret = wm8994_write(wm8994, WM8994_LDO_1, WM8994_NUM_LDO_REGS * 2, 343 ret = wm8994_write(wm8994, WM8994_LDO_1, WM8994_NUM_LDO_REGS * 2,
338 &wm8994->ldo_regs); 344 &wm8994->ldo_regs);