sound fixes for 2.6.37
Subsystems (3)
Linus,
please pull sound fixes for v2.6.37-final from:
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.git for-linus
Unlike my previous expectation, as usual, there is again another update just before the final. One trivial security fix and a quirk addition, and the rest large (but flat) changes are for the last-minute fixes of ASoC cache issues. These are pretty local and shouldn't bring any serious regressions.
Thanks!
Takashi
===
Dan Rosenberg (1):
sound: Prevent buffer overflow in OSS load_mixer_volumes
Daniel T Chen (1):
ALSA: hda: Use LPIB quirk for Dell Inspiron m101z/1120
Lars-Peter Clausen (9):
ASoC: codecs: Add missing control_type initialization
ASoC: codecs: max98088: Fix register cache incoherency
ASoC: codecs: wm8523: Fix register cache incoherency
ASoC: codecs: wm8741: Fix register cache incoherency
ASoC: codecs: wm8904: Fix register cache incoherency
ASoC: codecs: wm8955: Fix register cache incoherency
ASoC: codecs: wm8962: Fix register cache incoherency
ASoC: codecs: wm9090: Fix register cache incoherency
ASoC: codecs: wm8753: Fix register cache incoherency
--- sound/oss/soundcard.c | 4 +- sound/pci/hda/hda_intel.c | 1 + sound/soc/codecs/max98088.c | 10 +- sound/soc/codecs/wm8523.c | 9 +- sound/soc/codecs/wm8741.c | 10 +- sound/soc/codecs/wm8753.c | 226 ++++++++++++++++--------------------------- sound/soc/codecs/wm8904.c | 37 ++++---- sound/soc/codecs/wm8940.c | 1 + sound/soc/codecs/wm8955.c | 31 +++--- sound/soc/codecs/wm8960.c | 1 + sound/soc/codecs/wm8962.c | 45 ++++----- sound/soc/codecs/wm8971.c | 1 + sound/soc/codecs/wm9081.c | 1 + sound/soc/codecs/wm9090.c | 18 ++-- 14 files changed, 167 insertions(+), 228 deletions(-)
sound/oss/soundcard.c +2 -2
@@ -87,7 +87,7 @@ int *load_mixer_volumes(char *name, int *levels, int present)int i, n;for (i =0 ; i < num_mixer_volumes; i++) { -if (strcmp (name, mixer_vols[i].name) ==0 ) { +if (strncmp (name, mixer_vols[i].name,32 ) ==0 ) {if (present) mixer_vols[i].num = i;return mixer_vols[i].levels;
@@ -99,7 +99,7 @@ int *load_mixer_volumes(char *name, int *levels, int present) } n = num_mixer_volumes++; -strcpy (mixer_vols[n].name, name); +strncpy (mixer_vols[n].name, name,32 );if (present) mixer_vols[n].num = n;
sound/pci/hda/hda_intel.c +1 -0
@@ -2300,6 +2300,7 @@ static struct snd_pci_quirk position_fix_list[] __devinitdata = {SND_PCI_QUIRK (0x1028 ,0x01cc ,"Dell D820" ,POS_FIX_LPIB ),SND_PCI_QUIRK (0x1028 ,0x01de ,"Dell Precision 390" ,POS_FIX_LPIB ),SND_PCI_QUIRK (0x1028 ,0x01f6 ,"Dell Latitude 131L" ,POS_FIX_LPIB ), +SND_PCI_QUIRK (0x1028 ,0x0470 ,"Dell Inspiron 1120" ,POS_FIX_LPIB ),SND_PCI_QUIRK (0x103c ,0x306d ,"HP dv3" ,POS_FIX_LPIB ),SND_PCI_QUIRK (0x1043 ,0x813d ,"ASUS P5AD2" ,POS_FIX_LPIB ), SND_PCI_QUIRK(0x1043, 0x81b3, "ASUS", POS_FIX_LPIB),
sound/soc/codecs/max98088.c +4 -6
@@ -40,7 +40,6 @@ struct max98088_cdata { };struct max98088_priv { -u8 reg_cache[M98088_REG_CNT ];enum max98088_type devtype;void *control_data;struct max98088_pdata *pdata;
@@ -1588,7 +1587,7 @@ static int max98088_dai2_set_fmt(struct snd_soc_dai *codec_dai,static void max98088_sync_cache (struct snd_soc_codec *codec) { -struct max98088_priv *max98088 =snd_soc_codec_get_drvdata (codec); +u16 *reg_cache = codec->reg_cache;int i;if (!codec->cache_sync)
@@ -1599,14 +1598,14 @@ static void max98088_sync_cache(struct snd_soc_codec *codec)/* write back cached values if they're writeable and * different from the hardware default. */ -for (i =1 ; i <ARRAY_SIZE (max98088->reg_cache); i++) { +for (i =1 ; i < codec->driver->reg_cache_size; i++) {if (!max98088_access[i].writable)continue ; -if (max98088->reg_cache[i] == max98088_reg[i]) +if (reg_cache[i] == max98088_reg[i])continue ; -snd_soc_write (codec, i, max98088->reg_cache[i]); +snd_soc_write (codec, i, reg_cache[i]); } codec->cache_sync =0 ;
@@ -1951,7 +1950,6 @@ static int max98088_probe(struct snd_soc_codec *codec)int ret =0 ; codec->cache_sync =1 ; -memcpy (codec->reg_cache, max98088_reg,sizeof (max98088_reg)); ret =snd_soc_codec_set_cache_io (codec,8 ,8 ,SND_SOC_I2C );if (ret !=0 ) {
sound/soc/codecs/wm8523.c +5 -4
@@ -41,7 +41,6 @@ static const char *wm8523_supply_names[WM8523_NUM_SUPPLIES] = {/* codec private data */ struct wm8523_priv {enum snd_soc_control_type control_type; -u16 reg_cache[WM8523_REGISTER_COUNT ];struct regulator_bulk_data supplies[WM8523_NUM_SUPPLIES ];unsigned int sysclk;unsigned int rate_constraint_list[WM8523_NUM_RATES ];
@@ -314,6 +313,7 @@ static int wm8523_set_bias_level(struct snd_soc_codec *codec, enum snd_soc_bias_level level) {struct wm8523_priv *wm8523 =snd_soc_codec_get_drvdata (codec); +u16 *reg_cache = codec->reg_cache;int ret, i;switch (level) {
@@ -344,7 +344,7 @@ static int wm8523_set_bias_level(struct snd_soc_codec *codec,/* Sync back default/cached values */ for (i =WM8523_AIF_CTRL1 ; i <WM8523_MAX_REGISTER ; i++) -snd_soc_write (codec, i, wm8523->reg_cache[i]); +snd_soc_write (codec, i, reg_cache[i]);msleep (100 );
@@ -414,6 +414,7 @@ static int wm8523_resume(struct snd_soc_codec *codec)static int wm8523_probe (struct snd_soc_codec *codec) {struct wm8523_priv *wm8523 =snd_soc_codec_get_drvdata (codec); +u16 *reg_cache = codec->reg_cache;int ret, i; codec->hw_write = (hw_write_t )i2c_master_send;
@@ -470,8 +471,8 @@ static int wm8523_probe(struct snd_soc_codec *codec) }/* Change some default settings - latch VU and enable ZC */ - wm8523->reg_cache[WM8523_DAC_GAINR ] |=WM8523_DACR_VU ; - wm8523->reg_cache[WM8523_DAC_CTRL3 ] |=WM8523_ZC ; + reg_cache[WM8523_DAC_GAINR ] |=WM8523_DACR_VU ; + reg_cache[WM8523_DAC_CTRL3 ] |=WM8523_ZC ;wm8523_set_bias_level (codec,SND_SOC_BIAS_STANDBY );
sound/soc/codecs/wm8741.c +5 -5
@@ -41,7 +41,6 @@ static const char *wm8741_supply_names[WM8741_NUM_SUPPLIES] = {/* codec private data */ struct wm8741_priv {enum snd_soc_control_type control_type; -u16 reg_cache[WM8741_REGISTER_COUNT ];struct regulator_bulk_data supplies[WM8741_NUM_SUPPLIES ];unsigned int sysclk;struct snd_pcm_hw_constraint_list *sysclk_constraints;
@@ -422,6 +421,7 @@ static int wm8741_resume(struct snd_soc_codec *codec)static int wm8741_probe (struct snd_soc_codec *codec) {struct wm8741_priv *wm8741 =snd_soc_codec_get_drvdata (codec); +u16 *reg_cache = codec->reg_cache;int ret =0 ; ret =snd_soc_codec_set_cache_io (codec,7 ,9 , wm8741->control_type);
@@ -437,10 +437,10 @@ static int wm8741_probe(struct snd_soc_codec *codec) }/* Change some default settings - latch VU */ - wm8741->reg_cache[WM8741_DACLLSB_ATTENUATION ] |=WM8741_UPDATELL ; - wm8741->reg_cache[WM8741_DACLMSB_ATTENUATION ] |=WM8741_UPDATELM ; - wm8741->reg_cache[WM8741_DACRLSB_ATTENUATION ] |=WM8741_UPDATERL ; - wm8741->reg_cache[WM8741_DACRLSB_ATTENUATION ] |=WM8741_UPDATERM ; + reg_cache[WM8741_DACLLSB_ATTENUATION ] |=WM8741_UPDATELL ; + reg_cache[WM8741_DACLMSB_ATTENUATION ] |=WM8741_UPDATELM ; + reg_cache[WM8741_DACRLSB_ATTENUATION ] |=WM8741_UPDATERL ; + reg_cache[WM8741_DACRLSB_ATTENUATION ] |=WM8741_UPDATERM ;snd_soc_add_controls (codec, wm8741_snd_controls,ARRAY_SIZE (wm8741_snd_controls));
sound/soc/codecs/wm8753.c +83 -143
456 lines not on this page · raw message
sound/soc/codecs/wm8904.c +18 -19
@@ -50,8 +50,6 @@ static const char *wm8904_supply_names[WM8904_NUM_SUPPLIES] = {/* codec private data */ struct wm8904_priv { -u16 reg_cache[WM8904_MAX_REGISTER +1 ]; -enum wm8904_type devtype;void *control_data;
@@ -2094,7 +2092,7 @@ static int wm8904_digital_mute(struct snd_soc_dai *codec_dai, int mute)static void wm8904_sync_cache (struct snd_soc_codec *codec) { -struct wm8904_priv *wm8904 =snd_soc_codec_get_drvdata (codec); +u16 *reg_cache = codec->reg_cache;int i;if (!codec->cache_sync)
@@ -2105,14 +2103,14 @@ static void wm8904_sync_cache(struct snd_soc_codec *codec)/* Sync back cached values if they're different from the * hardware default. */ -for (i =1 ; i <ARRAY_SIZE (wm8904->reg_cache); i++) { +for (i =1 ; i < codec->driver->reg_cache_size; i++) {if (!wm8904_access[i].writable)continue ; -if (wm8904->reg_cache[i] == wm8904_reg[i]) +if (reg_cache[i] == wm8904_reg[i])continue ; -snd_soc_write (codec, i, wm8904->reg_cache[i]); +snd_soc_write (codec, i, reg_cache[i]); } codec->cache_sync =0 ;
@@ -2371,6 +2369,7 @@ static int wm8904_probe(struct snd_soc_codec *codec) {struct wm8904_priv *wm8904 =snd_soc_codec_get_drvdata (codec);struct wm8904_pdata *pdata = wm8904->pdata; +u16 *reg_cache = codec->reg_cache;int ret, i; codec->cache_sync =1 ;
@@ -2437,19 +2436,19 @@ static int wm8904_probe(struct snd_soc_codec *codec) }/* Change some default settings - latch VU and enable ZC */ - wm8904->reg_cache[WM8904_ADC_DIGITAL_VOLUME_LEFT ] |=WM8904_ADC_VU ; - wm8904->reg_cache[WM8904_ADC_DIGITAL_VOLUME_RIGHT ] |=WM8904_ADC_VU ; - wm8904->reg_cache[WM8904_DAC_DIGITAL_VOLUME_LEFT ] |=WM8904_DAC_VU ; - wm8904->reg_cache[WM8904_DAC_DIGITAL_VOLUME_RIGHT ] |=WM8904_DAC_VU ; - wm8904->reg_cache[WM8904_ANALOGUE_OUT1_LEFT ] |=WM8904_HPOUT_VU | + reg_cache[WM8904_ADC_DIGITAL_VOLUME_LEFT ] |=WM8904_ADC_VU ; + reg_cache[WM8904_ADC_DIGITAL_VOLUME_RIGHT ] |=WM8904_ADC_VU ; + reg_cache[WM8904_DAC_DIGITAL_VOLUME_LEFT ] |=WM8904_DAC_VU ; + reg_cache[WM8904_DAC_DIGITAL_VOLUME_RIGHT ] |=WM8904_DAC_VU ; + reg_cache[WM8904_ANALOGUE_OUT1_LEFT ] |=WM8904_HPOUT_VU |WM8904_HPOUTLZC ; - wm8904->reg_cache[WM8904_ANALOGUE_OUT1_RIGHT ] |=WM8904_HPOUT_VU | + reg_cache[WM8904_ANALOGUE_OUT1_RIGHT ] |=WM8904_HPOUT_VU |WM8904_HPOUTRZC ; - wm8904->reg_cache[WM8904_ANALOGUE_OUT2_LEFT ] |=WM8904_LINEOUT_VU | + reg_cache[WM8904_ANALOGUE_OUT2_LEFT ] |=WM8904_LINEOUT_VU |WM8904_LINEOUTLZC ; - wm8904->reg_cache[WM8904_ANALOGUE_OUT2_RIGHT ] |=WM8904_LINEOUT_VU | + reg_cache[WM8904_ANALOGUE_OUT2_RIGHT ] |=WM8904_LINEOUT_VU |WM8904_LINEOUTRZC ; - wm8904->reg_cache[WM8904_CLOCK_RATES_0 ] &= ~WM8904_SR_MODE ; + reg_cache[WM8904_CLOCK_RATES_0 ] &= ~WM8904_SR_MODE ;/* Apply configuration from the platform data. */ if (wm8904->pdata) {
@@ -2457,23 +2456,23 @@ static int wm8904_probe(struct snd_soc_codec *codec)if (!pdata->gpio_cfg[i])continue ; - wm8904->reg_cache[WM8904_GPIO_CONTROL_1 + i] + reg_cache[WM8904_GPIO_CONTROL_1 + i] = pdata->gpio_cfg[i] &0xffff ; }/* Zero is the default value for these anyway */ for (i =0 ; i <WM8904_MIC_REGS ; i++) - wm8904->reg_cache[WM8904_MIC_BIAS_CONTROL_0 + i] + reg_cache[WM8904_MIC_BIAS_CONTROL_0 + i] = pdata->mic_cfg[i]; }/* Set Class W by default - this will be managed by the Class * G widget at runtime where bypass paths are available. */ - wm8904->reg_cache[WM8904_CLASS_W_0 ] |=WM8904_CP_DYN_PWR ; + reg_cache[WM8904_CLASS_W_0 ] |=WM8904_CP_DYN_PWR ;/* Use normal bias source */ - wm8904->reg_cache[WM8904_BIAS_CONTROL_0 ] &= ~WM8904_POBCTRL ; + reg_cache[WM8904_BIAS_CONTROL_0 ] &= ~WM8904_POBCTRL ;wm8904_set_bias_level (codec,SND_SOC_BIAS_STANDBY );
sound/soc/codecs/wm8940.c +1 -0
@@ -768,6 +768,7 @@ static __devinit int wm8940_i2c_probe(struct i2c_client *i2c,i2c_set_clientdata (i2c, wm8940); wm8940->control_data = i2c; + wm8940->control_type =SND_SOC_I2C ; ret =snd_soc_register_codec (&i2c->dev, &soc_codec_dev_wm8940, &wm8940_dai,1 );
sound/soc/codecs/wm8955.c +16 -15
@@ -42,8 +42,6 @@ static const char *wm8955_supply_names[WM8955_NUM_SUPPLIES] = {struct wm8955_priv {enum snd_soc_control_type control_type; -u16 reg_cache[WM8955_MAX_REGISTER +1 ]; -unsigned int mclk_rate;int deemph;
@@ -768,6 +766,7 @@ static int wm8955_set_bias_level(struct snd_soc_codec *codec, enum snd_soc_bias_level level) {struct wm8955_priv *wm8955 =snd_soc_codec_get_drvdata (codec); +u16 *reg_cache = codec->reg_cache;int ret, i;switch (level) {
@@ -800,14 +799,14 @@ static int wm8955_set_bias_level(struct snd_soc_codec *codec,/* Sync back cached values if they're * different from the hardware default. */ -for (i =0 ; i <ARRAY_SIZE (wm8955->reg_cache); i++) { +for (i =0 ; i < codec->driver->reg_cache_size; i++) {if (i ==WM8955_RESET )continue ; -if (wm8955->reg_cache[i] == wm8955_reg[i]) +if (reg_cache[i] == wm8955_reg[i])continue ; -snd_soc_write (codec, i, wm8955->reg_cache[i]); +snd_soc_write (codec, i, reg_cache[i]); }/* Enable VREF and VMID */
@@ -902,6 +901,7 @@ static int wm8955_probe(struct snd_soc_codec *codec) {struct wm8955_priv *wm8955 =snd_soc_codec_get_drvdata (codec);struct wm8955_pdata *pdata =dev_get_platdata (codec->dev); +u16 *reg_cache = codec->reg_cache;int ret, i; ret =snd_soc_codec_set_cache_io (codec,7 ,9 , wm8955->control_type);
@@ -934,25 +934,25 @@ static int wm8955_probe(struct snd_soc_codec *codec) }/* Change some default settings - latch VU and enable ZC */ - wm8955->reg_cache[WM8955_LEFT_DAC_VOLUME ] |=WM8955_LDVU ; - wm8955->reg_cache[WM8955_RIGHT_DAC_VOLUME ] |=WM8955_RDVU ; - wm8955->reg_cache[WM8955_LOUT1_VOLUME ] |=WM8955_LO1VU |WM8955_LO1ZC ; - wm8955->reg_cache[WM8955_ROUT1_VOLUME ] |=WM8955_RO1VU |WM8955_RO1ZC ; - wm8955->reg_cache[WM8955_LOUT2_VOLUME ] |=WM8955_LO2VU |WM8955_LO2ZC ; - wm8955->reg_cache[WM8955_ROUT2_VOLUME ] |=WM8955_RO2VU |WM8955_RO2ZC ; - wm8955->reg_cache[WM8955_MONOOUT_VOLUME ] |=WM8955_MOZC ; + reg_cache[WM8955_LEFT_DAC_VOLUME ] |=WM8955_LDVU ; + reg_cache[WM8955_RIGHT_DAC_VOLUME ] |=WM8955_RDVU ; + reg_cache[WM8955_LOUT1_VOLUME ] |=WM8955_LO1VU |WM8955_LO1ZC ; + reg_cache[WM8955_ROUT1_VOLUME ] |=WM8955_RO1VU |WM8955_RO1ZC ; + reg_cache[WM8955_LOUT2_VOLUME ] |=WM8955_LO2VU |WM8955_LO2ZC ; + reg_cache[WM8955_ROUT2_VOLUME ] |=WM8955_RO2VU |WM8955_RO2ZC ; + reg_cache[WM8955_MONOOUT_VOLUME ] |=WM8955_MOZC ;/* Also enable adaptive bass boost by default */ - wm8955->reg_cache[WM8955_BASS_CONTROL ] |=WM8955_BB ; + reg_cache[WM8955_BASS_CONTROL ] |=WM8955_BB ;/* Set platform data values */ if (pdata) {if (pdata->out2_speaker) - wm8955->reg_cache[WM8955_ADDITIONAL_CONTROL_2 ] + reg_cache[WM8955_ADDITIONAL_CONTROL_2 ] |=WM8955_ROUT2INV ;if (pdata->monoin_diff) - wm8955->reg_cache[WM8955_MONO_OUT_MIX_1 ] + reg_cache[WM8955_MONO_OUT_MIX_1 ] |=WM8955_DMEN ; }
@@ -1003,6 +1003,7 @@ static __devinit int wm8955_i2c_probe(struct i2c_client *i2c,return -ENOMEM ;i2c_set_clientdata (i2c, wm8955); + wm8955->control_type =SND_SOC_I2C ; ret =snd_soc_register_codec (&i2c->dev, &soc_codec_dev_wm8955, &wm8955_dai,1 );
sound/soc/codecs/wm8960.c +1 -0
@@ -1013,6 +1013,7 @@ static __devinit int wm8960_i2c_probe(struct i2c_client *i2c,return -ENOMEM ;i2c_set_clientdata (i2c, wm8960); + wm8960->control_type =SND_SOC_I2C ; wm8960->control_data = i2c; ret = snd_soc_register_codec(&i2c->dev,
sound/soc/codecs/wm8962.c +20 -25
113 lines not on this page · raw message
sound/soc/codecs/wm8971.c +1 -0
@@ -718,6 +718,7 @@ static __devinit int wm8971_i2c_probe(struct i2c_client *i2c,if (wm8971 ==NULL )return -ENOMEM ; + wm8971->control_type =SND_SOC_I2C ;i2c_set_clientdata (i2c, wm8971); ret = snd_soc_register_codec(&i2c->dev,
sound/soc/codecs/wm9081.c +1 -0
@@ -1335,6 +1335,7 @@ static __devinit int wm9081_i2c_probe(struct i2c_client *i2c,return -ENOMEM ;i2c_set_clientdata (i2c, wm9081); + wm9081->control_type =SND_SOC_I2C ; wm9081->control_data = i2c; ret = snd_soc_register_codec(&i2c->dev,
sound/soc/codecs/wm9090.c +9 -9
@@ -141,7 +141,6 @@ static const u16 wm9090_reg_defaults[] = {/* This struct is used to save the context */ struct wm9090_priv {struct mutex mutex; -u16 reg_cache[WM9090_MAX_REGISTER +1 ];struct wm9090_platform_data pdata;void *control_data; };
@@ -552,6 +551,7 @@ static int wm9090_set_bias_level(struct snd_soc_codec *codec,static int wm9090_probe (struct snd_soc_codec *codec) {struct wm9090_priv *wm9090 =snd_soc_codec_get_drvdata (codec); +u16 *reg_cache = codec->reg_cache;int ret; codec->control_data = wm9090->control_data;
@@ -576,22 +576,22 @@ static int wm9090_probe(struct snd_soc_codec *codec)/* Configure some defaults; they will be written out when we * bring the bias up. */ - wm9090->reg_cache[WM9090_IN1_LINE_INPUT_A_VOLUME ] |=WM9090_IN1_VU + reg_cache[WM9090_IN1_LINE_INPUT_A_VOLUME ] |=WM9090_IN1_VU |WM9090_IN1A_ZC ; - wm9090->reg_cache[WM9090_IN1_LINE_INPUT_B_VOLUME ] |=WM9090_IN1_VU + reg_cache[WM9090_IN1_LINE_INPUT_B_VOLUME ] |=WM9090_IN1_VU |WM9090_IN1B_ZC ; - wm9090->reg_cache[WM9090_IN2_LINE_INPUT_A_VOLUME ] |=WM9090_IN2_VU + reg_cache[WM9090_IN2_LINE_INPUT_A_VOLUME ] |=WM9090_IN2_VU |WM9090_IN2A_ZC ; - wm9090->reg_cache[WM9090_IN2_LINE_INPUT_B_VOLUME ] |=WM9090_IN2_VU + reg_cache[WM9090_IN2_LINE_INPUT_B_VOLUME ] |=WM9090_IN2_VU |WM9090_IN2B_ZC ; - wm9090->reg_cache[WM9090_SPEAKER_VOLUME_LEFT ] |= + reg_cache[WM9090_SPEAKER_VOLUME_LEFT ] |=WM9090_SPKOUT_VU |WM9090_SPKOUTL_ZC ; - wm9090->reg_cache[WM9090_LEFT_OUTPUT_VOLUME ] |= + reg_cache[WM9090_LEFT_OUTPUT_VOLUME ] |=WM9090_HPOUT1_VU |WM9090_HPOUT1L_ZC ; - wm9090->reg_cache[WM9090_RIGHT_OUTPUT_VOLUME ] |= + reg_cache[WM9090_RIGHT_OUTPUT_VOLUME ] |=WM9090_HPOUT1_VU |WM9090_HPOUT1R_ZC ; - wm9090->reg_cache[WM9090_CLOCKING_1 ] |=WM9090_TOCLK_ENA ; + reg_cache[WM9090_CLOCKING_1 ] |=WM9090_TOCLK_ENA ;wm9090_set_bias_level (codec,SND_SOC_BIAS_STANDBY );