提交 98ae1cca 编写于 作者: M Mark Brown 提交者: Samuel Ortiz

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: NMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: NSamuel Ortiz <sameo@linux.intel.com>
上级 78bb3688
...@@ -316,7 +316,7 @@ static int wm8994_suspend(struct device *dev) ...@@ -316,7 +316,7 @@ static int wm8994_suspend(struct device *dev)
static int wm8994_resume(struct device *dev) static int wm8994_resume(struct device *dev)
{ {
struct wm8994 *wm8994 = dev_get_drvdata(dev); struct wm8994 *wm8994 = dev_get_drvdata(dev);
int ret; int ret, i;
/* We may have lied to the PM core about suspending */ /* We may have lied to the PM core about suspending */
if (!wm8994->suspended) if (!wm8994->suspended)
...@@ -329,10 +329,16 @@ static int wm8994_resume(struct device *dev) ...@@ -329,10 +329,16 @@ static int wm8994_resume(struct device *dev)
return ret; return ret;
} }
ret = wm8994_write(wm8994, WM8994_INTERRUPT_STATUS_1_MASK, /* Write register at a time as we use the cache on the CPU so store
WM8994_NUM_IRQ_REGS * 2, &wm8994->irq_masks_cur); * it in native endian.
if (ret < 0) */
dev_err(dev, "Failed to restore interrupt masks: %d\n", ret); for (i = 0; i < ARRAY_SIZE(wm8994->irq_masks_cur); i++) {
ret = wm8994_reg_write(wm8994, WM8994_INTERRUPT_STATUS_1_MASK
+ i, wm8994->irq_masks_cur[i]);
if (ret < 0)
dev_err(dev, "Failed to restore interrupt masks: %d\n",
ret);
}
ret = wm8994_write(wm8994, WM8994_LDO_1, WM8994_NUM_LDO_REGS * 2, ret = wm8994_write(wm8994, WM8994_LDO_1, WM8994_NUM_LDO_REGS * 2,
&wm8994->ldo_regs); &wm8994->ldo_regs);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册