Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 193221
b: refs/heads/master
c: 45d7605
h: refs/heads/master
i:
  193219: e9115e6
v: v3
  • Loading branch information
Daniel Mack authored and Takashi Iwai committed Mar 12, 2010
1 parent bbaf216 commit 2f72062
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 26 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7e847894039d7590321de306fca2b1ae58662f29
refs/heads/master: 45d760567a7d773237b8996584a4ae0440d5e369
6 changes: 4 additions & 2 deletions trunk/sound/usb/format.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,8 @@ static int parse_audio_format_rates_v2(struct snd_usb_audio *chip,
/* get the number of sample rates first by only fetching 2 bytes */
ret = snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), UAC2_CS_RANGE,
USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_DIR_IN,
0x0100, chip->clock_id << 8, tmp, sizeof(tmp), 1000);
UAC2_CS_CONTROL_SAM_FREQ << 8, chip->clock_id << 8,
tmp, sizeof(tmp), 1000);

if (ret < 0) {
snd_printk(KERN_ERR "unable to retrieve number of sample rates\n");
Expand All @@ -236,7 +237,8 @@ static int parse_audio_format_rates_v2(struct snd_usb_audio *chip,
/* now get the full information */
ret = snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), UAC2_CS_RANGE,
USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_DIR_IN,
0x0100, chip->clock_id << 8, data, data_size, 1000);
UAC2_CS_CONTROL_SAM_FREQ << 8, chip->clock_id << 8,
data, data_size, 1000);

if (ret < 0) {
snd_printk(KERN_ERR "unable to retrieve sample rate range\n");
Expand Down
27 changes: 6 additions & 21 deletions trunk/sound/usb/usbmixer.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,21 +136,6 @@ struct usb_mixer_elem_info {
u8 initialized;
};


enum {
USB_FEATURE_NONE = 0,
USB_FEATURE_MUTE = 1,
USB_FEATURE_VOLUME,
USB_FEATURE_BASS,
USB_FEATURE_MID,
USB_FEATURE_TREBLE,
USB_FEATURE_GEQ,
USB_FEATURE_AGC,
USB_FEATURE_DELAY,
USB_FEATURE_BASSBOOST,
USB_FEATURE_LOUDNESS
};

enum {
USB_MIXER_BOOLEAN,
USB_MIXER_INV_BOOLEAN,
Expand Down Expand Up @@ -954,7 +939,7 @@ static void build_feature_ctl(struct mixer_build *state, unsigned char *desc,

control++; /* change from zero-based to 1-based value */

if (control == USB_FEATURE_GEQ) {
if (control == UAC_GRAPHIC_EQUALIZER_CONTROL) {
/* FIXME: not supported yet */
return;
}
Expand Down Expand Up @@ -1001,8 +986,8 @@ static void build_feature_ctl(struct mixer_build *state, unsigned char *desc,
kctl->id.name, sizeof(kctl->id.name));

switch (control) {
case USB_FEATURE_MUTE:
case USB_FEATURE_VOLUME:
case UAC_MUTE_CONTROL:
case UAC_VOLUME_CONTROL:
/* determine the control name. the rule is:
* - if a name id is given in descriptor, use it.
* - if the connected input can be determined, then use the name
Expand All @@ -1029,9 +1014,9 @@ static void build_feature_ctl(struct mixer_build *state, unsigned char *desc,
len = append_ctl_name(kctl, " Playback");
}
}
append_ctl_name(kctl, control == USB_FEATURE_MUTE ?
append_ctl_name(kctl, control == UAC_MUTE_CONTROL ?
" Switch" : " Volume");
if (control == USB_FEATURE_VOLUME) {
if (control == UAC_VOLUME_CONTROL) {
kctl->tlv.c = mixer_vol_tlv;
kctl->vd[0].access |=
SNDRV_CTL_ELEM_ACCESS_TLV_READ |
Expand Down Expand Up @@ -1120,7 +1105,7 @@ static int parse_audio_feature_unit(struct mixer_build *state, int unitid, void
snd_printk(KERN_INFO
"usbmixer: master volume quirk for PCM2702 chip\n");
/* disable non-functional volume control */
master_bits &= ~(1 << (USB_FEATURE_VOLUME - 1));
master_bits &= ~UAC_FU_VOLUME;
break;
}
if (channels > 0)
Expand Down
4 changes: 2 additions & 2 deletions trunk/sound/usb/usbmixer_maps.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ static struct usbmix_name_map extigy_map[] = {
/* 16: MU (w/o controls) */
{ 17, NULL, 1 }, /* DISABLED: PU-switch (any effect?) */
{ 17, "Channel Routing", 2 }, /* PU: mode select */
{ 18, "Tone Control - Bass", USB_FEATURE_BASS }, /* FU */
{ 18, "Tone Control - Treble", USB_FEATURE_TREBLE }, /* FU */
{ 18, "Tone Control - Bass", UAC_BASS_CONTROL }, /* FU */
{ 18, "Tone Control - Treble", UAC_TREBLE_CONTROL }, /* FU */
{ 18, "Master Playback" }, /* FU; others */
/* 19: OT speaker */
/* 20: OT headphone */
Expand Down

0 comments on commit 2f72062

Please sign in to comment.