| Index: sound/soc/codecs/wm8904.c
|
| diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c
|
| index 1ec12eff06205f9023b57c5da7b836d6e81a1f4b..443ae580445cb7f207029a5711eba52a5e49f157 100644
|
| --- a/sound/soc/codecs/wm8904.c
|
| +++ b/sound/soc/codecs/wm8904.c
|
| @@ -24,7 +24,6 @@
|
| #include <sound/pcm.h>
|
| #include <sound/pcm_params.h>
|
| #include <sound/soc.h>
|
| -#include <sound/soc-dapm.h>
|
| #include <sound/initval.h>
|
| #include <sound/tlv.h>
|
| #include <sound/wm8904.h>
|
| @@ -597,7 +596,7 @@ static struct {
|
| { 0x003F, 0x003F, 0 }, /* R248 - FLL NCO Test 1 */
|
| };
|
|
|
| -static int wm8904_volatile_register(unsigned int reg)
|
| +static int wm8904_volatile_register(struct snd_soc_codec *codec, unsigned int reg)
|
| {
|
| return wm8904_access[reg].vol;
|
| }
|
| @@ -1427,10 +1426,11 @@ static const struct snd_soc_dapm_route wm8912_intercon[] = {
|
| static int wm8904_add_widgets(struct snd_soc_codec *codec)
|
| {
|
| struct wm8904_priv *wm8904 = snd_soc_codec_get_drvdata(codec);
|
| + struct snd_soc_dapm_context *dapm = &codec->dapm;
|
|
|
| - snd_soc_dapm_new_controls(codec, wm8904_core_dapm_widgets,
|
| + snd_soc_dapm_new_controls(dapm, wm8904_core_dapm_widgets,
|
| ARRAY_SIZE(wm8904_core_dapm_widgets));
|
| - snd_soc_dapm_add_routes(codec, core_intercon,
|
| + snd_soc_dapm_add_routes(dapm, core_intercon,
|
| ARRAY_SIZE(core_intercon));
|
|
|
| switch (wm8904->devtype) {
|
| @@ -1442,20 +1442,20 @@ static int wm8904_add_widgets(struct snd_soc_codec *codec)
|
| snd_soc_add_controls(codec, wm8904_snd_controls,
|
| ARRAY_SIZE(wm8904_snd_controls));
|
|
|
| - snd_soc_dapm_new_controls(codec, wm8904_adc_dapm_widgets,
|
| + snd_soc_dapm_new_controls(dapm, wm8904_adc_dapm_widgets,
|
| ARRAY_SIZE(wm8904_adc_dapm_widgets));
|
| - snd_soc_dapm_new_controls(codec, wm8904_dac_dapm_widgets,
|
| + snd_soc_dapm_new_controls(dapm, wm8904_dac_dapm_widgets,
|
| ARRAY_SIZE(wm8904_dac_dapm_widgets));
|
| - snd_soc_dapm_new_controls(codec, wm8904_dapm_widgets,
|
| + snd_soc_dapm_new_controls(dapm, wm8904_dapm_widgets,
|
| ARRAY_SIZE(wm8904_dapm_widgets));
|
|
|
| - snd_soc_dapm_add_routes(codec, core_intercon,
|
| + snd_soc_dapm_add_routes(dapm, core_intercon,
|
| ARRAY_SIZE(core_intercon));
|
| - snd_soc_dapm_add_routes(codec, adc_intercon,
|
| + snd_soc_dapm_add_routes(dapm, adc_intercon,
|
| ARRAY_SIZE(adc_intercon));
|
| - snd_soc_dapm_add_routes(codec, dac_intercon,
|
| + snd_soc_dapm_add_routes(dapm, dac_intercon,
|
| ARRAY_SIZE(dac_intercon));
|
| - snd_soc_dapm_add_routes(codec, wm8904_intercon,
|
| + snd_soc_dapm_add_routes(dapm, wm8904_intercon,
|
| ARRAY_SIZE(wm8904_intercon));
|
| break;
|
|
|
| @@ -1463,17 +1463,17 @@ static int wm8904_add_widgets(struct snd_soc_codec *codec)
|
| snd_soc_add_controls(codec, wm8904_dac_snd_controls,
|
| ARRAY_SIZE(wm8904_dac_snd_controls));
|
|
|
| - snd_soc_dapm_new_controls(codec, wm8904_dac_dapm_widgets,
|
| + snd_soc_dapm_new_controls(dapm, wm8904_dac_dapm_widgets,
|
| ARRAY_SIZE(wm8904_dac_dapm_widgets));
|
|
|
| - snd_soc_dapm_add_routes(codec, dac_intercon,
|
| + snd_soc_dapm_add_routes(dapm, dac_intercon,
|
| ARRAY_SIZE(dac_intercon));
|
| - snd_soc_dapm_add_routes(codec, wm8912_intercon,
|
| + snd_soc_dapm_add_routes(dapm, wm8912_intercon,
|
| ARRAY_SIZE(wm8912_intercon));
|
| break;
|
| }
|
|
|
| - snd_soc_dapm_new_widgets(codec);
|
| + snd_soc_dapm_new_widgets(dapm);
|
| return 0;
|
| }
|
|
|
| @@ -1589,7 +1589,7 @@ static int wm8904_hw_params(struct snd_pcm_substream *substream,
|
| - wm8904->fs);
|
| for (i = 1; i < ARRAY_SIZE(clk_sys_rates); i++) {
|
| cur_val = abs((wm8904->sysclk_rate /
|
| - clk_sys_rates[i].ratio) - wm8904->fs);;
|
| + clk_sys_rates[i].ratio) - wm8904->fs);
|
| if (cur_val < best_val) {
|
| best = i;
|
| best_val = cur_val;
|
| @@ -2138,7 +2138,7 @@ static int wm8904_set_bias_level(struct snd_soc_codec *codec,
|
| break;
|
|
|
| case SND_SOC_BIAS_STANDBY:
|
| - if (codec->bias_level == SND_SOC_BIAS_OFF) {
|
| + if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) {
|
| ret = regulator_bulk_enable(ARRAY_SIZE(wm8904->supplies),
|
| wm8904->supplies);
|
| if (ret != 0) {
|
| @@ -2197,7 +2197,7 @@ static int wm8904_set_bias_level(struct snd_soc_codec *codec,
|
| wm8904->supplies);
|
| break;
|
| }
|
| - codec->bias_level = level;
|
| + codec->dapm.bias_level = level;
|
| return 0;
|
| }
|
|
|
| @@ -2373,7 +2373,7 @@ static int wm8904_probe(struct snd_soc_codec *codec)
|
| int ret, i;
|
|
|
| codec->cache_sync = 1;
|
| - codec->idle_bias_off = 1;
|
| + codec->dapm.idle_bias_off = 1;
|
|
|
| switch (wm8904->devtype) {
|
| case WM8904:
|
| @@ -2436,19 +2436,28 @@ static int wm8904_probe(struct snd_soc_codec *codec)
|
| }
|
|
|
| /* Change some default settings - latch VU and enable ZC */
|
| - reg_cache[WM8904_ADC_DIGITAL_VOLUME_LEFT] |= WM8904_ADC_VU;
|
| - reg_cache[WM8904_ADC_DIGITAL_VOLUME_RIGHT] |= WM8904_ADC_VU;
|
| - reg_cache[WM8904_DAC_DIGITAL_VOLUME_LEFT] |= WM8904_DAC_VU;
|
| - reg_cache[WM8904_DAC_DIGITAL_VOLUME_RIGHT] |= WM8904_DAC_VU;
|
| - reg_cache[WM8904_ANALOGUE_OUT1_LEFT] |= WM8904_HPOUT_VU |
|
| - WM8904_HPOUTLZC;
|
| - reg_cache[WM8904_ANALOGUE_OUT1_RIGHT] |= WM8904_HPOUT_VU |
|
| - WM8904_HPOUTRZC;
|
| - reg_cache[WM8904_ANALOGUE_OUT2_LEFT] |= WM8904_LINEOUT_VU |
|
| - WM8904_LINEOUTLZC;
|
| - reg_cache[WM8904_ANALOGUE_OUT2_RIGHT] |= WM8904_LINEOUT_VU |
|
| - WM8904_LINEOUTRZC;
|
| - reg_cache[WM8904_CLOCK_RATES_0] &= ~WM8904_SR_MODE;
|
| + snd_soc_update_bits(codec, WM8904_ADC_DIGITAL_VOLUME_LEFT,
|
| + WM8904_ADC_VU, WM8904_ADC_VU);
|
| + snd_soc_update_bits(codec, WM8904_ADC_DIGITAL_VOLUME_RIGHT,
|
| + WM8904_ADC_VU, WM8904_ADC_VU);
|
| + snd_soc_update_bits(codec, WM8904_DAC_DIGITAL_VOLUME_LEFT,
|
| + WM8904_DAC_VU, WM8904_DAC_VU);
|
| + snd_soc_update_bits(codec, WM8904_DAC_DIGITAL_VOLUME_RIGHT,
|
| + WM8904_DAC_VU, WM8904_DAC_VU);
|
| + snd_soc_update_bits(codec, WM8904_ANALOGUE_OUT1_LEFT,
|
| + WM8904_HPOUT_VU | WM8904_HPOUTLZC,
|
| + WM8904_HPOUT_VU | WM8904_HPOUTLZC);
|
| + snd_soc_update_bits(codec, WM8904_ANALOGUE_OUT1_RIGHT,
|
| + WM8904_HPOUT_VU | WM8904_HPOUTRZC,
|
| + WM8904_HPOUT_VU | WM8904_HPOUTRZC);
|
| + snd_soc_update_bits(codec, WM8904_ANALOGUE_OUT2_LEFT,
|
| + WM8904_LINEOUT_VU | WM8904_LINEOUTLZC,
|
| + WM8904_LINEOUT_VU | WM8904_LINEOUTLZC);
|
| + snd_soc_update_bits(codec, WM8904_ANALOGUE_OUT2_RIGHT,
|
| + WM8904_LINEOUT_VU | WM8904_LINEOUTRZC,
|
| + WM8904_LINEOUT_VU | WM8904_LINEOUTRZC);
|
| + snd_soc_update_bits(codec, WM8904_CLOCK_RATES_0,
|
| + WM8904_SR_MODE, 0);
|
|
|
| /* Apply configuration from the platform data. */
|
| if (wm8904->pdata) {
|
| @@ -2469,10 +2478,12 @@ static int wm8904_probe(struct snd_soc_codec *codec)
|
| /* Set Class W by default - this will be managed by the Class
|
| * G widget at runtime where bypass paths are available.
|
| */
|
| - reg_cache[WM8904_CLASS_W_0] |= WM8904_CP_DYN_PWR;
|
| + snd_soc_update_bits(codec, WM8904_CLASS_W_0,
|
| + WM8904_CP_DYN_PWR, WM8904_CP_DYN_PWR);
|
|
|
| /* Use normal bias source */
|
| - reg_cache[WM8904_BIAS_CONTROL_0] &= ~WM8904_POBCTRL;
|
| + snd_soc_update_bits(codec, WM8904_BIAS_CONTROL_0,
|
| + WM8904_POBCTRL, 0);
|
|
|
| wm8904_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
|
|
|
|
|