All of lore.kernel.org
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
To: Robert Jarzmik <robert.jarzmik@free.fr>
Cc: alsa-devel@alsa-project.org, Liam Girdwood <lgirdwood@gmail.com>,
	patches@opensource.wolfsonmicro.com,
	linux-kernel@vger.kernel.org, Takashi Iwai <tiwai@suse.com>,
	Mark Brown <broonie@kernel.org>
Subject: Re: [PATCH v2] ASoC: wm9713: convert to regmap
Date: Mon, 26 Oct 2015 11:02:57 +0000	[thread overview]
Message-ID: <20151026110257.GH10520@ck-lbox> (raw)
In-Reply-To: <1445722627-28854-1-git-send-email-robert.jarzmik@free.fr>

On Sat, Oct 24, 2015 at 11:37:07PM +0200, Robert Jarzmik wrote:
> Convert the Wolfson WM9713 to regmap API. This will leverage all the
> regmap functions (debug, registers update, etc ...).
> 
> As a bonus, this will pave the path to gpio chip introduction, and
> devicetree support.
> 
> Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
> ---
> Since v1: fix suspend/resume (that specific part is not tested yet)
> ---
>  sound/soc/codecs/Kconfig  |   1 +
>  sound/soc/codecs/wm9713.c | 296 +++++++++++++++++++++++-----------------------
>  2 files changed, 152 insertions(+), 145 deletions(-)
<snip>
> @@ -1156,16 +1165,17 @@ static int wm9713_set_bias_level(struct snd_soc_codec *codec,
>  
>  static int wm9713_soc_suspend(struct snd_soc_codec *codec)
>  {
> -	u16 reg;
> +	regcache_cache_only(codec->component.regmap, true);
> +	snd_soc_cache_sync(codec);

I am assuming we don't want to be doing a cache_sync just after we
have marked the regmap as cache only.

>  
>  	/* Disable everything except touchpanel - that will be handled
>  	 * by the touch driver and left disabled if touch is not in
>  	 * use. */
> -	reg = ac97_read(codec, AC97_EXTENDED_MID);
> -	ac97_write(codec, AC97_EXTENDED_MID, reg | 0x7fff);
> -	ac97_write(codec, AC97_EXTENDED_MSTATUS, 0xffff);
> -	ac97_write(codec, AC97_POWERDOWN, 0x6f00);
> -	ac97_write(codec, AC97_POWERDOWN, 0xffff);
> +	snd_soc_update_bits(codec, AC97_EXTENDED_MID, 0x7fff,
> +				 0x7fff);
> +	snd_soc_write(codec, AC97_EXTENDED_MSTATUS, 0xffff);
> +	snd_soc_write(codec, AC97_POWERDOWN, 0x6f00);
> +	snd_soc_write(codec, AC97_POWERDOWN, 0xffff);

Also as you have already marked the regmap as cache only these
writes won't go to the hardware.

Thanks,
Charles

WARNING: multiple messages have this Message-ID (diff)
From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
To: Robert Jarzmik <robert.jarzmik@free.fr>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>, <alsa-devel@alsa-project.org>,
	<linux-kernel@vger.kernel.org>,
	<patches@opensource.wolfsonmicro.com>
Subject: Re: [PATCH v2] ASoC: wm9713: convert to regmap
Date: Mon, 26 Oct 2015 11:02:57 +0000	[thread overview]
Message-ID: <20151026110257.GH10520@ck-lbox> (raw)
In-Reply-To: <1445722627-28854-1-git-send-email-robert.jarzmik@free.fr>

On Sat, Oct 24, 2015 at 11:37:07PM +0200, Robert Jarzmik wrote:
> Convert the Wolfson WM9713 to regmap API. This will leverage all the
> regmap functions (debug, registers update, etc ...).
> 
> As a bonus, this will pave the path to gpio chip introduction, and
> devicetree support.
> 
> Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
> ---
> Since v1: fix suspend/resume (that specific part is not tested yet)
> ---
>  sound/soc/codecs/Kconfig  |   1 +
>  sound/soc/codecs/wm9713.c | 296 +++++++++++++++++++++++-----------------------
>  2 files changed, 152 insertions(+), 145 deletions(-)
<snip>
> @@ -1156,16 +1165,17 @@ static int wm9713_set_bias_level(struct snd_soc_codec *codec,
>  
>  static int wm9713_soc_suspend(struct snd_soc_codec *codec)
>  {
> -	u16 reg;
> +	regcache_cache_only(codec->component.regmap, true);
> +	snd_soc_cache_sync(codec);

I am assuming we don't want to be doing a cache_sync just after we
have marked the regmap as cache only.

>  
>  	/* Disable everything except touchpanel - that will be handled
>  	 * by the touch driver and left disabled if touch is not in
>  	 * use. */
> -	reg = ac97_read(codec, AC97_EXTENDED_MID);
> -	ac97_write(codec, AC97_EXTENDED_MID, reg | 0x7fff);
> -	ac97_write(codec, AC97_EXTENDED_MSTATUS, 0xffff);
> -	ac97_write(codec, AC97_POWERDOWN, 0x6f00);
> -	ac97_write(codec, AC97_POWERDOWN, 0xffff);
> +	snd_soc_update_bits(codec, AC97_EXTENDED_MID, 0x7fff,
> +				 0x7fff);
> +	snd_soc_write(codec, AC97_EXTENDED_MSTATUS, 0xffff);
> +	snd_soc_write(codec, AC97_POWERDOWN, 0x6f00);
> +	snd_soc_write(codec, AC97_POWERDOWN, 0xffff);

Also as you have already marked the regmap as cache only these
writes won't go to the hardware.

Thanks,
Charles

  reply	other threads:[~2015-10-26 11:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-24 21:37 [PATCH v2] ASoC: wm9713: convert to regmap Robert Jarzmik
2015-10-26 11:02 ` Charles Keepax [this message]
2015-10-26 11:02   ` Charles Keepax
2015-10-26 17:53   ` Robert Jarzmik
2015-10-26 17:53     ` Robert Jarzmik
2015-10-27  9:10     ` Charles Keepax
2015-10-27  9:10       ` Charles Keepax
2015-10-26 11:27 ` [alsa-devel] " Lars-Peter Clausen
2015-10-26 18:02   ` Robert Jarzmik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151026110257.GH10520@ck-lbox \
    --to=ckeepax@opensource.wolfsonmicro.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@opensource.wolfsonmicro.com \
    --cc=robert.jarzmik@free.fr \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.