diff options
author | David Woodhouse <dwmw2@shinybook.infradead.org> | 2005-08-09 11:51:35 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@shinybook.infradead.org> | 2005-08-09 11:51:35 -0400 |
commit | c973b112c76c9d8fd042991128f218a738cc8d0a (patch) | |
tree | e813b0da5d0a0e19e06de6462d145a29ad683026 /sound/pci/ens1370.c | |
parent | c5fbc3966f48279dbebfde10248c977014aa9988 (diff) | |
parent | 00dd1e433967872f3997a45d5adf35056fdf2f56 (diff) |
Merge with /shiny/git/linux-2.6/.git
Diffstat (limited to 'sound/pci/ens1370.c')
-rw-r--r-- | sound/pci/ens1370.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/sound/pci/ens1370.c b/sound/pci/ens1370.c index 4e63498a58b2..78a81f3912a1 100644 --- a/sound/pci/ens1370.c +++ b/sound/pci/ens1370.c | |||
@@ -685,6 +685,15 @@ static unsigned short snd_es1371_codec_read(ac97_t *ac97, | |||
685 | return 0; | 685 | return 0; |
686 | } | 686 | } |
687 | 687 | ||
688 | static void snd_es1371_codec_wait(ac97_t *ac97) | ||
689 | { | ||
690 | msleep(750); | ||
691 | snd_es1371_codec_read(ac97, AC97_RESET); | ||
692 | snd_es1371_codec_read(ac97, AC97_VENDOR_ID1); | ||
693 | snd_es1371_codec_read(ac97, AC97_VENDOR_ID2); | ||
694 | msleep(50); | ||
695 | } | ||
696 | |||
688 | static void snd_es1371_adc_rate(ensoniq_t * ensoniq, unsigned int rate) | 697 | static void snd_es1371_adc_rate(ensoniq_t * ensoniq, unsigned int rate) |
689 | { | 698 | { |
690 | unsigned int n, truncm, freq, result; | 699 | unsigned int n, truncm, freq, result; |
@@ -1585,6 +1594,7 @@ static int snd_ensoniq_1371_mixer(ensoniq_t * ensoniq) | |||
1585 | static ac97_bus_ops_t ops = { | 1594 | static ac97_bus_ops_t ops = { |
1586 | .write = snd_es1371_codec_write, | 1595 | .write = snd_es1371_codec_write, |
1587 | .read = snd_es1371_codec_read, | 1596 | .read = snd_es1371_codec_read, |
1597 | .wait = snd_es1371_codec_wait, | ||
1588 | }; | 1598 | }; |
1589 | 1599 | ||
1590 | if ((err = snd_ac97_bus(card, 0, &ops, NULL, &pbus)) < 0) | 1600 | if ((err = snd_ac97_bus(card, 0, &ops, NULL, &pbus)) < 0) |
@@ -2008,21 +2018,11 @@ static int __devinit snd_ensoniq_create(snd_card_t * card, | |||
2008 | if (pci->vendor == es1371_ac97_reset_hack[idx].vid && | 2018 | if (pci->vendor == es1371_ac97_reset_hack[idx].vid && |
2009 | pci->device == es1371_ac97_reset_hack[idx].did && | 2019 | pci->device == es1371_ac97_reset_hack[idx].did && |
2010 | ensoniq->rev == es1371_ac97_reset_hack[idx].rev) { | 2020 | ensoniq->rev == es1371_ac97_reset_hack[idx].rev) { |
2011 | unsigned long tmo; | ||
2012 | signed long tmo2; | ||
2013 | |||
2014 | ensoniq->cssr |= ES_1371_ST_AC97_RST; | 2021 | ensoniq->cssr |= ES_1371_ST_AC97_RST; |
2015 | outl(ensoniq->cssr, ES_REG(ensoniq, STATUS)); | 2022 | outl(ensoniq->cssr, ES_REG(ensoniq, STATUS)); |
2016 | /* need to delay around 20ms(bleech) to give | 2023 | /* need to delay around 20ms(bleech) to give |
2017 | some CODECs enough time to wakeup */ | 2024 | some CODECs enough time to wakeup */ |
2018 | tmo = jiffies + (HZ / 50) + 1; | 2025 | msleep(20); |
2019 | while (1) { | ||
2020 | tmo2 = tmo - jiffies; | ||
2021 | if (tmo2 <= 0) | ||
2022 | break; | ||
2023 | set_current_state(TASK_UNINTERRUPTIBLE); | ||
2024 | schedule_timeout(tmo2); | ||
2025 | } | ||
2026 | break; | 2026 | break; |
2027 | } | 2027 | } |
2028 | /* AC'97 warm reset to start the bitclk */ | 2028 | /* AC'97 warm reset to start the bitclk */ |