aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorDaniel Mack <daniel@caiaq.de>2010-05-31 07:35:41 -0400
committerTakashi Iwai <tiwai@suse.de>2010-05-31 12:17:22 -0400
commit65f25da44b51f55e3a74301c25f29263be2bf1ba (patch)
tree5a2e91b0af5a0000b6c404f625b3933dd81aaae3 /sound
parent79f920fbff566ffc9de44111eb1456a3cef310f0 (diff)
ALSA: usb-audio: unify constants from specification
Move more definitions from private enums to appropriate header files. Signed-off-by: Daniel Mack <daniel@caiaq.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/usb/mixer.c99
-rw-r--r--sound/usb/mixer_maps.c4
2 files changed, 35 insertions, 68 deletions
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index 9149a84c716..24428198ae1 100644
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -78,39 +78,6 @@ enum {
78 USB_MIXER_U16, 78 USB_MIXER_U16,
79}; 79};
80 80
81enum {
82 USB_PROC_UPDOWN = 1,
83 USB_PROC_UPDOWN_SWITCH = 1,
84 USB_PROC_UPDOWN_MODE_SEL = 2,
85
86 USB_PROC_PROLOGIC = 2,
87 USB_PROC_PROLOGIC_SWITCH = 1,
88 USB_PROC_PROLOGIC_MODE_SEL = 2,
89
90 USB_PROC_3DENH = 3,
91 USB_PROC_3DENH_SWITCH = 1,
92 USB_PROC_3DENH_SPACE = 2,
93
94 USB_PROC_REVERB = 4,
95 USB_PROC_REVERB_SWITCH = 1,
96 USB_PROC_REVERB_LEVEL = 2,
97 USB_PROC_REVERB_TIME = 3,
98 USB_PROC_REVERB_DELAY = 4,
99
100 USB_PROC_CHORUS = 5,
101 USB_PROC_CHORUS_SWITCH = 1,
102 USB_PROC_CHORUS_LEVEL = 2,
103 USB_PROC_CHORUS_RATE = 3,
104 USB_PROC_CHORUS_DEPTH = 4,
105
106 USB_PROC_DCR = 6,
107 USB_PROC_DCR_SWITCH = 1,
108 USB_PROC_DCR_RATIO = 2,
109 USB_PROC_DCR_MAX_AMP = 3,
110 USB_PROC_DCR_THRESHOLD = 4,
111 USB_PROC_DCR_ATTACK = 5,
112 USB_PROC_DCR_RELEASE = 6,
113};
114 81
115/*E-mu 0202(0404) eXtension Unit(XU) control*/ 82/*E-mu 0202(0404) eXtension Unit(XU) control*/
116enum { 83enum {
@@ -980,7 +947,7 @@ static void build_feature_ctl(struct mixer_build *state, void *raw_desc,
980 947
981 control++; /* change from zero-based to 1-based value */ 948 control++; /* change from zero-based to 1-based value */
982 949
983 if (control == UAC_GRAPHIC_EQUALIZER_CONTROL) { 950 if (control == UAC_FU_GRAPHIC_EQUALIZER) {
984 /* FIXME: not supported yet */ 951 /* FIXME: not supported yet */
985 return; 952 return;
986 } 953 }
@@ -1036,8 +1003,8 @@ static void build_feature_ctl(struct mixer_build *state, void *raw_desc,
1036 kctl->id.name, sizeof(kctl->id.name)); 1003 kctl->id.name, sizeof(kctl->id.name));
1037 1004
1038 switch (control) { 1005 switch (control) {
1039 case UAC_MUTE_CONTROL: 1006 case UAC_FU_MUTE:
1040 case UAC_VOLUME_CONTROL: 1007 case UAC_FU_VOLUME:
1041 /* determine the control name. the rule is: 1008 /* determine the control name. the rule is:
1042 * - if a name id is given in descriptor, use it. 1009 * - if a name id is given in descriptor, use it.
1043 * - if the connected input can be determined, then use the name 1010 * - if the connected input can be determined, then use the name
@@ -1064,9 +1031,9 @@ static void build_feature_ctl(struct mixer_build *state, void *raw_desc,
1064 len = append_ctl_name(kctl, " Playback"); 1031 len = append_ctl_name(kctl, " Playback");
1065 } 1032 }
1066 } 1033 }
1067 append_ctl_name(kctl, control == UAC_MUTE_CONTROL ? 1034 append_ctl_name(kctl, control == UAC_FU_MUTE ?
1068 " Switch" : " Volume"); 1035 " Switch" : " Volume");
1069 if (control == UAC_VOLUME_CONTROL) { 1036 if (control == UAC_FU_VOLUME) {
1070 kctl->tlv.c = mixer_vol_tlv; 1037 kctl->tlv.c = mixer_vol_tlv;
1071 kctl->vd[0].access |= 1038 kctl->vd[0].access |=
1072 SNDRV_CTL_ELEM_ACCESS_TLV_READ | 1039 SNDRV_CTL_ELEM_ACCESS_TLV_READ |
@@ -1165,7 +1132,7 @@ static int parse_audio_feature_unit(struct mixer_build *state, int unitid, void
1165 snd_printk(KERN_INFO 1132 snd_printk(KERN_INFO
1166 "usbmixer: master volume quirk for PCM2702 chip\n"); 1133 "usbmixer: master volume quirk for PCM2702 chip\n");
1167 /* disable non-functional volume control */ 1134 /* disable non-functional volume control */
1168 master_bits &= ~UAC_FU_VOLUME; 1135 master_bits &= ~UAC_CONTROL_BIT(UAC_FU_VOLUME);
1169 break; 1136 break;
1170 } 1137 }
1171 if (channels > 0) 1138 if (channels > 0)
@@ -1410,51 +1377,51 @@ struct procunit_info {
1410}; 1377};
1411 1378
1412static struct procunit_value_info updown_proc_info[] = { 1379static struct procunit_value_info updown_proc_info[] = {
1413 { USB_PROC_UPDOWN_SWITCH, "Switch", USB_MIXER_BOOLEAN }, 1380 { UAC_UD_ENABLE, "Switch", USB_MIXER_BOOLEAN },
1414 { USB_PROC_UPDOWN_MODE_SEL, "Mode Select", USB_MIXER_U8, 1 }, 1381 { UAC_UD_MODE_SELECT, "Mode Select", USB_MIXER_U8, 1 },
1415 { 0 } 1382 { 0 }
1416}; 1383};
1417static struct procunit_value_info prologic_proc_info[] = { 1384static struct procunit_value_info prologic_proc_info[] = {
1418 { USB_PROC_PROLOGIC_SWITCH, "Switch", USB_MIXER_BOOLEAN }, 1385 { UAC_DP_ENABLE, "Switch", USB_MIXER_BOOLEAN },
1419 { USB_PROC_PROLOGIC_MODE_SEL, "Mode Select", USB_MIXER_U8, 1 }, 1386 { UAC_DP_MODE_SELECT, "Mode Select", USB_MIXER_U8, 1 },
1420 { 0 } 1387 { 0 }
1421}; 1388};
1422static struct procunit_value_info threed_enh_proc_info[] = { 1389static struct procunit_value_info threed_enh_proc_info[] = {
1423 { USB_PROC_3DENH_SWITCH, "Switch", USB_MIXER_BOOLEAN }, 1390 { UAC_3D_ENABLE, "Switch", USB_MIXER_BOOLEAN },
1424 { USB_PROC_3DENH_SPACE, "Spaciousness", USB_MIXER_U8 }, 1391 { UAC_3D_SPACE, "Spaciousness", USB_MIXER_U8 },
1425 { 0 } 1392 { 0 }
1426}; 1393};
1427static struct procunit_value_info reverb_proc_info[] = { 1394static struct procunit_value_info reverb_proc_info[] = {
1428 { USB_PROC_REVERB_SWITCH, "Switch", USB_MIXER_BOOLEAN }, 1395 { UAC_REVERB_ENABLE, "Switch", USB_MIXER_BOOLEAN },
1429 { USB_PROC_REVERB_LEVEL, "Level", USB_MIXER_U8 }, 1396 { UAC_REVERB_LEVEL, "Level", USB_MIXER_U8 },
1430 { USB_PROC_REVERB_TIME, "Time", USB_MIXER_U16 }, 1397 { UAC_REVERB_TIME, "Time", USB_MIXER_U16 },
1431 { USB_PROC_REVERB_DELAY, "Delay", USB_MIXER_U8 }, 1398 { UAC_REVERB_FEEDBACK, "Feedback", USB_MIXER_U8 },
1432 { 0 } 1399 { 0 }
1433}; 1400};
1434static struct procunit_value_info chorus_proc_info[] = { 1401static struct procunit_value_info chorus_proc_info[] = {
1435 { USB_PROC_CHORUS_SWITCH, "Switch", USB_MIXER_BOOLEAN }, 1402 { UAC_CHORUS_ENABLE, "Switch", USB_MIXER_BOOLEAN },
1436 { USB_PROC_CHORUS_LEVEL, "Level", USB_MIXER_U8 }, 1403 { UAC_CHORUS_LEVEL, "Level", USB_MIXER_U8 },
1437 { USB_PROC_CHORUS_RATE, "Rate", USB_MIXER_U16 }, 1404 { UAC_CHORUS_RATE, "Rate", USB_MIXER_U16 },
1438 { USB_PROC_CHORUS_DEPTH, "Depth", USB_MIXER_U16 }, 1405 { UAC_CHORUS_DEPTH, "Depth", USB_MIXER_U16 },
1439 { 0 } 1406 { 0 }
1440}; 1407};
1441static struct procunit_value_info dcr_proc_info[] = { 1408static struct procunit_value_info dcr_proc_info[] = {
1442 { USB_PROC_DCR_SWITCH, "Switch", USB_MIXER_BOOLEAN }, 1409 { UAC_DCR_ENABLE, "Switch", USB_MIXER_BOOLEAN },
1443 { USB_PROC_DCR_RATIO, "Ratio", USB_MIXER_U16 }, 1410 { UAC_DCR_RATE, "Ratio", USB_MIXER_U16 },
1444 { USB_PROC_DCR_MAX_AMP, "Max Amp", USB_MIXER_S16 }, 1411 { UAC_DCR_MAXAMPL, "Max Amp", USB_MIXER_S16 },
1445 { USB_PROC_DCR_THRESHOLD, "Threshold", USB_MIXER_S16 }, 1412 { UAC_DCR_THRESHOLD, "Threshold", USB_MIXER_S16 },
1446 { USB_PROC_DCR_ATTACK, "Attack Time", USB_MIXER_U16 }, 1413 { UAC_DCR_ATTACK_TIME, "Attack Time", USB_MIXER_U16 },
1447 { USB_PROC_DCR_RELEASE, "Release Time", USB_MIXER_U16 }, 1414 { UAC_DCR_RELEASE_TIME, "Release Time", USB_MIXER_U16 },
1448 { 0 } 1415 { 0 }
1449}; 1416};
1450 1417
1451static struct procunit_info procunits[] = { 1418static struct procunit_info procunits[] = {
1452 { USB_PROC_UPDOWN, "Up Down", updown_proc_info }, 1419 { UAC_PROCESS_UP_DOWNMIX, "Up Down", updown_proc_info },
1453 { USB_PROC_PROLOGIC, "Dolby Prologic", prologic_proc_info }, 1420 { UAC_PROCESS_DOLBY_PROLOGIC, "Dolby Prologic", prologic_proc_info },
1454 { USB_PROC_3DENH, "3D Stereo Extender", threed_enh_proc_info }, 1421 { UAC_PROCESS_STEREO_EXTENDER, "3D Stereo Extender", threed_enh_proc_info },
1455 { USB_PROC_REVERB, "Reverb", reverb_proc_info }, 1422 { UAC_PROCESS_REVERB, "Reverb", reverb_proc_info },
1456 { USB_PROC_CHORUS, "Chorus", chorus_proc_info }, 1423 { UAC_PROCESS_CHORUS, "Chorus", chorus_proc_info },
1457 { USB_PROC_DCR, "DCR", dcr_proc_info }, 1424 { UAC_PROCESS_DYN_RANGE_COMP, "DCR", dcr_proc_info },
1458 { 0 }, 1425 { 0 },
1459}; 1426};
1460/* 1427/*
@@ -1542,7 +1509,7 @@ static int build_audio_procunit(struct mixer_build *state, int unitid, void *raw
1542 cval->channels = 1; 1509 cval->channels = 1;
1543 1510
1544 /* get min/max values */ 1511 /* get min/max values */
1545 if (type == USB_PROC_UPDOWN && cval->control == USB_PROC_UPDOWN_MODE_SEL) { 1512 if (type == UAC_PROCESS_UP_DOWNMIX && cval->control == UAC_UD_MODE_SELECT) {
1546 __u8 *control_spec = uac_processing_unit_specific(desc, state->mixer->protocol); 1513 __u8 *control_spec = uac_processing_unit_specific(desc, state->mixer->protocol);
1547 /* FIXME: hard-coded */ 1514 /* FIXME: hard-coded */
1548 cval->min = 1; 1515 cval->min = 1;
diff --git a/sound/usb/mixer_maps.c b/sound/usb/mixer_maps.c
index d93fc89beba..f1324c42383 100644
--- a/sound/usb/mixer_maps.c
+++ b/sound/usb/mixer_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", UAC_BASS_CONTROL }, /* FU */ 88 { 18, "Tone Control - Bass", UAC_FU_BASS }, /* FU */
89 { 18, "Tone Control - Treble", UAC_TREBLE_CONTROL }, /* FU */ 89 { 18, "Tone Control - Treble", UAC_FU_TREBLE }, /* 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 */