4 * Copyright 2015-2016 Google Inc.
6 * Released under the GPLv2 only.
9 #ifndef _GB_AUDIO_MANAGER_H_
10 #define _GB_AUDIO_MANAGER_H_
12 #include <linux/kobject.h>
13 #include <linux/list.h>
15 #define GB_AUDIO_MANAGER_NAME "gb_audio_manager"
16 #define GB_AUDIO_MANAGER_MODULE_NAME_LEN 64
17 #define GB_AUDIO_MANAGER_MODULE_NAME_LEN_SSCANF "63"
19 struct gb_audio_manager_module_descriptor {
20 char name[GB_AUDIO_MANAGER_MODULE_NAME_LEN];
25 unsigned int ip_devices;
26 unsigned int op_devices;
29 struct gb_audio_manager_module {
31 struct list_head list;
33 struct gb_audio_manager_module_descriptor desc;
37 * Creates a new gb_audio_manager_module_descriptor, using the specified
40 * Returns a negative result on error, or the id of the newly created module.
43 int gb_audio_manager_add(struct gb_audio_manager_module_descriptor *desc);
46 * Removes a connected gb_audio_manager_module_descriptor for the specified ID.
48 * Returns zero on success, or a negative value on error.
50 int gb_audio_manager_remove(int id);
53 * Removes all connected gb_audio_modules
55 * Returns zero on success, or a negative value on error.
57 void gb_audio_manager_remove_all(void);
60 * Retrieves a gb_audio_manager_module_descriptor for the specified id.
61 * Returns the gb_audio_manager_module_descriptor structure,
62 * or NULL if there is no module with the specified ID.
64 struct gb_audio_manager_module *gb_audio_manager_get_module(int id);
67 * Decreases the refcount of the module, obtained by the get function.
68 * Modules are removed via gb_audio_manager_remove
70 void gb_audio_manager_put_module(struct gb_audio_manager_module *module);
73 * Dumps the module for the specified id
76 int gb_audio_manager_dump_module(int id);
79 * Dumps all connected modules
81 void gb_audio_manager_dump_all(void);
83 #endif /* _GB_AUDIO_MANAGER_H_ */