diff options
author | Jacob Meuser <jakemsr@cvs.openbsd.org> | 2008-12-22 00:54:05 +0000 |
---|---|---|
committer | Jacob Meuser <jakemsr@cvs.openbsd.org> | 2008-12-22 00:54:05 +0000 |
commit | 79231127eb60780c0686d10b9477e859392ca146 (patch) | |
tree | 2f8a5abf86b34b3be9e4dbed3e9432b859f01e80 /sys/dev/pci/azalia_codec.c | |
parent | 2e43bf9f0ec166848215f9b3522ac9e04da11ad8 (diff) |
new function azalia_pin_config_ov, used to override configuration
values read from pin complex widgets.
Diffstat (limited to 'sys/dev/pci/azalia_codec.c')
-rw-r--r-- | sys/dev/pci/azalia_codec.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/sys/dev/pci/azalia_codec.c b/sys/dev/pci/azalia_codec.c index d2c4642c2a9..9ca8dafa04c 100644 --- a/sys/dev/pci/azalia_codec.c +++ b/sys/dev/pci/azalia_codec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: azalia_codec.c,v 1.81 2008/12/21 20:44:04 jakemsr Exp $ */ +/* $OpenBSD: azalia_codec.c,v 1.82 2008/12/22 00:54:04 jakemsr Exp $ */ /* $NetBSD: azalia_codec.c,v 1.8 2006/05/10 11:17:27 kent Exp $ */ /*- @@ -90,6 +90,7 @@ int azalia_generic_get_port(codec_t *, mixer_ctrl_t *); int azalia_gpio_unmute(codec_t *, int); int azalia_nid_to_index(const codec_t *, nid_t); +void azalia_pin_config_ov(widget_t *, int, int); int azalia_alc260_mixer_init(codec_t *); int azalia_alc88x_mixer_init(codec_t *); @@ -1722,6 +1723,31 @@ azalia_gpio_unmute(codec_t *this, int pin) return 0; } +void +azalia_pin_config_ov(widget_t *w, int mask, int val) +{ + int bits, offset; + + switch (mask) { + case CORB_CD_DEVICE_MASK: + bits = CORB_CD_DEVICE_BITS; + offset = CORB_CD_DEVICE_OFFSET; + break; + case CORB_CD_PORT_MASK: + bits = CORB_CD_PORT_BITS; + offset = CORB_CD_PORT_OFFSET; + break; + default: + return; + } + val &= bits; + w->d.pin.config &= ~(mask); + w->d.pin.config |= val << offset; + if (mask == CORB_CD_DEVICE_MASK) + w->d.pin.device = val; +} + + /* ---------------------------------------------------------------- * Realtek ALC260 * |