diff options
author | 2006-06-25 00:45:00 +0000 | |
---|---|---|
committer | 2006-06-25 00:45:00 +0000 | |
commit | f90ef3523fb2cfc9117242be7262876cc88b20a5 (patch) | |
tree | 0114399899a5f4a663a725235f44916c43f1f5f1 /sys | |
parent | Shave 8 bytes off struct udf_mnt (diff) | |
download | wireguard-openbsd-f90ef3523fb2cfc9117242be7262876cc88b20a5.tar.xz wireguard-openbsd-f90ef3523fb2cfc9117242be7262876cc88b20a5.zip |
If the encoding of an audio converter is 0, refer to
the audio function node. CMI9880 0.2 has such ADCs.
From kent NetBSD
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/azalia.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/sys/dev/pci/azalia.c b/sys/dev/pci/azalia.c index 65f8e9a923f..ea7845d0ed8 100644 --- a/sys/dev/pci/azalia.c +++ b/sys/dev/pci/azalia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: azalia.c,v 1.17 2006/06/23 06:27:11 miod Exp $ */ +/* $OpenBSD: azalia.c,v 1.18 2006/06/25 00:45:00 brad Exp $ */ /* $NetBSD: azalia.c,v 1.20 2006/05/07 08:31:44 kent Exp $ */ /*- @@ -1458,15 +1458,24 @@ azalia_widget_init_audio(widget_t *this, const codec_t *codec) if (err) return err; this->d.audio.encodings = result; - if ((result & COP_STREAM_FORMAT_PCM) == 0) { - printf("%s: %s: No PCM support: %x\n", - XNAME(codec->az), this->name, result); - return -1; + if (result == 0) { /* quirk for CMI9880. + * This must not occuur usually... */ + this->d.audio.encodings = + codec->w[codec->audiofunc].d.audio.encodings; + this->d.audio.bits_rates = + codec->w[codec->audiofunc].d.audio.bits_rates; + } else { + if ((result & COP_STREAM_FORMAT_PCM) == 0) { + printf("%s: %s: No PCM support: %x\n", + XNAME(codec->az), this->name, result); + return -1; + } + err = codec->comresp(codec, this->nid, CORB_GET_PARAMETER, + COP_PCM, &result); + if (err) + return err; + this->d.audio.bits_rates = result; } - err = codec->comresp(codec, this->nid, CORB_GET_PARAMETER, - COP_PCM, &result); - if (err) - return err; this->d.audio.bits_rates = result; } else { this->d.audio.encodings = |