Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1256207

Re: [PATCH v2] ASoC: wm9713: convert to regmap

From Robert Jarzmik <robert.jarzmik@free.fr>
Newsgroups linux.kernel
Subject Re: [PATCH v2] ASoC: wm9713: convert to regmap
Date 2015-10-26 19:10 +0100
Message-ID <qnUnx-35z-49@gated-at.bofh.it> (permalink)
References <qneRk-4jI-9@gated-at.bofh.it> <qnO8q-7AK-37@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Charles Keepax <ckeepax@opensource.wolfsonmicro.com> writes:

> 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.
Ah, this denotes my lack of understanding of regmap cache behavior.
Basically what I want at this point is that :
 1) All previous writes should hit the cache (cache coherency barrier)
 2) All subsequent writes should not go into the cache (uncached writes)
    => especially the next writes in wm9713_soc_suspend()

>> +	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.
Ah, exactly the opposite of what I wanted :(

Would you have an example driver I can inspire myself from. If not, I'll dig in
more in the regmap cache API.

Cheers.

-- 
Robert
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2] ASoC: wm9713: convert to regmap Robert Jarzmik <robert.jarzmik@free.fr> - 2015-10-24 23:50 +0200
  Re: [PATCH v2] ASoC: wm9713: convert to regmap Charles Keepax <ckeepax@opensource.wolfsonmicro.com> - 2015-10-26 12:30 +0100
    Re: [PATCH v2] ASoC: wm9713: convert to regmap Robert Jarzmik <robert.jarzmik@free.fr> - 2015-10-26 19:10 +0100
      Re: [PATCH v2] ASoC: wm9713: convert to regmap Charles Keepax <ckeepax@opensource.wolfsonmicro.com> - 2015-10-27 10:30 +0100
  Re: [alsa-devel] [PATCH v2] ASoC: wm9713: convert to regmap Lars-Peter Clausen <lars@metafoo.de> - 2015-10-26 12:30 +0100
    Re: [alsa-devel] [PATCH v2] ASoC: wm9713: convert to regmap Robert Jarzmik <robert.jarzmik@free.fr> - 2015-10-26 19:10 +0100

csiph-web