Skip to contentSkip to conversation

mfd: wm8994: Reset device during probe

PATCH Applied Mark Brown 2 participants 2 messages May 17, 2013 – Jun 17, 2013

Subsystems (2)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 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.

---
 drivers/mfd/wm8994-core.c |   11 +++++++++++
 1 file changed, 11 insertions(+)
drivers/mfd/wm8994-core.c +11 -0
index 00e4fe2..ccdddf9 100644
@@ -652,6 +652,17 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq)
 		return ret;
 	}
 
+	/* Explicitly put the device into reset in case regulators
+	 * don't get disabled in order to ensure we know the device
+	 * state.
+	 */
+	ret = wm8994_reg_write(wm8994, WM8994_SOFTWARE_RESET,
+			       wm8994_reg_read(wm8994, WM8994_SOFTWARE_RESET));
+	if (ret != 0) {
+		dev_err(wm8994->dev, "Failed to reset device: %d\n", ret);
+		return ret;
+	}
+
 	if (regmap_patch) {
 		ret = regmap_register_patch(wm8994->regmap, regmap_patch,
 					    patch_regs);
Signature · 1 line
1.7.10.4
Applied
#1 lore raw

Hi Mark,

Quoted 8 lines · Mark Brown

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.

---
 drivers/mfd/wm8994-core.c |   11 +++++++++++
 1 file changed, 11 insertions(+)

Applied, thanks.

Cheers,
Samuel.

Signature · 2 lines
Intel Open Source Technology Centre
http://oss.intel.com/