diff options
author | Dave Airlie <airlied@redhat.com> | 2011-07-13 07:30:11 (GMT) |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2011-07-13 07:30:22 (GMT) |
commit | cf056edbbe70393faa6edd2b7859a14467910946 (patch) | |
tree | ca30ef021f12d1f06e18856a60f815ba63e78f60 /sound/soc/blackfin | |
parent | 58b6542b50ded4243c26c251c0507e5f658642f6 (diff) | |
parent | 620917de59eeb934b9f8cf35cc2d95c1ac8ed0fc (diff) | |
download | linux-fsl-qoriq-cf056edbbe70393faa6edd2b7859a14467910946.tar.xz |
Merge 3.0-rc7 into drm-core-next
This pulls in all the drm fixes up to this point which are needed
for some -next patches to work.
Diffstat (limited to 'sound/soc/blackfin')
-rw-r--r-- | sound/soc/blackfin/bf5xx-i2s-pcm.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/sound/soc/blackfin/bf5xx-i2s-pcm.c b/sound/soc/blackfin/bf5xx-i2s-pcm.c index b5101ef..f1fd95b 100644 --- a/sound/soc/blackfin/bf5xx-i2s-pcm.c +++ b/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; } |