linux-hardened/sound/soc
Wolfram Sang 151798f872 ASoC: sgtl5000: fix cache handling
Cache handling in this driver is broken. The chip has 16-bit registers, yet the
register numbers also increase by 2 per register, i.e.  there are only
even-numbered registers. The cache in this driver, though, simply increments
register numbers, so it does need some mapping as seen in
sgtl5000_restore_regs(), note the '>> 1':

	snd_soc_write(codec, SGTL5000_CHIP_LINREG_CTRL,
                        cache[SGTL5000_CHIP_LINREG_CTRL >> 1]);

That, of course, won't work with snd_soc_update_bits(). (Thus, we won't even
notice the missing register 0x1c in the default regs which shifted all follwing
registers to wrong values.) Noticed on the MX28EVK where enabling the regulators
simply locked up the chip.

Refactor the routines and use a properly sized default_regs array which matches
the register layout of the underlying chip, i.e. create a truly flat cache.
This also saves some code which should make up for the bigger array a little.
When soc-core will somewhen have another cache type which handles a step size,
this conversion will also ease the transition.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Tested-by: Dong Aisheng <b29396@freescale.com>
Tested-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
2011-08-03 10:21:42 +09:00
..
atmel sound/atmel_ssc_dai: add a missing space to an error message 2011-06-10 10:55:20 +01:00
au1x ASoC: core - Optimise and refactor pcm_new() to pass only rtd 2011-06-07 18:38:27 +01:00
blackfin Merge branch 'for-3.0' into for-3.1 2011-06-29 09:49:04 -07:00
codecs ASoC: sgtl5000: fix cache handling 2011-08-03 10:21:42 +09:00
davinci ASoC: davinci: add missing break statement 2011-07-20 20:51:35 +01:00
ep93xx ASoC: core - Optimise and refactor pcm_new() to pass only rtd 2011-06-07 18:38:27 +01:00
fsl Merge branch 'for-3.0' into for-3.1 2011-06-09 12:02:26 +01:00
imx Merge branch 'for-3.0' into for-3.1 2011-06-23 20:10:28 +01:00
jz4740 ASoC: core - Optimise and refactor pcm_new() to pass only rtd 2011-06-07 18:38:27 +01:00
kirkwood ASoC: core - Optimise and refactor pcm_new() to pass only rtd 2011-06-07 18:38:27 +01:00
mid-x86 ASoC: core - Optimise and refactor pcm_new() to pass only rtd 2011-06-07 18:38:27 +01:00
nuc900 ASoC: core - Optimise and refactor pcm_new() to pass only rtd 2011-06-07 18:38:27 +01:00
omap Merge branch 'for-3.1' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/asoc-2.6 into topic/asoc 2011-07-05 07:33:23 +02:00
pxa ASoC: pxa2xx-pcm: remove unused variable 'dai' 2011-07-07 09:54:09 -07:00
s6000 ASoC: core - Optimise and refactor pcm_new() to pass only rtd 2011-06-07 18:38:27 +01:00
samsung ASoC: Revert "ASoC: SAMSUNG: Add I2S0 internal dma driver" 2011-07-24 22:47:39 +01:00
sh Merge branch 'for-3.0' into for-3.1 2011-07-09 19:06:33 +09:00
tegra ASoC: Tegra: Implement SPDIF CPU DAI 2011-07-05 12:20:56 -07:00
txx9 ASoC: Fix txx9aclc.c build 2011-07-29 07:53:08 +02:00
Kconfig ASoC: tegra: Kconfig and Makefile 2011-01-10 22:21:09 +00:00
Makefile ASoC: Move register I/O code into a separate file 2011-06-13 18:56:10 +01:00
soc-cache.c ASoC: Remove unused and about to be broken SND_SOC_CUSTOM I/O bus 2011-06-13 19:17:55 +01:00
soc-core.c ASoC: core: make comments fit the code 2011-07-19 16:19:15 +01:00
soc-dapm.c ASoC: dapm - Add methods to retrieve snd_card and soc_card from dapm context. 2011-07-20 21:15:51 +01:00
soc-io.c Merge branch 'for-3.0' into for-3.1 2011-06-13 19:21:09 +01:00
soc-jack.c ASoC: Merge branch 'for-2.6.39' into for-2.6.40 2011-04-18 18:07:43 +01:00
soc-pcm.c ASoC: pcm - rename snd_codec_close() to snd_pcm_close(). 2011-06-09 19:29:35 +01:00
soc-utils.c ASoC: Work around allmodconfig failure 2011-04-28 12:09:06 +01:00