ASoC: tlv320dac33: Limit the US_TO_SAMPLES macro
authorPeter Ujfalusi <peter.ujfalusi@nokia.com>
Fri, 29 Oct 2010 11:07:25 +0000 (14:07 +0300)
committerLiam Girdwood <lrg@slimlogic.co.uk>
Sat, 30 Oct 2010 16:33:38 +0000 (17:33 +0100)
commitd54e1f4fdf4cf9754b7220ae4cb66dcae0fc1702
treedef420c853f160f65c2200ba612f3a05cf69ee15
parent911a0f0bfc01750590e8ac6e7f9f4921f470b0d1
ASoC: tlv320dac33: Limit the US_TO_SAMPLES macro

Limit the time window to maximum 1s in the macro.
The driver deals with much shorter times (<200ms).
This will fix a rare division by zero bug in Mode1.
This could happen, when the work is not executed in
time (within mode1_latency) after the interrupt.
In this case the DAC33 will not receive the needed
nSample command in time, and enters to an unknown
state, and won't recover.
In such event the time window will increase, and
eventually going to be bigger than 1s, resulting
devision by zero.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
sound/soc/codecs/tlv320dac33.c