From dda7b36122998602a11462398fc0072c0f418bd5 Mon Sep 17 00:00:00 2001 From: Mark Farrugia Date: Fri, 1 Mar 2019 17:20:29 +1100 Subject: Move sysfs functionality to sysfs.c Signed-off-by: Mark Farrugia --- core.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'core.h') diff --git a/core.h b/core.h index 6dc3333..e83631f 100644 --- a/core.h +++ b/core.h @@ -27,6 +27,12 @@ struct snd_avirt_core { bool streams_sealed; }; +struct snd_avirt_audiopath_obj { + struct kobject kobj; + struct list_head list; + struct snd_avirt_audiopath *path; +}; + /** * snd_avirt_configfs_init - Initialise the configfs system * @core: The snd_avirt_core pointer @@ -40,6 +46,34 @@ int __init snd_avirt_configfs_init(struct snd_avirt_core *core); */ void __exit snd_avirt_configfs_exit(struct snd_avirt_core *core); +/** + * snd_avirt_sysfs_init - Initialise the sysfs system + * @core: The snd_avirt_core pointer + * @return: 0 on success, negative ERRNO on failure + */ +int __init snd_avirt_sysfs_init(struct snd_avirt_core *core); + +/** + * snd_avirt_sysfs_exit - Clean up and exit the sysfs system + * @core: The snd_avirt_core pointer + */ +void __exit snd_avirt_sysfs_exit(struct snd_avirt_core *core); + +/** + * snd_avirt_audiopath_obj - creates an Audio Path object, assigns the kset + * and registers it with sysfs. + * @uid: Unique ID of the Audio Path + * @return: Pointer to the Audio Path object or NULL if it failed. + */ +struct snd_avirt_audiopath_obj *snd_avirt_audiopath_create_obj(const char *uid); + +/** + * snd_avirt_audiopath_destroy_obj - destroys an Audio Path object, deregisters + * it with sysfs + * @name: the Audio Path object + */ +void snd_avirt_audiopath_destroy_obj(struct snd_avirt_audiopath_obj *p); + /** * snd_avirt_streams_seal - Register the sound card to user space * @return: 0 on success, negative ERRNO on failure -- cgit 1.2.3-korg