diff options
Diffstat (limited to 'sound/soc/codecs/wm8960.c')
| -rw-r--r-- | sound/soc/codecs/wm8960.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/sound/soc/codecs/wm8960.c b/sound/soc/codecs/wm8960.c index 4393394b7bc1..2df253c18568 100644 --- a/sound/soc/codecs/wm8960.c +++ b/sound/soc/codecs/wm8960.c | |||
| @@ -72,7 +72,6 @@ static const u16 wm8960_reg[WM8960_CACHEREGNUM] = { | |||
| 72 | 72 | ||
| 73 | struct wm8960_priv { | 73 | struct wm8960_priv { |
| 74 | enum snd_soc_control_type control_type; | 74 | enum snd_soc_control_type control_type; |
| 75 | void *control_data; | ||
| 76 | int (*set_bias_level)(struct snd_soc_codec *, | 75 | int (*set_bias_level)(struct snd_soc_codec *, |
| 77 | enum snd_soc_bias_level level); | 76 | enum snd_soc_bias_level level); |
| 78 | struct snd_soc_dapm_widget *lout1; | 77 | struct snd_soc_dapm_widget *lout1; |
| @@ -575,6 +574,8 @@ static int wm8960_set_bias_level_out3(struct snd_soc_codec *codec, | |||
| 575 | 574 | ||
| 576 | case SND_SOC_BIAS_STANDBY: | 575 | case SND_SOC_BIAS_STANDBY: |
| 577 | if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) { | 576 | if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) { |
| 577 | snd_soc_cache_sync(codec); | ||
| 578 | |||
| 578 | /* Enable anti-pop features */ | 579 | /* Enable anti-pop features */ |
| 579 | snd_soc_write(codec, WM8960_APOP1, | 580 | snd_soc_write(codec, WM8960_APOP1, |
| 580 | WM8960_POBCTRL | WM8960_SOFT_ST | | 581 | WM8960_POBCTRL | WM8960_SOFT_ST | |
| @@ -677,6 +678,9 @@ static int wm8960_set_bias_level_capless(struct snd_soc_codec *codec, | |||
| 677 | WM8960_VREF | WM8960_VMID_MASK, 0); | 678 | WM8960_VREF | WM8960_VMID_MASK, 0); |
| 678 | break; | 679 | break; |
| 679 | 680 | ||
| 681 | case SND_SOC_BIAS_OFF: | ||
| 682 | snd_soc_cache_sync(codec); | ||
| 683 | break; | ||
| 680 | default: | 684 | default: |
| 681 | break; | 685 | break; |
| 682 | } | 686 | } |
| @@ -902,16 +906,6 @@ static int wm8960_suspend(struct snd_soc_codec *codec, pm_message_t state) | |||
| 902 | static int wm8960_resume(struct snd_soc_codec *codec) | 906 | static int wm8960_resume(struct snd_soc_codec *codec) |
| 903 | { | 907 | { |
| 904 | struct wm8960_priv *wm8960 = snd_soc_codec_get_drvdata(codec); | 908 | struct wm8960_priv *wm8960 = snd_soc_codec_get_drvdata(codec); |
| 905 | int i; | ||
| 906 | u8 data[2]; | ||
| 907 | u16 *cache = codec->reg_cache; | ||
| 908 | |||
| 909 | /* Sync reg_cache with the hardware */ | ||
| 910 | for (i = 0; i < ARRAY_SIZE(wm8960_reg); i++) { | ||
| 911 | data[0] = (i << 1) | ((cache[i] >> 8) & 0x0001); | ||
| 912 | data[1] = cache[i] & 0x00ff; | ||
| 913 | codec->hw_write(codec->control_data, data, 2); | ||
| 914 | } | ||
| 915 | 909 | ||
| 916 | wm8960->set_bias_level(codec, SND_SOC_BIAS_STANDBY); | 910 | wm8960->set_bias_level(codec, SND_SOC_BIAS_STANDBY); |
| 917 | return 0; | 911 | return 0; |
| @@ -925,7 +919,6 @@ static int wm8960_probe(struct snd_soc_codec *codec) | |||
| 925 | u16 reg; | 919 | u16 reg; |
| 926 | 920 | ||
| 927 | wm8960->set_bias_level = wm8960_set_bias_level_out3; | 921 | wm8960->set_bias_level = wm8960_set_bias_level_out3; |
| 928 | codec->control_data = wm8960->control_data; | ||
| 929 | 922 | ||
| 930 | if (!pdata) { | 923 | if (!pdata) { |
| 931 | dev_warn(codec->dev, "No platform data supplied\n"); | 924 | dev_warn(codec->dev, "No platform data supplied\n"); |
| @@ -1015,7 +1008,6 @@ static __devinit int wm8960_i2c_probe(struct i2c_client *i2c, | |||
| 1015 | 1008 | ||
| 1016 | i2c_set_clientdata(i2c, wm8960); | 1009 | i2c_set_clientdata(i2c, wm8960); |
| 1017 | wm8960->control_type = SND_SOC_I2C; | 1010 | wm8960->control_type = SND_SOC_I2C; |
| 1018 | wm8960->control_data = i2c; | ||
| 1019 | 1011 | ||
| 1020 | ret = snd_soc_register_codec(&i2c->dev, | 1012 | ret = snd_soc_register_codec(&i2c->dev, |
| 1021 | &soc_codec_dev_wm8960, &wm8960_dai, 1); | 1013 | &soc_codec_dev_wm8960, &wm8960_dai, 1); |
