sound fixes for 2.6.32-rc2
Subsystems (5)
Linus,
please pull sound fixes for v2.6.32-rc2 from:
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.git for-linus
containing the following fixes.
Thanks!
Takashi
===
Barry Song (1):
ASoC: fix kconfig order of Blackfin drivers
Chaithrika U S (1):
ASoC: DaVinci: Correct McASP FIFO initialization
Cliff Cai (1):
ASoC: Blackfin: fix inverted handling of SPORT0 on PORT F/G
Daniel T Chen (3):
ALSA: hda - Add HP Pavilion dv4t-1300 to MSI whitelist
ALSA: intel8x0 - Mute External Amplifier by default for Sony VAIO VGN-T350P
ALSA: intel8x0 - Mute External Amplifier by default for Sony VAIO VGN-B1VP
Giuliano Pochini (1):
ALSA: echoaudio - Re-enable the line-out control for the Mia card
Jean Delvare (1):
sound: Make keywest_driver static
Lukasz Marcinowski (1):
ALSA: hda - CD-audio sound for hda-intel conexant benq laptop
Manoj Iyer (1):
ALSA: hda - Added quirk to enable sound on Toshiba NB200
Miguel de Barros (1):
ALSA: hda - Analog Devices AD1984A add HP Touchsmart model
Sven Eckelmann (1):
ALSA: ctxfi: Swapped SURROUND-SIDE mute
Takashi Iwai (7):
ALSA: hda - Resurrect input-source mixer of ALC268 model=acer
ALSA: Don't assume i2c device probing always succeeds
ASoC: Fix dependency of CONFIG_SND_PXA2XX_SOC_IMOTE2
ALSA: hda - Fix digital/analog mic auto-switching with IDT codecs
ALSA: hda - Fix / improve ALC66x parser
ALSA: Fix invalid __exit in sound/mips/*.c
ALSA: usb - Use strlcat() correctly
Troy Kisky (2):
ASoC: DaVinci: Fix divide by zero error during 1st execution
ASoC: Davinci: Fix race with cpu_dai->dma_data
--- Documentation/sound/alsa/HD-Audio-Models.txt | 1 + sound/aoa/codecs/tas.c | 9 + sound/mips/hal2.c | 2 +- sound/mips/sgio2audio.c | 2 +- sound/pci/ctxfi/ctatc.c | 4 +- sound/pci/echoaudio/echoaudio.c | 30 +++- sound/pci/echoaudio/mia.c | 1 + sound/pci/hda/hda_intel.c | 1 + sound/pci/hda/patch_analog.c | 139 +++++++++++++++ sound/pci/hda/patch_conexant.c | 12 ++- sound/pci/hda/patch_realtek.c | 244 +++++++++++++++++--------- sound/pci/hda/patch_sigmatel.c | 20 ++- sound/pci/intel8x0.c | 12 ++ sound/ppc/keywest.c | 14 ++- sound/soc/blackfin/Kconfig | 98 +++++----- sound/soc/blackfin/bf5xx-i2s.c | 8 +- sound/soc/blackfin/bf5xx-tdm.c | 8 +- sound/soc/davinci/davinci-i2s.c | 37 ++--- sound/soc/davinci/davinci-mcasp.c | 80 +++------ sound/soc/davinci/davinci-mcasp.h | 7 +- sound/soc/davinci/davinci-pcm.c | 13 +- sound/soc/davinci/davinci-pcm.h | 1 - sound/soc/pxa/Kconfig | 2 +- sound/usb/usbmixer.c | 23 ++- 24 files changed, 512 insertions(+), 256 deletions(-)
Documentation/sound/alsa/HD-Audio-Models.txt +1 -0
@@ -209,6 +209,7 @@ AD1884A / AD1883 / AD1984A / AD1984B laptop laptop with HP jack sensing mobile mobile devices with HP jack sensing thinkpad Lenovo Thinkpad X300 + touchsmart HP Touchsmart AD1884 ======
sound/aoa/codecs/tas.c +9 -0
@@ -897,6 +897,15 @@ static int tas_create(struct i2c_adapter *adapter, client =i2c_new_device (adapter, &info);if (!client)return -ENODEV ; +/* +* We know the driver is already loaded, so the device should be +* already bound. If not it means binding failed, and then there +* is no point in keeping the device instantiated. +*/ +if (!client->driver) { +i2c_unregister_device (client); +return -ENODEV ; + }/* * Let i2c-core delete that device on driver removal.
sound/mips/hal2.c +1 -1
@@ -915,7 +915,7 @@ static int __devinit hal2_probe(struct platform_device *pdev)return 0 ; } -static int __exit hal2_remove(struct platform_device *pdev) +static int __devexit hal2_remove(struct platform_device *pdev) {struct snd_card *card =platform_get_drvdata (pdev);
sound/mips/sgio2audio.c +1 -1
@@ -973,7 +973,7 @@ static int __devinit snd_sgio2audio_probe(struct platform_device *pdev)return 0 ; } -static int __exit snd_sgio2audio_remove(struct platform_device *pdev) +static int __devexit snd_sgio2audio_remove(struct platform_device *pdev) {struct snd_card *card =platform_get_drvdata (pdev);
sound/pci/ctxfi/ctatc.c +2 -2
@@ -1037,7 +1037,7 @@ static int atc_line_front_unmute(struct ct_atc *atc, unsigned char state)static int atc_line_surround_unmute (struct ct_atc *atc,unsigned char state) { -return atc_daio_unmute (atc, state,LINEO4 ); +return atc_daio_unmute (atc, state,LINEO2 ); }static int atc_line_clfe_unmute (struct ct_atc *atc,unsigned char state)
@@ -1047,7 +1047,7 @@ static int atc_line_clfe_unmute(struct ct_atc *atc, unsigned char state)static int atc_line_rear_unmute (struct ct_atc *atc,unsigned char state) { -return atc_daio_unmute (atc, state,LINEO2 ); +return atc_daio_unmute (atc, state,LINEO4 ); }static int atc_line_in_unmute (struct ct_atc *atc,unsigned char state)
sound/pci/echoaudio/echoaudio.c +26 -4
@@ -950,7 +950,7 @@ static int __devinit snd_echo_new_pcm(struct echoaudio *chip)Control interface ******************************************************************************/ -#ifndef ECHOCARD_HAS_VMIXER +#if !defined(ECHOCARD_HAS_VMIXER ) || defined(ECHOCARD_HAS_LINE_OUT_GAIN )/******************* PCM output volume *******************/ static int snd_echo_output_gain_info(struct snd_kcontrol *kcontrol,
@@ -1003,6 +1003,19 @@ static int snd_echo_output_gain_put(struct snd_kcontrol *kcontrol,return changed; } +#ifdef ECHOCARD_HAS_LINE_OUT_GAIN +/* On the Mia this one controls the line-out volume */ +static struct snd_kcontrol_new snd_echo_line_output_gain__devinitdata = { + .name ="Line Playback Volume" , + .iface =SNDRV_CTL_ELEM_IFACE_MIXER , + .access =SNDRV_CTL_ELEM_ACCESS_READWRITE | +SNDRV_CTL_ELEM_ACCESS_TLV_READ , + .info = snd_echo_output_gain_info, + .get = snd_echo_output_gain_get, + .put = snd_echo_output_gain_put, + .tlv = {.p = db_scale_output_gain}, +}; +#else static struct snd_kcontrol_new snd_echo_pcm_output_gain__devinitdata = { .name ="PCM Playback Volume" , .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -1012,9 +1025,10 @@ static struct snd_kcontrol_new snd_echo_pcm_output_gain __devinitdata = { .put = snd_echo_output_gain_put, .tlv = {.p = db_scale_output_gain}, }; -#endif +#endif /* !ECHOCARD_HAS_VMIXER || ECHOCARD_HAS_LINE_OUT_GAIN */ +#ifdef ECHOCARD_HAS_INPUT_GAIN
@@ -2030,10 +2044,18 @@ static int __devinit snd_echo_probe(struct pci_dev *pci, snd_echo_vmixer.count =num_pipes_out (chip) *num_busses_out (chip);if ((err =snd_ctl_add (chip->card,snd_ctl_new1 (&snd_echo_vmixer, chip))) <0 ) goto ctl_error; -#else -if ((err =snd_ctl_add (chip->card,snd_ctl_new1 (&snd_echo_pcm_output_gain, chip))) <0 ) +#ifdef ECHOCARD_HAS_LINE_OUT_GAIN + err =snd_ctl_add (chip->card, +snd_ctl_new1 (&snd_echo_line_output_gain, chip)); +if (err <0 ) goto ctl_error;#endif +#else /* ECHOCARD_HAS_VMIXER */ + err =snd_ctl_add (chip->card, +snd_ctl_new1 (&snd_echo_pcm_output_gain, chip)); +if (err <0 ) + goto ctl_error; +#endif /* ECHOCARD_HAS_VMIXER */ #ifdef ECHOCARD_HAS_INPUT_GAIN if ((err =snd_ctl_add (chip->card,snd_ctl_new1 (&snd_echo_line_input_gain, chip))) <0 )
sound/pci/echoaudio/mia.c +1 -0
@@ -29,6 +29,7 @@#define ECHOCARD_HAS_ADAT FALSE#define ECHOCARD_HAS_STEREO_BIG_ENDIAN32 #define ECHOCARD_HAS_MIDI +#define ECHOCARD_HAS_LINE_OUT_GAIN /* Pipe indexes */ #define PX_ANALOG_OUT 0/* 8 */
sound/pci/hda/hda_intel.c +1 -0
@@ -2303,6 +2303,7 @@ static void __devinit check_probe_mask(struct azx *chip, int dev)* white-list for enable_msi */ static struct snd_pci_quirk msi_white_list[]__devinitdata = { +SND_PCI_QUIRK (0x103c ,0x30f7 ,"HP Pavilion dv4t-1300" ,1 ),SND_PCI_QUIRK (0x103c ,0x3607 ,"HP Compa CQ40" ,1 ), {} };
sound/pci/hda/patch_analog.c +139 -0
169 lines not on this page · raw message
sound/pci/hda/patch_conexant.c +11 -1
@@ -682,11 +682,13 @@ static struct hda_input_mux cxt5045_capture_source = { };static struct hda_input_mux cxt5045_capture_source_benq = { - .num_items =3 , + .num_items =5 , .items = { {"IntMic" ,0x1 }, {"ExtMic" ,0x2 }, {"LineIn" ,0x3 }, + {"CD" ,0x4 }, + {"Mixer" ,0x0 }, } };
@@ -811,11 +813,19 @@ static struct snd_kcontrol_new cxt5045_mixers[] = { };static struct snd_kcontrol_new cxt5045_benq_mixers[] = { +HDA_CODEC_VOLUME ("CD Capture Volume" ,0x1a ,0x04 ,HDA_INPUT ), +HDA_CODEC_MUTE ("CD Capture Switch" ,0x1a ,0x04 ,HDA_INPUT ), +HDA_CODEC_VOLUME ("CD Playback Volume" ,0x17 ,0x4 ,HDA_INPUT ), +HDA_CODEC_MUTE ("CD Playback Switch" ,0x17 ,0x4 ,HDA_INPUT ), +HDA_CODEC_VOLUME ("Line In Capture Volume" ,0x1a ,0x03 ,HDA_INPUT ),HDA_CODEC_MUTE ("Line In Capture Switch" ,0x1a ,0x03 ,HDA_INPUT ),HDA_CODEC_VOLUME ("Line In Playback Volume" ,0x17 ,0x3 ,HDA_INPUT ),HDA_CODEC_MUTE ("Line In Playback Switch" ,0x17 ,0x3 ,HDA_INPUT ), +HDA_CODEC_VOLUME ("Mixer Capture Volume" ,0x1a ,0x0 ,HDA_INPUT ), +HDA_CODEC_MUTE ("Mixer Capture Switch" ,0x1a ,0x0 ,HDA_INPUT ), + {} };
sound/pci/hda/patch_realtek.c +157 -87
357 lines not on this page · raw message
sound/pci/hda/patch_sigmatel.c +14 -6
@@ -182,8 +182,8 @@ struct sigmatel_jack {struct sigmatel_mic_route {hda_nid_t pin; -unsigned char mux_idx; -unsigned char dmux_idx; +signed char mux_idx; +signed char dmux_idx; };struct sigmatel_spec {
@@ -3469,18 +3469,26 @@ static int set_mic_route(struct hda_codec *codec,break ;if (i <=AUTO_PIN_FRONT_MIC ) {/* analog pin */ - mic->dmux_idx =0 ; i =get_connection_index (codec, spec->mux_nids[0 ], pin);if (i <0 )return -1 ; mic->mux_idx = i; + mic->dmux_idx =-1 ; +if (spec->dmux_nids) + mic->dmux_idx =get_connection_index (codec, + spec->dmux_nids[0 ], + spec->mux_nids[0 ]); }else if (spec->dmux_nids) {/* digital pin */ - mic->mux_idx =0 ; i =get_connection_index (codec, spec->dmux_nids[0 ], pin);if (i <0 )return -1 ; mic->dmux_idx = i; + mic->mux_idx =-1 ; +if (spec->mux_nids) + mic->mux_idx =get_connection_index (codec, + spec->mux_nids[0 ], + spec->dmux_nids[0 ]); }return 0 ; }
@@ -4557,11 +4565,11 @@ static void stac92xx_mic_detect(struct hda_codec *codec) mic = &spec->ext_mic; else mic = &spec->int_mic; -if (mic->dmux_idx) +if (mic->dmux_idx >=0 )snd_hda_codec_write_cache (codec, spec->dmux_nids[0 ],0 ,AC_VERB_SET_CONNECT_SEL , mic->dmux_idx); -else +if (mic->mux_idx >=0 )snd_hda_codec_write_cache (codec, spec->mux_nids[0 ],0 ,AC_VERB_SET_CONNECT_SEL , mic->mux_idx);
sound/pci/intel8x0.c +12 -0
@@ -1954,6 +1954,18 @@ static struct ac97_quirk ac97_quirks[] __devinitdata = { .name = "Sony S1XP", .type =AC97_TUNE_INV_EAPD }, + { + .subvendor = 0x104d, + .subdevice = 0x81c0, + .name = "Sony VAIO VGN-T350P", /*AD1981B*/ + .type =AC97_TUNE_INV_EAPD + }, + { + .subvendor = 0x104d, + .subdevice = 0x81c5, + .name = "Sony VAIO VGN-B1VP", /*AD1981B*/ + .type =AC97_TUNE_INV_EAPD + }, { .subvendor = 0x1043, .subdevice = 0x80f3,
sound/ppc/keywest.c +13 -1
@@ -59,6 +59,18 @@ static int keywest_attach_adapter(struct i2c_adapter *adapter)strlcpy (info.type,"keywest" ,I2C_NAME_SIZE ); info.addr = keywest_ctx->addr; keywest_ctx->client =i2c_new_device (adapter, &info); +if (!keywest_ctx->client) +return -ENODEV ; +/* +* We know the driver is already loaded, so the device should be +* already bound. If not it means binding failed, and then there +* is no point in keeping the device instantiated. +*/ +if (!keywest_ctx->client->driver) { +i2c_unregister_device (keywest_ctx->client); + keywest_ctx->client =NULL ; +return -ENODEV ; + }/* * Let i2c-core delete that device on driver removal.
@@ -86,7 +98,7 @@ static const struct i2c_device_id keywest_i2c_id[] = { { } }; -struct i2c_driver keywest_driver = { +static struct i2c_driver keywest_driver = { .driver = { .name ="PMac Keywest Audio" , },
sound/soc/blackfin/Kconfig +49 -49
125 lines not on this page · raw message
sound/soc/blackfin/bf5xx-i2s.c +4 -4
@@ -77,12 +77,12 @@ static struct sport_param sport_params[2] = {* TFS. When Port G is selected and EMAC then there is a conflict between * the PHY interrupt line and TFS. Current settings prevent the conflict * by ignoring the TFS pin when Port G is selected. This allows both -* ssm2602 using Port G and EMAC concurrently. +* codecs and EMAC using Port G concurrently. */ -#ifdef CONFIG_BF527_SPORT0_PORTF -#define LOCAL_SPORT0_TFS (P_SPORT0_TFS) -#else +#ifdef CONFIG_BF527_SPORT0_PORTG #define LOCAL_SPORT0_TFS (0) +#else +#define LOCAL_SPORT0_TFS (P_SPORT0_TFS)#endif static u16 sport_req[][7 ] = { {P_SPORT0_DTPRI ,P_SPORT0_TSCLK ,P_SPORT0_RFS ,
sound/soc/blackfin/bf5xx-tdm.c +4 -4
@@ -78,12 +78,12 @@ static struct sport_param sport_params[2] = {* TFS. When Port G is selected and EMAC then there is a conflict between * the PHY interrupt line and TFS. Current settings prevent the conflict * by ignoring the TFS pin when Port G is selected. This allows both -* ssm2602 using Port G and EMAC concurrently. +* codecs and EMAC using Port G concurrently. */ -#ifdef CONFIG_BF527_SPORT0_PORTF -#define LOCAL_SPORT0_TFS (P_SPORT0_TFS) -#else +#ifdef CONFIG_BF527_SPORT0_PORTG #define LOCAL_SPORT0_TFS (0) +#else +#define LOCAL_SPORT0_TFS (P_SPORT0_TFS)#endif static u16 sport_req[][7 ] = { {P_SPORT0_DTPRI ,P_SPORT0_TSCLK ,P_SPORT0_RFS ,
sound/soc/davinci/davinci-i2s.c +12 -25
@@ -97,22 +97,19 @@ enum { DAVINCI_MCBSP_WORD_32, }; -static struct davinci_pcm_dma_params davinci_i2s_pcm_out = { - .name ="I2S PCM Stereo out" , -}; - -static struct davinci_pcm_dma_params davinci_i2s_pcm_in = { - .name ="I2S PCM Stereo in" , -}; -struct davinci_mcbsp_dev { +/* +* dma_params must be first because rtd->dai->cpu_dai->private_data +* is cast to a pointer of an array of struct davinci_pcm_dma_params in +* davinci_pcm_open. +*/ +struct davinci_pcm_dma_params dma_params[2 ];void __iomem *base;#define MOD_DSP_A 0#define MOD_DSP_B 1int mode;u32 pcr;struct clk *clk; -struct davinci_pcm_dma_params *dma_params[2 ]; }; static inline void davinci_mcbsp_write_reg(struct davinci_mcbsp_dev *dev,
@@ -215,14 +212,6 @@ static void davinci_mcbsp_stop(struct davinci_mcbsp_dev *dev, int playback)toggle_clock (dev, playback); } -static int davinci_i2s_startup (struct snd_pcm_substream *substream, -struct snd_soc_dai *cpu_dai) -{ -struct davinci_mcbsp_dev *dev = cpu_dai->private_data; - cpu_dai->dma_data = dev->dma_params[substream->stream]; -return 0 ; -} -#define DEFAULT_BITPERSAMPLE 16 static int davinci_i2s_set_dai_fmt(struct snd_soc_dai *cpu_dai,
@@ -353,8 +342,9 @@ static int davinci_i2s_hw_params(struct snd_pcm_substream *substream,struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) { - struct davinci_pcm_dma_params *dma_params = dai->dma_data; struct davinci_mcbsp_dev *dev = dai->private_data; +struct davinci_pcm_dma_params *dma_params = + &dev->dma_params[substream->stream];struct snd_interval *i =NULL ;int mcbsp_word_length;unsigned int rcr, xcr, srgr;
@@ -472,7 +462,6 @@ static void davinci_i2s_shutdown(struct snd_pcm_substream *substream,#define DAVINCI_I2S_RATES SNDRV_PCM_RATE_8000_96000static struct snd_soc_dai_ops davinci_i2s_dai_ops = { - .startup = davinci_i2s_startup, .shutdown = davinci_i2s_shutdown, .prepare = davinci_i2s_prepare, .trigger = davinci_i2s_trigger,
@@ -534,12 +523,10 @@ static int davinci_i2s_probe(struct platform_device *pdev) dev->base = (void __iomem *)IO_ADDRESS (mem->start); - dev->dma_params[SNDRV_PCM_STREAM_PLAYBACK ] = &davinci_i2s_pcm_out; - dev->dma_params[SNDRV_PCM_STREAM_PLAYBACK ]->dma_addr = + dev->dma_params[SNDRV_PCM_STREAM_PLAYBACK ].dma_addr = (dma_addr_t)(io_v2p (dev->base) +DAVINCI_MCBSP_DXR_REG ); - dev->dma_params[SNDRV_PCM_STREAM_CAPTURE ] = &davinci_i2s_pcm_in; - dev->dma_params[SNDRV_PCM_STREAM_CAPTURE ]->dma_addr = + dev->dma_params[SNDRV_PCM_STREAM_CAPTURE ].dma_addr = (dma_addr_t)(io_v2p (dev->base) +DAVINCI_MCBSP_DRR_REG );/* first TX, then RX */
@@ -549,7 +536,7 @@ static int davinci_i2s_probe(struct platform_device *pdev) ret = -ENXIO ; goto err_free_mem; } - dev->dma_params[SNDRV_PCM_STREAM_PLAYBACK ]->channel = res->start; + dev->dma_params[SNDRV_PCM_STREAM_PLAYBACK ].channel = res->start; res =platform_get_resource (pdev,IORESOURCE_DMA ,1 );if (!res) {
@@ -557,7 +544,7 @@ static int davinci_i2s_probe(struct platform_device *pdev) ret = -ENXIO ; goto err_free_mem; } - dev->dma_params[SNDRV_PCM_STREAM_CAPTURE ]->channel = res->start; + dev->dma_params[SNDRV_PCM_STREAM_CAPTURE ].channel = res->start; davinci_i2s_dai.private_data = dev; ret =snd_soc_register_dai (&davinci_i2s_dai);
sound/soc/davinci/davinci-mcasp.c +28 -52
164 lines not on this page · raw message
sound/soc/davinci/davinci-mcasp.h +6 -1
@@ -39,10 +39,15 @@ enum { };struct davinci_audio_dev { +/* +* dma_params must be first because rtd->dai->cpu_dai->private_data +* is cast to a pointer of an array of struct davinci_pcm_dma_params in +* davinci_pcm_open. +*/ +struct davinci_pcm_dma_params dma_params[2 ];void __iomem *base;int sample_rate;struct clk *clk; -struct davinci_pcm_dma_params *dma_params[2 ];unsigned int codec_fmt;/* McASP specific data */
sound/soc/davinci/davinci-pcm.c +6 -7
@@ -126,16 +126,9 @@ static void davinci_pcm_dma_irq(unsigned lch, u16 ch_status, void *data)static int davinci_pcm_dma_request (struct snd_pcm_substream *substream) {struct davinci_runtime_data *prtd = substream->runtime->private_data; -struct snd_soc_pcm_runtime *rtd = substream->private_data; -struct davinci_pcm_dma_params *dma_data = rtd->dai->cpu_dai->dma_data;struct edmacc_param p_ram;int ret; -if (!dma_data) -return -ENODEV ; - - prtd->params = dma_data; -/* Request master DMA channel */ ret = edma_alloc_channel(prtd->params->channel, davinci_pcm_dma_irq, substream,
@@ -244,6 +237,11 @@ static int davinci_pcm_open(struct snd_pcm_substream *substream)struct snd_pcm_runtime *runtime = substream->runtime;struct davinci_runtime_data *prtd;int ret =0 ; +struct snd_soc_pcm_runtime *rtd = substream->private_data; +struct davinci_pcm_dma_params *pa = rtd->dai->cpu_dai->private_data; +struct davinci_pcm_dma_params *params = &pa[substream->stream]; +if (!params) +return -ENODEV ;snd_soc_set_runtime_hwparams (substream, &davinci_pcm_hardware);/* ensure that buffer size is a multiple of period size */
@@ -257,6 +255,7 @@ static int davinci_pcm_open(struct snd_pcm_substream *substream)return -ENOMEM ;spin_lock_init (&prtd->lock); + prtd->params = params; runtime->private_data = prtd;
sound/soc/davinci/davinci-pcm.h +0 -1
@@ -17,7 +17,6 @@struct davinci_pcm_dma_params { -char *name;/* stream identifier */ int channel;/* sync dma channel ID */ unsigned short acnt;dma_addr_t dma_addr;/* device physical address for DMA */
sound/soc/pxa/Kconfig +1 -1
@@ -138,7 +138,7 @@ config SND_PXA2XX_SOC_MIOA701 config SND_PXA2XX_SOC_IMOTE2 tristate "SoC Audio support for IMote 2" - depends on SND_PXA2XX_SOC && MACH_INTELMOTE2 + depends on SND_PXA2XX_SOC && MACH_INTELMOTE2 && I2C select SND_PXA2XX_SOC_I2S select SND_SOC_WM8940 help
sound/usb/usbmixer.c +14 -9
@@ -898,6 +898,11 @@ static struct snd_kcontrol_new usb_feature_unit_ctl = {* build a feature control */ +static size_t append_ctl_name (struct snd_kcontrol *kctl,const char *str) +{ +return strlcat (kctl->id.name, str,sizeof (kctl->id.name)); +} +static void build_feature_ctl (struct mixer_build *state,unsigned char *desc,unsigned int ctl_mask,int control,struct usb_audio_term *iterm,int unitid)
@@ -978,13 +983,13 @@ static void build_feature_ctl(struct mixer_build *state, unsigned char *desc,*/ if (! mapped_name && ! (state->oterm.type >>16 )) {if ((state->oterm.type &0xff00 ) ==0x0100 ) { - len =strlcat (kctl->id.name," Capture" ,sizeof (kctl->id.name)); + len =append_ctl_name (kctl," Capture" ); }else { - len =strlcat (kctl->id.name + len," Playback" ,sizeof (kctl->id.name)); + len =append_ctl_name (kctl," Playback" ); } } -strlcat (kctl->id.name + len, control ==USB_FEATURE_MUTE ?" Switch" :" Volume" , -sizeof (kctl->id.name)); +append_ctl_name (kctl, control ==USB_FEATURE_MUTE ? +" Switch" :" Volume" );if (control ==USB_FEATURE_VOLUME ) { kctl->tlv.c = mixer_vol_tlv; kctl->vd[0].access |=
@@ -1143,7 +1148,7 @@ static void build_mixer_unit_ctl(struct mixer_build *state, unsigned char *desc, len =get_term_name (state, iterm, kctl->id.name,sizeof (kctl->id.name),0 );if (! len) len =sprintf (kctl->id.name,"Mixer Source %d" , in_ch +1 ); -strlcat (kctl->id.name + len," Volume" ,sizeof (kctl->id.name)); +append_ctl_name (kctl," Volume" );snd_printdd (KERN_INFO "[%d] MU [%s] ch = %d, val = %d/%d\n" , 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, unsignedif (! len)strlcpy (kctl->id.name, name,sizeof (kctl->id.name)); } -strlcat (kctl->id.name," " ,sizeof (kctl->id.name)); -strlcat (kctl->id.name, valinfo->suffix,sizeof (kctl->id.name)); +append_ctl_name (kctl," " ); +append_ctl_name (kctl, valinfo->suffix);snd_printdd (KERN_INFO "[%d] PU [%s] ch = %d, val = %d/%d\n" , 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, unsistrlcpy (kctl->id.name,"USB" ,sizeof (kctl->id.name));if ((state->oterm.type &0xff00 ) ==0x0100 ) -strlcat (kctl->id.name," Capture Source" ,sizeof (kctl->id.name)); +append_ctl_name (kctl," Capture Source" );else -strlcat (kctl->id.name," Playback Source" ,sizeof (kctl->id.name)); +append_ctl_name (kctl," Playback Source" ); } snd_printdd(KERN_INFO "[%d] SU [%s] items = %d\n",