aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-10-03 14:25:30 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-10-03 14:25:30 -0400
commitf0a221ef47df3cdde2123fe75ce3b61bb7df656d (patch)
treed373fb0659a43eb3c3421db67787d6c95d340aca /sound/usb
parent9117703fabe4141dae566d683eeb728f638c9e49 (diff)
parent7fa9742bf7f918293c0b3ffd84167fccbdd42765 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'for-linus' of ssh://master.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: (21 commits) ALSA: usb - Use strlcat() correctly ALSA: Fix invalid __exit in sound/mips/*.c ALSA: hda - Fix / improve ALC66x parser ALSA: ctxfi: Swapped SURROUND-SIDE mute sound: Make keywest_driver static ALSA: intel8x0 - Mute External Amplifier by default for Sony VAIO VGN-B1VP ALSA: hda - Fix digita/analog mic auto-switching with IDT codecs ASoC: fix kconfig order of Blackfin drivers ALSA: hda - Added quirk to enable sound on Toshiba NB200 ASoC: Fix dependency of CONFIG_SND_PXA2XX_SOC_IMOTE2 ALSA: Don't assume i2c device probing always succeeds ALSA: intel8x0 - Mute External Amplifier by default for Sony VAIO VGN-T350P ALSA: echoaudio - Re-enable the line-out control for the Mia card ALSA: hda - Resurrect input-source mixer of ALC268 model=acer ALSA: hda - Analog Devices AD1984A add HP Touchsmart model ALSA: hda - Add HP Pavilion dv4t-1300 to MSI whitelist ALSA: hda - CD-audio sound for hda-intel conexant benq laptop ASoC: DaVinci: Correct McASP FIFO initialization ASoC: Davinci: Fix race with cpu_dai->dma_data ASoC: DaVinci: Fix divide by zero error during 1st execution ...
Diffstat (limited to 'sound/usb')
-rw-r--r--sound/usb/usbmixer.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/sound/usb/usbmixer.c b/sound/usb/usbmixer.c
index ab5a3ac2ac47..9efcfd08d747 100644
--- a/sound/usb/usbmixer.c
+++ b/sound/usb/usbmixer.c
@@ -898,6 +898,11 @@ static struct snd_kcontrol_new usb_feature_unit_ctl = {
898 * build a feature control 898 * build a feature control
899 */ 899 */
900 900
901static size_t append_ctl_name(struct snd_kcontrol *kctl, const char *str)
902{
903 return strlcat(kctl->id.name, str, sizeof(kctl->id.name));
904}
905
901static void build_feature_ctl(struct mixer_build *state, unsigned char *desc, 906static void build_feature_ctl(struct mixer_build *state, unsigned char *desc,
902 unsigned int ctl_mask, int control, 907 unsigned int ctl_mask, int control,
903 struct usb_audio_term *iterm, int unitid) 908 struct usb_audio_term *iterm, int unitid)
@@ -978,13 +983,13 @@ static void build_feature_ctl(struct mixer_build *state, unsigned char *desc,
978 */ 983 */
979 if (! mapped_name && ! (state->oterm.type >> 16)) { 984 if (! mapped_name && ! (state->oterm.type >> 16)) {
980 if ((state->oterm.type & 0xff00) == 0x0100) { 985 if ((state->oterm.type & 0xff00) == 0x0100) {
981 len = strlcat(kctl->id.name, " Capture", sizeof(kctl->id.name)); 986 len = append_ctl_name(kctl, " Capture");
982 } else { 987 } else {
983 len = strlcat(kctl->id.name + len, " Playback", sizeof(kctl->id.name)); 988 len = append_ctl_name(kctl, " Playback");
984 } 989 }
985 } 990 }
986 strlcat(kctl->id.name + len, control == USB_FEATURE_MUTE ? " Switch" : " Volume", 991 append_ctl_name(kctl, control == USB_FEATURE_MUTE ?
987 sizeof(kctl->id.name)); 992 " Switch" : " Volume");
988 if (control == USB_FEATURE_VOLUME) { 993 if (control == USB_FEATURE_VOLUME) {
989 kctl->tlv.c = mixer_vol_tlv; 994 kctl->tlv.c = mixer_vol_tlv;
990 kctl->vd[0].access |= 995 kctl->vd[0].access |=
@@ -1143,7 +1148,7 @@ static void build_mixer_unit_ctl(struct mixer_build *state, unsigned char *desc,
1143 len = get_term_name(state, iterm, kctl->id.name, sizeof(kctl->id.name), 0); 1148 len = get_term_name(state, iterm, kctl->id.name, sizeof(kctl->id.name), 0);
1144 if (! len) 1149 if (! len)
1145 len = sprintf(kctl->id.name, "Mixer Source %d", in_ch + 1); 1150 len = sprintf(kctl->id.name, "Mixer Source %d", in_ch + 1);
1146 strlcat(kctl->id.name + len, " Volume", sizeof(kctl->id.name)); 1151 append_ctl_name(kctl, " Volume");
1147 1152
1148 snd_printdd(KERN_INFO "[%d] MU [%s] ch = %d, val = %d/%d\n", 1153 snd_printdd(KERN_INFO "[%d] MU [%s] ch = %d, val = %d/%d\n",
1149 cval->id, kctl->id.name, cval->channels, cval->min, cval->max); 1154 cval->id, kctl->id.name, cval->channels, cval->min, cval->max);
@@ -1400,8 +1405,8 @@ static int build_audio_procunit(struct mixer_build *state, int unitid, unsigned
1400 if (! len) 1405 if (! len)
1401 strlcpy(kctl->id.name, name, sizeof(kctl->id.name)); 1406 strlcpy(kctl->id.name, name, sizeof(kctl->id.name));
1402 } 1407 }
1403 strlcat(kctl->id.name, " ", sizeof(kctl->id.name)); 1408 append_ctl_name(kctl, " ");
1404 strlcat(kctl->id.name, valinfo->suffix, sizeof(kctl->id.name)); 1409 append_ctl_name(kctl, valinfo->suffix);
1405 1410
1406 snd_printdd(KERN_INFO "[%d] PU [%s] ch = %d, val = %d/%d\n", 1411 snd_printdd(KERN_INFO "[%d] PU [%s] ch = %d, val = %d/%d\n",
1407 cval->id, kctl->id.name, cval->channels, cval->min, cval->max); 1412 cval->id, kctl->id.name, cval->channels, cval->min, cval->max);
@@ -1610,9 +1615,9 @@ static int parse_audio_selector_unit(struct mixer_build *state, int unitid, unsi
1610 strlcpy(kctl->id.name, "USB", sizeof(kctl->id.name)); 1615 strlcpy(kctl->id.name, "USB", sizeof(kctl->id.name));
1611 1616
1612 if ((state->oterm.type & 0xff00) == 0x0100) 1617 if ((state->oterm.type & 0xff00) == 0x0100)
1613 strlcat(kctl->id.name, " Capture Source", sizeof(kctl->id.name)); 1618 append_ctl_name(kctl, " Capture Source");
1614 else 1619 else
1615 strlcat(kctl->id.name, " Playback Source", sizeof(kctl->id.name)); 1620 append_ctl_name(kctl, " Playback Source");
1616 } 1621 }
1617 1622
1618 snd_printdd(KERN_INFO "[%d] SU [%s] items = %d\n", 1623 snd_printdd(KERN_INFO "[%d] SU [%s] items = %d\n",