aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiam Girdwood <liam.r.girdwood@linux.intel.com>2014-01-17 12:03:55 -0500
committerMark Brown <broonie@linaro.org>2014-01-17 12:56:21 -0500
commit23607025303af6e84bc2cd4cabe89c21f6a22a3f (patch)
treef19774538a5f34c2ce661d3f43dde49e56183007
parent6ce4eac1f600b34f2f7f58f9cd8f0503d79e42ae (diff)
ASoC: DPCM: make some DPCM API calls non static for compressed usage
The ASoC compressed code needs to call the internal DPCM APIs in order to dynamically route compressed data to different DAIs. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r--include/sound/soc-dpcm.h22
-rw-r--r--sound/soc/soc-pcm.c29
2 files changed, 34 insertions, 17 deletions
diff --git a/include/sound/soc-dpcm.h b/include/sound/soc-dpcm.h
index 047d657c331c..2883a7a6f9f3 100644
--- a/include/sound/soc-dpcm.h
+++ b/include/sound/soc-dpcm.h
@@ -11,6 +11,7 @@
11#ifndef __LINUX_SND_SOC_DPCM_H 11#ifndef __LINUX_SND_SOC_DPCM_H
12#define __LINUX_SND_SOC_DPCM_H 12#define __LINUX_SND_SOC_DPCM_H
13 13
14#include <linux/slab.h>
14#include <linux/list.h> 15#include <linux/list.h>
15#include <sound/pcm.h> 16#include <sound/pcm.h>
16 17
@@ -135,4 +136,25 @@ int soc_dpcm_be_digital_mute(struct snd_soc_pcm_runtime *fe, int mute);
135int soc_dpcm_debugfs_add(struct snd_soc_pcm_runtime *rtd); 136int soc_dpcm_debugfs_add(struct snd_soc_pcm_runtime *rtd);
136int soc_dpcm_runtime_update(struct snd_soc_card *); 137int soc_dpcm_runtime_update(struct snd_soc_card *);
137 138
139int dpcm_path_get(struct snd_soc_pcm_runtime *fe,
140 int stream, struct snd_soc_dapm_widget_list **list_);
141int dpcm_process_paths(struct snd_soc_pcm_runtime *fe,
142 int stream, struct snd_soc_dapm_widget_list **list, int new);
143int dpcm_be_dai_startup(struct snd_soc_pcm_runtime *fe, int stream);
144int dpcm_be_dai_shutdown(struct snd_soc_pcm_runtime *fe, int stream);
145void dpcm_be_disconnect(struct snd_soc_pcm_runtime *fe, int stream);
146void dpcm_clear_pending_state(struct snd_soc_pcm_runtime *fe, int stream);
147int dpcm_be_dai_hw_free(struct snd_soc_pcm_runtime *fe, int stream);
148int dpcm_be_dai_hw_params(struct snd_soc_pcm_runtime *fe, int tream);
149int dpcm_be_dai_trigger(struct snd_soc_pcm_runtime *fe, int stream, int cmd);
150int dpcm_be_dai_prepare(struct snd_soc_pcm_runtime *fe, int stream);
151int dpcm_dapm_stream_event(struct snd_soc_pcm_runtime *fe, int dir,
152 int event);
153
154static inline void dpcm_path_put(struct snd_soc_dapm_widget_list **list)
155{
156 kfree(*list);
157}
158
159
138#endif 160#endif
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 42782c01e413..64bf3f827aac 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -58,7 +58,7 @@ int snd_soc_set_runtime_hwparams(struct snd_pcm_substream *substream,
58EXPORT_SYMBOL_GPL(snd_soc_set_runtime_hwparams); 58EXPORT_SYMBOL_GPL(snd_soc_set_runtime_hwparams);
59 59
60/* DPCM stream event, send event to FE and all active BEs. */ 60/* DPCM stream event, send event to FE and all active BEs. */
61static int dpcm_dapm_stream_event(struct snd_soc_pcm_runtime *fe, int dir, 61int dpcm_dapm_stream_event(struct snd_soc_pcm_runtime *fe, int dir,
62 int event) 62 int event)
63{ 63{
64 struct snd_soc_dpcm *dpcm; 64 struct snd_soc_dpcm *dpcm;
@@ -773,7 +773,7 @@ static void dpcm_be_reparent(struct snd_soc_pcm_runtime *fe,
773} 773}
774 774
775/* disconnect a BE and FE */ 775/* disconnect a BE and FE */
776static void dpcm_be_disconnect(struct snd_soc_pcm_runtime *fe, int stream) 776void dpcm_be_disconnect(struct snd_soc_pcm_runtime *fe, int stream)
777{ 777{
778 struct snd_soc_dpcm *dpcm, *d; 778 struct snd_soc_dpcm *dpcm, *d;
779 779
@@ -869,7 +869,7 @@ static int widget_in_list(struct snd_soc_dapm_widget_list *list,
869 return 0; 869 return 0;
870} 870}
871 871
872static int dpcm_path_get(struct snd_soc_pcm_runtime *fe, 872int dpcm_path_get(struct snd_soc_pcm_runtime *fe,
873 int stream, struct snd_soc_dapm_widget_list **list_) 873 int stream, struct snd_soc_dapm_widget_list **list_)
874{ 874{
875 struct snd_soc_dai *cpu_dai = fe->cpu_dai; 875 struct snd_soc_dai *cpu_dai = fe->cpu_dai;
@@ -891,11 +891,6 @@ static int dpcm_path_get(struct snd_soc_pcm_runtime *fe,
891 return paths; 891 return paths;
892} 892}
893 893
894static inline void dpcm_path_put(struct snd_soc_dapm_widget_list **list)
895{
896 kfree(*list);
897}
898
899static int dpcm_prune_paths(struct snd_soc_pcm_runtime *fe, int stream, 894static int dpcm_prune_paths(struct snd_soc_pcm_runtime *fe, int stream,
900 struct snd_soc_dapm_widget_list **list_) 895 struct snd_soc_dapm_widget_list **list_)
901{ 896{
@@ -965,7 +960,7 @@ static int dpcm_add_paths(struct snd_soc_pcm_runtime *fe, int stream,
965 continue; 960 continue;
966 961
967 /* don't connect if FE is not running */ 962 /* don't connect if FE is not running */
968 if (!fe->dpcm[stream].runtime) 963 if (!fe->dpcm[stream].runtime && !fe->fe_compr)
969 continue; 964 continue;
970 965
971 /* newly connected FE and BE */ 966 /* newly connected FE and BE */
@@ -990,7 +985,7 @@ static int dpcm_add_paths(struct snd_soc_pcm_runtime *fe, int stream,
990 * Find the corresponding BE DAIs that source or sink audio to this 985 * Find the corresponding BE DAIs that source or sink audio to this
991 * FE substream. 986 * FE substream.
992 */ 987 */
993static int dpcm_process_paths(struct snd_soc_pcm_runtime *fe, 988int dpcm_process_paths(struct snd_soc_pcm_runtime *fe,
994 int stream, struct snd_soc_dapm_widget_list **list, int new) 989 int stream, struct snd_soc_dapm_widget_list **list, int new)
995{ 990{
996 if (new) 991 if (new)
@@ -999,7 +994,7 @@ static int dpcm_process_paths(struct snd_soc_pcm_runtime *fe,
999 return dpcm_prune_paths(fe, stream, list); 994 return dpcm_prune_paths(fe, stream, list);
1000} 995}
1001 996
1002static void dpcm_clear_pending_state(struct snd_soc_pcm_runtime *fe, int stream) 997void dpcm_clear_pending_state(struct snd_soc_pcm_runtime *fe, int stream)
1003{ 998{
1004 struct snd_soc_dpcm *dpcm; 999 struct snd_soc_dpcm *dpcm;
1005 1000
@@ -1037,7 +1032,7 @@ static void dpcm_be_dai_startup_unwind(struct snd_soc_pcm_runtime *fe,
1037 } 1032 }
1038} 1033}
1039 1034
1040static int dpcm_be_dai_startup(struct snd_soc_pcm_runtime *fe, int stream) 1035int dpcm_be_dai_startup(struct snd_soc_pcm_runtime *fe, int stream)
1041{ 1036{
1042 struct snd_soc_dpcm *dpcm; 1037 struct snd_soc_dpcm *dpcm;
1043 int err, count = 0; 1038 int err, count = 0;
@@ -1186,7 +1181,7 @@ be_err:
1186 return ret; 1181 return ret;
1187} 1182}
1188 1183
1189static int dpcm_be_dai_shutdown(struct snd_soc_pcm_runtime *fe, int stream) 1184int dpcm_be_dai_shutdown(struct snd_soc_pcm_runtime *fe, int stream)
1190{ 1185{
1191 struct snd_soc_dpcm *dpcm; 1186 struct snd_soc_dpcm *dpcm;
1192 1187
@@ -1247,7 +1242,7 @@ static int dpcm_fe_dai_shutdown(struct snd_pcm_substream *substream)
1247 return 0; 1242 return 0;
1248} 1243}
1249 1244
1250static int dpcm_be_dai_hw_free(struct snd_soc_pcm_runtime *fe, int stream) 1245int dpcm_be_dai_hw_free(struct snd_soc_pcm_runtime *fe, int stream)
1251{ 1246{
1252 struct snd_soc_dpcm *dpcm; 1247 struct snd_soc_dpcm *dpcm;
1253 1248
@@ -1312,7 +1307,7 @@ static int dpcm_fe_dai_hw_free(struct snd_pcm_substream *substream)
1312 return 0; 1307 return 0;
1313} 1308}
1314 1309
1315static int dpcm_be_dai_hw_params(struct snd_soc_pcm_runtime *fe, int stream) 1310int dpcm_be_dai_hw_params(struct snd_soc_pcm_runtime *fe, int stream)
1316{ 1311{
1317 struct snd_soc_dpcm *dpcm; 1312 struct snd_soc_dpcm *dpcm;
1318 int ret; 1313 int ret;
@@ -1442,7 +1437,7 @@ static int dpcm_do_trigger(struct snd_soc_dpcm *dpcm,
1442 return ret; 1437 return ret;
1443} 1438}
1444 1439
1445static int dpcm_be_dai_trigger(struct snd_soc_pcm_runtime *fe, int stream, 1440int dpcm_be_dai_trigger(struct snd_soc_pcm_runtime *fe, int stream,
1446 int cmd) 1441 int cmd)
1447{ 1442{
1448 struct snd_soc_dpcm *dpcm; 1443 struct snd_soc_dpcm *dpcm;
@@ -1610,7 +1605,7 @@ out:
1610 return ret; 1605 return ret;
1611} 1606}
1612 1607
1613static int dpcm_be_dai_prepare(struct snd_soc_pcm_runtime *fe, int stream) 1608int dpcm_be_dai_prepare(struct snd_soc_pcm_runtime *fe, int stream)
1614{ 1609{
1615 struct snd_soc_dpcm *dpcm; 1610 struct snd_soc_dpcm *dpcm;
1616 int ret = 0; 1611 int ret = 0;