Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
ALSA: hda - Fix a copmile warning
ASoC: ak4642: fixup snd_soc_update_bits mask for PW_MGMT2
ALSA: hda - Change all ADCs for dual-adc switching mode for Realtek
ASoC: Manage WM8731 ACTIVE bit as a supply widget
ASoC: Don't set invalid name string to snd_card->driver field
ASoC: Ensure we delay long enough for WM8994 FLL to lock when starting
ASoC: Tegra: I2S: Ensure clock is enabled when writing regs
ASoC: Fix Blackfin I2S _pointer() implementation return in bounds values
ASoC: tlv320aic3x: Do soft reset to codec when going to bias off state
ASoC: tlv320aic3x: Don't sync first two registers from register cache
audio: tlv320aic26: fix PLL register configuration

+68 -45
+23 -10
sound/pci/hda/patch_realtek.c
··· 2715 2715 2716 2716 static int alc_cap_getput_caller(struct snd_kcontrol *kcontrol, 2717 2717 struct snd_ctl_elem_value *ucontrol, 2718 - getput_call_t func) 2718 + getput_call_t func, bool check_adc_switch) 2719 2719 { 2720 2720 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); 2721 2721 struct alc_spec *spec = codec->spec; 2722 - unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); 2723 - int err; 2722 + int i, err = 0; 2724 2723 2725 2724 mutex_lock(&codec->control_mutex); 2726 - kcontrol->private_value = HDA_COMPOSE_AMP_VAL(spec->adc_nids[adc_idx], 2727 - 3, 0, HDA_INPUT); 2728 - err = func(kcontrol, ucontrol); 2725 + if (check_adc_switch && spec->dual_adc_switch) { 2726 + for (i = 0; i < spec->num_adc_nids; i++) { 2727 + kcontrol->private_value = 2728 + HDA_COMPOSE_AMP_VAL(spec->adc_nids[i], 2729 + 3, 0, HDA_INPUT); 2730 + err = func(kcontrol, ucontrol); 2731 + if (err < 0) 2732 + goto error; 2733 + } 2734 + } else { 2735 + i = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); 2736 + kcontrol->private_value = 2737 + HDA_COMPOSE_AMP_VAL(spec->adc_nids[i], 2738 + 3, 0, HDA_INPUT); 2739 + err = func(kcontrol, ucontrol); 2740 + } 2741 + error: 2729 2742 mutex_unlock(&codec->control_mutex); 2730 2743 return err; 2731 2744 } ··· 2747 2734 struct snd_ctl_elem_value *ucontrol) 2748 2735 { 2749 2736 return alc_cap_getput_caller(kcontrol, ucontrol, 2750 - snd_hda_mixer_amp_volume_get); 2737 + snd_hda_mixer_amp_volume_get, false); 2751 2738 } 2752 2739 2753 2740 static int alc_cap_vol_put(struct snd_kcontrol *kcontrol, 2754 2741 struct snd_ctl_elem_value *ucontrol) 2755 2742 { 2756 2743 return alc_cap_getput_caller(kcontrol, ucontrol, 2757 - snd_hda_mixer_amp_volume_put); 2744 + snd_hda_mixer_amp_volume_put, true); 2758 2745 } 2759 2746 2760 2747 /* capture mixer elements */ ··· 2764 2751 struct snd_ctl_elem_value *ucontrol) 2765 2752 { 2766 2753 return alc_cap_getput_caller(kcontrol, ucontrol, 2767 - snd_hda_mixer_amp_switch_get); 2754 + snd_hda_mixer_amp_switch_get, false); 2768 2755 } 2769 2756 2770 2757 static int alc_cap_sw_put(struct snd_kcontrol *kcontrol, 2771 2758 struct snd_ctl_elem_value *ucontrol) 2772 2759 { 2773 2760 return alc_cap_getput_caller(kcontrol, ucontrol, 2774 - snd_hda_mixer_amp_switch_put); 2761 + snd_hda_mixer_amp_switch_put, true); 2775 2762 } 2776 2763 2777 2764 #define _DEFINE_CAPMIX(num) \
+11 -2
sound/soc/blackfin/bf5xx-i2s-pcm.c
··· 138 138 pr_debug("%s enter\n", __func__); 139 139 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { 140 140 diff = sport_curr_offset_tx(sport); 141 - frames = bytes_to_frames(substream->runtime, diff); 142 141 } else { 143 142 diff = sport_curr_offset_rx(sport); 144 - frames = bytes_to_frames(substream->runtime, diff); 145 143 } 144 + 145 + /* 146 + * TX at least can report one frame beyond the end of the 147 + * buffer if we hit the wraparound case - clamp to within the 148 + * buffer as the ALSA APIs require. 149 + */ 150 + if (diff == snd_pcm_lib_buffer_bytes(substream)) 151 + diff = 0; 152 + 153 + frames = bytes_to_frames(substream->runtime, diff); 154 + 146 155 return frames; 147 156 } 148 157
+1 -1
sound/soc/codecs/ak4642.c
··· 357 357 default: 358 358 return -EINVAL; 359 359 } 360 - snd_soc_update_bits(codec, PW_MGMT2, MS, data); 360 + snd_soc_update_bits(codec, PW_MGMT2, MS | MCKO | PMPLL, data); 361 361 snd_soc_update_bits(codec, MD_CTL1, BCKO_MASK, bcko); 362 362 363 363 /* format type */
+11 -3
sound/soc/codecs/tlv320aic26.c
··· 161 161 dev_dbg(&aic26->spi->dev, "bad format\n"); return -EINVAL; 162 162 } 163 163 164 - /* Configure PLL */ 164 + /** 165 + * Configure PLL 166 + * fsref = (mclk * PLLM) / 2048 167 + * where PLLM = J.DDDD (DDDD register ranges from 0 to 9999, decimal) 168 + */ 165 169 pval = 1; 166 - jval = (fsref == 44100) ? 7 : 8; 167 - dval = (fsref == 44100) ? 5264 : 1920; 170 + /* compute J portion of multiplier */ 171 + jval = fsref / (aic26->mclk / 2048); 172 + /* compute fractional DDDD component of multiplier */ 173 + dval = fsref - (jval * (aic26->mclk / 2048)); 174 + dval = (10000 * dval) / (aic26->mclk / 2048); 175 + dev_dbg(&aic26->spi->dev, "Setting PLLM to %d.%04d\n", jval, dval); 168 176 qval = 0; 169 177 reg = 0x8000 | qval << 11 | pval << 8 | jval << 2; 170 178 aic26_reg_write(codec, AIC26_REG_PLL_PROG1, reg);
+8 -1
sound/soc/codecs/tlv320aic3x.c
··· 1114 1114 1115 1115 /* Sync reg_cache with the hardware */ 1116 1116 codec->cache_only = 0; 1117 - for (i = 0; i < ARRAY_SIZE(aic3x_reg); i++) 1117 + for (i = AIC3X_SAMPLE_RATE_SEL_REG; i < ARRAY_SIZE(aic3x_reg); i++) 1118 1118 snd_soc_write(codec, i, cache[i]); 1119 1119 if (aic3x->model == AIC3X_MODEL_3007) 1120 1120 aic3x_init_3007(codec); 1121 1121 codec->cache_sync = 0; 1122 1122 } else { 1123 + /* 1124 + * Do soft reset to this codec instance in order to clear 1125 + * possible VDD leakage currents in case the supply regulators 1126 + * remain on 1127 + */ 1128 + snd_soc_write(codec, AIC3X_RESET, SOFT_RESET); 1129 + codec->cache_sync = 1; 1123 1130 aic3x->power = 0; 1124 1131 /* HW writes are needless when bias is off */ 1125 1132 codec->cache_only = 1;
+3 -26
sound/soc/codecs/wm8731.c
··· 175 175 SOC_DAPM_ENUM("Input Select", wm8731_insel_enum); 176 176 177 177 static const struct snd_soc_dapm_widget wm8731_dapm_widgets[] = { 178 + SND_SOC_DAPM_SUPPLY("ACTIVE",WM8731_ACTIVE, 0, 0, NULL, 0), 178 179 SND_SOC_DAPM_SUPPLY("OSC", WM8731_PWR, 5, 1, NULL, 0), 179 180 SND_SOC_DAPM_MIXER("Output Mixer", WM8731_PWR, 4, 1, 180 181 &wm8731_output_mixer_controls[0], ··· 205 204 static const struct snd_soc_dapm_route wm8731_intercon[] = { 206 205 {"DAC", NULL, "OSC", wm8731_check_osc}, 207 206 {"ADC", NULL, "OSC", wm8731_check_osc}, 207 + {"DAC", NULL, "ACTIVE"}, 208 + {"ADC", NULL, "ACTIVE"}, 208 209 209 210 /* output mixer */ 210 211 {"Output Mixer", "Line Bypass Switch", "Line Input"}, ··· 316 313 317 314 snd_soc_write(codec, WM8731_IFACE, iface); 318 315 return 0; 319 - } 320 - 321 - static int wm8731_pcm_prepare(struct snd_pcm_substream *substream, 322 - struct snd_soc_dai *dai) 323 - { 324 - struct snd_soc_codec *codec = dai->codec; 325 - 326 - /* set active */ 327 - snd_soc_write(codec, WM8731_ACTIVE, 0x0001); 328 - 329 - return 0; 330 - } 331 - 332 - static void wm8731_shutdown(struct snd_pcm_substream *substream, 333 - struct snd_soc_dai *dai) 334 - { 335 - struct snd_soc_codec *codec = dai->codec; 336 - 337 - /* deactivate */ 338 - if (!codec->active) { 339 - udelay(50); 340 - snd_soc_write(codec, WM8731_ACTIVE, 0x0); 341 - } 342 316 } 343 317 344 318 static int wm8731_mute(struct snd_soc_dai *dai, int mute) ··· 460 480 snd_soc_write(codec, WM8731_PWR, reg | 0x0040); 461 481 break; 462 482 case SND_SOC_BIAS_OFF: 463 - snd_soc_write(codec, WM8731_ACTIVE, 0x0); 464 483 snd_soc_write(codec, WM8731_PWR, 0xffff); 465 484 regulator_bulk_disable(ARRAY_SIZE(wm8731->supplies), 466 485 wm8731->supplies); ··· 475 496 SNDRV_PCM_FMTBIT_S24_LE) 476 497 477 498 static struct snd_soc_dai_ops wm8731_dai_ops = { 478 - .prepare = wm8731_pcm_prepare, 479 499 .hw_params = wm8731_hw_params, 480 - .shutdown = wm8731_shutdown, 481 500 .digital_mute = wm8731_mute, 482 501 .set_sysclk = wm8731_set_dai_sysclk, 483 502 .set_fmt = wm8731_set_dai_fmt,
+2
sound/soc/codecs/wm8994.c
··· 1713 1713 snd_soc_update_bits(codec, WM8994_FLL1_CONTROL_1 + reg_offset, 1714 1714 WM8994_FLL1_ENA | WM8994_FLL1_FRAC, 1715 1715 reg); 1716 + 1717 + msleep(5); 1716 1718 } 1717 1719 1718 1720 wm8994->fll[id].in = freq_in;
+3 -2
sound/soc/soc-core.c
··· 1929 1929 "%s", card->name); 1930 1930 snprintf(card->snd_card->longname, sizeof(card->snd_card->longname), 1931 1931 "%s", card->long_name ? card->long_name : card->name); 1932 - snprintf(card->snd_card->driver, sizeof(card->snd_card->driver), 1933 - "%s", card->driver_name ? card->driver_name : card->name); 1932 + if (card->driver_name) 1933 + strlcpy(card->snd_card->driver, card->driver_name, 1934 + sizeof(card->snd_card->driver)); 1934 1935 1935 1936 if (card->late_probe) { 1936 1937 ret = card->late_probe(card);
+6
sound/soc/tegra/tegra_i2s.c
··· 222 222 if (i2sclock % (2 * srate)) 223 223 reg |= TEGRA_I2S_TIMING_NON_SYM_ENABLE; 224 224 225 + if (!i2s->clk_refs) 226 + clk_enable(i2s->clk_i2s); 227 + 225 228 tegra_i2s_write(i2s, TEGRA_I2S_TIMING, reg); 226 229 227 230 tegra_i2s_write(i2s, TEGRA_I2S_FIFO_SCR, 228 231 TEGRA_I2S_FIFO_SCR_FIFO2_ATN_LVL_FOUR_SLOTS | 229 232 TEGRA_I2S_FIFO_SCR_FIFO1_ATN_LVL_FOUR_SLOTS); 233 + 234 + if (!i2s->clk_refs) 235 + clk_disable(i2s->clk_i2s); 230 236 231 237 return 0; 232 238 }