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];
28 struct gb_audio_manager_module {
30 struct list_head list;
32 struct gb_audio_manager_module_descriptor desc;
36 * Creates a new gb_audio_manager_module_descriptor, using the specified
39 * Returns a negative result on error, or the id of the newly created module.
42 int gb_audio_manager_add(struct gb_audio_manager_module_descriptor *desc);
45 * Removes a connected gb_audio_manager_module_descriptor for the specified ID.
47 * Returns zero on success, or a negative value on error.
49 int gb_audio_manager_remove(int id);
52 * Removes all connected gb_audio_modules
54 * Returns zero on success, or a negative value on error.
56 void gb_audio_manager_remove_all(void);
59 * Retrieves a gb_audio_manager_module_descriptor for the specified id.
60 * Returns the gb_audio_manager_module_descriptor structure,
61 * or NULL if there is no module with the specified ID.
63 struct gb_audio_manager_module *gb_audio_manager_get_module(int id);
66 * Decreases the refcount of the module, obtained by the get function.
67 * Modules are removed via gb_audio_manager_remove
69 void gb_audio_manager_put_module(struct gb_audio_manager_module *module);
72 * Dumps the module for the specified id
75 int gb_audio_manager_dump_module(int id);
78 * Dumps all connected modules
80 void gb_audio_manager_dump_all(void);
82 #endif /* _GB_AUDIO_MANAGER_H_ */