diff options
author | Peter Ujfalusi <peter.ujfalusi@nokia.com> | 2010-10-22 08:11:20 -0400 |
---|---|---|
committer | Liam Girdwood <lrg@slimlogic.co.uk> | 2010-10-23 09:43:08 -0400 |
commit | 84eae18c867fcb7ce43d5830e23377ed33e45df9 (patch) | |
tree | 04481cde89ca1a72aaa870f58fe8e0d60661d7b0 /sound/soc | |
parent | 872a64d7e73f0e4dc435295da393db25332172b8 (diff) |
ASoC: tlv320dac33: Use usleep_range for delays
Switch to use the more precise usleep_range instead of
msleep().
Replace the udelay with usleep_range to remove the busy loop
waiting.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Mark Borwn <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'sound/soc')
-rw-r--r-- | sound/soc/codecs/tlv320dac33.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sound/soc/codecs/tlv320dac33.c b/sound/soc/codecs/tlv320dac33.c index 58349dcd1a6e..d251ff54a2d3 100644 --- a/sound/soc/codecs/tlv320dac33.c +++ b/sound/soc/codecs/tlv320dac33.c | |||
@@ -669,6 +669,7 @@ static int dac33_set_bias_level(struct snd_soc_codec *codec, | |||
669 | static inline void dac33_prefill_handler(struct tlv320dac33_priv *dac33) | 669 | static inline void dac33_prefill_handler(struct tlv320dac33_priv *dac33) |
670 | { | 670 | { |
671 | struct snd_soc_codec *codec = dac33->codec; | 671 | struct snd_soc_codec *codec = dac33->codec; |
672 | unsigned int delay; | ||
672 | 673 | ||
673 | switch (dac33->fifo_mode) { | 674 | switch (dac33->fifo_mode) { |
674 | case DAC33_FIFO_MODE1: | 675 | case DAC33_FIFO_MODE1: |
@@ -684,8 +685,9 @@ static inline void dac33_prefill_handler(struct tlv320dac33_priv *dac33) | |||
684 | dac33_write16(codec, DAC33_PREFILL_MSB, | 685 | dac33_write16(codec, DAC33_PREFILL_MSB, |
685 | DAC33_THRREG(dac33->alarm_threshold)); | 686 | DAC33_THRREG(dac33->alarm_threshold)); |
686 | /* Enable Alarm Threshold IRQ with a delay */ | 687 | /* Enable Alarm Threshold IRQ with a delay */ |
687 | udelay(SAMPLES_TO_US(dac33->burst_rate, | 688 | delay = SAMPLES_TO_US(dac33->burst_rate, |
688 | dac33->alarm_threshold)); | 689 | dac33->alarm_threshold) + 1000; |
690 | usleep_range(delay, delay + 500); | ||
689 | dac33_write(codec, DAC33_FIFO_IRQ_MASK, DAC33_MAT); | 691 | dac33_write(codec, DAC33_FIFO_IRQ_MASK, DAC33_MAT); |
690 | break; | 692 | break; |
691 | case DAC33_FIFO_MODE7: | 693 | case DAC33_FIFO_MODE7: |
@@ -785,11 +787,11 @@ static irqreturn_t dac33_interrupt_handler(int irq, void *dev) | |||
785 | 787 | ||
786 | static void dac33_oscwait(struct snd_soc_codec *codec) | 788 | static void dac33_oscwait(struct snd_soc_codec *codec) |
787 | { | 789 | { |
788 | int timeout = 20; | 790 | int timeout = 60; |
789 | u8 reg; | 791 | u8 reg; |
790 | 792 | ||
791 | do { | 793 | do { |
792 | msleep(1); | 794 | usleep_range(1000, 2000); |
793 | dac33_read(codec, DAC33_INT_OSC_STATUS, ®); | 795 | dac33_read(codec, DAC33_INT_OSC_STATUS, ®); |
794 | } while (((reg & 0x03) != DAC33_OSCSTATUS_NORMAL) && timeout--); | 796 | } while (((reg & 0x03) != DAC33_OSCSTATUS_NORMAL) && timeout--); |
795 | if ((reg & 0x03) != DAC33_OSCSTATUS_NORMAL) | 797 | if ((reg & 0x03) != DAC33_OSCSTATUS_NORMAL) |