diff options
author | orion <orion@FreeBSD.org> | 2001-12-19 18:04:04 +0000 |
---|---|---|
committer | orion <orion@FreeBSD.org> | 2001-12-19 18:04:04 +0000 |
commit | 3d7b11bb97ddae0f22c539d82455b491493aef42 (patch) | |
tree | 34e8ee49b8e5b31034a7d9db09efa02f9450e4bf /sys | |
parent | 308c6566ff55a6d390f9dcd6c8f314d7787af642 (diff) | |
download | FreeBSD-src-3d7b11bb97ddae0f22c539d82455b491493aef42.zip FreeBSD-src-3d7b11bb97ddae0f22c539d82455b491493aef42.tar.gz |
Nitlets.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/sound/pci/ich.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/sys/dev/sound/pci/ich.c b/sys/dev/sound/pci/ich.c index 54ad18c..39ba19e 100644 --- a/sys/dev/sound/pci/ich.c +++ b/sys/dev/sound/pci/ich.c @@ -450,8 +450,7 @@ unsigned int ich_calibrate(struct sc_info *sc) * generated. */ struct sc_chinfo *ch = &sc->ch[1]; u_int16_t target_picb, actual_picb; - u_int32_t wait_us; - int32_t actual_48k_rate; + u_int32_t wait_us, actual_48k_rate; KASSERT(ch->regbase == ICH_REG_PI_BASE, ("wrong direction")); @@ -473,17 +472,17 @@ unsigned int ich_calibrate(struct sc_info *sc) actual_48k_rate = 48000 * (2 * target_picb - actual_picb) / (target_picb); - if (bootverbose) - device_printf(sc->dev, - "Tgt PICB %d, Act PICB %d, 48k rate %d\n", - target_picb, actual_picb, actual_48k_rate); - - if ((actual_48k_rate - 48000) > 500 || - (actual_48k_rate - 48000) < -500) { + if (actual_48k_rate > 48500 || actual_48k_rate < 47500) { sc->ac97rate = actual_48k_rate; } else { sc->ac97rate = 48000; } + + if (bootverbose) + device_printf(sc->dev, + "Estimated AC97 link rate %d, using %d\n", + actual_48k_rate, sc->ac97rate); + return sc->ac97rate; } |