diff options
Diffstat (limited to 'core.c')
-rw-r--r-- | core.c | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -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 |