summaryrefslogtreecommitdiffstats
path: root/core_internal.h
diff options
context:
space:
mode:
authorMark Farrugia <mark.farrugia@fiberdyne.com.au>2018-10-01 17:43:39 +1000
committerMark Farrugia <mark.farrugia@fiberdyne.com.au>2018-10-26 17:27:35 +1100
commit3247d61d378afd8fc76f1e9182e5691bd538ab3f (patch)
tree02485f2a47d8df1c5dbaa11007d6439bac0951e0 /core_internal.h
parent6c5c0d66a792ecbbf92538a7822b62a36710a341 (diff)
Add configfs interface, revamp stream grouping
Add additional callbacks for audio path configuring, after card has been sealed. Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
Diffstat (limited to 'core_internal.h')
-rw-r--r--core_internal.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/core_internal.h b/core_internal.h
new file mode 100644
index 0000000..3639d6e
--- /dev/null
+++ b/core_internal.h
@@ -0,0 +1,50 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * ALSA Virtual Soundcard
+ *
+ * core.h - Internal header for virtual ALSA card
+ *
+ * Copyright (C) 2010-2018 Fiberdyne Systems Pty Ltd
+ */
+
+#ifndef __AVIRT_CORE_INTERNAL_H__
+#define __AVIRT_CORE_INTERNAL_H__
+
+#include <avirt/core.h>
+
+#include "utils.h"
+
+struct avirt_core {
+ struct snd_card *card;
+ struct device *dev;
+ struct class *avirt_class;
+ struct config_group *stream_group;
+ unsigned int stream_count;
+};
+
+int __init __avirt_configfs_init(struct avirt_core *core);
+void __exit __avirt_configfs_exit(struct avirt_core *core);
+
+/**
+ * __avirt_card_register - Register the sound card to user space
+ * @return: 0 on success, negative ERRNO on failure
+ */
+int __avirt_card_register(void);
+
+/**
+ * __avirt_stream_find_by_device - Get audio stream from device number
+ * @device: The PCM device number corresponding to the desired stream
+ * @return: The audio stream if found, or an error pointer otherwise
+ */
+struct avirt_stream *__avirt_stream_find_by_device(unsigned int device);
+
+/**
+ * __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
+ * SNDRV_PCM_STREAM_CAPTURE)
+ * @return: The newly created audio stream if successful, or an error pointer
+ */
+struct avirt_stream *__avirt_stream_create(const char *name, int direction);
+
+#endif // __AVIRT_CORE_INTERNAL_H__