summaryrefslogtreecommitdiff
path: root/sys/dev/pci/auixp.c
diff options
context:
space:
mode:
authorJacob Meuser <jakemsr@cvs.openbsd.org>2008-01-15 02:52:51 +0000
committerJacob Meuser <jakemsr@cvs.openbsd.org>2008-01-15 02:52:51 +0000
commitfdb9fd0866050d52511af5964c7dcaa8163829dc (patch)
tree84fe430f5e1050ce3953703eab2ca5e5dd0a8d1c /sys/dev/pci/auixp.c
parentea2aa03ab2ea9e57ed9db458346e303e1e7a5f28 (diff)
bring in lots of ac97(4) and auvia(4) updates from NetBSD
user visible changes: - when setting up ac97(4) mixer items, for some features like surround sound, check if the feature if supported by the codec and only add items for that feature if it is - auvia(4) now supports multichannel playback with at least some multichannel ac97(4) codecs fixes problems for me and ajacoutot with different auvia(4) devices/codecs. no regressions reported by testers. if you have an ac97(4) audio device and are using mixerctl.conf(5), you may want/need to update it. ok ratchov
Diffstat (limited to 'sys/dev/pci/auixp.c')
-rw-r--r--sys/dev/pci/auixp.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/sys/dev/pci/auixp.c b/sys/dev/pci/auixp.c
index 6c535acafa1..556ba54ccbf 100644
--- a/sys/dev/pci/auixp.c
+++ b/sys/dev/pci/auixp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auixp.c,v 1.13 2007/11/05 00:17:28 jakemsr Exp $ */
+/* $OpenBSD: auixp.c,v 1.14 2008/01/15 02:52:50 jakemsr Exp $ */
/* $NetBSD: auixp.c,v 1.9 2005/06/27 21:13:09 thorpej Exp $ */
/*
@@ -364,6 +364,7 @@ auixp_set_params(void *hdl, int setmode, int usemode,
struct auixp_codec *co;
struct auixp_softc *sc;
int error;
+ u_int temprate;
co = (struct auixp_codec *) hdl;
sc = co->sc;
@@ -534,9 +535,23 @@ auixp_set_params(void *hdl, int setmode, int usemode,
return (EINVAL);
}
- error = ac97_set_rate(co->codec_if, play, AUMODE_PLAY);
+ temprate = play->sample_rate;
+ error = ac97_set_rate(co->codec_if,
+ AC97_REG_PCM_FRONT_DAC_RATE, &play->sample_rate);
if (error)
return (error);
+ play->sample_rate = temprate;
+ error = ac97_set_rate(co->codec_if,
+ AC97_REG_PCM_SURR_DAC_RATE, &play->sample_rate);
+ if (error)
+ return (error);
+ play->sample_rate = temprate;
+ error = ac97_set_rate(co->codec_if,
+ AC97_REG_PCM_LFE_DAC_RATE, &play->sample_rate);
+
+ if (error)
+ return (error);
+
}
if (setmode & AUMODE_RECORD) {
@@ -571,7 +586,8 @@ auixp_set_params(void *hdl, int setmode, int usemode,
return (EINVAL);
}
- error = ac97_set_rate(co->codec_if, rec, AUMODE_RECORD);
+ error = ac97_set_rate(co->codec_if, AC97_REG_PCM_LR_ADC_RATE,
+ &rec->sample_rate);
if (error)
return (error);
}