aboutsummaryrefslogtreecommitdiffstats
path: root/sound/avirt.h
diff options
context:
space:
mode:
Diffstat (limited to 'sound/avirt.h')
-rw-r--r--sound/avirt.h54
1 files changed, 43 insertions, 11 deletions
diff --git a/sound/avirt.h b/sound/avirt.h
index 0ebac86..138d0ca 100644
--- a/sound/avirt.h
+++ b/sound/avirt.h
@@ -3,7 +3,7 @@
* AVIRT - ALSA Virtual Soundcard
*
* Copyright (c) 2010-2018 Fiberdyne Systems Pty Ltd
- *
+ *
* avirt.h - AVIRT system-level header
*/
@@ -36,9 +36,12 @@ struct snd_avirt_stream_array; /* Forward declaration */
typedef int (*snd_avirt_audiopath_configure)(
struct snd_card *card, struct snd_avirt_stream_array *stream_array);
+typedef void (*snd_avirt_pcm_exttrigger)(void);
+
/**
* AVIRT Audio Path info
*/
+typedef struct snd_avirt_audiopath snd_avirt_audiopath;
struct snd_avirt_audiopath {
const char *uid; /* Unique identifier */
const char *name; /* Pretty name */
@@ -47,8 +50,24 @@ struct snd_avirt_audiopath {
const struct snd_pcm_ops *pcm_playback_ops; /* ALSA PCM playback ops */
const struct snd_pcm_ops *pcm_capture_ops; /* ALSA PCM capture ops */
snd_avirt_audiopath_configure configure; /* Config callback function */
-
+ snd_avirt_pcm_exttrigger pcm_exttrigger;
void *context;
+
+ // MUST be at the end
+ struct snd_avirt_audiopath *route_from_ap;
+ struct snd_avirt_audiopath *route_to_ap;
+};
+
+/**
+ * Audio routing
+ */
+struct snd_avirt_route {
+ char name[MAX_NAME_LEN];
+ unsigned int channels;
+ unsigned int direction;
+ struct snd_avirt_audiopath *from_ap;
+ struct snd_avirt_audiopath *to_ap;
+ struct config_item item;
};
/**
@@ -61,25 +80,31 @@ struct snd_avirt_stream {
unsigned int device; /* Stream PCM device no. */
unsigned int direction; /* Stream direction */
struct snd_pcm *pcm; /* ALSA PCM */
+ struct snd_pcm_ops *pcm_ops; /* ALSA PCM ops */
struct config_item item; /* configfs item reference */
};
/**
+ * Audio stream group
+ */
+struct snd_avirt_stream_array {
+ struct snd_avirt_stream *streams[MAX_STREAMS];
+ int count;
+};
+
+/**
+ * snd_avirt_private_free - free Audio Path private data from function prototype
+ * @pcm: The PCM object
+ */
+typedef void (*snd_avirt_ap_private_free)(struct snd_pcm *pcm);
+/**
* Private Data Expansion
*/
struct snd_avirt_private_data {
struct snd_avirt_audiopath *audiopath;
void *ap_private_data;
- void (*ap_private_free)(struct snd_pcm *pcm);
-};
-
-/**
- * Audio stream group
- */
-struct snd_avirt_stream_array {
- struct snd_avirt_stream *streams[MAX_STREAMS];
- int count;
+ snd_avirt_ap_private_free ap_private_free;
};
/**
@@ -97,6 +122,13 @@ int snd_avirt_audiopath_register(struct snd_avirt_audiopath *audiopath);
int snd_avirt_audiopath_deregister(struct snd_avirt_audiopath *audiopath);
/**
+ * snd_avirt_audiopath_get - get Audio Path by it's UID
+ * @uid: The Audio Path UID to get
+ * @return: The Audio Path if it exists, NULL otherwise.
+ */
+struct snd_avirt_audiopath *snd_avirt_audiopath_get(const char *uid);
+
+/**
* snd_avirt_pcm_period_elapsed - PCM buffer complete callback
* @substream: pointer to ALSA PCM substream
*