mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] mfd: wm8994: Reset device during probe
@ 2013-05-17 12:25 Mark Brown
  2013-06-17 22:08 ` Samuel Ortiz
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Brown @ 2013-05-17 12:25 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: linux-kernel, patches, 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.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 drivers/mfd/wm8994-core.c |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/mfd/wm8994-core.c b/drivers/mfd/wm8994-core.c
index 00e4fe2..ccdddf9 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)
 		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);
-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] mfd: wm8994: Reset device during probe
  2013-05-17 12:25 [PATCH] mfd: wm8994: Reset device during probe Mark Brown
@ 2013-06-17 22:08 ` Samuel Ortiz
  0 siblings, 0 replies; 2+ messages in thread
From: Samuel Ortiz @ 2013-06-17 22:08 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-kernel, patches

Hi Mark,

On Fri, May 17, 2013 at 01:25:21PM +0100, Mark Brown wrote:
> 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>
> ---
>  drivers/mfd/wm8994-core.c |   11 +++++++++++
>  1 file changed, 11 insertions(+)
Applied, thanks.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-06-17 22:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-17 12:25 [PATCH] mfd: wm8994: Reset device during probe Mark Brown
2013-06-17 22:08 ` Samuel Ortiz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®