diff options
Diffstat (limited to 'sound/soc/codecs/wm8993.c')
-rw-r--r-- | sound/soc/codecs/wm8993.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/sound/soc/codecs/wm8993.c b/sound/soc/codecs/wm8993.c index 589e3fa24734..18c0d9ce7c32 100644 --- a/sound/soc/codecs/wm8993.c +++ b/sound/soc/codecs/wm8993.c | |||
@@ -24,7 +24,6 @@ | |||
24 | #include <sound/pcm_params.h> | 24 | #include <sound/pcm_params.h> |
25 | #include <sound/tlv.h> | 25 | #include <sound/tlv.h> |
26 | #include <sound/soc.h> | 26 | #include <sound/soc.h> |
27 | #include <sound/soc-dapm.h> | ||
28 | #include <sound/initval.h> | 27 | #include <sound/initval.h> |
29 | #include <sound/wm8993.h> | 28 | #include <sound/wm8993.h> |
30 | 29 | ||
@@ -226,7 +225,6 @@ static struct { | |||
226 | 225 | ||
227 | struct wm8993_priv { | 226 | struct wm8993_priv { |
228 | struct wm_hubs_data hubs_data; | 227 | struct wm_hubs_data hubs_data; |
229 | u16 reg_cache[WM8993_REGISTER_COUNT]; | ||
230 | struct regulator_bulk_data supplies[WM8993_NUM_SUPPLIES]; | 228 | struct regulator_bulk_data supplies[WM8993_NUM_SUPPLIES]; |
231 | struct wm8993_platform_data pdata; | 229 | struct wm8993_platform_data pdata; |
232 | enum snd_soc_control_type control_type; | 230 | enum snd_soc_control_type control_type; |
@@ -735,6 +733,7 @@ static int class_w_put(struct snd_kcontrol *kcontrol, | |||
735 | 0); | 733 | 0); |
736 | } | 734 | } |
737 | wm8993->class_w_users++; | 735 | wm8993->class_w_users++; |
736 | wm8993->hubs_data.class_w = true; | ||
738 | } | 737 | } |
739 | 738 | ||
740 | /* Implement the change */ | 739 | /* Implement the change */ |
@@ -751,6 +750,7 @@ static int class_w_put(struct snd_kcontrol *kcontrol, | |||
751 | WM8993_CP_DYN_V); | 750 | WM8993_CP_DYN_V); |
752 | } | 751 | } |
753 | wm8993->class_w_users--; | 752 | wm8993->class_w_users--; |
753 | wm8993->hubs_data.class_w = false; | ||
754 | } | 754 | } |
755 | 755 | ||
756 | dev_dbg(codec->dev, "Indirect DAC use count now %d\n", | 756 | dev_dbg(codec->dev, "Indirect DAC use count now %d\n", |
@@ -968,7 +968,7 @@ static int wm8993_set_bias_level(struct snd_soc_codec *codec, | |||
968 | break; | 968 | break; |
969 | 969 | ||
970 | case SND_SOC_BIAS_STANDBY: | 970 | case SND_SOC_BIAS_STANDBY: |
971 | if (codec->bias_level == SND_SOC_BIAS_OFF) { | 971 | if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) { |
972 | ret = regulator_bulk_enable(ARRAY_SIZE(wm8993->supplies), | 972 | ret = regulator_bulk_enable(ARRAY_SIZE(wm8993->supplies), |
973 | wm8993->supplies); | 973 | wm8993->supplies); |
974 | if (ret != 0) | 974 | if (ret != 0) |
@@ -1029,6 +1029,12 @@ static int wm8993_set_bias_level(struct snd_soc_codec *codec, | |||
1029 | WM8993_VMID_SEL_MASK | WM8993_BIAS_ENA, | 1029 | WM8993_VMID_SEL_MASK | WM8993_BIAS_ENA, |
1030 | 0); | 1030 | 0); |
1031 | 1031 | ||
1032 | snd_soc_update_bits(codec, WM8993_ANTIPOP2, | ||
1033 | WM8993_STARTUP_BIAS_ENA | | ||
1034 | WM8993_VMID_BUF_ENA | | ||
1035 | WM8993_VMID_RAMP_MASK | | ||
1036 | WM8993_BIAS_SRC, 0); | ||
1037 | |||
1032 | #ifdef CONFIG_REGULATOR | 1038 | #ifdef CONFIG_REGULATOR |
1033 | /* Post 2.6.34 we will be able to get a callback when | 1039 | /* Post 2.6.34 we will be able to get a callback when |
1034 | * the regulators are disabled which we can use but | 1040 | * the regulators are disabled which we can use but |
@@ -1043,7 +1049,7 @@ static int wm8993_set_bias_level(struct snd_soc_codec *codec, | |||
1043 | break; | 1049 | break; |
1044 | } | 1050 | } |
1045 | 1051 | ||
1046 | codec->bias_level = level; | 1052 | codec->dapm.bias_level = level; |
1047 | 1053 | ||
1048 | return 0; | 1054 | return 0; |
1049 | } | 1055 | } |
@@ -1225,7 +1231,7 @@ static int wm8993_hw_params(struct snd_pcm_substream *substream, | |||
1225 | - wm8993->fs); | 1231 | - wm8993->fs); |
1226 | for (i = 1; i < ARRAY_SIZE(clk_sys_rates); i++) { | 1232 | for (i = 1; i < ARRAY_SIZE(clk_sys_rates); i++) { |
1227 | cur_val = abs((wm8993->sysclk_rate / | 1233 | cur_val = abs((wm8993->sysclk_rate / |
1228 | clk_sys_rates[i].ratio) - wm8993->fs);; | 1234 | clk_sys_rates[i].ratio) - wm8993->fs); |
1229 | if (cur_val < best_val) { | 1235 | if (cur_val < best_val) { |
1230 | best = i; | 1236 | best = i; |
1231 | best_val = cur_val; | 1237 | best_val = cur_val; |
@@ -1422,6 +1428,7 @@ static struct snd_soc_dai_driver wm8993_dai = { | |||
1422 | static int wm8993_probe(struct snd_soc_codec *codec) | 1428 | static int wm8993_probe(struct snd_soc_codec *codec) |
1423 | { | 1429 | { |
1424 | struct wm8993_priv *wm8993 = snd_soc_codec_get_drvdata(codec); | 1430 | struct wm8993_priv *wm8993 = snd_soc_codec_get_drvdata(codec); |
1431 | struct snd_soc_dapm_context *dapm = &codec->dapm; | ||
1425 | int ret, i, val; | 1432 | int ret, i, val; |
1426 | 1433 | ||
1427 | wm8993->hubs_data.hp_startup_mode = 1; | 1434 | wm8993->hubs_data.hp_startup_mode = 1; |
@@ -1503,11 +1510,11 @@ static int wm8993_probe(struct snd_soc_codec *codec) | |||
1503 | ARRAY_SIZE(wm8993_eq_controls)); | 1510 | ARRAY_SIZE(wm8993_eq_controls)); |
1504 | } | 1511 | } |
1505 | 1512 | ||
1506 | snd_soc_dapm_new_controls(codec, wm8993_dapm_widgets, | 1513 | snd_soc_dapm_new_controls(dapm, wm8993_dapm_widgets, |
1507 | ARRAY_SIZE(wm8993_dapm_widgets)); | 1514 | ARRAY_SIZE(wm8993_dapm_widgets)); |
1508 | wm_hubs_add_analogue_controls(codec); | 1515 | wm_hubs_add_analogue_controls(codec); |
1509 | 1516 | ||
1510 | snd_soc_dapm_add_routes(codec, routes, ARRAY_SIZE(routes)); | 1517 | snd_soc_dapm_add_routes(dapm, routes, ARRAY_SIZE(routes)); |
1511 | wm_hubs_add_analogue_routes(codec, wm8993->pdata.lineout1_diff, | 1518 | wm_hubs_add_analogue_routes(codec, wm8993->pdata.lineout1_diff, |
1512 | wm8993->pdata.lineout2_diff); | 1519 | wm8993->pdata.lineout2_diff); |
1513 | 1520 | ||