aboutsummaryrefslogtreecommitdiffstats
path: root/include/sound
diff options
context:
space:
mode:
Diffstat (limited to 'include/sound')
-rw-r--r--include/sound/control.h52
-rw-r--r--include/sound/core.h36
-rw-r--r--include/sound/hwdep.h38
-rw-r--r--include/sound/jack.h5
-rw-r--r--include/sound/rawmidi.h1
5 files changed, 109 insertions, 23 deletions
diff --git a/include/sound/control.h b/include/sound/control.h
index 4721b4bba053..ef96f07aa03b 100644
--- a/include/sound/control.h
+++ b/include/sound/control.h
@@ -171,6 +171,54 @@ int snd_ctl_boolean_stereo_info(struct snd_kcontrol *kcontrol,
171 */ 171 */
172struct snd_kcontrol *snd_ctl_make_virtual_master(char *name, 172struct snd_kcontrol *snd_ctl_make_virtual_master(char *name,
173 const unsigned int *tlv); 173 const unsigned int *tlv);
174int snd_ctl_add_slave(struct snd_kcontrol *master, struct snd_kcontrol *slave); 174int _snd_ctl_add_slave(struct snd_kcontrol *master, struct snd_kcontrol *slave,
175 175 unsigned int flags);
176/* optional flags for slave */
177#define SND_CTL_SLAVE_NEED_UPDATE (1 << 0)
178
179/**
180 * snd_ctl_add_slave - Add a virtual slave control
181 * @master: vmaster element
182 * @slave: slave element to add
183 *
184 * Add a virtual slave control to the given master element created via
185 * snd_ctl_create_virtual_master() beforehand.
186 * Returns zero if successful or a negative error code.
187 *
188 * All slaves must be the same type (returning the same information
189 * via info callback). The fucntion doesn't check it, so it's your
190 * responsibility.
191 *
192 * Also, some additional limitations:
193 * at most two channels,
194 * logarithmic volume control (dB level) thus no linear volume,
195 * master can only attenuate the volume without gain
196 */
197static inline int
198snd_ctl_add_slave(struct snd_kcontrol *master, struct snd_kcontrol *slave)
199{
200 return _snd_ctl_add_slave(master, slave, 0);
201}
202
203/**
204 * snd_ctl_add_slave_uncached - Add a virtual slave control
205 * @master: vmaster element
206 * @slave: slave element to add
207 *
208 * Add a virtual slave control to the given master.
209 * Unlike snd_ctl_add_slave(), the element added via this function
210 * is supposed to have volatile values, and get callback is called
211 * at each time quried from the master.
212 *
213 * When the control peeks the hardware values directly and the value
214 * can be changed by other means than the put callback of the element,
215 * this function should be used to keep the value always up-to-date.
216 */
217static inline int
218snd_ctl_add_slave_uncached(struct snd_kcontrol *master,
219 struct snd_kcontrol *slave)
220{
221 return _snd_ctl_add_slave(master, slave, SND_CTL_SLAVE_NEED_UPDATE);
222}
223
176#endif /* __SOUND_CONTROL_H */ 224#endif /* __SOUND_CONTROL_H */
diff --git a/include/sound/core.h b/include/sound/core.h
index f632484bc743..3dea79829acc 100644
--- a/include/sound/core.h
+++ b/include/sound/core.h
@@ -97,9 +97,9 @@ struct snd_device {
97 97
98struct snd_monitor_file { 98struct snd_monitor_file {
99 struct file *file; 99 struct file *file;
100 struct snd_monitor_file *next;
101 const struct file_operations *disconnected_f_op; 100 const struct file_operations *disconnected_f_op;
102 struct list_head shutdown_list; 101 struct list_head shutdown_list; /* still need to shutdown */
102 struct list_head list; /* link of monitor files */
103}; 103};
104 104
105/* main structure for soundcard */ 105/* main structure for soundcard */
@@ -134,7 +134,7 @@ struct snd_card {
134 struct snd_info_entry *proc_id; /* the card id */ 134 struct snd_info_entry *proc_id; /* the card id */
135 struct proc_dir_entry *proc_root_link; /* number link to real id */ 135 struct proc_dir_entry *proc_root_link; /* number link to real id */
136 136
137 struct snd_monitor_file *files; /* all files associated to this card */ 137 struct list_head files_list; /* all files associated to this card */
138 struct snd_shutdown_f_ops *s_f_ops; /* file operations in the shutdown 138 struct snd_shutdown_f_ops *s_f_ops; /* file operations in the shutdown
139 state */ 139 state */
140 spinlock_t files_lock; /* lock the files for this card */ 140 spinlock_t files_lock; /* lock the files for this card */
@@ -296,8 +296,20 @@ int snd_card_locked(int card);
296extern int (*snd_mixer_oss_notify_callback)(struct snd_card *card, int cmd); 296extern int (*snd_mixer_oss_notify_callback)(struct snd_card *card, int cmd);
297#endif 297#endif
298 298
299int snd_card_create(int idx, const char *id,
300 struct module *module, int extra_size,
301 struct snd_card **card_ret);
302
303static inline __deprecated
299struct snd_card *snd_card_new(int idx, const char *id, 304struct snd_card *snd_card_new(int idx, const char *id,
300 struct module *module, int extra_size); 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
301int snd_card_disconnect(struct snd_card *card); 313int snd_card_disconnect(struct snd_card *card);
302int snd_card_free(struct snd_card *card); 314int snd_card_free(struct snd_card *card);
303int snd_card_free_when_closed(struct snd_card *card); 315int snd_card_free_when_closed(struct snd_card *card);
@@ -446,21 +458,33 @@ static inline int __snd_bug_on(int cond)
446struct snd_pci_quirk { 458struct snd_pci_quirk {
447 unsigned short subvendor; /* PCI subvendor ID */ 459 unsigned short subvendor; /* PCI subvendor ID */
448 unsigned short subdevice; /* PCI subdevice ID */ 460 unsigned short subdevice; /* PCI subdevice ID */
461 unsigned short subdevice_mask; /* bitmask to match */
449 int value; /* value */ 462 int value; /* value */
450#ifdef CONFIG_SND_DEBUG_VERBOSE 463#ifdef CONFIG_SND_DEBUG_VERBOSE
451 const char *name; /* name of the device (optional) */ 464 const char *name; /* name of the device (optional) */
452#endif 465#endif
453}; 466};
454 467
455#define _SND_PCI_QUIRK_ID(vend,dev) \ 468#define _SND_PCI_QUIRK_ID_MASK(vend, mask, dev) \
456 .subvendor = (vend), .subdevice = (dev) 469 .subvendor = (vend), .subdevice = (dev), .subdevice_mask = (mask)
470#define _SND_PCI_QUIRK_ID(vend, dev) \
471 _SND_PCI_QUIRK_ID_MASK(vend, 0xffff, dev)
457#define SND_PCI_QUIRK_ID(vend,dev) {_SND_PCI_QUIRK_ID(vend, dev)} 472#define SND_PCI_QUIRK_ID(vend,dev) {_SND_PCI_QUIRK_ID(vend, dev)}
458#ifdef CONFIG_SND_DEBUG_VERBOSE 473#ifdef CONFIG_SND_DEBUG_VERBOSE
459#define SND_PCI_QUIRK(vend,dev,xname,val) \ 474#define SND_PCI_QUIRK(vend,dev,xname,val) \
460 {_SND_PCI_QUIRK_ID(vend, dev), .value = (val), .name = (xname)} 475 {_SND_PCI_QUIRK_ID(vend, dev), .value = (val), .name = (xname)}
476#define SND_PCI_QUIRK_VENDOR(vend, xname, val) \
477 {_SND_PCI_QUIRK_ID_MASK(vend, 0, 0), .value = (val), .name = (xname)}
478#define SND_PCI_QUIRK_MASK(vend, mask, dev, xname, val) \
479 {_SND_PCI_QUIRK_ID_MASK(vend, mask, dev), \
480 .value = (val), .name = (xname)}
461#else 481#else
462#define SND_PCI_QUIRK(vend,dev,xname,val) \ 482#define SND_PCI_QUIRK(vend,dev,xname,val) \
463 {_SND_PCI_QUIRK_ID(vend, dev), .value = (val)} 483 {_SND_PCI_QUIRK_ID(vend, dev), .value = (val)}
484#define SND_PCI_QUIRK_MASK(vend, mask, dev, xname, val) \
485 {_SND_PCI_QUIRK_ID_MASK(vend, mask, dev), .value = (val)}
486#define SND_PCI_QUIRK_VENDOR(vend, xname, val) \
487 {_SND_PCI_QUIRK_ID_MASK(vend, 0, 0), .value = (val)}
464#endif 488#endif
465 489
466const struct snd_pci_quirk * 490const struct snd_pci_quirk *
diff --git a/include/sound/hwdep.h b/include/sound/hwdep.h
index d9eea013c753..8c05e47a4090 100644
--- a/include/sound/hwdep.h
+++ b/include/sound/hwdep.h
@@ -27,18 +27,28 @@
27 27
28struct snd_hwdep; 28struct snd_hwdep;
29 29
30/* hwdep file ops; all ops can be NULL */
30struct snd_hwdep_ops { 31struct snd_hwdep_ops {
31 long long (*llseek) (struct snd_hwdep *hw, struct file * file, long long offset, int orig); 32 long long (*llseek)(struct snd_hwdep *hw, struct file *file,
32 long (*read) (struct snd_hwdep *hw, char __user *buf, long count, loff_t *offset); 33 long long offset, int orig);
33 long (*write) (struct snd_hwdep *hw, const char __user *buf, long count, loff_t *offset); 34 long (*read)(struct snd_hwdep *hw, char __user *buf,
34 int (*open) (struct snd_hwdep * hw, struct file * file); 35 long count, loff_t *offset);
35 int (*release) (struct snd_hwdep *hw, struct file * file); 36 long (*write)(struct snd_hwdep *hw, const char __user *buf,
36 unsigned int (*poll) (struct snd_hwdep *hw, struct file * file, poll_table * wait); 37 long count, loff_t *offset);
37 int (*ioctl) (struct snd_hwdep *hw, struct file * file, unsigned int cmd, unsigned long arg); 38 int (*open)(struct snd_hwdep *hw, struct file * file);
38 int (*ioctl_compat) (struct snd_hwdep *hw, struct file * file, unsigned int cmd, unsigned long arg); 39 int (*release)(struct snd_hwdep *hw, struct file * file);
39 int (*mmap) (struct snd_hwdep *hw, struct file * file, struct vm_area_struct * vma); 40 unsigned int (*poll)(struct snd_hwdep *hw, struct file *file,
40 int (*dsp_status) (struct snd_hwdep *hw, struct snd_hwdep_dsp_status *status); 41 poll_table *wait);
41 int (*dsp_load) (struct snd_hwdep *hw, struct snd_hwdep_dsp_image *image); 42 int (*ioctl)(struct snd_hwdep *hw, struct file *file,
43 unsigned int cmd, unsigned long arg);
44 int (*ioctl_compat)(struct snd_hwdep *hw, struct file *file,
45 unsigned int cmd, unsigned long arg);
46 int (*mmap)(struct snd_hwdep *hw, struct file *file,
47 struct vm_area_struct *vma);
48 int (*dsp_status)(struct snd_hwdep *hw,
49 struct snd_hwdep_dsp_status *status);
50 int (*dsp_load)(struct snd_hwdep *hw,
51 struct snd_hwdep_dsp_image *image);
42}; 52};
43 53
44struct snd_hwdep { 54struct snd_hwdep {
@@ -61,9 +71,9 @@ struct snd_hwdep {
61 void (*private_free) (struct snd_hwdep *hwdep); 71 void (*private_free) (struct snd_hwdep *hwdep);
62 72
63 struct mutex open_mutex; 73 struct mutex open_mutex;
64 int used; 74 int used; /* reference counter */
65 unsigned int dsp_loaded; 75 unsigned int dsp_loaded; /* bit fields of loaded dsp indices */
66 unsigned int exclusive: 1; 76 unsigned int exclusive:1; /* exclusive access mode */
67}; 77};
68 78
69extern int snd_hwdep_new(struct snd_card *card, char *id, int device, 79extern int snd_hwdep_new(struct snd_card *card, char *id, int device,
diff --git a/include/sound/jack.h b/include/sound/jack.h
index 2e0315cdd0d6..6b013c6f6a04 100644
--- a/include/sound/jack.h
+++ b/include/sound/jack.h
@@ -30,6 +30,9 @@ struct input_dev;
30/** 30/**
31 * Jack types which can be reported. These values are used as a 31 * Jack types which can be reported. These values are used as a
32 * bitmask. 32 * bitmask.
33 *
34 * Note that this must be kept in sync with the lookup table in
35 * sound/core/jack.c.
33 */ 36 */
34enum snd_jack_types { 37enum snd_jack_types {
35 SND_JACK_HEADPHONE = 0x0001, 38 SND_JACK_HEADPHONE = 0x0001,
@@ -37,6 +40,8 @@ enum snd_jack_types {
37 SND_JACK_HEADSET = SND_JACK_HEADPHONE | SND_JACK_MICROPHONE, 40 SND_JACK_HEADSET = SND_JACK_HEADPHONE | SND_JACK_MICROPHONE,
38 SND_JACK_LINEOUT = 0x0004, 41 SND_JACK_LINEOUT = 0x0004,
39 SND_JACK_MECHANICAL = 0x0008, /* If detected separately */ 42 SND_JACK_MECHANICAL = 0x0008, /* If detected separately */
43 SND_JACK_VIDEOOUT = 0x0010,
44 SND_JACK_AVOUT = SND_JACK_LINEOUT | SND_JACK_VIDEOOUT,
40}; 45};
41 46
42struct snd_jack { 47struct snd_jack {
diff --git a/include/sound/rawmidi.h b/include/sound/rawmidi.h
index b550a416d075..c23c26585700 100644
--- a/include/sound/rawmidi.h
+++ b/include/sound/rawmidi.h
@@ -42,7 +42,6 @@
42#define SNDRV_RAWMIDI_LFLG_INPUT (1<<1) 42#define SNDRV_RAWMIDI_LFLG_INPUT (1<<1)
43#define SNDRV_RAWMIDI_LFLG_OPEN (3<<0) 43#define SNDRV_RAWMIDI_LFLG_OPEN (3<<0)
44#define SNDRV_RAWMIDI_LFLG_APPEND (1<<2) 44#define SNDRV_RAWMIDI_LFLG_APPEND (1<<2)
45#define SNDRV_RAWMIDI_LFLG_NOOPENLOCK (1<<3)
46 45
47struct snd_rawmidi; 46struct snd_rawmidi;
48struct snd_rawmidi_substream; 47struct snd_rawmidi_substream;