Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/hdaudio Fix hdaudio device configuration



details:   https://anonhg.NetBSD.org/src/rev/db17f24589a9
branches:  trunk
changeset: 433674:db17f24589a9
user:      manu <manu%NetBSD.org@localhost>
date:      Thu Sep 27 01:18:11 2018 +0000

description:
Fix hdaudio device configuration

When disabling unassociated devices, we have a special handling
for pins of type COP_AWCAP_TYPE_PIN_COMPLEX, but it came after code
that may disable any pins, including the ones that should be handled
as COP_AWCAP_TYPE_PIN_COMPLEX.

The result was that hdaudio could fail to detect some devices.  We
fix the situation by making sure that COP_AWCAP_TYPE_PIN_COMPLEX
pins always get their specific handling.

The change makes the built-in speaker work on Dell OptiPlex 5060

diffstat:

 sys/dev/hdaudio/hdafg.c |  32 ++++++++++++++++----------------
 1 files changed, 16 insertions(+), 16 deletions(-)

diffs (58 lines):

diff -r 36d1a2c0cf29 -r db17f24589a9 sys/dev/hdaudio/hdafg.c
--- a/sys/dev/hdaudio/hdafg.c   Thu Sep 27 01:03:40 2018 +0000
+++ b/sys/dev/hdaudio/hdafg.c   Thu Sep 27 01:18:11 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hdafg.c,v 1.15 2018/02/14 18:28:43 maya Exp $ */
+/* $NetBSD: hdafg.c,v 1.16 2018/09/27 01:18:11 manu 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.15 2018/02/14 18:28:43 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.16 2018/09/27 01:18:11 manu Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -2102,25 +2102,25 @@
        struct hdaudio_control *ctl;
        int i, j, k;
 
-       /* Disable unassociated widgets */
        for (i = sc->sc_startnode; i < sc->sc_endnode; i++) {
                w = hdafg_widget_lookup(sc, i);
                if (w == NULL || w->w_enable == false)
                        continue;
-               if (w->w_bindas == -1) {
-                       w->w_enable = 0;
-                       hda_trace(sc, "disable %02X [unassociated]\n",
-                           w->w_nid);
+               
+               /* Disable unassociated widgets */
+               if (w->w_type != COP_AWCAP_TYPE_PIN_COMPLEX) {
+                       if (w->w_bindas == -1) {
+                               w->w_enable = 0;
+                               hda_trace(sc, "disable %02X [unassociated]\n",
+                                   w->w_nid);
+                       }
+                       continue;
                }
-       }
-
-       /* Disable input connections on input pin and output on output */
-       for (i = sc->sc_startnode; i < sc->sc_endnode; i++) {
-               w = hdafg_widget_lookup(sc, i);
-               if (w == NULL || w->w_enable == false)
-                       continue;
-               if (w->w_type != COP_AWCAP_TYPE_PIN_COMPLEX)
-                       continue;
+
+               /*
+                * Disable input connections on input pin
+                * and output on output pin
+                */
                if (w->w_bindas < 0)
                        continue;
                if (as[w->w_bindas].as_dir == HDAUDIO_PINDIR_IN) {



Home | Main Index | Thread Index | Old Index