[ALSA] Fix-up sleeping in sound/ppc

PPC AWACS driver,PPC PMAC driver,PPC Tumbler driver
Description: Fix-up sleeping in sound/ppc. Replace big_mdelay() with
msleep() to guarantee the task delays as expected. This also involved
replacing/removing custom sleep functions.

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
This commit is contained in:
Nishanth Aravamudan 2005-07-09 10:53:24 +02:00 committed by Jaroslav Kysela
parent ef21ca24fa
commit 989a0b248b
3 changed files with 11 additions and 16 deletions

View file

@ -103,7 +103,7 @@ static void screamer_recalibrate(pmac_t *chip)
snd_pmac_awacs_write_noreg(chip, 1, chip->awacs_reg[1]);
if (chip->manufacturer == 0x1)
/* delay for broken crystal part */
big_mdelay(750);
msleep(750);
snd_pmac_awacs_write_noreg(chip, 1,
chip->awacs_reg[1] | MASK_RECALIBRATE | MASK_CMUTE | MASK_AMUTE);
snd_pmac_awacs_write_noreg(chip, 1, chip->awacs_reg[1]);
@ -653,10 +653,10 @@ static void snd_pmac_awacs_resume(pmac_t *chip)
{
if (machine_is_compatible("PowerBook3,1")
|| machine_is_compatible("PowerBook3,2")) {
big_mdelay(100);
msleep(100);
snd_pmac_awacs_write_reg(chip, 1,
chip->awacs_reg[1] & ~MASK_PAROUT);
big_mdelay(300);
msleep(300);
}
awacs_restore_all_regs(chip);

View file

@ -212,9 +212,4 @@ int snd_pmac_boolean_mono_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *ui
int snd_pmac_add_automute(pmac_t *chip);
#define big_mdelay(msec) do {\
set_current_state(TASK_UNINTERRUPTIBLE);\
schedule_timeout(((msec) * HZ + 999) / 1000);\
} while (0)
#endif /* __PMAC_H */

View file

@ -945,7 +945,7 @@ static void device_change_handler(void *self)
check_mute(chip, &mix->line_mute, 0, mix->auto_mute_notify,
chip->lineout_sw_ctl);
if (mix->anded_reset)
big_mdelay(10);
msleep(10);
check_mute(chip, &mix->amp_mute, 1, mix->auto_mute_notify,
chip->speaker_sw_ctl);
mix->drc_enable = 0;
@ -954,7 +954,7 @@ static void device_change_handler(void *self)
check_mute(chip, &mix->amp_mute, 0, mix->auto_mute_notify,
chip->speaker_sw_ctl);
if (mix->anded_reset)
big_mdelay(10);
msleep(10);
check_mute(chip, &mix->hp_mute, 1, mix->auto_mute_notify,
chip->master_sw_ctl);
if (mix->line_mute.addr != 0)
@ -1109,22 +1109,22 @@ static void tumbler_reset_audio(pmac_t *chip)
DBG("(I) codec anded reset !\n");
write_audio_gpio(&mix->hp_mute, 0);
write_audio_gpio(&mix->amp_mute, 0);
big_mdelay(200);
msleep(200);
write_audio_gpio(&mix->hp_mute, 1);
write_audio_gpio(&mix->amp_mute, 1);
big_mdelay(100);
msleep(100);
write_audio_gpio(&mix->hp_mute, 0);
write_audio_gpio(&mix->amp_mute, 0);
big_mdelay(100);
msleep(100);
} else {
DBG("(I) codec normal reset !\n");
write_audio_gpio(&mix->audio_reset, 0);
big_mdelay(200);
msleep(200);
write_audio_gpio(&mix->audio_reset, 1);
big_mdelay(100);
msleep(100);
write_audio_gpio(&mix->audio_reset, 0);
big_mdelay(100);
msleep(100);
}
}