NetBSD-Users archive

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

Re: hdaudio jack detection



2017.03.06. 10:33 keltezéssel, coypu%SDF.ORG@localhost írta:
When jack detection works, it just works.
It works out of the box on my laptop and shows up in dmesg as
hdafg:...unsol (which is also referenced in the hdaudio code).
So when I plug in my headphones it will play to them and not speakers.

Some hardware is worse supported.

Hi again,

Finally I could solve the problem by modifying the driver. Now it works.

I attached the patch.

So, I don't know what's next.

This patch is more like a hardware dependent tuning. I am not sure its generally a good pin configuration for all AD 1984A...

Is there anybody around having an Analog Devices AD1984A, and could try my patch?

Regards,

FeZ
Index: hdafg.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/hdaudio/Attic/hdafg.c,v
retrieving revision 1.21.2.1
diff -u -r1.21.2.1 hdafg.c
--- hdafg.c	4 Sep 2015 15:07:08 -0000	1.21.2.1
+++ hdafg.c	18 Mar 2017 14:11:57 -0000
@@ -656,7 +656,44 @@
 		w->w_pin.config |= 0xe0;
 	}
 #endif
-
+   
+        /* XXX ADI AD1984A */
+        if (sc->sc_vendor == HDA_VENDOR_ANALOG_DEVICES && sc->sc_product == 0x194A) {
+	    if ((COP_CFG_DEFAULT_DEVICE(w->w_pin.config) == COP_DEVICE_SPEAKER)) {
+	        /* nid 22 Speaker */ 
+	        if (w->w_nid == 0x16) {
+		  /* set assoc=1 */
+		  w->w_pin.config &= ~0xf0;
+		  w->w_pin.config |= 0x10;
+		  /* set sequence=0 */
+		  w->w_pin.config &= ~0xf;
+		  w->w_pin.config |= 0x0;
+		}
+	   
+		/* nid 18 Line-out */ 
+		if (w->w_nid == 0x12) {
+		  /* set assoc=2 */
+		  w->w_pin.config &= ~0xf0;
+		  w->w_pin.config |= 0x20;
+		  /* set sequence=0 */ 
+		  w->w_pin.config &= ~0xf;
+		  w->w_pin.config |= 0x0; 
+		}
+	    }
+      
+	    if (COP_CFG_PORT_CONNECTIVITY(w->w_pin.config) == COP_PORT_JACK) {
+	        /* nid 17 */ 
+	        if (w->w_nid == 0x11) {
+		  /* set assoc=1 */
+		  w->w_pin.config &= ~0xf0;
+		  w->w_pin.config |= 0x10;
+		  /* set seq=15 */		
+		  w->w_pin.config &= ~0x0f;
+		  w->w_pin.config |= 0x0f;
+		}
+	    }
+	}
+   
 	conn = COP_CFG_PORT_CONNECTIVITY(w->w_pin.config);
 	color = COP_CFG_COLOR(w->w_pin.config);
 	defdev = COP_CFG_DEFAULT_DEVICE(w->w_pin.config);


Home | Main Index | Thread Index | Old Index