diff options
author | Nishanth Aravamudan <nacc@us.ibm.com> | 2005-07-09 04:53:24 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2005-07-28 06:22:15 -0400 |
commit | 989a0b248bbf32c89e60dc6f02219e446b320712 (patch) | |
tree | 6eab18b706182471ad1a22636a3c769c068836f0 /sound | |
parent | ef21ca24faf28df6d06939e77d5032a313490289 (diff) |
[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>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/ppc/awacs.c | 6 | ||||
-rw-r--r-- | sound/ppc/pmac.h | 5 | ||||
-rw-r--r-- | sound/ppc/tumbler.c | 16 |
3 files changed, 11 insertions, 16 deletions
diff --git a/sound/ppc/awacs.c b/sound/ppc/awacs.c index 061e52d3d771..758ca1bcbcf2 100644 --- a/sound/ppc/awacs.c +++ b/sound/ppc/awacs.c | |||
@@ -103,7 +103,7 @@ static void screamer_recalibrate(pmac_t *chip) | |||
103 | snd_pmac_awacs_write_noreg(chip, 1, chip->awacs_reg[1]); | 103 | snd_pmac_awacs_write_noreg(chip, 1, chip->awacs_reg[1]); |
104 | if (chip->manufacturer == 0x1) | 104 | if (chip->manufacturer == 0x1) |
105 | /* delay for broken crystal part */ | 105 | /* delay for broken crystal part */ |
106 | big_mdelay(750); | 106 | msleep(750); |
107 | snd_pmac_awacs_write_noreg(chip, 1, | 107 | snd_pmac_awacs_write_noreg(chip, 1, |
108 | chip->awacs_reg[1] | MASK_RECALIBRATE | MASK_CMUTE | MASK_AMUTE); | 108 | chip->awacs_reg[1] | MASK_RECALIBRATE | MASK_CMUTE | MASK_AMUTE); |
109 | snd_pmac_awacs_write_noreg(chip, 1, chip->awacs_reg[1]); | 109 | 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 | { | 653 | { |
654 | if (machine_is_compatible("PowerBook3,1") | 654 | if (machine_is_compatible("PowerBook3,1") |
655 | || machine_is_compatible("PowerBook3,2")) { | 655 | || machine_is_compatible("PowerBook3,2")) { |
656 | big_mdelay(100); | 656 | msleep(100); |
657 | snd_pmac_awacs_write_reg(chip, 1, | 657 | snd_pmac_awacs_write_reg(chip, 1, |
658 | chip->awacs_reg[1] & ~MASK_PAROUT); | 658 | chip->awacs_reg[1] & ~MASK_PAROUT); |
659 | big_mdelay(300); | 659 | msleep(300); |
660 | } | 660 | } |
661 | 661 | ||
662 | awacs_restore_all_regs(chip); | 662 | awacs_restore_all_regs(chip); |
diff --git a/sound/ppc/pmac.h b/sound/ppc/pmac.h index 582db5220119..ae3bb6c6edff 100644 --- a/sound/ppc/pmac.h +++ b/sound/ppc/pmac.h | |||
@@ -212,9 +212,4 @@ int snd_pmac_boolean_mono_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *ui | |||
212 | 212 | ||
213 | int snd_pmac_add_automute(pmac_t *chip); | 213 | int snd_pmac_add_automute(pmac_t *chip); |
214 | 214 | ||
215 | #define big_mdelay(msec) do {\ | ||
216 | set_current_state(TASK_UNINTERRUPTIBLE);\ | ||
217 | schedule_timeout(((msec) * HZ + 999) / 1000);\ | ||
218 | } while (0) | ||
219 | |||
220 | #endif /* __PMAC_H */ | 215 | #endif /* __PMAC_H */ |
diff --git a/sound/ppc/tumbler.c b/sound/ppc/tumbler.c index 36c5d5d45bb1..b94437c024b1 100644 --- a/sound/ppc/tumbler.c +++ b/sound/ppc/tumbler.c | |||
@@ -945,7 +945,7 @@ static void device_change_handler(void *self) | |||
945 | check_mute(chip, &mix->line_mute, 0, mix->auto_mute_notify, | 945 | check_mute(chip, &mix->line_mute, 0, mix->auto_mute_notify, |
946 | chip->lineout_sw_ctl); | 946 | chip->lineout_sw_ctl); |
947 | if (mix->anded_reset) | 947 | if (mix->anded_reset) |
948 | big_mdelay(10); | 948 | msleep(10); |
949 | check_mute(chip, &mix->amp_mute, 1, mix->auto_mute_notify, | 949 | check_mute(chip, &mix->amp_mute, 1, mix->auto_mute_notify, |
950 | chip->speaker_sw_ctl); | 950 | chip->speaker_sw_ctl); |
951 | mix->drc_enable = 0; | 951 | mix->drc_enable = 0; |
@@ -954,7 +954,7 @@ static void device_change_handler(void *self) | |||
954 | check_mute(chip, &mix->amp_mute, 0, mix->auto_mute_notify, | 954 | check_mute(chip, &mix->amp_mute, 0, mix->auto_mute_notify, |
955 | chip->speaker_sw_ctl); | 955 | chip->speaker_sw_ctl); |
956 | if (mix->anded_reset) | 956 | if (mix->anded_reset) |
957 | big_mdelay(10); | 957 | msleep(10); |
958 | check_mute(chip, &mix->hp_mute, 1, mix->auto_mute_notify, | 958 | check_mute(chip, &mix->hp_mute, 1, mix->auto_mute_notify, |
959 | chip->master_sw_ctl); | 959 | chip->master_sw_ctl); |
960 | if (mix->line_mute.addr != 0) | 960 | if (mix->line_mute.addr != 0) |
@@ -1109,22 +1109,22 @@ static void tumbler_reset_audio(pmac_t *chip) | |||
1109 | DBG("(I) codec anded reset !\n"); | 1109 | DBG("(I) codec anded reset !\n"); |
1110 | write_audio_gpio(&mix->hp_mute, 0); | 1110 | write_audio_gpio(&mix->hp_mute, 0); |
1111 | write_audio_gpio(&mix->amp_mute, 0); | 1111 | write_audio_gpio(&mix->amp_mute, 0); |
1112 | big_mdelay(200); | 1112 | msleep(200); |
1113 | write_audio_gpio(&mix->hp_mute, 1); | 1113 | write_audio_gpio(&mix->hp_mute, 1); |
1114 | write_audio_gpio(&mix->amp_mute, 1); | 1114 | write_audio_gpio(&mix->amp_mute, 1); |
1115 | big_mdelay(100); | 1115 | msleep(100); |
1116 | write_audio_gpio(&mix->hp_mute, 0); | 1116 | write_audio_gpio(&mix->hp_mute, 0); |
1117 | write_audio_gpio(&mix->amp_mute, 0); | 1117 | write_audio_gpio(&mix->amp_mute, 0); |
1118 | big_mdelay(100); | 1118 | msleep(100); |
1119 | } else { | 1119 | } else { |
1120 | DBG("(I) codec normal reset !\n"); | 1120 | DBG("(I) codec normal reset !\n"); |
1121 | 1121 | ||
1122 | write_audio_gpio(&mix->audio_reset, 0); | 1122 | write_audio_gpio(&mix->audio_reset, 0); |
1123 | big_mdelay(200); | 1123 | msleep(200); |
1124 | write_audio_gpio(&mix->audio_reset, 1); | 1124 | write_audio_gpio(&mix->audio_reset, 1); |
1125 | big_mdelay(100); | 1125 | msleep(100); |
1126 | write_audio_gpio(&mix->audio_reset, 0); | 1126 | write_audio_gpio(&mix->audio_reset, 0); |
1127 | big_mdelay(100); | 1127 | msleep(100); |
1128 | } | 1128 | } |
1129 | } | 1129 | } |
1130 | 1130 | ||