diff options
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r-- | sound/soc/soc-dapm.c | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index dcade130157f..67e63ab1f11e 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c | |||
@@ -2868,6 +2868,7 @@ int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol, | |||
2868 | unsigned int val; | 2868 | unsigned int val; |
2869 | int connect, change; | 2869 | int connect, change; |
2870 | struct snd_soc_dapm_update update; | 2870 | struct snd_soc_dapm_update update; |
2871 | int ret = 0; | ||
2871 | 2872 | ||
2872 | if (snd_soc_volsw_is_stereo(mc)) | 2873 | if (snd_soc_volsw_is_stereo(mc)) |
2873 | dev_warn(codec->dapm.dev, | 2874 | dev_warn(codec->dapm.dev, |
@@ -2901,12 +2902,16 @@ int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol, | |||
2901 | card->update = &update; | 2902 | card->update = &update; |
2902 | } | 2903 | } |
2903 | 2904 | ||
2904 | soc_dapm_mixer_update_power(card, kcontrol, connect); | 2905 | ret = soc_dapm_mixer_update_power(card, kcontrol, connect); |
2905 | 2906 | ||
2906 | card->update = NULL; | 2907 | card->update = NULL; |
2907 | } | 2908 | } |
2908 | 2909 | ||
2909 | mutex_unlock(&card->dapm_mutex); | 2910 | mutex_unlock(&card->dapm_mutex); |
2911 | |||
2912 | if (ret > 0) | ||
2913 | soc_dpcm_runtime_update(card); | ||
2914 | |||
2910 | return change; | 2915 | return change; |
2911 | } | 2916 | } |
2912 | EXPORT_SYMBOL_GPL(snd_soc_dapm_put_volsw); | 2917 | EXPORT_SYMBOL_GPL(snd_soc_dapm_put_volsw); |
@@ -2955,6 +2960,7 @@ int snd_soc_dapm_put_enum_double(struct snd_kcontrol *kcontrol, | |||
2955 | unsigned int val, mux, change; | 2960 | unsigned int val, mux, change; |
2956 | unsigned int mask; | 2961 | unsigned int mask; |
2957 | struct snd_soc_dapm_update update; | 2962 | struct snd_soc_dapm_update update; |
2963 | int ret = 0; | ||
2958 | 2964 | ||
2959 | if (ucontrol->value.enumerated.item[0] > e->max - 1) | 2965 | if (ucontrol->value.enumerated.item[0] > e->max - 1) |
2960 | return -EINVAL; | 2966 | return -EINVAL; |
@@ -2978,12 +2984,16 @@ int snd_soc_dapm_put_enum_double(struct snd_kcontrol *kcontrol, | |||
2978 | update.val = val; | 2984 | update.val = val; |
2979 | card->update = &update; | 2985 | card->update = &update; |
2980 | 2986 | ||
2981 | soc_dapm_mux_update_power(card, kcontrol, mux, e); | 2987 | ret = soc_dapm_mux_update_power(card, kcontrol, mux, e); |
2982 | 2988 | ||
2983 | card->update = NULL; | 2989 | card->update = NULL; |
2984 | } | 2990 | } |
2985 | 2991 | ||
2986 | mutex_unlock(&card->dapm_mutex); | 2992 | mutex_unlock(&card->dapm_mutex); |
2993 | |||
2994 | if (ret > 0) | ||
2995 | soc_dpcm_runtime_update(card); | ||
2996 | |||
2987 | return change; | 2997 | return change; |
2988 | } | 2998 | } |
2989 | EXPORT_SYMBOL_GPL(snd_soc_dapm_put_enum_double); | 2999 | EXPORT_SYMBOL_GPL(snd_soc_dapm_put_enum_double); |
@@ -3019,6 +3029,7 @@ int snd_soc_dapm_put_enum_virt(struct snd_kcontrol *kcontrol, | |||
3019 | struct soc_enum *e = | 3029 | struct soc_enum *e = |
3020 | (struct soc_enum *)kcontrol->private_value; | 3030 | (struct soc_enum *)kcontrol->private_value; |
3021 | int change; | 3031 | int change; |
3032 | int ret = 0; | ||
3022 | 3033 | ||
3023 | if (ucontrol->value.enumerated.item[0] >= e->max) | 3034 | if (ucontrol->value.enumerated.item[0] >= e->max) |
3024 | return -EINVAL; | 3035 | return -EINVAL; |
@@ -3028,9 +3039,13 @@ int snd_soc_dapm_put_enum_virt(struct snd_kcontrol *kcontrol, | |||
3028 | value = ucontrol->value.enumerated.item[0]; | 3039 | value = ucontrol->value.enumerated.item[0]; |
3029 | change = dapm_kcontrol_set_value(kcontrol, value); | 3040 | change = dapm_kcontrol_set_value(kcontrol, value); |
3030 | if (change) | 3041 | if (change) |
3031 | soc_dapm_mux_update_power(card, kcontrol, value, e); | 3042 | ret = soc_dapm_mux_update_power(card, kcontrol, value, e); |
3032 | 3043 | ||
3033 | mutex_unlock(&card->dapm_mutex); | 3044 | mutex_unlock(&card->dapm_mutex); |
3045 | |||
3046 | if (ret > 0) | ||
3047 | soc_dpcm_runtime_update(card); | ||
3048 | |||
3034 | return change; | 3049 | return change; |
3035 | } | 3050 | } |
3036 | EXPORT_SYMBOL_GPL(snd_soc_dapm_put_enum_virt); | 3051 | EXPORT_SYMBOL_GPL(snd_soc_dapm_put_enum_virt); |
@@ -3097,6 +3112,7 @@ int snd_soc_dapm_put_value_enum_double(struct snd_kcontrol *kcontrol, | |||
3097 | unsigned int val, mux, change; | 3112 | unsigned int val, mux, change; |
3098 | unsigned int mask; | 3113 | unsigned int mask; |
3099 | struct snd_soc_dapm_update update; | 3114 | struct snd_soc_dapm_update update; |
3115 | int ret = 0; | ||
3100 | 3116 | ||
3101 | if (ucontrol->value.enumerated.item[0] > e->max - 1) | 3117 | if (ucontrol->value.enumerated.item[0] > e->max - 1) |
3102 | return -EINVAL; | 3118 | return -EINVAL; |
@@ -3120,12 +3136,16 @@ int snd_soc_dapm_put_value_enum_double(struct snd_kcontrol *kcontrol, | |||
3120 | update.val = val; | 3136 | update.val = val; |
3121 | card->update = &update; | 3137 | card->update = &update; |
3122 | 3138 | ||
3123 | soc_dapm_mux_update_power(card, kcontrol, mux, e); | 3139 | ret = soc_dapm_mux_update_power(card, kcontrol, mux, e); |
3124 | 3140 | ||
3125 | card->update = NULL; | 3141 | card->update = NULL; |
3126 | } | 3142 | } |
3127 | 3143 | ||
3128 | mutex_unlock(&card->dapm_mutex); | 3144 | mutex_unlock(&card->dapm_mutex); |
3145 | |||
3146 | if (ret > 0) | ||
3147 | soc_dpcm_runtime_update(card); | ||
3148 | |||
3129 | return change; | 3149 | return change; |
3130 | } | 3150 | } |
3131 | EXPORT_SYMBOL_GPL(snd_soc_dapm_put_value_enum_double); | 3151 | EXPORT_SYMBOL_GPL(snd_soc_dapm_put_value_enum_double); |