diff options
| -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) |
