From ec2e3031b65f23f66840b5c89c4b83076831a435 Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Wed, 18 Apr 2012 11:41:11 +0100 Subject: ASoC: dapm: Add API call to query valid DAPM paths In preparation for ASoC DSP support. Add a DAPM API call to determine whether a DAPM audio path is valid between source and sink widgets. This also takes into account all kcontrol mux and mixer settings in between the source and sink widgets to validate the audio path. This will be used by the DSP core to determine the runtime DAI mappings between FE and BE DAIs in order to run PCM operations. Signed-off-by: Liam Girdwood Signed-off-by: Mark Brown --- include/trace/events/asoc.h | 80 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) (limited to 'include/trace') diff --git a/include/trace/events/asoc.h b/include/trace/events/asoc.h index ab26f8aa3c7..6d8efb1cc8c 100644 --- a/include/trace/events/asoc.h +++ b/include/trace/events/asoc.h @@ -7,6 +7,8 @@ #include #include +#define DAPM_DIRECT "(direct)" + struct snd_soc_jack; struct snd_soc_codec; struct snd_soc_platform; @@ -241,6 +243,84 @@ TRACE_EVENT(snd_soc_dapm_walk_done, (int)__entry->path_checks, (int)__entry->neighbour_checks) ); +TRACE_EVENT(snd_soc_dapm_output_path, + + TP_PROTO(struct snd_soc_dapm_widget *widget, + struct snd_soc_dapm_path *path), + + TP_ARGS(widget, path), + + TP_STRUCT__entry( + __string( wname, widget->name ) + __string( pname, path->name ? path->name : DAPM_DIRECT) + __string( psname, path->sink->name ) + __field( int, path_sink ) + __field( int, path_connect ) + ), + + TP_fast_assign( + __assign_str(wname, widget->name); + __assign_str(pname, path->name ? path->name : DAPM_DIRECT); + __assign_str(psname, path->sink->name); + __entry->path_connect = path->connect; + __entry->path_sink = (int)path->sink; + ), + + TP_printk("%c%s -> %s -> %s\n", + (int) __entry->path_sink && + (int) __entry->path_connect ? '*' : ' ', + __get_str(wname), __get_str(pname), __get_str(psname)) +); + +TRACE_EVENT(snd_soc_dapm_input_path, + + TP_PROTO(struct snd_soc_dapm_widget *widget, + struct snd_soc_dapm_path *path), + + TP_ARGS(widget, path), + + TP_STRUCT__entry( + __string( wname, widget->name ) + __string( pname, path->name ? path->name : DAPM_DIRECT) + __string( psname, path->source->name ) + __field( int, path_source ) + __field( int, path_connect ) + ), + + TP_fast_assign( + __assign_str(wname, widget->name); + __assign_str(pname, path->name ? path->name : DAPM_DIRECT); + __assign_str(psname, path->source->name); + __entry->path_connect = path->connect; + __entry->path_source = (int)path->source; + ), + + TP_printk("%c%s <- %s <- %s\n", + (int) __entry->path_source && + (int) __entry->path_connect ? '*' : ' ', + __get_str(wname), __get_str(pname), __get_str(psname)) +); + +TRACE_EVENT(snd_soc_dapm_connected, + + TP_PROTO(int paths, int stream), + + TP_ARGS(paths, stream), + + TP_STRUCT__entry( + __field( int, paths ) + __field( int, stream ) + ), + + TP_fast_assign( + __entry->paths = paths; + __entry->stream = stream; + ), + + TP_printk("%s: found %d paths\n", + __entry->stream ? "capture" : "playback", __entry->paths) +); + TRACE_EVENT(snd_soc_jack_irq, TP_PROTO(const char *name), -- cgit v1.2.3-70-g09d2 From c97f3bdd26080c2cb2a648c37b6dcb8eac2f91e7 Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Mon, 23 Apr 2012 10:31:15 +0100 Subject: ASoC: dapm: Fix x86_64 build warning. Fixes the following build warning on x86_64. In file included from include/trace/ftrace.h:567:0, from include/trace/define_trace.h:86, from include/trace/events/asoc.h:410, from sound/soc/soc-core.c:45: include/trace/events/asoc.h: In function 'ftrace_raw_event_snd_soc_dapm_output_path': include/trace/events/asoc.h:246:1: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] include/trace/events/asoc.h: In function 'ftrace_raw_event_snd_soc_dapm_input_path': include/trace/events/asoc.h:275:1: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] Signed-off-by: Liam Girdwood Signed-off-by: Mark Brown --- include/trace/events/asoc.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/trace') diff --git a/include/trace/events/asoc.h b/include/trace/events/asoc.h index 6d8efb1cc8c..5fc2dcdd21c 100644 --- a/include/trace/events/asoc.h +++ b/include/trace/events/asoc.h @@ -263,7 +263,7 @@ TRACE_EVENT(snd_soc_dapm_output_path, __assign_str(pname, path->name ? path->name : DAPM_DIRECT); __assign_str(psname, path->sink->name); __entry->path_connect = path->connect; - __entry->path_sink = (int)path->sink; + __entry->path_sink = (long)path->sink; ), TP_printk("%c%s -> %s -> %s\n", @@ -292,7 +292,7 @@ TRACE_EVENT(snd_soc_dapm_input_path, __assign_str(pname, path->name ? path->name : DAPM_DIRECT); __assign_str(psname, path->source->name); __entry->path_connect = path->connect; - __entry->path_source = (int)path->source; + __entry->path_source = (long)path->source; ), TP_printk("%c%s <- %s <- %s\n", -- cgit v1.2.3-70-g09d2