Skip to content

Commit

Permalink
[ALSA] Fix-up sleeping in sound/ppc
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nishanth Aravamudan authored and Jaroslav Kysela committed Jul 28, 2005
1 parent ef21ca2 commit 989a0b2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 16 deletions.
6 changes: 3 additions & 3 deletions sound/ppc/awacs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down Expand Up @@ -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);
Expand Down
5 changes: 0 additions & 5 deletions sound/ppc/pmac.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
16 changes: 8 additions & 8 deletions sound/ppc/tumbler.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)
Expand Down Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 989a0b2

Please sign in to comment.