aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb
diff options
context:
space:
mode:
authorDaniel Mack <daniel@caiaq.de>2010-03-11 15:13:21 -0500
committerTakashi Iwai <tiwai@suse.de>2010-03-12 06:20:07 -0500
commit45d760567a7d773237b8996584a4ae0440d5e369 (patch)
tree01a57c042733dde1b9488b8739c37b1a54a65a72 /sound/usb
parent7e847894039d7590321de306fca2b1ae58662f29 (diff)
ALSA: usb-mixer: use defines from audio.h
No need for the private enum. Signed-off-by: Daniel Mack <daniel@caiaq.de> Cc: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb')
-rw-r--r--sound/usb/format.c6
-rw-r--r--sound/usb/usbmixer.c27
-rw-r--r--sound/usb/usbmixer_maps.c4
3 files changed, 12 insertions, 25 deletions
diff --git a/sound/usb/format.c b/sound/usb/format.c
index 0e04efe9551..fcadedd9454 100644
--- a/sound/usb/format.c
+++ b/sound/usb/format.c
@@ -218,7 +218,8 @@ static int parse_audio_format_rates_v2(struct snd_usb_audio *chip,
218 /* get the number of sample rates first by only fetching 2 bytes */ 218 /* get the number of sample rates first by only fetching 2 bytes */
219 ret = snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), UAC2_CS_RANGE, 219 ret = snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), UAC2_CS_RANGE,
220 USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_DIR_IN, 220 USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_DIR_IN,
221 0x0100, chip->clock_id << 8, tmp, sizeof(tmp), 1000); 221 UAC2_CS_CONTROL_SAM_FREQ << 8, chip->clock_id << 8,
222 tmp, sizeof(tmp), 1000);
222 223
223 if (ret < 0) { 224 if (ret < 0) {
224 snd_printk(KERN_ERR "unable to retrieve number of sample rates\n"); 225 snd_printk(KERN_ERR "unable to retrieve number of sample rates\n");
@@ -236,7 +237,8 @@ static int parse_audio_format_rates_v2(struct snd_usb_audio *chip,
236 /* now get the full information */ 237 /* now get the full information */
237 ret = snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), UAC2_CS_RANGE, 238 ret = snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), UAC2_CS_RANGE,
238 USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_DIR_IN, 239 USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_DIR_IN,
239 0x0100, chip->clock_id << 8, data, data_size, 1000); 240 UAC2_CS_CONTROL_SAM_FREQ << 8, chip->clock_id << 8,
241 data, data_size, 1000);
240 242
241 if (ret < 0) { 243 if (ret < 0) {
242 snd_printk(KERN_ERR "unable to retrieve sample rate range\n"); 244 snd_printk(KERN_ERR "unable to retrieve sample rate range\n");
diff --git a/sound/usb/usbmixer.c b/sound/usb/usbmixer.c
index 5c056837594..ab8f0f0b65b 100644
--- a/sound/usb/usbmixer.c
+++ b/sound/usb/usbmixer.c
@@ -136,21 +136,6 @@ struct usb_mixer_elem_info {
136 u8 initialized; 136 u8 initialized;
137}; 137};
138 138
139
140enum {
141 USB_FEATURE_NONE = 0,
142 USB_FEATURE_MUTE = 1,
143 USB_FEATURE_VOLUME,
144 USB_FEATURE_BASS,
145 USB_FEATURE_MID,
146 USB_FEATURE_TREBLE,
147 USB_FEATURE_GEQ,
148 USB_FEATURE_AGC,
149 USB_FEATURE_DELAY,
150 USB_FEATURE_BASSBOOST,
151 USB_FEATURE_LOUDNESS
152};
153
154enum { 139enum {
155 USB_MIXER_BOOLEAN, 140 USB_MIXER_BOOLEAN,
156 USB_MIXER_INV_BOOLEAN, 141 USB_MIXER_INV_BOOLEAN,
@@ -954,7 +939,7 @@ static void build_feature_ctl(struct mixer_build *state, unsigned char *desc,
954 939
955 control++; /* change from zero-based to 1-based value */ 940 control++; /* change from zero-based to 1-based value */
956 941
957 if (control == USB_FEATURE_GEQ) { 942 if (control == UAC_GRAPHIC_EQUALIZER_CONTROL) {
958 /* FIXME: not supported yet */ 943 /* FIXME: not supported yet */
959 return; 944 return;
960 } 945 }
@@ -1001,8 +986,8 @@ static void build_feature_ctl(struct mixer_build *state, unsigned char *desc,
1001 kctl->id.name, sizeof(kctl->id.name)); 986 kctl->id.name, sizeof(kctl->id.name));
1002 987
1003 switch (control) { 988 switch (control) {
1004 case USB_FEATURE_MUTE: 989 case UAC_MUTE_CONTROL:
1005 case USB_FEATURE_VOLUME: 990 case UAC_VOLUME_CONTROL:
1006 /* determine the control name. the rule is: 991 /* determine the control name. the rule is:
1007 * - if a name id is given in descriptor, use it. 992 * - if a name id is given in descriptor, use it.
1008 * - if the connected input can be determined, then use the name 993 * - if the connected input can be determined, then use the name
@@ -1029,9 +1014,9 @@ static void build_feature_ctl(struct mixer_build *state, unsigned char *desc,
1029 len = append_ctl_name(kctl, " Playback"); 1014 len = append_ctl_name(kctl, " Playback");
1030 } 1015 }
1031 } 1016 }
1032 append_ctl_name(kctl, control == USB_FEATURE_MUTE ? 1017 append_ctl_name(kctl, control == UAC_MUTE_CONTROL ?
1033 " Switch" : " Volume"); 1018 " Switch" : " Volume");
1034 if (control == USB_FEATURE_VOLUME) { 1019 if (control == UAC_VOLUME_CONTROL) {
1035 kctl->tlv.c = mixer_vol_tlv; 1020 kctl->tlv.c = mixer_vol_tlv;
1036 kctl->vd[0].access |= 1021 kctl->vd[0].access |=
1037 SNDRV_CTL_ELEM_ACCESS_TLV_READ | 1022 SNDRV_CTL_ELEM_ACCESS_TLV_READ |
@@ -1120,7 +1105,7 @@ static int parse_audio_feature_unit(struct mixer_build *state, int unitid, void
1120 snd_printk(KERN_INFO 1105 snd_printk(KERN_INFO
1121 "usbmixer: master volume quirk for PCM2702 chip\n"); 1106 "usbmixer: master volume quirk for PCM2702 chip\n");
1122 /* disable non-functional volume control */ 1107 /* disable non-functional volume control */
1123 master_bits &= ~(1 << (USB_FEATURE_VOLUME - 1)); 1108 master_bits &= ~UAC_FU_VOLUME;
1124 break; 1109 break;
1125 } 1110 }
1126 if (channels > 0) 1111 if (channels > 0)
diff --git a/sound/usb/usbmixer_maps.c b/sound/usb/usbmixer_maps.c
index 79e903a6086..d93fc89beba 100644
--- a/sound/usb/usbmixer_maps.c
+++ b/sound/usb/usbmixer_maps.c
@@ -85,8 +85,8 @@ static struct usbmix_name_map extigy_map[] = {
85 /* 16: MU (w/o controls) */ 85 /* 16: MU (w/o controls) */
86 { 17, NULL, 1 }, /* DISABLED: PU-switch (any effect?) */ 86 { 17, NULL, 1 }, /* DISABLED: PU-switch (any effect?) */
87 { 17, "Channel Routing", 2 }, /* PU: mode select */ 87 { 17, "Channel Routing", 2 }, /* PU: mode select */
88 { 18, "Tone Control - Bass", USB_FEATURE_BASS }, /* FU */ 88 { 18, "Tone Control - Bass", UAC_BASS_CONTROL }, /* FU */
89 { 18, "Tone Control - Treble", USB_FEATURE_TREBLE }, /* FU */ 89 { 18, "Tone Control - Treble", UAC_TREBLE_CONTROL }, /* FU */
90 { 18, "Master Playback" }, /* FU; others */ 90 { 18, "Master Playback" }, /* FU; others */
91 /* 19: OT speaker */ 91 /* 19: OT speaker */
92 /* 20: OT headphone */ 92 /* 20: OT headphone */