Commit 45d760567a7d773237b8996584a4ae0440d5e369
Committed by
Takashi Iwai
1 parent
7e84789403
Exists in
master
and in
7 other branches
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>
Showing 3 changed files with 12 additions and 25 deletions Side-by-side Diff
sound/usb/format.c
... | ... | @@ -218,7 +218,8 @@ |
218 | 218 | /* get the number of sample rates first by only fetching 2 bytes */ |
219 | 219 | ret = snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), UAC2_CS_RANGE, |
220 | 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 | 224 | if (ret < 0) { |
224 | 225 | snd_printk(KERN_ERR "unable to retrieve number of sample rates\n"); |
... | ... | @@ -236,7 +237,8 @@ |
236 | 237 | /* now get the full information */ |
237 | 238 | ret = snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), UAC2_CS_RANGE, |
238 | 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 | 243 | if (ret < 0) { |
242 | 244 | snd_printk(KERN_ERR "unable to retrieve sample rate range\n"); |
sound/usb/usbmixer.c
... | ... | @@ -136,22 +136,7 @@ |
136 | 136 | u8 initialized; |
137 | 137 | }; |
138 | 138 | |
139 | - | |
140 | 139 | enum { |
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 | - | |
154 | -enum { | |
155 | 140 | USB_MIXER_BOOLEAN, |
156 | 141 | USB_MIXER_INV_BOOLEAN, |
157 | 142 | USB_MIXER_S8, |
... | ... | @@ -954,7 +939,7 @@ |
954 | 939 | |
955 | 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 | 943 | /* FIXME: not supported yet */ |
959 | 944 | return; |
960 | 945 | } |
... | ... | @@ -1001,8 +986,8 @@ |
1001 | 986 | kctl->id.name, sizeof(kctl->id.name)); |
1002 | 987 | |
1003 | 988 | switch (control) { |
1004 | - case USB_FEATURE_MUTE: | |
1005 | - case USB_FEATURE_VOLUME: | |
989 | + case UAC_MUTE_CONTROL: | |
990 | + case UAC_VOLUME_CONTROL: | |
1006 | 991 | /* determine the control name. the rule is: |
1007 | 992 | * - if a name id is given in descriptor, use it. |
1008 | 993 | * - if the connected input can be determined, then use the name |
1009 | 994 | |
... | ... | @@ -1029,9 +1014,9 @@ |
1029 | 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 | 1018 | " Switch" : " Volume"); |
1034 | - if (control == USB_FEATURE_VOLUME) { | |
1019 | + if (control == UAC_VOLUME_CONTROL) { | |
1035 | 1020 | kctl->tlv.c = mixer_vol_tlv; |
1036 | 1021 | kctl->vd[0].access |= |
1037 | 1022 | SNDRV_CTL_ELEM_ACCESS_TLV_READ | |
... | ... | @@ -1120,7 +1105,7 @@ |
1120 | 1105 | snd_printk(KERN_INFO |
1121 | 1106 | "usbmixer: master volume quirk for PCM2702 chip\n"); |
1122 | 1107 | /* disable non-functional volume control */ |
1123 | - master_bits &= ~(1 << (USB_FEATURE_VOLUME - 1)); | |
1108 | + master_bits &= ~UAC_FU_VOLUME; | |
1124 | 1109 | break; |
1125 | 1110 | } |
1126 | 1111 | if (channels > 0) |
sound/usb/usbmixer_maps.c
... | ... | @@ -85,8 +85,8 @@ |
85 | 85 | /* 16: MU (w/o controls) */ |
86 | 86 | { 17, NULL, 1 }, /* DISABLED: PU-switch (any effect?) */ |
87 | 87 | { 17, "Channel Routing", 2 }, /* PU: mode select */ |
88 | - { 18, "Tone Control - Bass", USB_FEATURE_BASS }, /* FU */ | |
89 | - { 18, "Tone Control - Treble", USB_FEATURE_TREBLE }, /* FU */ | |
88 | + { 18, "Tone Control - Bass", UAC_BASS_CONTROL }, /* FU */ | |
89 | + { 18, "Tone Control - Treble", UAC_TREBLE_CONTROL }, /* FU */ | |
90 | 90 | { 18, "Master Playback" }, /* FU; others */ |
91 | 91 | /* 19: OT speaker */ |
92 | 92 | /* 20: OT headphone */ |