public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: Writing register default value for the reset register
@ 2011-10-11  9:55 Axel Lin
  2011-10-11 12:33 ` Dimitris Papastamos
  2011-10-11 13:33 ` Mark Brown
  0 siblings, 2 replies; 5+ messages in thread
From: Axel Lin @ 2011-10-11  9:55 UTC (permalink / raw)
  To: linux-kernel; +Cc: Mark Brown, Dimitris Papastamos, Liam Girdwood, alsa-devel

The WM8983 can be reset by performing a write of any value to
the software reset register.
To avoid writing to the software reset register while resume,
we should write the same value in wm8983_reg_defs to software
reset register in wm8983_probe().
The write to the reset register is suppressed by the cache
restore code when it skips writes of default registers.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 sound/soc/codecs/wm8983.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sound/soc/codecs/wm8983.c b/sound/soc/codecs/wm8983.c
index 17f04ec..93ee284 100644
--- a/sound/soc/codecs/wm8983.c
+++ b/sound/soc/codecs/wm8983.c
@@ -1007,7 +1007,7 @@ static int wm8983_probe(struct snd_soc_codec *codec)
 		return ret;
 	}
 
-	ret = snd_soc_write(codec, WM8983_SOFTWARE_RESET, 0x8983);
+	ret = snd_soc_write(codec, WM8983_SOFTWARE_RESET, 0);
 	if (ret < 0) {
 		dev_err(codec->dev, "Failed to issue reset: %d\n", ret);
 		return ret;
-- 
1.7.4.1




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

* Re: [PATCH] ASoC: Writing register default value for the reset register
  2011-10-11  9:55 [PATCH] ASoC: Writing register default value for the reset register Axel Lin
@ 2011-10-11 12:33 ` Dimitris Papastamos
  2011-10-11 13:31   ` Mark Brown
  2011-10-11 13:33 ` Mark Brown
  1 sibling, 1 reply; 5+ messages in thread
From: Dimitris Papastamos @ 2011-10-11 12:33 UTC (permalink / raw)
  To: Axel Lin; +Cc: linux-kernel, Mark Brown, Liam Girdwood, alsa-devel

On Tue, Oct 11, 2011 at 05:55:00PM +0800, Axel Lin wrote:
> The WM8983 can be reset by performing a write of any value to
> the software reset register.
> To avoid writing to the software reset register while resume,
> we should write the same value in wm8983_reg_defs to software
> reset register in wm8983_probe().
> The write to the reset register is suppressed by the cache
> restore code when it skips writes of default registers.
> 
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
> ---
>  sound/soc/codecs/wm8983.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/sound/soc/codecs/wm8983.c b/sound/soc/codecs/wm8983.c
> index 17f04ec..93ee284 100644
> --- a/sound/soc/codecs/wm8983.c
> +++ b/sound/soc/codecs/wm8983.c
> @@ -1007,7 +1007,7 @@ static int wm8983_probe(struct snd_soc_codec *codec)
>  		return ret;
>  	}
>  
> -	ret = snd_soc_write(codec, WM8983_SOFTWARE_RESET, 0x8983);
> +	ret = snd_soc_write(codec, WM8983_SOFTWARE_RESET, 0);
>  	if (ret < 0) {
>  		dev_err(codec->dev, "Failed to issue reset: %d\n", ret);
>  		return ret;

We should probably just handle the reset register specially during
resume.

Thanks,
Dimitris

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

* Re: [PATCH] ASoC: Writing register default value for the reset register
  2011-10-11 12:33 ` Dimitris Papastamos
@ 2011-10-11 13:31   ` Mark Brown
  2011-10-11 14:16     ` Dimitris Papastamos
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2011-10-11 13:31 UTC (permalink / raw)
  To: Dimitris Papastamos; +Cc: Axel Lin, linux-kernel, Liam Girdwood, alsa-devel

On Tue, Oct 11, 2011 at 01:33:05PM +0100, Dimitris Papastamos wrote:
> On Tue, Oct 11, 2011 at 05:55:00PM +0800, Axel Lin wrote:
> > The WM8983 can be reset by performing a write of any value to
> > the software reset register.

> > -	ret = snd_soc_write(codec, WM8983_SOFTWARE_RESET, 0x8983);
> > +	ret = snd_soc_write(codec, WM8983_SOFTWARE_RESET, 0);

> We should probably just handle the reset register specially during
> resume.

I really don't think it's worth the code complexity to add special
handling like that, this is a trivial patch which avoids the need for
any extra infrastructure.

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

* Re: [PATCH] ASoC: Writing register default value for the reset register
  2011-10-11  9:55 [PATCH] ASoC: Writing register default value for the reset register Axel Lin
  2011-10-11 12:33 ` Dimitris Papastamos
@ 2011-10-11 13:33 ` Mark Brown
  1 sibling, 0 replies; 5+ messages in thread
From: Mark Brown @ 2011-10-11 13:33 UTC (permalink / raw)
  To: Axel Lin; +Cc: linux-kernel, Dimitris Papastamos, Liam Girdwood, alsa-devel

On Tue, Oct 11, 2011 at 05:55:00PM +0800, Axel Lin wrote:
> The WM8983 can be reset by performing a write of any value to
> the software reset register.

Applied, thanks.

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

* Re: [PATCH] ASoC: Writing register default value for the reset register
  2011-10-11 13:31   ` Mark Brown
@ 2011-10-11 14:16     ` Dimitris Papastamos
  0 siblings, 0 replies; 5+ messages in thread
From: Dimitris Papastamos @ 2011-10-11 14:16 UTC (permalink / raw)
  To: Mark Brown; +Cc: Axel Lin, linux-kernel, Liam Girdwood, alsa-devel

On Tue, Oct 11, 2011 at 02:31:18PM +0100, Mark Brown wrote:
> On Tue, Oct 11, 2011 at 01:33:05PM +0100, Dimitris Papastamos wrote:
> > On Tue, Oct 11, 2011 at 05:55:00PM +0800, Axel Lin wrote:
> > > The WM8983 can be reset by performing a write of any value to
> > > the software reset register.
> 
> > > -	ret = snd_soc_write(codec, WM8983_SOFTWARE_RESET, 0x8983);
> > > +	ret = snd_soc_write(codec, WM8983_SOFTWARE_RESET, 0);
> 
> > We should probably just handle the reset register specially during
> > resume.
> 
> I really don't think it's worth the code complexity to add special
> handling like that, this is a trivial patch which avoids the need for
> any extra infrastructure.

Aw I thought this code was using the old style open coded syncing
functions, which would be trivial and perhaps idiomatic to simply
check for the reset register and continue.

Thanks,
Dimitris

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

end of thread, other threads:[~2011-10-11 14:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-11  9:55 [PATCH] ASoC: Writing register default value for the reset register Axel Lin
2011-10-11 12:33 ` Dimitris Papastamos
2011-10-11 13:31   ` Mark Brown
2011-10-11 14:16     ` Dimitris Papastamos
2011-10-11 13:33 ` Mark Brown

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