Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci/hdaudio for analog devices codecs, mark the anal...



details:   https://anonhg.NetBSD.org/src/rev/5df0d79b2cdc
branches:  trunk
changeset: 772119:5df0d79b2cdc
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Mon Dec 19 12:19:26 2011 +0000

description:
for analog devices codecs, mark the analog beeper pin as a beep generator
to help the parser. makes pcppi beep work again.

diffstat:

 sys/dev/pci/hdaudio/hdafg.c |  31 +++++++++++++++++++++++++++----
 1 files changed, 27 insertions(+), 4 deletions(-)

diffs (59 lines):

diff -r f95bf3587cb8 -r 5df0d79b2cdc sys/dev/pci/hdaudio/hdafg.c
--- a/sys/dev/pci/hdaudio/hdafg.c       Mon Dec 19 11:59:56 2011 +0000
+++ b/sys/dev/pci/hdaudio/hdafg.c       Mon Dec 19 12:19:26 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hdafg.c,v 1.13 2011/12/12 01:25:29 christos Exp $ */
+/* $NetBSD: hdafg.c,v 1.14 2011/12/19 12:19:26 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd <support%precedence.co.uk@localhost>
@@ -60,7 +60,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.13 2011/12/12 01:25:29 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.14 2011/12/19 12:19:26 jmcneill Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -675,15 +675,38 @@
 {
        struct hdafg_softc *sc = w->w_afg;
        uint32_t wcap, config;
+       bool pcbeep = false;
 
        wcap = hda_get_wparam(w, AUDIO_WIDGET_CAPABILITIES);
        config = hdafg_widget_getconfig(w);
 
        w->w_waspin = false;
 
-       if (sc->sc_has_beepgen == false &&
+       switch (sc->sc_vendor) {
+       case HDA_VENDOR_ANALOG_DEVICES:
+               /*
+                * help the parser by marking the analog
+                * beeper as a beep generator
+                */
+               if (w->w_nid == 0x1a &&
+                   COP_CFG_SEQUENCE(config) == 0x0 &&
+                   COP_CFG_DEFAULT_ASSOCIATION(config) == 0xf &&
+                   COP_CFG_PORT_CONNECTIVITY(config) ==
+                     COP_PORT_FIXED_FUNCTION &&
+                   COP_CFG_DEFAULT_DEVICE(config) ==
+                     COP_DEVICE_OTHER &&
+                   COP_CFG_CONNECTION_TYPE(config) ==
+                     COP_CONN_TYPE_ATAPI_INTERNAL &&
+                   COP_CFG_COLOR(config) == 0x0) {
+                       pcbeep = true;
+               }
+               break;
+       }
+
+       if (pcbeep ||
+           (sc->sc_has_beepgen == false &&
            COP_CFG_DEFAULT_DEVICE(config) == COP_DEVICE_SPEAKER &&
-           (wcap & (COP_AWCAP_INAMP_PRESENT|COP_AWCAP_OUTAMP_PRESENT)) == 0) {
+           (wcap & (COP_AWCAP_INAMP_PRESENT|COP_AWCAP_OUTAMP_PRESENT)) == 0)) {
                wcap &= ~COP_AWCAP_TYPE_MASK;
                wcap |= (COP_AWCAP_TYPE_BEEP_GENERATOR << COP_AWCAP_TYPE_SHIFT);
                w->w_waspin = true;



Home | Main Index | Thread Index | Old Index