Module Name: src
Committed By: martin
Date: Tue Oct 9 10:09:52 UTC 2018
Modified Files:
src/sys/dev/hdaudio [netbsd-8]: hdafg.c
Log Message:
Pull up following revision(s) (requested by manu in ticket #1053):
sys/dev/hdaudio/hdafg.c: revision 1.16
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
To generate a diff of this commit:
cvs rdiff -u -r1.12.2.1 -r1.12.2.2 src/sys/dev/hdaudio/hdafg.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/hdaudio/hdafg.c
diff -u src/sys/dev/hdaudio/hdafg.c:1.12.2.1 src/sys/dev/hdaudio/hdafg.c:1.12.2.2
--- src/sys/dev/hdaudio/hdafg.c:1.12.2.1 Sun Aug 20 04:50:38 2017
+++ src/sys/dev/hdaudio/hdafg.c Tue Oct 9 10:09:51 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: hdafg.c,v 1.12.2.1 2017/08/20 04:50:38 snj Exp $ */
+/* $NetBSD: hdafg.c,v 1.12.2.2 2018/10/09 10:09:51 martin Exp $ */
/*
* Copyright (c) 2009 Precedence Technologies Ltd <[email protected]>
@@ -60,7 +60,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.12.2.1 2017/08/20 04:50:38 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.12.2.2 2018/10/09 10:09:51 martin Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -2106,25 +2106,25 @@ hdafg_disable_unassoc(struct hdafg_softc
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) {