From 79231127eb60780c0686d10b9477e859392ca146 Mon Sep 17 00:00:00 2001 From: Jacob Meuser Date: Mon, 22 Dec 2008 00:54:05 +0000 Subject: new function azalia_pin_config_ov, used to override configuration values read from pin complex widgets. --- sys/dev/pci/azalia_codec.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'sys/dev/pci/azalia_codec.c') 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 * -- cgit v1.2.3