diff options
Diffstat (limited to 'sound/usb/mixer.h')
-rw-r--r-- | sound/usb/mixer.h | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/sound/usb/mixer.h b/sound/usb/mixer.h index 2478a844a322..0fe87b7c7f00 100644 --- a/sound/usb/mixer.h +++ b/sound/usb/mixer.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef __USBMIXER_H | 1 | #ifndef __USBMIXER_H |
2 | #define __USBMIXER_H | 2 | #define __USBMIXER_H |
3 | 3 | ||
4 | #include <sound/info.h> | ||
5 | |||
4 | struct usb_mixer_interface { | 6 | struct usb_mixer_interface { |
5 | struct snd_usb_audio *chip; | 7 | struct snd_usb_audio *chip; |
6 | struct usb_host_interface *hostif; | 8 | struct usb_host_interface *hostif; |
@@ -8,7 +10,7 @@ struct usb_mixer_interface { | |||
8 | unsigned int ignore_ctl_error; | 10 | unsigned int ignore_ctl_error; |
9 | struct urb *urb; | 11 | struct urb *urb; |
10 | /* array[MAX_ID_ELEMS], indexed by unit id */ | 12 | /* array[MAX_ID_ELEMS], indexed by unit id */ |
11 | struct usb_mixer_elem_info **id_elems; | 13 | struct usb_mixer_elem_list **id_elems; |
12 | 14 | ||
13 | /* the usb audio specification version this interface complies to */ | 15 | /* the usb audio specification version this interface complies to */ |
14 | int protocol; | 16 | int protocol; |
@@ -36,11 +38,21 @@ enum { | |||
36 | USB_MIXER_U16, | 38 | USB_MIXER_U16, |
37 | }; | 39 | }; |
38 | 40 | ||
39 | struct usb_mixer_elem_info { | 41 | typedef void (*usb_mixer_elem_dump_func_t)(struct snd_info_buffer *buffer, |
42 | struct usb_mixer_elem_list *list); | ||
43 | typedef int (*usb_mixer_elem_resume_func_t)(struct usb_mixer_elem_list *elem); | ||
44 | |||
45 | struct usb_mixer_elem_list { | ||
40 | struct usb_mixer_interface *mixer; | 46 | struct usb_mixer_interface *mixer; |
41 | struct usb_mixer_elem_info *next_id_elem; /* list of controls with same id */ | 47 | struct usb_mixer_elem_list *next_id_elem; /* list of controls with same id */ |
42 | struct snd_ctl_elem_id *elem_id; | 48 | struct snd_kcontrol *kctl; |
43 | unsigned int id; | 49 | unsigned int id; |
50 | usb_mixer_elem_dump_func_t dump; | ||
51 | usb_mixer_elem_resume_func_t resume; | ||
52 | }; | ||
53 | |||
54 | struct usb_mixer_elem_info { | ||
55 | struct usb_mixer_elem_list head; | ||
44 | unsigned int control; /* CS or ICN (high byte) */ | 56 | unsigned int control; /* CS or ICN (high byte) */ |
45 | unsigned int cmask; /* channel mask bitmap: 0 = master */ | 57 | unsigned int cmask; /* channel mask bitmap: 0 = master */ |
46 | unsigned int idx_off; /* Control index offset */ | 58 | unsigned int idx_off; /* Control index offset */ |
@@ -65,9 +77,13 @@ void snd_usb_mixer_notify_id(struct usb_mixer_interface *mixer, int unitid); | |||
65 | int snd_usb_mixer_set_ctl_value(struct usb_mixer_elem_info *cval, | 77 | int snd_usb_mixer_set_ctl_value(struct usb_mixer_elem_info *cval, |
66 | int request, int validx, int value_set); | 78 | int request, int validx, int value_set); |
67 | 79 | ||
68 | int snd_usb_mixer_add_control(struct usb_mixer_interface *mixer, | 80 | int snd_usb_mixer_add_control(struct usb_mixer_elem_list *list, |
69 | struct snd_kcontrol *kctl); | 81 | struct snd_kcontrol *kctl); |
70 | 82 | ||
83 | void snd_usb_mixer_elem_init_std(struct usb_mixer_elem_list *list, | ||
84 | struct usb_mixer_interface *mixer, | ||
85 | int unitid); | ||
86 | |||
71 | int snd_usb_mixer_vol_tlv(struct snd_kcontrol *kcontrol, int op_flag, | 87 | int snd_usb_mixer_vol_tlv(struct snd_kcontrol *kcontrol, int op_flag, |
72 | unsigned int size, unsigned int __user *_tlv); | 88 | unsigned int size, unsigned int __user *_tlv); |
73 | 89 | ||