diff --git a/[refs] b/[refs] index 12a6c278c409..644d5fa97f6d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d54e1f4fdf4cf9754b7220ae4cb66dcae0fc1702 +refs/heads/master: 1bc13b2e3518ff7856924d7c2bdf06196f605260 diff --git a/trunk/sound/soc/codecs/tlv320dac33.c b/trunk/sound/soc/codecs/tlv320dac33.c index c47c20d21ea5..c5ab8c805771 100644 --- a/trunk/sound/soc/codecs/tlv320dac33.c +++ b/trunk/sound/soc/codecs/tlv320dac33.c @@ -1082,6 +1082,9 @@ static void dac33_calculate_times(struct snd_pcm_substream *substream) /* Number of samples under i2c latency */ dac33->alarm_threshold = US_TO_SAMPLES(rate, dac33->mode1_latency); + nsample_limit = DAC33_BUFFER_SIZE_SAMPLES - + dac33->alarm_threshold; + if (dac33->auto_fifo_config) { if (period_size <= dac33->alarm_threshold) /* @@ -1092,6 +1095,8 @@ static void dac33_calculate_times(struct snd_pcm_substream *substream) ((dac33->alarm_threshold / period_size) + (dac33->alarm_threshold % period_size ? 1 : 0)); + else if (period_size > nsample_limit) + dac33->nsample = nsample_limit; else dac33->nsample = period_size; } else { @@ -1103,8 +1108,7 @@ static void dac33_calculate_times(struct snd_pcm_substream *substream) */ dac33->nsample_max = substream->runtime->buffer_size - period_size; - nsample_limit = DAC33_BUFFER_SIZE_SAMPLES - - dac33->alarm_threshold; + if (dac33->nsample_max > nsample_limit) dac33->nsample_max = nsample_limit;