linux/sound/soc/codecs
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
..
88pm860x-codec.c ASoC: s/w->kcontrols/w->kcontrol_news/g 2011-05-03 19:28:47 +01:00
88pm860x-codec.h ASoC: add 88pm860x codec driver 2010-08-18 18:03:09 +01:00
ac97.c ASoC: ac97: add MODULE_ALIAS for the platform driver 2010-10-13 10:35:30 +01:00
ad193x.c ASoC: ad193x: fix codec name 2011-03-30 07:17:16 +09:00
ad193x.h ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
ad1836.c ASoC: AD1836: rename suspend/resume funcs 2011-06-16 11:42:10 +01:00
ad1836.h ASoC: AD1836: fix intermixed tab/space indentation 2011-06-16 11:41:53 +01:00
ad1980.c ASoC: ad1980: fix codec name 2011-03-30 07:17:31 +09:00
ad1980.h Merge branch 'for-2.6.36' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6 into for-2.6.37 2010-08-15 14:56:40 +01:00
ad73311.c ASoC: ad73311: fix codec name 2011-03-30 07:17:01 +09:00
ad73311.h ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
adau1701.c ASoC: adau1701: signedness bug in adau1701_write() 2011-06-20 18:46:33 +01:00
adau1701.h ASoC: Add ADAU1701 codec driver 2011-06-16 11:24:17 +01:00
adav80x.c ASoC: Report an error for unknown adav80x formats 2011-07-17 13:15:20 +09:00
adav80x.h ASoC: Add ADAV80x codec driver 2011-06-28 17:11:20 +01:00
ads117x.c ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
ads117x.h ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
ak4104.c ASoC: Remove module probe announcements from CODEC drivers 2011-03-01 23:30:40 +00:00
ak4535.c ASoC: Use data based init for ak4535 DAPM 2011-03-31 06:22:24 +09:00
ak4535.h ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
ak4641.c ASoC: Staticize ak4641_dai 2011-06-01 19:18:59 +01:00
ak4641.h ASoC: Asahi Kasei AK4641 codec driver 2011-05-19 14:10:45 -07:00
ak4642.c ASoC: ak4642: fixup snd_soc_update_bits mask for PW_MGMT2 2011-07-07 09:46:06 -07:00
ak4671.c ASoC: Use data based init for ak4671 DAPM 2011-03-31 06:21:33 +09:00
ak4671.h ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
alc5623.c Fix common misspellings 2011-03-31 11:26:23 -03:00
alc5623.h ASoC: add support for alc562[123] codecs 2010-10-21 13:51:13 -07:00
cq93vc.c mfd: Use mfd cell platform_data for davinci cells platform bits 2011-05-26 19:45:13 +02:00
cs42l51.c ASoC: codecs: Remove unused reg_cache fields from device structs 2010-12-28 23:37:21 +00:00
cs42l51.h ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
cs4270.c ASoC: Fix comment in cs4270 codec driver 2011-05-26 09:26:22 +08:00
cs4271.c ASoC: Manage mode and rate bits correctly for CS4271 CODEC. 2011-03-09 13:08:16 +00:00
cx20442.c Merge branch 'tty-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6 2011-05-23 12:23:20 -07:00
cx20442.h ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
da7210.c ASoC: Decouple DAPM from CODECs 2010-11-06 11:28:29 -04:00
dfbmcs320.c ASoC: Add driver for the dfbmcs320 bluetooth module 2011-03-07 12:20:01 +00:00
dmic.c ASoC: DMIC codec - Add input widget 2011-05-12 17:40:05 +02:00
jz4740.c ASoC: codecs: JZ4740: Convert to table based controls and DAPM setup 2011-04-13 10:35:03 -07:00
Kconfig ASoC: WM8983: Initial driver 2011-07-15 23:39:53 +09:00
l3.c ASoC: UDA134x codec driver 2008-11-17 11:45:39 +00:00
lm4857.c Fix common misspellings 2011-03-31 11:26:23 -03:00
Makefile ASoC: WM8983: Initial driver 2011-07-15 23:39:53 +09:00
max9850.c ASoC: Fix spacing in MAX8950 2011-03-11 12:07:31 +00:00
max9850.h ASoC: Add MAX9850 codec driver 2011-03-11 12:01:44 +00:00
max9877.c ASoC: MAX9877: fix write operation for register 2009-07-23 11:08:30 +01:00
max9877.h ASoC: MAX9877: add MAX9877 amp driver 2009-07-15 16:59:31 +01:00
max98088.c Merge branch 'for-2.6.40' into for-2.6.41 2011-05-30 10:54:18 +08:00
max98088.h ASoC: codecs: max98088: Added digital mute function in DAI1 and DAI2 2011-05-15 21:26:36 -07:00
max98095.c ASoC: codecs: Max98095: Fix logging of hardware revision. 2011-06-22 00:27:39 +01:00
max98095.h ASoC: Add EQ and filter to max98095 CODEC driver 2011-04-20 13:50:41 +01:00
pcm3008.c ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
pcm3008.h ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
sgtl5000.c ASoC: sgtl5000: fix cache handling 2011-08-03 10:21:42 +09:00
sgtl5000.h ASoC: remove unnecessary header including in SGTL5000 codec driver 2011-02-28 14:24:35 +00:00
sn95031.c ASoC: Merge branch 'for-2.6.39' into for-2.6.40 2011-04-18 18:07:43 +01:00
sn95031.h ASoC: sn95031: Add support for reading mic bias 2011-02-09 22:32:53 +00:00
spdif_transciever.c ASoC: spdif-dit: Add missing MODULE_* 2011-05-20 11:19:29 +01:00
ssm2602.c ASoC: Fix NULL vs. 0 warning in SSM2602 2011-05-11 15:24:05 +02:00
ssm2602.h ASoC: SSM2602: Remove unused struct and define 2011-05-08 14:44:11 +01:00
sta32x.c ASoC: STA32x: Preserve reserved register bits 2011-07-14 00:24:32 +09:00
sta32x.h ASoC: add STA32X codec driver 2011-06-22 19:10:59 +01:00
stac9766.c Merge branch 'for-2.6.37' into for-2.6.38 2010-11-22 20:33:12 +00:00
stac9766.h ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
tlv320aic3x.c Merge branch 'topic/asoc' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6 into for-3.1 2011-07-09 23:16:12 +09:00
tlv320aic3x.h ASoC: tlv320aic3x: Reimplement output mixers 2010-08-28 10:57:58 +01:00
tlv320aic23.c ASoC: Use data based init for tlv320aic23 DAPM 2011-03-31 06:22:20 +09:00
tlv320aic23.h ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
tlv320aic26.c audio: tlv320aic26: fix PLL register configuration 2011-05-21 12:07:56 +01:00
tlv320aic26.h Fix common misspellings 2011-03-31 11:26:23 -03:00
tlv320aic32x4.c ASoC: Fix outdated API usage in tlv320aic32x4 2011-03-07 11:13:42 +00:00
tlv320aic32x4.h ASoC: Add TI tlv320aic32x4 codec support. 2011-03-04 18:21:08 +00:00
tlv320dac33.c ASoC: tlv320dac33: Update e-mail address 2011-05-11 16:12:35 +01:00
tlv320dac33.h ASoC: tlv320dac33: Update e-mail address 2011-05-11 16:12:35 +01:00
tpa6130a2.c ASoC: tpa6130a2: Update e-mail address 2011-05-11 16:12:45 +01:00
tpa6130a2.h ASoC: tpa6130a2: Update e-mail address 2011-05-11 16:12:45 +01:00
twl4030.c mfd: Use mfd cell platform_data for twl4030 codec cells platform bits 2011-05-26 19:45:09 +02:00
twl6040.c ASoC: twl6040 - According to TWL6040 specification, gain start at 6dB and not -6dB. 2011-06-08 19:52:17 +01:00
twl6040.h ASoC: twl6040: Enable plug detection interrupts 2010-12-14 20:36:59 +00:00
uda134x.c ASoC: UDA134x: Remove POWER_OFF_ON_STANDBY define. 2011-05-08 15:27:48 +01:00
uda134x.h ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
uda1380.c ASoC: codecs: Remove unused reg_cache fields from device structs 2010-12-28 23:37:21 +00:00
uda1380.h ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
wl1273.c mfd: Use mfd cell platform_data for wl1273 cells platform bits 2011-05-26 19:45:02 +02:00
wl1273.h ASoC: WL1273 FM radio: Fix breakage with MFD API changes 2011-01-14 12:29:40 +00:00
wm1250-ev1.c ASoC: wm1250-ev1: Define "WM1250 Output" with SND_SOC_DAPM_OUTPUT 2011-05-26 22:11:24 +08:00
wm2000.c ASoC: Move WM2000 to dev_pm_ops 2011-02-25 12:58:36 +00:00
wm2000.h ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
wm8350.c ASoC: Yet more x86 tracepoint workarounds 2010-12-29 13:06:18 +00:00
wm8350.h ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
wm8400.c mfd: Use mfd cell platform_data for wm8400 cells platform bits 2011-05-26 19:45:14 +02:00
wm8400.h ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
wm8510.c ASoC: Do not include soc-dapm.h 2010-11-22 14:04:41 +00:00
wm8510.h ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
wm8523.c ASoC: Avoid direct register cache access when setting defaults 2011-01-17 13:59:39 +00:00
wm8523.h ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
wm8580.c Fix common misspellings 2011-03-31 11:26:23 -03:00
wm8580.h ASoC: Automatically calculate clock ratio for WM8580 2010-08-15 14:52:12 +01:00
wm8711.c ASoC: Use data based init for wm8711 DAPM 2011-03-31 06:22:15 +09:00
wm8711.h ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
wm8727.c ASoC: Staticise WM8727 codec driver structure 2010-08-12 16:10:55 +01:00
wm8728.c ASoC: Use data based init for wm8728 DAPM 2011-03-31 06:22:10 +09:00
wm8728.h ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
wm8731.c ASoC: Manage WM8731 ACTIVE bit as a supply widget 2011-07-05 11:07:33 -07:00
wm8731.h ASoC: Support non-crystal master clocks for WM8731 2010-08-18 16:52:56 +01:00
wm8737.c ASoC: Remove redundant hw_write initialisation in WM8737 2010-11-26 15:16:19 +00:00
wm8737.h ASoC: Add initial WM8737 driver 2010-11-24 11:33:12 +00:00
wm8741.c ASoC: Avoid direct register cache access when setting defaults 2011-01-17 13:59:39 +00:00
wm8741.h ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
wm8750.c ASoC: codecs: Remove unused reg_cache fields from device structs 2010-12-28 23:37:21 +00:00
wm8750.h ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
wm8753.c Fix common misspellings 2011-03-31 11:26:23 -03:00
wm8753.h ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
wm8770.c ASoC: Do not include soc-dapm.h 2010-11-22 14:04:41 +00:00
wm8770.h ASoC: WM8770: Initial driver 2010-11-06 11:35:39 -04:00
wm8776.c ASoC: Do not include soc-dapm.h 2010-11-22 14:04:41 +00:00
wm8776.h ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
wm8782.c ASoC: add WM8782 ADC Codec Driver 2011-06-22 19:11:02 +01:00
wm8804.c ASoC: WM8804 does not support sample rates below 32kHz 2011-06-09 11:51:07 +01:00
wm8804.h ASoC: WM8804: Initial driver 2010-09-30 13:32:21 -07:00
wm8900.c ASoC: wm8900: fix a memory leak if wm8900_set_fll fails 2011-07-14 20:04:26 +09:00
wm8900.h ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
wm8903.c ASoC: Fix wrong data type access in a few codec drivers 2011-05-16 09:06:47 -07:00
wm8903.h Merge branch 'for-2.6.38' into for-2.6.39 2011-02-22 10:38:13 -08:00
wm8904.c ASoC: Add basic WM8918 support 2011-06-23 20:05:38 +01:00
wm8904.h ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
wm8915.c ASoC: Allow WM8915 BCLK calculation outside hw_params() 2011-06-06 21:45:44 +01:00
wm8915.h ASoC: Add WM8915 CODEC driver 2011-04-11 13:33:50 -07:00
wm8940.c ASoC: wm8940: remove unnecessary if statements 2011-06-07 09:47:40 +01:00
wm8940.h ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
wm8955.c Fix common misspellings 2011-03-31 11:26:23 -03:00
wm8955.h ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
wm8958-dsp2.c ASoC: Don't restart an already running WM8958 DSP2 2011-05-16 08:55:52 -07:00
wm8960.c Merge branch 'for-2.6.37' into for-2.6.38 2010-12-28 23:42:53 +00:00
wm8960.h ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
wm8961.c ASoC: Update users of readable_register()/volatile_register() 2011-01-13 14:17:43 +00:00
wm8961.h ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
wm8962.c ASoC: Acknowledge WM8962 interrupts before acting on them 2011-07-20 20:50:08 +01:00
wm8962.h ASoC: Compress WM8962 register access map 2010-10-11 03:52:04 -07:00
wm8971.c Merge branch 'for-2.6.37' into for-2.6.38 2010-12-28 23:42:53 +00:00
wm8971.h ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
wm8974.c ASoC: codecs: Remove unused reg_cache fields from device structs 2010-12-28 23:37:21 +00:00
wm8974.h ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
wm8978.c ASoC: Fix broken bitfield definitions in WM8978 2011-03-09 12:32:50 +00:00
wm8978.h ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
wm8983.c ASoC: WM8983: Initial driver 2011-07-15 23:39:53 +09:00
wm8983.h ASoC: WM8983: Initial driver 2011-07-15 23:39:53 +09:00
wm8985.c ASoC: Do not include soc-dapm.h 2010-11-22 14:04:41 +00:00
wm8985.h ASoC: WM8985: Initial driver 2010-09-15 16:11:24 +01:00
wm8988.c ASoC: codecs: Remove unused reg_cache fields from device structs 2010-12-28 23:37:21 +00:00
wm8988.h ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
wm8990.c ASoC: WM8990: msleep() takes milliseconds not jiffies 2011-01-17 14:09:44 +00:00
wm8990.h ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
wm8991.c Fix common misspellings 2011-03-31 11:26:23 -03:00
wm8991.h ASoC: WM8991: Add initial WM8991 driver 2011-01-17 13:50:20 +00:00
wm8993.c ASoC: Use late enable handling for direct voice, speaker and headphone 2011-07-14 00:37:52 +09:00
wm8993.h ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
wm8994-tables.c ASoC: Fix section mismatch warnings in WM8994 2011-03-08 18:56:11 +00:00
wm8994.c Merge branch 'for-3.0' into for-3.1 2011-07-17 18:25:58 +09:00
wm8994.h ASoC: Use WM8994 FLL lock interrupt 2011-07-14 00:38:22 +09:00
wm8995.c ASoC: Fix wrong data type access in a few codec drivers 2011-05-16 09:06:47 -07:00
wm8995.h ASoC: Remove WM8995 write sequencer bitfield definitions 2010-12-24 11:32:45 +00:00
wm9081.c ASoC: Change WM9081 speaker output enable to _OUT_DRV 2011-06-29 09:48:55 -07:00
wm9081.h ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
wm9090.c ASoC: Avoid direct register cache access when setting defaults 2011-01-17 13:59:39 +00:00
wm9090.h ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
wm9705.c ASoC: Use data based init for wm9705 DAPM 2011-03-31 06:22:04 +09:00
wm9705.h ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
wm9712.c ASoC: Use data based init for wm9712 DAPM 2011-03-31 06:21:58 +09:00
wm9712.h ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
wm9713.c ASoC: Use data based init for wm9713 DAPM 2011-03-31 06:21:52 +09:00
wm9713.h ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
wm_hubs.c ASoC: Disable wm_hubs periodic DC servo update 2011-07-29 10:31:07 +01:00
wm_hubs.h ASoC: Implement DC servo completion IRQ handling for wm_hubs devices 2011-07-14 00:38:04 +09:00