diff options
Diffstat (limited to 'sound/usb/mixer_quirks.c')
-rw-r--r-- | sound/usb/mixer_quirks.c | 72 |
1 files changed, 56 insertions, 16 deletions
diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c index 15520de1df56..497d2741d119 100644 --- a/sound/usb/mixer_quirks.c +++ b/sound/usb/mixer_quirks.c | |||
@@ -637,7 +637,7 @@ static int snd_nativeinstruments_create_mixer(struct usb_mixer_interface *mixer, | |||
637 | } | 637 | } |
638 | 638 | ||
639 | /* M-Audio FastTrack Ultra quirks */ | 639 | /* M-Audio FastTrack Ultra quirks */ |
640 | /* FTU Effect switch (also used by C400) */ | 640 | /* FTU Effect switch (also used by C400/C600) */ |
641 | struct snd_ftu_eff_switch_priv_val { | 641 | struct snd_ftu_eff_switch_priv_val { |
642 | struct usb_mixer_interface *mixer; | 642 | struct usb_mixer_interface *mixer; |
643 | int cached_value; | 643 | int cached_value; |
@@ -1029,32 +1029,45 @@ void snd_emuusb_set_samplerate(struct snd_usb_audio *chip, | |||
1029 | } | 1029 | } |
1030 | } | 1030 | } |
1031 | 1031 | ||
1032 | /* M-Audio Fast Track C400 */ | 1032 | /* M-Audio Fast Track C400/C600 */ |
1033 | /* C400 volume controls, this control needs a volume quirk, see mixer.c */ | 1033 | /* C400/C600 volume controls, this control needs a volume quirk, see mixer.c */ |
1034 | static int snd_c400_create_vol_ctls(struct usb_mixer_interface *mixer) | 1034 | static int snd_c400_create_vol_ctls(struct usb_mixer_interface *mixer) |
1035 | { | 1035 | { |
1036 | char name[64]; | 1036 | char name[64]; |
1037 | unsigned int cmask, offset; | 1037 | unsigned int cmask, offset; |
1038 | int out, chan, err; | 1038 | int out, chan, err; |
1039 | int num_outs = 0; | ||
1040 | int num_ins = 0; | ||
1039 | 1041 | ||
1040 | const unsigned int id = 0x40; | 1042 | const unsigned int id = 0x40; |
1041 | const int val_type = USB_MIXER_S16; | 1043 | const int val_type = USB_MIXER_S16; |
1042 | const int control = 1; | 1044 | const int control = 1; |
1043 | 1045 | ||
1044 | for (chan = 0; chan < 10; chan++) { | 1046 | switch (mixer->chip->usb_id) { |
1045 | for (out = 0; out < 6; out++) { | 1047 | case USB_ID(0x0763, 0x2030): |
1046 | if (chan < 6) { | 1048 | num_outs = 6; |
1049 | num_ins = 4; | ||
1050 | break; | ||
1051 | case USB_ID(0x0763, 0x2031): | ||
1052 | num_outs = 8; | ||
1053 | num_ins = 6; | ||
1054 | break; | ||
1055 | } | ||
1056 | |||
1057 | for (chan = 0; chan < num_outs + num_ins; chan++) { | ||
1058 | for (out = 0; out < num_outs; out++) { | ||
1059 | if (chan < num_outs) { | ||
1047 | snprintf(name, sizeof(name), | 1060 | snprintf(name, sizeof(name), |
1048 | "PCM%d-Out%d Playback Volume", | 1061 | "PCM%d-Out%d Playback Volume", |
1049 | chan + 1, out + 1); | 1062 | chan + 1, out + 1); |
1050 | } else { | 1063 | } else { |
1051 | snprintf(name, sizeof(name), | 1064 | snprintf(name, sizeof(name), |
1052 | "In%d-Out%d Playback Volume", | 1065 | "In%d-Out%d Playback Volume", |
1053 | chan - 5, out + 1); | 1066 | chan - num_outs + 1, out + 1); |
1054 | } | 1067 | } |
1055 | 1068 | ||
1056 | cmask = (out == 0) ? 0 : 1 << (out - 1); | 1069 | cmask = (out == 0) ? 0 : 1 << (out - 1); |
1057 | offset = chan * 6; | 1070 | offset = chan * num_outs; |
1058 | err = snd_create_std_mono_ctl_offset(mixer, id, control, | 1071 | err = snd_create_std_mono_ctl_offset(mixer, id, control, |
1059 | cmask, val_type, offset, name, | 1072 | cmask, val_type, offset, name, |
1060 | &snd_usb_mixer_vol_tlv); | 1073 | &snd_usb_mixer_vol_tlv); |
@@ -1110,20 +1123,33 @@ static int snd_c400_create_effect_vol_ctls(struct usb_mixer_interface *mixer) | |||
1110 | char name[64]; | 1123 | char name[64]; |
1111 | unsigned int cmask; | 1124 | unsigned int cmask; |
1112 | int chan, err; | 1125 | int chan, err; |
1126 | int num_outs = 0; | ||
1127 | int num_ins = 0; | ||
1113 | 1128 | ||
1114 | const unsigned int id = 0x42; | 1129 | const unsigned int id = 0x42; |
1115 | const int val_type = USB_MIXER_S16; | 1130 | const int val_type = USB_MIXER_S16; |
1116 | const int control = 1; | 1131 | const int control = 1; |
1117 | 1132 | ||
1118 | for (chan = 0; chan < 10; chan++) { | 1133 | switch (mixer->chip->usb_id) { |
1119 | if (chan < 6) { | 1134 | case USB_ID(0x0763, 0x2030): |
1135 | num_outs = 6; | ||
1136 | num_ins = 4; | ||
1137 | break; | ||
1138 | case USB_ID(0x0763, 0x2031): | ||
1139 | num_outs = 8; | ||
1140 | num_ins = 6; | ||
1141 | break; | ||
1142 | } | ||
1143 | |||
1144 | for (chan = 0; chan < num_outs + num_ins; chan++) { | ||
1145 | if (chan < num_outs) { | ||
1120 | snprintf(name, sizeof(name), | 1146 | snprintf(name, sizeof(name), |
1121 | "Effect Send DOut%d", | 1147 | "Effect Send DOut%d", |
1122 | chan + 1); | 1148 | chan + 1); |
1123 | } else { | 1149 | } else { |
1124 | snprintf(name, sizeof(name), | 1150 | snprintf(name, sizeof(name), |
1125 | "Effect Send AIn%d", | 1151 | "Effect Send AIn%d", |
1126 | chan - 5); | 1152 | chan - num_outs + 1); |
1127 | } | 1153 | } |
1128 | 1154 | ||
1129 | cmask = (chan == 0) ? 0 : 1 << (chan - 1); | 1155 | cmask = (chan == 0) ? 0 : 1 << (chan - 1); |
@@ -1142,20 +1168,33 @@ static int snd_c400_create_effect_ret_vol_ctls(struct usb_mixer_interface *mixer | |||
1142 | char name[64]; | 1168 | char name[64]; |
1143 | unsigned int cmask; | 1169 | unsigned int cmask; |
1144 | int chan, err; | 1170 | int chan, err; |
1171 | int num_outs = 0; | ||
1172 | int offset = 0; | ||
1145 | 1173 | ||
1146 | const unsigned int id = 0x40; | 1174 | const unsigned int id = 0x40; |
1147 | const int val_type = USB_MIXER_S16; | 1175 | const int val_type = USB_MIXER_S16; |
1148 | const int control = 1; | 1176 | const int control = 1; |
1149 | const int chan_id[6] = { 0, 7, 2, 9, 4, 0xb }; | ||
1150 | const unsigned int offset = 0x3c; | ||
1151 | /* { 0x3c, 0x43, 0x3e, 0x45, 0x40, 0x47 } */ | ||
1152 | 1177 | ||
1153 | for (chan = 0; chan < 6; chan++) { | 1178 | switch (mixer->chip->usb_id) { |
1179 | case USB_ID(0x0763, 0x2030): | ||
1180 | num_outs = 6; | ||
1181 | offset = 0x3c; | ||
1182 | /* { 0x3c, 0x43, 0x3e, 0x45, 0x40, 0x47 } */ | ||
1183 | break; | ||
1184 | case USB_ID(0x0763, 0x2031): | ||
1185 | num_outs = 8; | ||
1186 | offset = 0x70; | ||
1187 | /* { 0x70, 0x79, 0x72, 0x7b, 0x74, 0x7d, 0x76, 0x7f } */ | ||
1188 | break; | ||
1189 | } | ||
1190 | |||
1191 | for (chan = 0; chan < num_outs; chan++) { | ||
1154 | snprintf(name, sizeof(name), | 1192 | snprintf(name, sizeof(name), |
1155 | "Effect Return %d", | 1193 | "Effect Return %d", |
1156 | chan + 1); | 1194 | chan + 1); |
1157 | 1195 | ||
1158 | cmask = (chan_id[chan] == 0) ? 0 : 1 << (chan_id[chan] - 1); | 1196 | cmask = (chan == 0) ? 0 : |
1197 | 1 << (chan + (chan % 2) * num_outs - 1); | ||
1159 | err = snd_create_std_mono_ctl_offset(mixer, id, control, | 1198 | err = snd_create_std_mono_ctl_offset(mixer, id, control, |
1160 | cmask, val_type, offset, name, | 1199 | cmask, val_type, offset, name, |
1161 | &snd_usb_mixer_vol_tlv); | 1200 | &snd_usb_mixer_vol_tlv); |
@@ -1299,6 +1338,7 @@ int snd_usb_mixer_apply_create_quirk(struct usb_mixer_interface *mixer) | |||
1299 | break; | 1338 | break; |
1300 | 1339 | ||
1301 | case USB_ID(0x0763, 0x2030): /* M-Audio Fast Track C400 */ | 1340 | case USB_ID(0x0763, 0x2030): /* M-Audio Fast Track C400 */ |
1341 | case USB_ID(0x0763, 0x2031): /* M-Audio Fast Track C400 */ | ||
1302 | err = snd_c400_create_mixer(mixer); | 1342 | err = snd_c400_create_mixer(mixer); |
1303 | break; | 1343 | break; |
1304 | 1344 | ||