diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-05-17 08:25:21 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2013-06-17 18:07:49 -0400 |
commit | f3799e93720b8b722944d86f7a2a0599f5a9d716 (patch) | |
tree | 2858c0f89bd15296a43bd5bd67d4e31b3c6ec935 | |
parent | 1ee5d8c85aecc0d7b4d0de7473dbc7340ddbb5d4 (diff) |
mfd: wm8994: Reset device during probe
Ensure that the device is in a known good state. This should have little
practical impact as the runtime PM will reset the device shortly after
probe but it's neater.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
-rw-r--r-- | drivers/mfd/wm8994-core.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/mfd/wm8994-core.c b/drivers/mfd/wm8994-core.c index 00e4fe2f3c75..ccdddf919069 100644 --- a/drivers/mfd/wm8994-core.c +++ b/drivers/mfd/wm8994-core.c | |||
@@ -652,6 +652,17 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq) | |||
652 | return ret; | 652 | return ret; |
653 | } | 653 | } |
654 | 654 | ||
655 | /* Explicitly put the device into reset in case regulators | ||
656 | * don't get disabled in order to ensure we know the device | ||
657 | * state. | ||
658 | */ | ||
659 | ret = wm8994_reg_write(wm8994, WM8994_SOFTWARE_RESET, | ||
660 | wm8994_reg_read(wm8994, WM8994_SOFTWARE_RESET)); | ||
661 | if (ret != 0) { | ||
662 | dev_err(wm8994->dev, "Failed to reset device: %d\n", ret); | ||
663 | return ret; | ||
664 | } | ||
665 | |||
655 | if (regmap_patch) { | 666 | if (regmap_patch) { |
656 | ret = regmap_register_patch(wm8994->regmap, regmap_patch, | 667 | ret = regmap_register_patch(wm8994->regmap, regmap_patch, |
657 | patch_regs); | 668 | patch_regs); |