diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2011-01-10 10:02:32 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-01-10 10:46:07 -0500 |
commit | 79815e004c75dcc2be6433737b5678cee80035db (patch) | |
tree | a9b3eaf98052585f7e420099ae65360470044d0f /sound | |
parent | 4106055cedea86596391f36deacd05616333fbb3 (diff) |
ALSA: virtuoso: wait for PCM1796 clock to become stable
The PCM1796 needs the master clock for I2C communication to work, so
add delays after clock changes to ensure that the clock is stable when
we try to write the DACs' registers.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/pci/oxygen/xonar_pcm179x.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sound/pci/oxygen/xonar_pcm179x.c b/sound/pci/oxygen/xonar_pcm179x.c index 49898d39f875..5ec164a70cf2 100644 --- a/sound/pci/oxygen/xonar_pcm179x.c +++ b/sound/pci/oxygen/xonar_pcm179x.c | |||
@@ -303,6 +303,7 @@ static void pcm1796_registers_init(struct oxygen *chip) | |||
303 | unsigned int i; | 303 | unsigned int i; |
304 | s8 gain_offset; | 304 | s8 gain_offset; |
305 | 305 | ||
306 | msleep(1); | ||
306 | gain_offset = data->hp_active ? data->hp_gain_offset : 0; | 307 | gain_offset = data->hp_active ? data->hp_gain_offset : 0; |
307 | for (i = 0; i < data->dacs; ++i) { | 308 | for (i = 0; i < data->dacs; ++i) { |
308 | /* set ATLD before ATL/ATR */ | 309 | /* set ATLD before ATL/ATR */ |
@@ -451,6 +452,7 @@ static void cs2000_registers_init(struct oxygen *chip) | |||
451 | data->cs2000_regs[CS2000_FUN_CFG_1]); | 452 | data->cs2000_regs[CS2000_FUN_CFG_1]); |
452 | cs2000_write(chip, CS2000_FUN_CFG_2, 0); | 453 | cs2000_write(chip, CS2000_FUN_CFG_2, 0); |
453 | cs2000_write(chip, CS2000_GLOBAL_CFG, CS2000_EN_DEV_CFG_2); | 454 | cs2000_write(chip, CS2000_GLOBAL_CFG, CS2000_EN_DEV_CFG_2); |
455 | msleep(3); /* PLL lock delay */ | ||
454 | } | 456 | } |
455 | 457 | ||
456 | static void xonar_st_init(struct oxygen *chip) | 458 | static void xonar_st_init(struct oxygen *chip) |
@@ -592,6 +594,7 @@ static void set_pcm1796_params(struct oxygen *chip, | |||
592 | { | 594 | { |
593 | struct xonar_pcm179x *data = chip->model_data; | 595 | struct xonar_pcm179x *data = chip->model_data; |
594 | 596 | ||
597 | msleep(1); | ||
595 | data->current_rate = params_rate(params); | 598 | data->current_rate = params_rate(params); |
596 | update_pcm1796_oversampling(chip); | 599 | update_pcm1796_oversampling(chip); |
597 | } | 600 | } |
@@ -669,6 +672,7 @@ static void update_cs2000_rate(struct oxygen *chip, unsigned int rate) | |||
669 | else | 672 | else |
670 | reg = CS2000_REF_CLK_DIV_2; | 673 | reg = CS2000_REF_CLK_DIV_2; |
671 | cs2000_write_cached(chip, CS2000_FUN_CFG_1, reg); | 674 | cs2000_write_cached(chip, CS2000_FUN_CFG_1, reg); |
675 | msleep(3); /* PLL lock delay */ | ||
672 | } | 676 | } |
673 | 677 | ||
674 | static void set_st_params(struct oxygen *chip, | 678 | static void set_st_params(struct oxygen *chip, |
@@ -796,6 +800,7 @@ static int os_128_put(struct snd_kcontrol *ctl, | |||
796 | oxygen_write16_masked(chip, OXYGEN_I2S_MULTICH_FORMAT, | 800 | oxygen_write16_masked(chip, OXYGEN_I2S_MULTICH_FORMAT, |
797 | mclk_from_rate(chip, data->current_rate), | 801 | mclk_from_rate(chip, data->current_rate), |
798 | OXYGEN_I2S_MCLK_MASK); | 802 | OXYGEN_I2S_MCLK_MASK); |
803 | msleep(1); | ||
799 | update_pcm1796_oversampling(chip); | 804 | update_pcm1796_oversampling(chip); |
800 | } | 805 | } |
801 | mutex_unlock(&chip->mutex); | 806 | mutex_unlock(&chip->mutex); |