aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8903.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2009-06-12 12:27:07 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2009-06-13 15:06:23 -0400
commit9e79261f302083cbc6aa95e0f778e3583b1ab36e (patch)
tree9501bb9f9376486cc1712a07042b147b9d5d1ee5 /sound/soc/codecs/wm8903.c
parentdf205936d5d1dfec9a52c90af77bb54a2c9c9728 (diff)
ASoC: Automatically control WM8903 sloping stopband filter
For best performance the DAC sloping stopband filter should be enabled below 24kHz and not enabled above that so remove the user visible control for this and do it autonomously in the driver. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/wm8903.c')
-rw-r--r--sound/soc/codecs/wm8903.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c
index d8a9222fbf74..3ebd770463e3 100644
--- a/sound/soc/codecs/wm8903.c
+++ b/sound/soc/codecs/wm8903.c
@@ -715,8 +715,6 @@ SOC_ENUM("DAC Soft Mute Rate", soft_mute),
715SOC_ENUM("DAC Mute Mode", mute_mode), 715SOC_ENUM("DAC Mute Mode", mute_mode),
716SOC_SINGLE("DAC Mono Switch", WM8903_DAC_DIGITAL_1, 12, 1, 0), 716SOC_SINGLE("DAC Mono Switch", WM8903_DAC_DIGITAL_1, 12, 1, 0),
717SOC_ENUM("DAC De-emphasis", dac_deemphasis), 717SOC_ENUM("DAC De-emphasis", dac_deemphasis),
718SOC_SINGLE("DAC Sloping Stopband Filter Switch",
719 WM8903_DAC_DIGITAL_1, 11, 1, 0),
720SOC_ENUM("DAC Companding Mode", dac_companding), 718SOC_ENUM("DAC Companding Mode", dac_companding),
721SOC_SINGLE("DAC Companding Switch", WM8903_AUDIO_INTERFACE_0, 1, 1, 0), 719SOC_SINGLE("DAC Companding Switch", WM8903_AUDIO_INTERFACE_0, 1, 1, 0),
722 720
@@ -1377,12 +1375,19 @@ static int wm8903_hw_params(struct snd_pcm_substream *substream,
1377 u16 aif3 = wm8903_read(codec, WM8903_AUDIO_INTERFACE_3); 1375 u16 aif3 = wm8903_read(codec, WM8903_AUDIO_INTERFACE_3);
1378 u16 clock0 = wm8903_read(codec, WM8903_CLOCK_RATES_0); 1376 u16 clock0 = wm8903_read(codec, WM8903_CLOCK_RATES_0);
1379 u16 clock1 = wm8903_read(codec, WM8903_CLOCK_RATES_1); 1377 u16 clock1 = wm8903_read(codec, WM8903_CLOCK_RATES_1);
1378 u16 dac_digital1 = wm8903_read(codec, WM8903_DAC_DIGITAL_1);
1380 1379
1381 if (substream == wm8903->slave_substream) { 1380 if (substream == wm8903->slave_substream) {
1382 dev_dbg(&i2c->dev, "Ignoring hw_params for slave substream\n"); 1381 dev_dbg(&i2c->dev, "Ignoring hw_params for slave substream\n");
1383 return 0; 1382 return 0;
1384 } 1383 }
1385 1384
1385 /* Enable sloping stopband filter for low sample rates */
1386 if (fs <= 24000)
1387 dac_digital1 |= WM8903_DAC_SB_FILT;
1388 else
1389 dac_digital1 &= ~WM8903_DAC_SB_FILT;
1390
1386 /* Configure sample rate logic for DSP - choose nearest rate */ 1391 /* Configure sample rate logic for DSP - choose nearest rate */
1387 dsp_config = 0; 1392 dsp_config = 0;
1388 best_val = abs(sample_rates[dsp_config].rate - fs); 1393 best_val = abs(sample_rates[dsp_config].rate - fs);
@@ -1507,6 +1512,7 @@ static int wm8903_hw_params(struct snd_pcm_substream *substream,
1507 wm8903_write(codec, WM8903_AUDIO_INTERFACE_1, aif1); 1512 wm8903_write(codec, WM8903_AUDIO_INTERFACE_1, aif1);
1508 wm8903_write(codec, WM8903_AUDIO_INTERFACE_2, aif2); 1513 wm8903_write(codec, WM8903_AUDIO_INTERFACE_2, aif2);
1509 wm8903_write(codec, WM8903_AUDIO_INTERFACE_3, aif3); 1514 wm8903_write(codec, WM8903_AUDIO_INTERFACE_3, aif3);
1515 wm8903_write(codec, WM8903_DAC_DIGITAL_1, dac_digital1);
1510 1516
1511 return 0; 1517 return 0;
1512} 1518}