aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2014-10-06 07:48:52 -0400
committerMark Brown <broonie@kernel.org>2014-10-06 07:48:52 -0400
commit97c53e26f0773b9eb9ede21f544a91dd1bcd9ca9 (patch)
treeabad2cc74e89d65514b501ad39fdf7a1c3546106
parent5bcaca4b5bf2b05cc15a2c5bfb3d95fc49607e36 (diff)
parente03f73a01f010b29504ceebda3c4fca25468516d (diff)
Merge remote-tracking branch 'asoc/topic/core' into asoc-next
-rw-r--r--include/sound/soc.h6
-rw-r--r--include/trace/events/asoc.h6
-rw-r--r--sound/soc/soc-core.c30
3 files changed, 19 insertions, 23 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h
index f1366ebca9c5..f90f605b3971 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -912,7 +912,7 @@ struct snd_soc_dai_link {
912 * only for codec to codec links, or systems using device tree. 912 * only for codec to codec links, or systems using device tree.
913 */ 913 */
914 const char *cpu_name; 914 const char *cpu_name;
915 const struct device_node *cpu_of_node; 915 struct device_node *cpu_of_node;
916 /* 916 /*
917 * You MAY specify the DAI name of the CPU DAI. If this information is 917 * You MAY specify the DAI name of the CPU DAI. If this information is
918 * omitted, the CPU-side DAI is matched using .cpu_name/.cpu_of_node 918 * omitted, the CPU-side DAI is matched using .cpu_name/.cpu_of_node
@@ -924,7 +924,7 @@ struct snd_soc_dai_link {
924 * DT/OF node, but not both. 924 * DT/OF node, but not both.
925 */ 925 */
926 const char *codec_name; 926 const char *codec_name;
927 const struct device_node *codec_of_node; 927 struct device_node *codec_of_node;
928 /* You MUST specify the DAI name within the codec */ 928 /* You MUST specify the DAI name within the codec */
929 const char *codec_dai_name; 929 const char *codec_dai_name;
930 930
@@ -937,7 +937,7 @@ struct snd_soc_dai_link {
937 * do not need a platform. 937 * do not need a platform.
938 */ 938 */
939 const char *platform_name; 939 const char *platform_name;
940 const struct device_node *platform_of_node; 940 struct device_node *platform_of_node;
941 int be_id; /* optional ID for machine driver BE identification */ 941 int be_id; /* optional ID for machine driver BE identification */
942 942
943 const struct snd_soc_pcm_stream *params; 943 const struct snd_soc_pcm_stream *params;
diff --git a/include/trace/events/asoc.h b/include/trace/events/asoc.h
index 0194a641e4e2..b04ee7e5a466 100644
--- a/include/trace/events/asoc.h
+++ b/include/trace/events/asoc.h
@@ -175,7 +175,7 @@ TRACE_EVENT(snd_soc_dapm_output_path,
175 __entry->path_sink = (long)path->sink; 175 __entry->path_sink = (long)path->sink;
176 ), 176 ),
177 177
178 TP_printk("%c%s -> %s -> %s\n", 178 TP_printk("%c%s -> %s -> %s",
179 (int) __entry->path_sink && 179 (int) __entry->path_sink &&
180 (int) __entry->path_connect ? '*' : ' ', 180 (int) __entry->path_connect ? '*' : ' ',
181 __get_str(wname), __get_str(pname), __get_str(psname)) 181 __get_str(wname), __get_str(pname), __get_str(psname))
@@ -204,7 +204,7 @@ TRACE_EVENT(snd_soc_dapm_input_path,
204 __entry->path_source = (long)path->source; 204 __entry->path_source = (long)path->source;
205 ), 205 ),
206 206
207 TP_printk("%c%s <- %s <- %s\n", 207 TP_printk("%c%s <- %s <- %s",
208 (int) __entry->path_source && 208 (int) __entry->path_source &&
209 (int) __entry->path_connect ? '*' : ' ', 209 (int) __entry->path_connect ? '*' : ' ',
210 __get_str(wname), __get_str(pname), __get_str(psname)) 210 __get_str(wname), __get_str(pname), __get_str(psname))
@@ -226,7 +226,7 @@ TRACE_EVENT(snd_soc_dapm_connected,
226 __entry->stream = stream; 226 __entry->stream = stream;
227 ), 227 ),
228 228
229 TP_printk("%s: found %d paths\n", 229 TP_printk("%s: found %d paths",
230 __entry->stream ? "capture" : "playback", __entry->paths) 230 __entry->stream ? "capture" : "playback", __entry->paths)
231); 231);
232 232
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index c75a27ce7b97..57de6a7d7ffa 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1956,19 +1956,14 @@ static struct platform_driver soc_driver = {
1956int snd_soc_new_ac97_codec(struct snd_soc_codec *codec, 1956int snd_soc_new_ac97_codec(struct snd_soc_codec *codec,
1957 struct snd_ac97_bus_ops *ops, int num) 1957 struct snd_ac97_bus_ops *ops, int num)
1958{ 1958{
1959 mutex_lock(&codec->mutex);
1960
1961 codec->ac97 = kzalloc(sizeof(struct snd_ac97), GFP_KERNEL); 1959 codec->ac97 = kzalloc(sizeof(struct snd_ac97), GFP_KERNEL);
1962 if (codec->ac97 == NULL) { 1960 if (codec->ac97 == NULL)
1963 mutex_unlock(&codec->mutex);
1964 return -ENOMEM; 1961 return -ENOMEM;
1965 }
1966 1962
1967 codec->ac97->bus = kzalloc(sizeof(struct snd_ac97_bus), GFP_KERNEL); 1963 codec->ac97->bus = kzalloc(sizeof(struct snd_ac97_bus), GFP_KERNEL);
1968 if (codec->ac97->bus == NULL) { 1964 if (codec->ac97->bus == NULL) {
1969 kfree(codec->ac97); 1965 kfree(codec->ac97);
1970 codec->ac97 = NULL; 1966 codec->ac97 = NULL;
1971 mutex_unlock(&codec->mutex);
1972 return -ENOMEM; 1967 return -ENOMEM;
1973 } 1968 }
1974 1969
@@ -1981,7 +1976,6 @@ int snd_soc_new_ac97_codec(struct snd_soc_codec *codec,
1981 */ 1976 */
1982 codec->ac97_created = 1; 1977 codec->ac97_created = 1;
1983 1978
1984 mutex_unlock(&codec->mutex);
1985 return 0; 1979 return 0;
1986} 1980}
1987EXPORT_SYMBOL_GPL(snd_soc_new_ac97_codec); 1981EXPORT_SYMBOL_GPL(snd_soc_new_ac97_codec);
@@ -2151,7 +2145,6 @@ EXPORT_SYMBOL_GPL(snd_soc_set_ac97_ops_of_reset);
2151 */ 2145 */
2152void snd_soc_free_ac97_codec(struct snd_soc_codec *codec) 2146void snd_soc_free_ac97_codec(struct snd_soc_codec *codec)
2153{ 2147{
2154 mutex_lock(&codec->mutex);
2155#ifdef CONFIG_SND_SOC_AC97_BUS 2148#ifdef CONFIG_SND_SOC_AC97_BUS
2156 soc_unregister_ac97_codec(codec); 2149 soc_unregister_ac97_codec(codec);
2157#endif 2150#endif
@@ -2159,7 +2152,6 @@ void snd_soc_free_ac97_codec(struct snd_soc_codec *codec)
2159 kfree(codec->ac97); 2152 kfree(codec->ac97);
2160 codec->ac97 = NULL; 2153 codec->ac97 = NULL;
2161 codec->ac97_created = 0; 2154 codec->ac97_created = 0;
2162 mutex_unlock(&codec->mutex);
2163} 2155}
2164EXPORT_SYMBOL_GPL(snd_soc_free_ac97_codec); 2156EXPORT_SYMBOL_GPL(snd_soc_free_ac97_codec);
2165 2157
@@ -2876,9 +2868,10 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol,
2876 unsigned int val, val_mask; 2868 unsigned int val, val_mask;
2877 int ret; 2869 int ret;
2878 2870
2879 val = ((ucontrol->value.integer.value[0] + min) & mask);
2880 if (invert) 2871 if (invert)
2881 val = max - val; 2872 val = (max - ucontrol->value.integer.value[0]) & mask;
2873 else
2874 val = ((ucontrol->value.integer.value[0] + min) & mask);
2882 val_mask = mask << shift; 2875 val_mask = mask << shift;
2883 val = val << shift; 2876 val = val << shift;
2884 2877
@@ -2887,9 +2880,10 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol,
2887 return ret; 2880 return ret;
2888 2881
2889 if (snd_soc_volsw_is_stereo(mc)) { 2882 if (snd_soc_volsw_is_stereo(mc)) {
2890 val = ((ucontrol->value.integer.value[1] + min) & mask);
2891 if (invert) 2883 if (invert)
2892 val = max - val; 2884 val = (max - ucontrol->value.integer.value[1]) & mask;
2885 else
2886 val = ((ucontrol->value.integer.value[1] + min) & mask);
2893 val_mask = mask << shift; 2887 val_mask = mask << shift;
2894 val = val << shift; 2888 val = val << shift;
2895 2889
@@ -2934,8 +2928,9 @@ int snd_soc_get_volsw_range(struct snd_kcontrol *kcontrol,
2934 if (invert) 2928 if (invert)
2935 ucontrol->value.integer.value[0] = 2929 ucontrol->value.integer.value[0] =
2936 max - ucontrol->value.integer.value[0]; 2930 max - ucontrol->value.integer.value[0];
2937 ucontrol->value.integer.value[0] = 2931 else
2938 ucontrol->value.integer.value[0] - min; 2932 ucontrol->value.integer.value[0] =
2933 ucontrol->value.integer.value[0] - min;
2939 2934
2940 if (snd_soc_volsw_is_stereo(mc)) { 2935 if (snd_soc_volsw_is_stereo(mc)) {
2941 ret = snd_soc_component_read(component, rreg, &val); 2936 ret = snd_soc_component_read(component, rreg, &val);
@@ -2946,8 +2941,9 @@ int snd_soc_get_volsw_range(struct snd_kcontrol *kcontrol,
2946 if (invert) 2941 if (invert)
2947 ucontrol->value.integer.value[1] = 2942 ucontrol->value.integer.value[1] =
2948 max - ucontrol->value.integer.value[1]; 2943 max - ucontrol->value.integer.value[1];
2949 ucontrol->value.integer.value[1] = 2944 else
2950 ucontrol->value.integer.value[1] - min; 2945 ucontrol->value.integer.value[1] =
2946 ucontrol->value.integer.value[1] - min;
2951 } 2947 }
2952 2948
2953 return 0; 2949 return 0;