From d8f1250ddcbfad2dcf49535fa6165c2355cff00f Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Mon, 13 Jun 2011 12:14:07 +0100 Subject: [PATCH] --- yaml --- r: 254794 b: refs/heads/master c: e999dc50404d401150a5429b6459473a691fd1a0 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/sound/soc/blackfin/bf5xx-i2s-pcm.c | 13 +++++++++++-- trunk/sound/soc/codecs/tlv320aic26.c | 14 +++----------- trunk/sound/soc/codecs/tlv320aic3x.c | 9 +-------- 4 files changed, 16 insertions(+), 22 deletions(-) diff --git a/[refs] b/[refs] index b2fdb5982922..cff0905e5a94 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 63bc9750167ac765827470aa5aed1e79aeaaad9e +refs/heads/master: e999dc50404d401150a5429b6459473a691fd1a0 diff --git a/trunk/sound/soc/blackfin/bf5xx-i2s-pcm.c b/trunk/sound/soc/blackfin/bf5xx-i2s-pcm.c index b5101efd1c87..f1fd95bb6416 100644 --- a/trunk/sound/soc/blackfin/bf5xx-i2s-pcm.c +++ b/trunk/sound/soc/blackfin/bf5xx-i2s-pcm.c @@ -138,11 +138,20 @@ static snd_pcm_uframes_t bf5xx_pcm_pointer(struct snd_pcm_substream *substream) pr_debug("%s enter\n", __func__); if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { diff = sport_curr_offset_tx(sport); - frames = bytes_to_frames(substream->runtime, diff); } else { diff = sport_curr_offset_rx(sport); - frames = bytes_to_frames(substream->runtime, diff); } + + /* + * TX at least can report one frame beyond the end of the + * buffer if we hit the wraparound case - clamp to within the + * buffer as the ALSA APIs require. + */ + if (diff == snd_pcm_lib_buffer_bytes(substream)) + diff = 0; + + frames = bytes_to_frames(substream->runtime, diff); + return frames; } 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;