[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20111007095720.GA19080@opensource.wolfsonmicro.com>
Date: Fri, 7 Oct 2011 10:57:21 +0100
From: Mark Brown <broonie@...nsource.wolfsonmicro.com>
To: Axel Lin <axel.lin@...il.com>
Cc: linux-kernel@...r.kernel.org, Liam Girdwood <lrg@...com>,
alsa-devel@...a-project.org
Subject: Re: [PATCH 01/11 RESEND] ASoC: wm8510: Convert to snd_soc_write
On Fri, Oct 07, 2011 at 10:40:20AM +0800, Axel Lin wrote:
> +static void wm8510_sync_cache(struct snd_soc_codec *codec)
> +{
> + short i;
> + u16 *cache;
> +
> + if (!codec->cache_sync)
> + return;
> + codec->cache_only = 0;
> + codec->cache_bypass = 1;
> + /* restore cache */
> + cache = codec->reg_cache;
> + for (i = 0; i < codec->driver->reg_cache_size; i++) {
> + if (i == WM8510_RESET || cache[i] == wm8510_reg[i])
> + continue;
> + snd_soc_write(codec, i, cache[i]);
> + }
> + codec->cache_bypass = 0;
> + codec->cache_sync = 0;
The usual trick for avoiding this is to provide a register default value
for the reset register and then write that value when the chip is reset.
This then means that the write to the reset register is suppressed by
the cache restore code when it skips writes of default registers.
Thanks for doing this work.
--
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