diff options
Diffstat (limited to 'include/sound/core.h')
-rw-r--r-- | include/sound/core.h | 44 |
1 files changed, 9 insertions, 35 deletions
diff --git a/include/sound/core.h b/include/sound/core.h index 1df3f2fe5350..da5748289968 100644 --- a/include/sound/core.h +++ b/include/sound/core.h | |||
@@ -109,6 +109,7 @@ struct snd_card { | |||
109 | private data */ | 109 | private data */ |
110 | struct list_head devices; /* devices */ | 110 | struct list_head devices; /* devices */ |
111 | 111 | ||
112 | struct device ctl_dev; /* control device */ | ||
112 | unsigned int last_numid; /* last used numeric ID */ | 113 | unsigned int last_numid; /* last used numeric ID */ |
113 | struct rw_semaphore controls_rwsem; /* controls list lock */ | 114 | struct rw_semaphore controls_rwsem; /* controls list lock */ |
114 | rwlock_t ctl_files_rwlock; /* ctl_files list lock */ | 115 | rwlock_t ctl_files_rwlock; /* ctl_files list lock */ |
@@ -131,6 +132,7 @@ struct snd_card { | |||
131 | struct completion *release_completion; | 132 | struct completion *release_completion; |
132 | struct device *dev; /* device assigned to this card */ | 133 | struct device *dev; /* device assigned to this card */ |
133 | struct device card_dev; /* cardX object for sysfs */ | 134 | struct device card_dev; /* cardX object for sysfs */ |
135 | const struct attribute_group *dev_groups[4]; /* assigned sysfs attr */ | ||
134 | bool registered; /* card_dev is registered? */ | 136 | bool registered; /* card_dev is registered? */ |
135 | 137 | ||
136 | #ifdef CONFIG_PM | 138 | #ifdef CONFIG_PM |
@@ -206,43 +208,13 @@ extern struct class *sound_class; | |||
206 | 208 | ||
207 | void snd_request_card(int card); | 209 | void snd_request_card(int card); |
208 | 210 | ||
209 | int snd_register_device_for_dev(int type, struct snd_card *card, | 211 | void snd_device_initialize(struct device *dev, struct snd_card *card); |
210 | int dev, | ||
211 | const struct file_operations *f_ops, | ||
212 | void *private_data, | ||
213 | const char *name, | ||
214 | struct device *device); | ||
215 | 212 | ||
216 | /** | 213 | int snd_register_device(int type, struct snd_card *card, int dev, |
217 | * snd_register_device - Register the ALSA device file for the card | 214 | const struct file_operations *f_ops, |
218 | * @type: the device type, SNDRV_DEVICE_TYPE_XXX | 215 | void *private_data, struct device *device); |
219 | * @card: the card instance | 216 | int snd_unregister_device(struct device *dev); |
220 | * @dev: the device index | ||
221 | * @f_ops: the file operations | ||
222 | * @private_data: user pointer for f_ops->open() | ||
223 | * @name: the device file name | ||
224 | * | ||
225 | * Registers an ALSA device file for the given card. | ||
226 | * The operators have to be set in reg parameter. | ||
227 | * | ||
228 | * This function uses the card's device pointer to link to the | ||
229 | * correct &struct device. | ||
230 | * | ||
231 | * Return: Zero if successful, or a negative error code on failure. | ||
232 | */ | ||
233 | static inline int snd_register_device(int type, struct snd_card *card, int dev, | ||
234 | const struct file_operations *f_ops, | ||
235 | void *private_data, | ||
236 | const char *name) | ||
237 | { | ||
238 | return snd_register_device_for_dev(type, card, dev, f_ops, | ||
239 | private_data, name, | ||
240 | snd_card_get_device_link(card)); | ||
241 | } | ||
242 | |||
243 | int snd_unregister_device(int type, struct snd_card *card, int dev); | ||
244 | void *snd_lookup_minor_data(unsigned int minor, int type); | 217 | void *snd_lookup_minor_data(unsigned int minor, int type); |
245 | struct device *snd_get_device(int type, struct snd_card *card, int dev); | ||
246 | 218 | ||
247 | #ifdef CONFIG_SND_OSSEMUL | 219 | #ifdef CONFIG_SND_OSSEMUL |
248 | int snd_register_oss_device(int type, struct snd_card *card, int dev, | 220 | int snd_register_oss_device(int type, struct snd_card *card, int dev, |
@@ -291,6 +263,8 @@ void snd_card_set_id(struct snd_card *card, const char *id); | |||
291 | int snd_card_register(struct snd_card *card); | 263 | int snd_card_register(struct snd_card *card); |
292 | int snd_card_info_init(void); | 264 | int snd_card_info_init(void); |
293 | int snd_card_info_done(void); | 265 | int snd_card_info_done(void); |
266 | int snd_card_add_dev_attr(struct snd_card *card, | ||
267 | const struct attribute_group *group); | ||
294 | int snd_component_add(struct snd_card *card, const char *component); | 268 | int snd_component_add(struct snd_card *card, const char *component); |
295 | int snd_card_file_add(struct snd_card *card, struct file *file); | 269 | int snd_card_file_add(struct snd_card *card, struct file *file); |
296 | int snd_card_file_remove(struct snd_card *card, struct file *file); | 270 | int snd_card_file_remove(struct snd_card *card, struct file *file); |