blob: a7cf1007fbb07478fa6a81280174aa919ac8ec4e [file] [log] [blame]
Daniel Mack3e1aebe2010-03-04 19:46:12 +01001#ifndef __USBMIXER_H
2#define __USBMIXER_H
3
Daniel Mack7b1eda22010-03-11 21:13:22 +01004struct 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
Daniel Mack23caaf12010-03-11 21:13:25 +010013 /* the usb audio specification version this interface complies to */
14 int protocol;
15
Daniel Mack7b1eda22010-03-11 21:13:22 +010016 /* 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
30struct 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 */
Daniel Macka6a33252010-05-31 13:35:37 +020037 unsigned int ch_readonly;
38 unsigned int master_readonly;
Daniel Mack7b1eda22010-03-11 21:13:22 +010039 int channels;
40 int val_type;
41 int min, max, res;
42 int dBmin, dBmax;
43 int cached;
44 int cache_val[MAX_CHANNELS];
45 u8 initialized;
46};
47
Daniel Mack3e1aebe2010-03-04 19:46:12 +010048int snd_usb_create_mixer(struct snd_usb_audio *chip, int ctrlif,
49 int ignore_error);
50void snd_usb_mixer_disconnect(struct list_head *p);
51
Daniel Mack7b1eda22010-03-11 21:13:22 +010052void snd_usb_mixer_notify_id(struct usb_mixer_interface *mixer, int unitid);
53
54int snd_usb_mixer_set_ctl_value(struct usb_mixer_elem_info *cval,
55 int request, int validx, int value_set);
Daniel Mack3e1aebe2010-03-04 19:46:12 +010056
57#endif /* __USBMIXER_H */