aboutsummaryrefslogtreecommitdiffstats
path: root/core.c
diff options
context:
space:
mode:
Diffstat (limited to 'core.c')
-rw-r--r--core.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/core.c b/core.c
index fd74b08..e1b056e 100644
--- a/core.c
+++ b/core.c
@@ -266,6 +266,28 @@ int snd_avirt_audiopath_deregister(struct snd_avirt_audiopath *audiopath)
EXPORT_SYMBOL_GPL(snd_avirt_audiopath_deregister);
/**
+ * snd_avirt_route_create - Create audio route
+ * @name: The name designated to the audio route
+ * @direction: The PCM direction (SNDRV_PCM_STREAM_PLAYBACK or
+ * SNDRV_PCM_STREAM_CAPTURE)
+ * @return: The newly created audio route if successful, or an error pointer
+ */
+struct snd_avirt_route *snd_avirt_route_create(const char *name, int direction)
+{
+ struct snd_avirt_route *route;
+
+ route = kzalloc(sizeof(*route), GFP_KERNEL);
+ if (!route)
+ return ERR_PTR(-ENOMEM);
+
+ strcpy(route->name, name);
+ route->channels = 0;
+ route->direction = direction;
+
+ return route;
+}
+
+/**
* snd_avirt_stream_create - Create audio stream, including it's ALSA PCM device
* @name: The name designated to the audio stream
* @direction: The PCM direction (SNDRV_PCM_STREAM_PLAYBACK or