aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/ac97/ac97_codec.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2007-08-10 10:50:37 -0400
committerJaroslav Kysela <perex@perex.cz>2007-10-16 09:58:40 -0400
commit45cffef1ff4679f5961146101ea1b8235bdd25b5 (patch)
tree0266ee1a9091285f2383d18aeec74961d4dc5126 /sound/pci/ac97/ac97_codec.c
parent9b0d39be53b057e05e2f796a071ff1cead3a2506 (diff)
[ALSA] Use msecs_to_jiffies() in ac97_codec.c
Replace the direct calculation of jiffies with msecs_to_jiffies(). Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/pci/ac97/ac97_codec.c')
-rw-r--r--sound/pci/ac97/ac97_codec.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c
index 7b02a967c1e6..df1333332a5e 100644
--- a/sound/pci/ac97/ac97_codec.c
+++ b/sound/pci/ac97/ac97_codec.c
@@ -2036,11 +2036,12 @@ int snd_ac97_mixer(struct snd_ac97_bus *bus, struct snd_ac97_template *template,
2036 else { 2036 else {
2037 udelay(50); 2037 udelay(50);
2038 if (ac97->scaps & AC97_SCAP_SKIP_AUDIO) 2038 if (ac97->scaps & AC97_SCAP_SKIP_AUDIO)
2039 err = ac97_reset_wait(ac97, HZ/2, 1); 2039 err = ac97_reset_wait(ac97, msecs_to_jiffies(500), 1);
2040 else { 2040 else {
2041 err = ac97_reset_wait(ac97, HZ/2, 0); 2041 err = ac97_reset_wait(ac97, msecs_to_jiffies(500), 0);
2042 if (err < 0) 2042 if (err < 0)
2043 err = ac97_reset_wait(ac97, HZ/2, 1); 2043 err = ac97_reset_wait(ac97,
2044 msecs_to_jiffies(500), 1);
2044 } 2045 }
2045 if (err < 0) { 2046 if (err < 0) {
2046 snd_printk(KERN_WARNING "AC'97 %d does not respond - RESET\n", ac97->num); 2047 snd_printk(KERN_WARNING "AC'97 %d does not respond - RESET\n", ac97->num);
@@ -2104,7 +2105,7 @@ int snd_ac97_mixer(struct snd_ac97_bus *bus, struct snd_ac97_template *template,
2104 } 2105 }
2105 /* nothing should be in powerdown mode */ 2106 /* nothing should be in powerdown mode */
2106 snd_ac97_write_cache(ac97, AC97_GENERAL_PURPOSE, 0); 2107 snd_ac97_write_cache(ac97, AC97_GENERAL_PURPOSE, 0);
2107 end_time = jiffies + (HZ / 10); 2108 end_time = jiffies + msecs_to_jiffies(100);
2108 do { 2109 do {
2109 if ((snd_ac97_read(ac97, AC97_POWERDOWN) & 0x0f) == 0x0f) 2110 if ((snd_ac97_read(ac97, AC97_POWERDOWN) & 0x0f) == 0x0f)
2110 goto __ready_ok; 2111 goto __ready_ok;
@@ -2136,7 +2137,7 @@ int snd_ac97_mixer(struct snd_ac97_bus *bus, struct snd_ac97_template *template,
2136 udelay(100); 2137 udelay(100);
2137 /* nothing should be in powerdown mode */ 2138 /* nothing should be in powerdown mode */
2138 snd_ac97_write_cache(ac97, AC97_EXTENDED_MSTATUS, 0); 2139 snd_ac97_write_cache(ac97, AC97_EXTENDED_MSTATUS, 0);
2139 end_time = jiffies + (HZ / 10); 2140 end_time = jiffies + msecs_to_jiffies(100);
2140 do { 2141 do {
2141 if ((snd_ac97_read(ac97, AC97_EXTENDED_MSTATUS) & tmp) == tmp) 2142 if ((snd_ac97_read(ac97, AC97_EXTENDED_MSTATUS) & tmp) == tmp)
2142 goto __ready_ok; 2143 goto __ready_ok;
@@ -2354,7 +2355,8 @@ int snd_ac97_update_power(struct snd_ac97 *ac97, int reg, int powerup)
2354 * (for avoiding loud click noises for many (OSS) apps 2355 * (for avoiding loud click noises for many (OSS) apps
2355 * that open/close frequently) 2356 * that open/close frequently)
2356 */ 2357 */
2357 schedule_delayed_work(&ac97->power_work, HZ*2); 2358 schedule_delayed_work(&ac97->power_work,
2359 msecs_to_jiffies(2000));
2358 else { 2360 else {
2359 cancel_delayed_work(&ac97->power_work); 2361 cancel_delayed_work(&ac97->power_work);
2360 update_power_regs(ac97); 2362 update_power_regs(ac97);