From 69df03e70de5c2b6562aef13a526984702ad1296 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Mon, 4 Jul 2011 10:27:51 -0700 Subject: [PATCH] --- yaml --- r: 254799 b: refs/heads/master c: 4c7c5374ce6876d3d2c7013ef815051df4258952 h: refs/heads/master i: 254797: a29e45255d27ff5da93030966f934b509a6e6264 254795: 9849edb713f605625550ca9012c1eb479462279f 254791: 5b9e518c1685d068b5bcdd99b44698be4cdd3ef6 254783: 6a7a47a41588ab4b88c8093de55844826fd5e4a7 v: v3 --- [refs] | 2 +- trunk/sound/soc/codecs/tlv320aic26.c | 14 +++----------- trunk/sound/soc/codecs/tlv320aic3x.c | 9 +-------- trunk/sound/soc/codecs/wm8731.c | 29 +++------------------------- trunk/sound/soc/soc-core.c | 5 ++--- 5 files changed, 10 insertions(+), 49 deletions(-) diff --git a/[refs] b/[refs] index e1cda642e3e1..8db340eec2fd 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 873bd4cb4fbba6a3e99f750e17ef2ba6ef96e9d3 +refs/heads/master: 4c7c5374ce6876d3d2c7013ef815051df4258952 diff --git a/trunk/sound/soc/codecs/tlv320aic26.c b/trunk/sound/soc/codecs/tlv320aic26.c index 7859bdcc93db..e2a7608d3944 100644 --- a/trunk/sound/soc/codecs/tlv320aic26.c +++ b/trunk/sound/soc/codecs/tlv320aic26.c @@ -161,18 +161,10 @@ static int aic26_hw_params(struct snd_pcm_substream *substream, dev_dbg(&aic26->spi->dev, "bad format\n"); return -EINVAL; } - /** - * Configure PLL - * fsref = (mclk * PLLM) / 2048 - * where PLLM = J.DDDD (DDDD register ranges from 0 to 9999, decimal) - */ + /* Configure PLL */ pval = 1; - /* compute J portion of multiplier */ - jval = fsref / (aic26->mclk / 2048); - /* compute fractional DDDD component of multiplier */ - dval = fsref - (jval * (aic26->mclk / 2048)); - dval = (10000 * dval) / (aic26->mclk / 2048); - dev_dbg(&aic26->spi->dev, "Setting PLLM to %d.%04d\n", jval, dval); + jval = (fsref == 44100) ? 7 : 8; + dval = (fsref == 44100) ? 5264 : 1920; qval = 0; reg = 0x8000 | qval << 11 | pval << 8 | jval << 2; aic26_reg_write(codec, AIC26_REG_PLL_PROG1, reg); diff --git a/trunk/sound/soc/codecs/tlv320aic3x.c b/trunk/sound/soc/codecs/tlv320aic3x.c index 789453d44ec5..c3d96fc8c267 100644 --- a/trunk/sound/soc/codecs/tlv320aic3x.c +++ b/trunk/sound/soc/codecs/tlv320aic3x.c @@ -1114,19 +1114,12 @@ static int aic3x_set_power(struct snd_soc_codec *codec, int power) /* Sync reg_cache with the hardware */ codec->cache_only = 0; - for (i = AIC3X_SAMPLE_RATE_SEL_REG; i < ARRAY_SIZE(aic3x_reg); i++) + for (i = 0; i < ARRAY_SIZE(aic3x_reg); i++) snd_soc_write(codec, i, cache[i]); if (aic3x->model == AIC3X_MODEL_3007) aic3x_init_3007(codec); codec->cache_sync = 0; } else { - /* - * Do soft reset to this codec instance in order to clear - * possible VDD leakage currents in case the supply regulators - * remain on - */ - snd_soc_write(codec, AIC3X_RESET, SOFT_RESET); - codec->cache_sync = 1; aic3x->power = 0; /* HW writes are needless when bias is off */ codec->cache_only = 1; diff --git a/trunk/sound/soc/codecs/wm8731.c b/trunk/sound/soc/codecs/wm8731.c index 2dc964b55e4f..76b4361e9b80 100644 --- a/trunk/sound/soc/codecs/wm8731.c +++ b/trunk/sound/soc/codecs/wm8731.c @@ -175,6 +175,7 @@ static const struct snd_kcontrol_new wm8731_input_mux_controls = SOC_DAPM_ENUM("Input Select", wm8731_insel_enum); static const struct snd_soc_dapm_widget wm8731_dapm_widgets[] = { +SND_SOC_DAPM_SUPPLY("ACTIVE",WM8731_ACTIVE, 0, 0, NULL, 0), SND_SOC_DAPM_SUPPLY("OSC", WM8731_PWR, 5, 1, NULL, 0), SND_SOC_DAPM_MIXER("Output Mixer", WM8731_PWR, 4, 1, &wm8731_output_mixer_controls[0], @@ -204,6 +205,8 @@ static int wm8731_check_osc(struct snd_soc_dapm_widget *source, static const struct snd_soc_dapm_route wm8731_intercon[] = { {"DAC", NULL, "OSC", wm8731_check_osc}, {"ADC", NULL, "OSC", wm8731_check_osc}, + {"DAC", NULL, "ACTIVE"}, + {"ADC", NULL, "ACTIVE"}, /* output mixer */ {"Output Mixer", "Line Bypass Switch", "Line Input"}, @@ -315,29 +318,6 @@ static int wm8731_hw_params(struct snd_pcm_substream *substream, return 0; } -static int wm8731_pcm_prepare(struct snd_pcm_substream *substream, - struct snd_soc_dai *dai) -{ - struct snd_soc_codec *codec = dai->codec; - - /* set active */ - snd_soc_write(codec, WM8731_ACTIVE, 0x0001); - - return 0; -} - -static void wm8731_shutdown(struct snd_pcm_substream *substream, - struct snd_soc_dai *dai) -{ - struct snd_soc_codec *codec = dai->codec; - - /* deactivate */ - if (!codec->active) { - udelay(50); - snd_soc_write(codec, WM8731_ACTIVE, 0x0); - } -} - static int wm8731_mute(struct snd_soc_dai *dai, int mute) { struct snd_soc_codec *codec = dai->codec; @@ -480,7 +460,6 @@ static int wm8731_set_bias_level(struct snd_soc_codec *codec, snd_soc_write(codec, WM8731_PWR, reg | 0x0040); break; case SND_SOC_BIAS_OFF: - snd_soc_write(codec, WM8731_ACTIVE, 0x0); snd_soc_write(codec, WM8731_PWR, 0xffff); regulator_bulk_disable(ARRAY_SIZE(wm8731->supplies), wm8731->supplies); @@ -496,9 +475,7 @@ static int wm8731_set_bias_level(struct snd_soc_codec *codec, SNDRV_PCM_FMTBIT_S24_LE) static struct snd_soc_dai_ops wm8731_dai_ops = { - .prepare = wm8731_pcm_prepare, .hw_params = wm8731_hw_params, - .shutdown = wm8731_shutdown, .digital_mute = wm8731_mute, .set_sysclk = wm8731_set_dai_sysclk, .set_fmt = wm8731_set_dai_fmt, diff --git a/trunk/sound/soc/soc-core.c b/trunk/sound/soc/soc-core.c index b194be09e74d..d75043ed7fc0 100644 --- a/trunk/sound/soc/soc-core.c +++ b/trunk/sound/soc/soc-core.c @@ -1929,9 +1929,8 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card) "%s", card->name); snprintf(card->snd_card->longname, sizeof(card->snd_card->longname), "%s", card->long_name ? card->long_name : card->name); - if (card->driver_name) - strlcpy(card->snd_card->driver, card->driver_name, - sizeof(card->snd_card->driver)); + snprintf(card->snd_card->driver, sizeof(card->snd_card->driver), + "%s", card->driver_name ? card->driver_name : card->name); if (card->late_probe) { ret = card->late_probe(card);