ALSA: via82xx: add option to disable 500ms delay in snd_via82xx_codec_wait

There's a large 500ms delay in snd_via82xx_codec_wait() that, at least
on my hardware, appears to be unnecessary. The rest of the init of
the card works without logging any warnings or errors and both audio
and mixer settings work.

This adds an "nodelay" parameter to disable this (undocumented in the
code) large delay improving bootup time by 489-500ms.

[    1.034217] initcall alsa_card_via82xx_init+0x0/0x16 returned 0 after 505757 usecs
vs.
[    0.533136] initcall alsa_card_via82xx_init+0x0/0x16 returned 0 after 15915 usecs

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Simon Arlott 2009-06-21 19:50:48 +01:00 committed by Takashi Iwai
parent 1f3fff7bda
commit 115551d98e
1 changed files with 5 additions and 1 deletions

View File

@ -85,6 +85,7 @@ static int joystick;
static int ac97_clock = 48000; static int ac97_clock = 48000;
static char *ac97_quirk; static char *ac97_quirk;
static int dxs_support; static int dxs_support;
static int nodelay;
module_param(index, int, 0444); module_param(index, int, 0444);
MODULE_PARM_DESC(index, "Index value for VIA 82xx bridge."); MODULE_PARM_DESC(index, "Index value for VIA 82xx bridge.");
@ -102,6 +103,8 @@ module_param(ac97_quirk, charp, 0444);
MODULE_PARM_DESC(ac97_quirk, "AC'97 workaround for strange hardware."); MODULE_PARM_DESC(ac97_quirk, "AC'97 workaround for strange hardware.");
module_param(dxs_support, int, 0444); module_param(dxs_support, int, 0444);
MODULE_PARM_DESC(dxs_support, "Support for DXS channels (0 = auto, 1 = enable, 2 = disable, 3 = 48k only, 4 = no VRA, 5 = enable any sample rate)"); MODULE_PARM_DESC(dxs_support, "Support for DXS channels (0 = auto, 1 = enable, 2 = disable, 3 = 48k only, 4 = no VRA, 5 = enable any sample rate)");
module_param(nodelay, int, 0444);
MODULE_PARM_DESC(nodelay, "Disable 500ms init delay");
/* just for backward compatibility */ /* just for backward compatibility */
static int enable; static int enable;
@ -549,7 +552,8 @@ static void snd_via82xx_codec_wait(struct snd_ac97 *ac97)
int err; int err;
err = snd_via82xx_codec_ready(chip, ac97->num); err = snd_via82xx_codec_ready(chip, ac97->num);
/* here we need to wait fairly for long time.. */ /* here we need to wait fairly for long time.. */
msleep(500); if (!nodelay)
msleep(500);
} }
static void snd_via82xx_codec_write(struct snd_ac97 *ac97, static void snd_via82xx_codec_write(struct snd_ac97 *ac97,