summaryrefslogtreecommitdiffstats
path: root/sound/avirt.h
diff options
context:
space:
mode:
authorMark Farrugia <mark.farrugia@fiberdyne.com.au>2018-11-01 12:17:10 +1100
committerMark Farrugia <mark.farrugia@fiberdyne.com.au>2018-11-01 14:57:07 +1100
commit52db7a23a234080d3a28dfe60191c239cc04613b (patch)
treea7b2332b51d6fee70f0f8cfec245fe4ca9e8d6dc /sound/avirt.h
parent0765c6c497379a9f850d15be3b3cbdaba59fe7fc (diff)
Only expose streams mapped to audiopaths on configure() cb
When the configure() callback occurs for each audiopath, we only want those streams that are mapped to the given audiopath to be exposed to the audiopath. E.g. only streams mapped to loopback should be propagated to loopback via configure() callback, rather than all streams. Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
Diffstat (limited to 'sound/avirt.h')
-rw-r--r--sound/avirt.h48
1 files changed, 16 insertions, 32 deletions
diff --git a/sound/avirt.h b/sound/avirt.h
index b077bbc..55db1eb 100644
--- a/sound/avirt.h
+++ b/sound/avirt.h
@@ -17,23 +17,24 @@
#define MAX_STREAMS 16
#define MAX_NAME_LEN 80
-#define DINFO(logname, fmt, args...) \
+#define DINFO(logname, fmt, args...) \
snd_printk(KERN_INFO "AVIRT: %s: " fmt "\n", logname, ##args)
-#define DERROR(logname, fmt, args...) \
+#define DERROR(logname, fmt, args...) \
snd_printk(KERN_ERR "AVIRT: %s: " fmt "\n", logname, ##args)
-#define DDEBUG(logname, fmt, args...) \
+#define DDEBUG(logname, fmt, args...) \
snd_printk(KERN_DEBUG "AVIRT: %s: " fmt "\n", logname, ##args)
+struct snd_avirt_stream_array; /* Forward declaration */
+
/**
* AVIRT Audio Path configure function type
* Each Audio Path registers this at snd_avirt_audiopath_register time.
* It is then called by the core once AVIRT has been configured
*/
-typedef int (*snd_avirt_audiopath_configure)(struct snd_card *card,
- struct config_group *stream_group,
- unsigned int stream_count);
+typedef int (*snd_avirt_audiopath_configure)(
+ struct snd_card *card, struct snd_avirt_stream_array *stream_array);
/**
* AVIRT Audio Path info
@@ -49,7 +50,7 @@ struct snd_avirt_audiopath {
void *context;
};
-/*
+/**
* Audio stream configuration
*/
struct snd_avirt_stream {
@@ -63,6 +64,14 @@ struct snd_avirt_stream {
};
/**
+ * Audio stream group
+ */
+struct snd_avirt_stream_array {
+ struct snd_avirt_stream *streams[MAX_STREAMS];
+ int count;
+};
+
+/**
* snd_avirt_audiopath_register - register Audio Path with AVIRT
* @audiopath: Audio Path to be registered
* @return: 0 on success or error code otherwise
@@ -77,31 +86,6 @@ int snd_avirt_audiopath_register(struct snd_avirt_audiopath *audiopath);
int snd_avirt_audiopath_deregister(struct snd_avirt_audiopath *audiopath);
/**
- * snd_avirt_audiopath_get - retrieves the Audio Path by it's UID
- * @uid: Unique ID for the Audio Path
- * @return: Corresponding Audio Path
- */
-struct snd_avirt_audiopath *snd_avirt_audiopath_get(const char *uid);
-
-/**
- * snd_avirt_stream_count - get the stream count for the given direction
- * @direction: The direction to get the stream count for
- * @return: The stream count
- */
-int snd_avirt_stream_count(unsigned int direction);
-
-/**
- * snd_avirt_stream_from_config_item - Convert config_item to a snd_avirt_stream
- * @item: The config_item to convert from
- * @return: The item's snd_avirt_stream if successful, NULL otherwise
- */
-static inline struct snd_avirt_stream *
- snd_avirt_stream_from_config_item(struct config_item *item)
-{
- return item ? container_of(item, struct snd_avirt_stream, item) : NULL;
-}
-
-/**
* snd_avirt_pcm_period_elapsed - PCM buffer complete callback
* @substream: pointer to ALSA PCM substream
*