lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 26 Oct 2015 11:02:57 +0000
From:	Charles Keepax <ckeepax@...nsource.wolfsonmicro.com>
To:	Robert Jarzmik <robert.jarzmik@...e.fr>
CC:	Liam Girdwood <lgirdwood@...il.com>,
	Mark Brown <broonie@...nel.org>,
	Jaroslav Kysela <perex@...ex.cz>,
	Takashi Iwai <tiwai@...e.com>, <alsa-devel@...a-project.org>,
	<linux-kernel@...r.kernel.org>,
	<patches@...nsource.wolfsonmicro.com>
Subject: Re: [PATCH v2] ASoC: wm9713: convert to regmap

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@...e.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ