aboutsummaryrefslogtreecommitdiffstats
path: root/include/sound/core.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/sound/core.h')
-rw-r--r--include/sound/core.h62
1 files changed, 15 insertions, 47 deletions
diff --git a/include/sound/core.h b/include/sound/core.h
index 3dea79829acc..a61499c22b0b 100644
--- a/include/sound/core.h
+++ b/include/sound/core.h
@@ -93,15 +93,6 @@ struct snd_device {
93 93
94#define snd_device(n) list_entry(n, struct snd_device, list) 94#define snd_device(n) list_entry(n, struct snd_device, list)
95 95
96/* monitor files for graceful shutdown (hotplug) */
97
98struct snd_monitor_file {
99 struct file *file;
100 const struct file_operations *disconnected_f_op;
101 struct list_head shutdown_list; /* still need to shutdown */
102 struct list_head list; /* link of monitor files */
103};
104
105/* main structure for soundcard */ 96/* main structure for soundcard */
106 97
107struct snd_card { 98struct snd_card {
@@ -300,19 +291,10 @@ int snd_card_create(int idx, const char *id,
300 struct module *module, int extra_size, 291 struct module *module, int extra_size,
301 struct snd_card **card_ret); 292 struct snd_card **card_ret);
302 293
303static inline __deprecated
304struct snd_card *snd_card_new(int idx, const char *id,
305 struct module *module, int extra_size)
306{
307 struct snd_card *card;
308 if (snd_card_create(idx, id, module, extra_size, &card) < 0)
309 return NULL;
310 return card;
311}
312
313int snd_card_disconnect(struct snd_card *card); 294int snd_card_disconnect(struct snd_card *card);
314int snd_card_free(struct snd_card *card); 295int snd_card_free(struct snd_card *card);
315int snd_card_free_when_closed(struct snd_card *card); 296int snd_card_free_when_closed(struct snd_card *card);
297void snd_card_set_id(struct snd_card *card, const char *id);
316int snd_card_register(struct snd_card *card); 298int snd_card_register(struct snd_card *card);
317int snd_card_info_init(void); 299int snd_card_info_init(void);
318int snd_card_info_done(void); 300int snd_card_info_done(void);
@@ -320,9 +302,7 @@ int snd_component_add(struct snd_card *card, const char *component);
320int snd_card_file_add(struct snd_card *card, struct file *file); 302int snd_card_file_add(struct snd_card *card, struct file *file);
321int snd_card_file_remove(struct snd_card *card, struct file *file); 303int snd_card_file_remove(struct snd_card *card, struct file *file);
322 304
323#ifndef snd_card_set_dev
324#define snd_card_set_dev(card, devptr) ((card)->dev = (devptr)) 305#define snd_card_set_dev(card, devptr) ((card)->dev = (devptr))
325#endif
326 306
327/* device.c */ 307/* device.c */
328 308
@@ -349,18 +329,17 @@ unsigned int snd_dma_pointer(unsigned long dma, unsigned int size);
349struct resource; 329struct resource;
350void release_and_free_resource(struct resource *res); 330void release_and_free_resource(struct resource *res);
351 331
352#ifdef CONFIG_SND_VERBOSE_PRINTK
353void snd_verbose_printk(const char *file, int line, const char *format, ...)
354 __attribute__ ((format (printf, 3, 4)));
355#endif
356#if defined(CONFIG_SND_DEBUG) && defined(CONFIG_SND_VERBOSE_PRINTK)
357void snd_verbose_printd(const char *file, int line, const char *format, ...)
358 __attribute__ ((format (printf, 3, 4)));
359#endif
360
361/* --- */ 332/* --- */
362 333
363#ifdef CONFIG_SND_VERBOSE_PRINTK 334#if defined(CONFIG_SND_DEBUG) || defined(CONFIG_SND_VERBOSE_PRINTK)
335void __snd_printk(unsigned int level, const char *file, int line,
336 const char *format, ...)
337 __attribute__ ((format (printf, 4, 5)));
338#else
339#define __snd_printk(level, file, line, format, args...) \
340 printk(format, ##args)
341#endif
342
364/** 343/**
365 * snd_printk - printk wrapper 344 * snd_printk - printk wrapper
366 * @fmt: format string 345 * @fmt: format string
@@ -369,15 +348,9 @@ void snd_verbose_printd(const char *file, int line, const char *format, ...)
369 * when configured with CONFIG_SND_VERBOSE_PRINTK. 348 * when configured with CONFIG_SND_VERBOSE_PRINTK.
370 */ 349 */
371#define snd_printk(fmt, args...) \ 350#define snd_printk(fmt, args...) \
372 snd_verbose_printk(__FILE__, __LINE__, fmt ,##args) 351 __snd_printk(0, __FILE__, __LINE__, fmt, ##args)
373#else
374#define snd_printk(fmt, args...) \
375 printk(fmt ,##args)
376#endif
377 352
378#ifdef CONFIG_SND_DEBUG 353#ifdef CONFIG_SND_DEBUG
379
380#ifdef CONFIG_SND_VERBOSE_PRINTK
381/** 354/**
382 * snd_printd - debug printk 355 * snd_printd - debug printk
383 * @fmt: format string 356 * @fmt: format string
@@ -386,11 +359,7 @@ void snd_verbose_printd(const char *file, int line, const char *format, ...)
386 * Ignored when CONFIG_SND_DEBUG is not set. 359 * Ignored when CONFIG_SND_DEBUG is not set.
387 */ 360 */
388#define snd_printd(fmt, args...) \ 361#define snd_printd(fmt, args...) \
389 snd_verbose_printd(__FILE__, __LINE__, fmt ,##args) 362 __snd_printk(1, __FILE__, __LINE__, fmt, ##args)
390#else
391#define snd_printd(fmt, args...) \
392 printk(fmt ,##args)
393#endif
394 363
395/** 364/**
396 * snd_BUG - give a BUG warning message and stack trace 365 * snd_BUG - give a BUG warning message and stack trace
@@ -437,9 +406,10 @@ static inline int __snd_bug_on(int cond)
437 * Works like snd_printk() for debugging purposes. 406 * Works like snd_printk() for debugging purposes.
438 * Ignored when CONFIG_SND_DEBUG_VERBOSE is not set. 407 * Ignored when CONFIG_SND_DEBUG_VERBOSE is not set.
439 */ 408 */
440#define snd_printdd(format, args...) snd_printk(format, ##args) 409#define snd_printdd(format, args...) \
410 __snd_printk(2, __FILE__, __LINE__, format, ##args)
441#else 411#else
442#define snd_printdd(format, args...) /* nothing */ 412#define snd_printdd(format, args...) do { } while (0)
443#endif 413#endif
444 414
445 415
@@ -447,12 +417,10 @@ static inline int __snd_bug_on(int cond)
447 417
448/* for easier backward-porting */ 418/* for easier backward-porting */
449#if defined(CONFIG_GAMEPORT) || defined(CONFIG_GAMEPORT_MODULE) 419#if defined(CONFIG_GAMEPORT) || defined(CONFIG_GAMEPORT_MODULE)
450#ifndef gameport_set_dev_parent
451#define gameport_set_dev_parent(gp,xdev) ((gp)->dev.parent = (xdev)) 420#define gameport_set_dev_parent(gp,xdev) ((gp)->dev.parent = (xdev))
452#define gameport_set_port_data(gp,r) ((gp)->port_data = (r)) 421#define gameport_set_port_data(gp,r) ((gp)->port_data = (r))
453#define gameport_get_port_data(gp) (gp)->port_data 422#define gameport_get_port_data(gp) (gp)->port_data
454#endif 423#endif
455#endif
456 424
457/* PCI quirk list helper */ 425/* PCI quirk list helper */
458struct snd_pci_quirk { 426struct snd_pci_quirk {