Commit 989a0b24 authored by Nishanth Aravamudan's avatar Nishanth Aravamudan Committed by Jaroslav Kysela

[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: default avatarNishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: default avatarJaroslav Kysela <perex@suse.cz>
parent ef21ca24
...@@ -103,7 +103,7 @@ static void screamer_recalibrate(pmac_t *chip) ...@@ -103,7 +103,7 @@ static void screamer_recalibrate(pmac_t *chip)
snd_pmac_awacs_write_noreg(chip, 1, chip->awacs_reg[1]); snd_pmac_awacs_write_noreg(chip, 1, chip->awacs_reg[1]);
if (chip->manufacturer == 0x1) if (chip->manufacturer == 0x1)
/* delay for broken crystal part */ /* delay for broken crystal part */
big_mdelay(750); msleep(750);
snd_pmac_awacs_write_noreg(chip, 1, snd_pmac_awacs_write_noreg(chip, 1,
chip->awacs_reg[1] | MASK_RECALIBRATE | MASK_CMUTE | MASK_AMUTE); chip->awacs_reg[1] | MASK_RECALIBRATE | MASK_CMUTE | MASK_AMUTE);
snd_pmac_awacs_write_noreg(chip, 1, chip->awacs_reg[1]); snd_pmac_awacs_write_noreg(chip, 1, chip->awacs_reg[1]);
...@@ -653,10 +653,10 @@ static void snd_pmac_awacs_resume(pmac_t *chip) ...@@ -653,10 +653,10 @@ static void snd_pmac_awacs_resume(pmac_t *chip)
{ {
if (machine_is_compatible("PowerBook3,1") if (machine_is_compatible("PowerBook3,1")
|| machine_is_compatible("PowerBook3,2")) { || machine_is_compatible("PowerBook3,2")) {
big_mdelay(100); msleep(100);
snd_pmac_awacs_write_reg(chip, 1, snd_pmac_awacs_write_reg(chip, 1,
chip->awacs_reg[1] & ~MASK_PAROUT); chip->awacs_reg[1] & ~MASK_PAROUT);
big_mdelay(300); msleep(300);
} }
awacs_restore_all_regs(chip); awacs_restore_all_regs(chip);
......
...@@ -212,9 +212,4 @@ int snd_pmac_boolean_mono_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *ui ...@@ -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); 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 */ #endif /* __PMAC_H */
...@@ -945,7 +945,7 @@ static void device_change_handler(void *self) ...@@ -945,7 +945,7 @@ static void device_change_handler(void *self)
check_mute(chip, &mix->line_mute, 0, mix->auto_mute_notify, check_mute(chip, &mix->line_mute, 0, mix->auto_mute_notify,
chip->lineout_sw_ctl); chip->lineout_sw_ctl);
if (mix->anded_reset) if (mix->anded_reset)
big_mdelay(10); msleep(10);
check_mute(chip, &mix->amp_mute, 1, mix->auto_mute_notify, check_mute(chip, &mix->amp_mute, 1, mix->auto_mute_notify,
chip->speaker_sw_ctl); chip->speaker_sw_ctl);
mix->drc_enable = 0; mix->drc_enable = 0;
...@@ -954,7 +954,7 @@ static void device_change_handler(void *self) ...@@ -954,7 +954,7 @@ static void device_change_handler(void *self)
check_mute(chip, &mix->amp_mute, 0, mix->auto_mute_notify, check_mute(chip, &mix->amp_mute, 0, mix->auto_mute_notify,
chip->speaker_sw_ctl); chip->speaker_sw_ctl);
if (mix->anded_reset) if (mix->anded_reset)
big_mdelay(10); msleep(10);
check_mute(chip, &mix->hp_mute, 1, mix->auto_mute_notify, check_mute(chip, &mix->hp_mute, 1, mix->auto_mute_notify,
chip->master_sw_ctl); chip->master_sw_ctl);
if (mix->line_mute.addr != 0) if (mix->line_mute.addr != 0)
...@@ -1109,22 +1109,22 @@ static void tumbler_reset_audio(pmac_t *chip) ...@@ -1109,22 +1109,22 @@ static void tumbler_reset_audio(pmac_t *chip)
DBG("(I) codec anded reset !\n"); DBG("(I) codec anded reset !\n");
write_audio_gpio(&mix->hp_mute, 0); write_audio_gpio(&mix->hp_mute, 0);
write_audio_gpio(&mix->amp_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->hp_mute, 1);
write_audio_gpio(&mix->amp_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->hp_mute, 0);
write_audio_gpio(&mix->amp_mute, 0); write_audio_gpio(&mix->amp_mute, 0);
big_mdelay(100); msleep(100);
} else { } else {
DBG("(I) codec normal reset !\n"); DBG("(I) codec normal reset !\n");
write_audio_gpio(&mix->audio_reset, 0); write_audio_gpio(&mix->audio_reset, 0);
big_mdelay(200); msleep(200);
write_audio_gpio(&mix->audio_reset, 1); write_audio_gpio(&mix->audio_reset, 1);
big_mdelay(100); msleep(100);
write_audio_gpio(&mix->audio_reset, 0); write_audio_gpio(&mix->audio_reset, 0);
big_mdelay(100); msleep(100);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment