From d8ff159e37cb3768358b350b2dc80118d81d4b2c Mon Sep 17 00:00:00 2001 From: Mark Farrugia Date: Thu, 25 Oct 2018 16:13:19 +1100 Subject: Refactor core_internal.h to core.h Signed-off-by: Mark Farrugia --- alsa-pcm.c | 2 +- configfs.c | 4 ++-- core.c | 2 +- core.h | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ core_internal.h | 67 --------------------------------------------------------- 5 files changed, 71 insertions(+), 71 deletions(-) create mode 100644 core.h delete mode 100644 core_internal.h diff --git a/alsa-pcm.c b/alsa-pcm.c index f174ef0..4d7b549 100644 --- a/alsa-pcm.c +++ b/alsa-pcm.c @@ -7,7 +7,7 @@ * alsa-pcm.c - AVIRT PCM interface */ -#include "core_internal.h" +#include "core.h" #define D_LOGNAME "pcm" diff --git a/configfs.c b/configfs.c index 49eaa78..1a7e7c5 100644 --- a/configfs.c +++ b/configfs.c @@ -9,7 +9,7 @@ #include -#include "core_internal.h" +#include "core.h" #define D_LOGNAME "configfs" @@ -105,7 +105,7 @@ static struct config_item_type cfg_avirt_stream_type = { }; static struct config_item * -cfg_avirt_stream_make_item(struct config_group *group, const char *name) + cfg_avirt_stream_make_item(struct config_group *group, const char *name) { char *split; int direction; diff --git a/core.c b/core.c index 6509b55..08381e5 100644 --- a/core.c +++ b/core.c @@ -12,7 +12,7 @@ #include #include -#include "core_internal.h" +#include "core.h" MODULE_AUTHOR("James O'Shannessy "); MODULE_AUTHOR("Mark Farrugia "); diff --git a/core.h b/core.h new file mode 100644 index 0000000..ca47067 --- /dev/null +++ b/core.h @@ -0,0 +1,67 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * AVIRT - ALSA Virtual Soundcard + * + * Copyright (c) 2010-2018 Fiberdyne Systems Pty Ltd + * + * core.h - AVIRT internal header + */ + +#ifndef __SOUND_AVIRT_CORE_H +#define __SOUND_AVIRT_CORE_H + +#include + +#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; + bool streams_sealed; +}; + +/** + * __avirt_configfs_init - Initialise the configfs system + * @core: The avirt_core pointer + * @return: 0 on success, negative ERRNO on failure + */ +int __init __avirt_configfs_init(struct avirt_core *core); + +/** + * __avirt_configfs_exit - Clean up and exit the configfs system + * @core: The avirt_core pointer + */ +void __exit __avirt_configfs_exit(struct avirt_core *core); + +/** + * __avirt_streams_seal - Register the sound card to user space + * @return: 0 on success, negative ERRNO on failure + */ +int __avirt_streams_seal(void); + +/** + * __avirt_streams_sealed - Check whether the streams have been sealed or not + * @return: true if sealed, false otherwise + */ +bool __avirt_streams_sealed(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 /* __SOUND_AVIRT_CORE_H */ diff --git a/core_internal.h b/core_internal.h deleted file mode 100644 index f3fcb48..0000000 --- a/core_internal.h +++ /dev/null @@ -1,67 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * AVIRT - ALSA Virtual Soundcard - * - * Copyright (c) 2010-2018 Fiberdyne Systems Pty Ltd - * - * core_internal.h - AVIRT internal header - */ - -#ifndef __SOUND_AVIRT_CORE_H -#define __SOUND_AVIRT_CORE_H - -#include - -#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; - bool streams_sealed; -}; - -/** - * __avirt_configfs_init - Initialise the configfs system - * @core: The avirt_core pointer - * @return: 0 on success, negative ERRNO on failure - */ -int __init __avirt_configfs_init(struct avirt_core *core); - -/** - * __avirt_configfs_exit - Clean up and exit the configfs system - * @core: The avirt_core pointer - */ -void __exit __avirt_configfs_exit(struct avirt_core *core); - -/** - * __avirt_streams_seal - Register the sound card to user space - * @return: 0 on success, negative ERRNO on failure - */ -int __avirt_streams_seal(void); - -/** - * __avirt_streams_sealed - Check whether the streams have been sealed or not - * @return: true if sealed, false otherwise - */ -bool __avirt_streams_sealed(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 /* __SOUND_AVIRT_CORE_H */ -- cgit 1.2.3-korg