130123854a6cfc37dc2c16cd88281222fa021300
[safe/jmp/linux-2.6] / sound / usb / mixer.h
1 #ifndef __USBMIXER_H
2 #define __USBMIXER_H
3
4 struct usb_mixer_interface {
5         struct snd_usb_audio *chip;
6         unsigned int ctrlif;
7         struct list_head list;
8         unsigned int ignore_ctl_error;
9         struct urb *urb;
10         /* array[MAX_ID_ELEMS], indexed by unit id */
11         struct usb_mixer_elem_info **id_elems;
12
13         /* the usb audio specification version this interface complies to */
14         int protocol;
15
16         /* Sound Blaster remote control stuff */
17         const struct rc_config *rc_cfg;
18         u32 rc_code;
19         wait_queue_head_t rc_waitq;
20         struct urb *rc_urb;
21         struct usb_ctrlrequest *rc_setup_packet;
22         u8 rc_buffer[6];
23
24         u8 audigy2nx_leds[3];
25         u8 xonar_u1_status;
26 };
27
28 #define MAX_CHANNELS    10      /* max logical channels */
29
30 struct usb_mixer_elem_info {
31         struct usb_mixer_interface *mixer;
32         struct usb_mixer_elem_info *next_id_elem; /* list of controls with same id */
33         struct snd_ctl_elem_id *elem_id;
34         unsigned int id;
35         unsigned int control;   /* CS or ICN (high byte) */
36         unsigned int cmask; /* channel mask bitmap: 0 = master */
37         int channels;
38         int val_type;
39         int min, max, res;
40         int dBmin, dBmax;
41         int cached;
42         int cache_val[MAX_CHANNELS];
43         u8 initialized;
44 };
45
46 int snd_usb_create_mixer(struct snd_usb_audio *chip, int ctrlif,
47                          int ignore_error);
48 void snd_usb_mixer_disconnect(struct list_head *p);
49
50 void snd_usb_mixer_notify_id(struct usb_mixer_interface *mixer, int unitid);
51
52 int snd_usb_mixer_set_ctl_value(struct usb_mixer_elem_info *cval,
53                                 int request, int validx, int value_set);
54
55 #endif /* __USBMIXER_H */