CVS commit: src/sys/dev/hdaudio

2024-04-17 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Wed Apr 17 11:44:00 UTC 2024

Modified Files:
src/sys/dev/hdaudio: hdaudiodevs.h hdaudiodevs_data.h

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/hdaudio/hdaudiodevs.h \
src/sys/dev/hdaudio/hdaudiodevs_data.h

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/hdaudiodevs.h
diff -u src/sys/dev/hdaudio/hdaudiodevs.h:1.9 src/sys/dev/hdaudio/hdaudiodevs.h:1.10
--- src/sys/dev/hdaudio/hdaudiodevs.h:1.9	Sat Apr  6 13:35:59 2024
+++ src/sys/dev/hdaudio/hdaudiodevs.h	Wed Apr 17 11:43:59 2024
@@ -1,10 +1,10 @@
-/*	$NetBSD: hdaudiodevs.h,v 1.9 2024/04/06 13:35:59 andvar Exp $	*/
+/*	$NetBSD: hdaudiodevs.h,v 1.10 2024/04/17 11:43:59 andvar Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: hdaudiodevs,v 1.8 2024/04/06 13:35:36 andvar Exp
+ *	NetBSD: hdaudiodevs,v 1.9 2024/04/17 11:42:47 andvar Exp
  */
 
 /*
@@ -151,6 +151,8 @@
 #define	HDAUDIO_PRODUCT_VIATECH_VT1812	0x0448		/* VT1812 */
 #define	HDAUDIO_PRODUCT_VIATECH_VT1818S	0x0440		/* VT1818S */
 #define	HDAUDIO_PRODUCT_VIATECH_VT1705	0x4760		/* VT1705 */
+#define	HDAUDIO_PRODUCT_VIATECH_VX900_HDMI_1	0x9f80		/* VX900 HDMI/DP */
+#define	HDAUDIO_PRODUCT_VIATECH_VX900_HDMI_2	0x9f81		/* VX900 HDMI/DP */
 
 /* Analog Devices */
 #define	HDAUDIO_PRODUCT_ANALOG_AD1884A	0x184a		/* AD1884A */
Index: src/sys/dev/hdaudio/hdaudiodevs_data.h
diff -u src/sys/dev/hdaudio/hdaudiodevs_data.h:1.9 src/sys/dev/hdaudio/hdaudiodevs_data.h:1.10
--- src/sys/dev/hdaudio/hdaudiodevs_data.h:1.9	Sat Apr  6 13:35:59 2024
+++ src/sys/dev/hdaudio/hdaudiodevs_data.h	Wed Apr 17 11:43:59 2024
@@ -1,10 +1,10 @@
-/*	$NetBSD: hdaudiodevs_data.h,v 1.9 2024/04/06 13:35:59 andvar Exp $	*/
+/*	$NetBSD: hdaudiodevs_data.h,v 1.10 2024/04/17 11:43:59 andvar Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: hdaudiodevs,v 1.8 2024/04/06 13:35:36 andvar Exp
+ *	NetBSD: hdaudiodevs,v 1.9 2024/04/17 11:42:47 andvar Exp
  */
 
 /*
@@ -231,60 +231,64 @@ static const uint32_t hdaudio_products[]
 	477, 0,
 	HDAUDIO_VENDOR_VIATECH, HDAUDIO_PRODUCT_VIATECH_VT1705, 
 	485, 0,
+	HDAUDIO_VENDOR_VIATECH, HDAUDIO_PRODUCT_VIATECH_VX900_HDMI_1, 
+	492, 160, 0,
+	HDAUDIO_VENDOR_VIATECH, HDAUDIO_PRODUCT_VIATECH_VX900_HDMI_2, 
+	492, 160, 0,
 	HDAUDIO_VENDOR_ANALOG, HDAUDIO_PRODUCT_ANALOG_AD1884A, 
-	492, 0,
+	498, 0,
 	HDAUDIO_VENDOR_ANALOG, HDAUDIO_PRODUCT_ANALOG_AD1882, 
-	500, 0,
+	506, 0,
 	HDAUDIO_VENDOR_ANALOG, HDAUDIO_PRODUCT_ANALOG_AD1883, 
-	507, 0,
+	513, 0,
 	HDAUDIO_VENDOR_ANALOG, HDAUDIO_PRODUCT_ANALOG_AD1884, 
-	514, 0,
+	520, 0,
 	HDAUDIO_VENDOR_ANALOG, HDAUDIO_PRODUCT_ANALOG_AD1984A, 
-	521, 0,
+	527, 0,
 	HDAUDIO_VENDOR_ANALOG, HDAUDIO_PRODUCT_ANALOG_AD1984B, 
-	529, 0,
+	535, 0,
 	HDAUDIO_VENDOR_ANALOG, HDAUDIO_PRODUCT_ANALOG_AD1981HD, 
-	537, 0,
+	543, 0,
 	HDAUDIO_VENDOR_ANALOG, HDAUDIO_PRODUCT_ANALOG_AD1983, 
-	546, 0,
+	552, 0,
 	HDAUDIO_VENDOR_ANALOG, HDAUDIO_PRODUCT_ANALOG_AD1984, 
-	553, 0,
+	559, 0,
 	HDAUDIO_VENDOR_ANALOG, HDAUDIO_PRODUCT_ANALOG_AD1986A, 
-	560, 0,
+	566, 0,
 	HDAUDIO_VENDOR_ANALOG, HDAUDIO_PRODUCT_ANALOG_AD1988A, 
-	568, 0,
+	574, 0,
 	HDAUDIO_VENDOR_ANALOG, HDAUDIO_PRODUCT_ANALOG_AD1988B, 
-	576, 0,
+	582, 0,
 	HDAUDIO_VENDOR_ANALOG, HDAUDIO_PRODUCT_ANALOG_AD1989A, 
-	584, 0,
+	590, 0,
 	HDAUDIO_VENDOR_ANALOG, HDAUDIO_PRODUCT_ANALOG_AD1989B, 
-	592, 0,
+	598, 0,
 	HDAUDIO_VENDOR_CONEXANT, HDAUDIO_PRODUCT_CONEXANT_CX20549, 
-	600, 0,
+	606, 0,
 	HDAUDIO_VENDOR_CONEXANT, HDAUDIO_PRODUCT_CONEXANT_CX20551, 
-	608, 0,
+	614, 0,
 	HDAUDIO_VENDOR_CONEXANT, HDAUDIO_PRODUCT_CONEXANT_CX20561, 
-	616, 0,
+	622, 0,
 	HDAUDIO_VENDOR_CONEXANT, HDAUDIO_PRODUCT_CONEXANT_CX20582, 
-	624, 0,
+	630, 0,
 	HDAUDIO_VENDOR_CONEXANT, HDAUDIO_PRODUCT_CONEXANT_CX20583, 
-	632, 0,
+	638, 0,
 	HDAUDIO_VENDOR_CONEXANT, HDAUDIO_PRODUCT_CONEXANT_CX20585, 
-	640, 0,
+	646, 0,
 	HDAUDIO_VENDOR_CONEXANT, HDAUDIO_PRODUCT_CONEXANT_CX20671, 
-	648, 0,
+	654, 0,
 	HDAUDIO_VENDOR_CMEDIA, HDAUDIO_PRODUCT_CMEDIA_CMI9880, 
-	656, 0,
+	662, 0,
 	HDAUDIO_VENDOR_INTEL, HDAUDIO_PRODUCT_INTEL_Q57_HDMI, 
-	664, 92, 0,
+	670, 92, 0,
 	HDAUDIO_VENDOR_INTEL, HDAUDIO_PRODUCT_INTEL_G45_HDMI_1, 
-	668, 672, 0,
+	674, 678, 0,
 	HDAUDIO_VENDOR_INTEL, HDAUDIO_PRODUCT_INTEL_G45_HDMI_2, 
-	668, 679, 0,
+	674, 685, 0,
 	HDAUDIO_VENDOR_INTEL, HDAUDIO_PRODUCT_INTEL_G45_HDMI_3, 
-	668, 686, 0,
+	674, 692, 0,
 	HDAUDIO_VENDOR_INTEL, HDAUDIO_PRODUCT_INTEL_G45_HDMI_4, 
-	  

CVS commit: src/sys/dev/hdaudio

2024-04-17 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Wed Apr 17 11:44:00 UTC 2024

Modified Files:
src/sys/dev/hdaudio: hdaudiodevs.h hdaudiodevs_data.h

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/hdaudio/hdaudiodevs.h \
src/sys/dev/hdaudio/hdaudiodevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/hdaudio

2024-04-17 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Wed Apr 17 11:42:47 UTC 2024

Modified Files:
src/sys/dev/hdaudio: hdaudiodevs

Log Message:
Add VIA VX900 HDMI.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/hdaudio/hdaudiodevs

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/hdaudiodevs
diff -u src/sys/dev/hdaudio/hdaudiodevs:1.8 src/sys/dev/hdaudio/hdaudiodevs:1.9
--- src/sys/dev/hdaudio/hdaudiodevs:1.8	Sat Apr  6 13:35:36 2024
+++ src/sys/dev/hdaudio/hdaudiodevs	Wed Apr 17 11:42:47 2024
@@ -1,4 +1,4 @@
-$NetBSD: hdaudiodevs,v 1.8 2024/04/06 13:35:36 andvar Exp $
+$NetBSD: hdaudiodevs,v 1.9 2024/04/17 11:42:47 andvar Exp $
 
 /*
  * Copyright (c) 2010 Jared D. McNeill 
@@ -144,6 +144,8 @@ product	VIATECH		VT2002P_1	0x4438	VT2002
 product	VIATECH		VT1812		0x0448	VT1812
 product	VIATECH		VT1818S		0x0440	VT1818S
 product	VIATECH		VT1705		0x4760	VT1705
+product	VIATECH		VX900_HDMI_1	0x9f80	VX900 HDMI/DP
+product	VIATECH		VX900_HDMI_2	0x9f81	VX900 HDMI/DP
 
 /* Analog Devices */
 product	ANALOG		AD1884A		0x184a	AD1884A



CVS commit: src/sys/dev/hdaudio

2024-04-17 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Wed Apr 17 11:42:47 UTC 2024

Modified Files:
src/sys/dev/hdaudio: hdaudiodevs

Log Message:
Add VIA VX900 HDMI.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/hdaudio/hdaudiodevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/hdaudio

2024-04-06 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Apr  6 13:35:59 UTC 2024

Modified Files:
src/sys/dev/hdaudio: hdaudiodevs.h hdaudiodevs_data.h

Log Message:
regen.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/hdaudio/hdaudiodevs.h \
src/sys/dev/hdaudio/hdaudiodevs_data.h

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/hdaudiodevs.h
diff -u src/sys/dev/hdaudio/hdaudiodevs.h:1.8 src/sys/dev/hdaudio/hdaudiodevs.h:1.9
--- src/sys/dev/hdaudio/hdaudiodevs.h:1.8	Sat Jul  1 13:37:48 2023
+++ src/sys/dev/hdaudio/hdaudiodevs.h	Sat Apr  6 13:35:59 2024
@@ -1,10 +1,10 @@
-/*	$NetBSD: hdaudiodevs.h,v 1.8 2023/07/01 13:37:48 nia Exp $	*/
+/*	$NetBSD: hdaudiodevs.h,v 1.9 2024/04/06 13:35:59 andvar Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: hdaudiodevs,v 1.6 2022/04/16 12:24:06 nia Exp
+ *	NetBSD: hdaudiodevs,v 1.8 2024/04/06 13:35:36 andvar Exp
  */
 
 /*
@@ -49,6 +49,7 @@
 #define	HDAUDIO_VENDOR_ANALOG	0x11d4		/* Analog Devices */
 #define	HDAUDIO_VENDOR_CONEXANT	0x14f1		/* Conexant */
 #define	HDAUDIO_VENDOR_VMWARE	0x15ad		/* VMware */
+#define	HDAUDIO_VENDOR_ZHAOXIN	0x1d17		/* Zhaoxin */
 #define	HDAUDIO_VENDOR_CMEDIA	0x434d		/* C-Media */
 #define	HDAUDIO_VENDOR_INTEL	0x8086		/* Intel */
 #define	HDAUDIO_VENDOR_SIGMATEL	0x8384		/* Sigmatel */
@@ -269,6 +270,10 @@
 /* VMware */
 #define	HDAUDIO_PRODUCT_VMWARE_VIRTUAL_HDA	0x1975		/* Virtual HDA */
 
+/* Zhaoxin */
+#define	HDAUDIO_PRODUCT_ZHAOXIN_KX6000_HDMI_1	0x9f8a		/* ZX-E HDMI/DP */
+#define	HDAUDIO_PRODUCT_ZHAOXIN_KX6000_HDMI_2	0x9f8b		/* ZX-E HDMI/DP */
+
 /* Define format strings for non-existent values */
 #define hdaudio_id1_format	"vendor %4.4x"
 #define hdaudio_id2_format	"product %4.4x"
Index: src/sys/dev/hdaudio/hdaudiodevs_data.h
diff -u src/sys/dev/hdaudio/hdaudiodevs_data.h:1.8 src/sys/dev/hdaudio/hdaudiodevs_data.h:1.9
--- src/sys/dev/hdaudio/hdaudiodevs_data.h:1.8	Sat Jul  1 13:37:48 2023
+++ src/sys/dev/hdaudio/hdaudiodevs_data.h	Sat Apr  6 13:35:59 2024
@@ -1,10 +1,10 @@
-/*	$NetBSD: hdaudiodevs_data.h,v 1.8 2023/07/01 13:37:48 nia Exp $	*/
+/*	$NetBSD: hdaudiodevs_data.h,v 1.9 2024/04/06 13:35:59 andvar Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: hdaudiodevs,v 1.6 2022/04/16 12:24:06 nia Exp
+ *	NetBSD: hdaudiodevs,v 1.8 2024/04/06 13:35:36 andvar Exp
  */
 
 /*
@@ -44,400 +44,405 @@ static const uint32_t hdaudio_vendors[] 
 	HDAUDIO_VENDOR_ANALOG, 33, 40, 0,
 	HDAUDIO_VENDOR_CONEXANT, 48, 0,
 	HDAUDIO_VENDOR_VMWARE, 57, 0,
-	HDAUDIO_VENDOR_CMEDIA, 64, 0,
-	HDAUDIO_VENDOR_INTEL, 72, 0,
+	HDAUDIO_VENDOR_ZHAOXIN, 64, 0,
+	HDAUDIO_VENDOR_CMEDIA, 72, 0,
+	HDAUDIO_VENDOR_INTEL, 80, 0,
 	HDAUDIO_VENDOR_SIGMATEL, 24, 0,
 };
 
 static const uint32_t hdaudio_products[] = {
 	HDAUDIO_VENDOR_ATI, HDAUDIO_PRODUCT_ATI_RS600_HDMI_1, 
-	78, 84, 0,
+	86, 92, 0,
 	HDAUDIO_VENDOR_ATI, HDAUDIO_PRODUCT_ATI_RS600_HDMI_2, 
-	78, 84, 0,
+	86, 92, 0,
 	HDAUDIO_VENDOR_ATI, HDAUDIO_PRODUCT_ATI_RS690_780_HDMI, 
-	89, 84, 0,
+	97, 92, 0,
 	HDAUDIO_VENDOR_ATI, HDAUDIO_PRODUCT_ATI_R6xx_HDMI, 
-	99, 84, 0,
+	107, 92, 0,
 	HDAUDIO_VENDOR_NVIDIA, HDAUDIO_PRODUCT_NVIDIA_MCP77_78_HDMI_2, 
-	104, 84, 0,
+	112, 92, 0,
 	HDAUDIO_VENDOR_NVIDIA, HDAUDIO_PRODUCT_NVIDIA_MCP77_78_HDMI_3, 
-	104, 84, 0,
+	112, 92, 0,
 	HDAUDIO_VENDOR_NVIDIA, HDAUDIO_PRODUCT_NVIDIA_MCP77_78_HDMI_5, 
-	104, 84, 0,
+	112, 92, 0,
 	HDAUDIO_VENDOR_NVIDIA, HDAUDIO_PRODUCT_NVIDIA_MCP77_78_HDMI_6, 
-	104, 84, 0,
+	112, 92, 0,
 	HDAUDIO_VENDOR_NVIDIA, HDAUDIO_PRODUCT_NVIDIA_MCP79_7A_HDMI_7, 
-	113, 84, 0,
+	121, 92, 0,
 	HDAUDIO_VENDOR_NVIDIA, HDAUDIO_PRODUCT_NVIDIA_GT220_HDMI, 
-	122, 84, 0,
+	130, 92, 0,
 	HDAUDIO_VENDOR_NVIDIA, HDAUDIO_PRODUCT_NVIDIA_GT21x_HDMI, 
-	128, 84, 0,
+	136, 92, 0,
 	HDAUDIO_VENDOR_NVIDIA, HDAUDIO_PRODUCT_NVIDIA_MCP89_HDMI, 
-	134, 84, 0,
+	142, 92, 0,
 	HDAUDIO_VENDOR_NVIDIA, HDAUDIO_PRODUCT_NVIDIA_GT240_HDMI, 
-	140, 84, 0,
+	148, 92, 0,
 	HDAUDIO_VENDOR_NVIDIA, HDAUDIO_PRODUCT_NVIDIA_GT5xx_HDMI_DP, 
-	146, 152, 0,
+	154, 160, 0,
 	HDAUDIO_VENDOR_NVIDIA, HDAUDIO_PRODUCT_NVIDIA_TEGRA124_HDMI, 
-	160, 84, 0,
+	168, 92, 0,
 	HDAUDIO_VENDOR_NVIDIA, HDAUDIO_PRODUCT_NVIDIA_MCP67_HDMI, 
-	169, 84, 0,
+	177, 92, 0,
 	HDAUDIO_VENDOR_NVIDIA, HDAUDIO_PRODUCT_NVIDIA_MCP73_HDMI, 
-	175, 84, 0,
+	183, 92, 0,
 	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC260, 
-	181, 0,
+	189, 0,
 	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC262, 
-	188, 0,
+	196, 0,
 	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC267, 
-	195, 0,
+	203, 0,
 

CVS commit: src/sys/dev/hdaudio

2024-04-06 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Apr  6 13:35:59 UTC 2024

Modified Files:
src/sys/dev/hdaudio: hdaudiodevs.h hdaudiodevs_data.h

Log Message:
regen.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/hdaudio/hdaudiodevs.h \
src/sys/dev/hdaudio/hdaudiodevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/hdaudio

2024-04-06 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Apr  6 13:35:36 UTC 2024

Modified Files:
src/sys/dev/hdaudio: hdaudiodevs

Log Message:
Add KX-6000 (ZX-E) HDA codecs.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/hdaudio/hdaudiodevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/hdaudio

2024-04-06 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Apr  6 13:35:36 UTC 2024

Modified Files:
src/sys/dev/hdaudio: hdaudiodevs

Log Message:
Add KX-6000 (ZX-E) HDA codecs.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/hdaudio/hdaudiodevs

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/hdaudiodevs
diff -u src/sys/dev/hdaudio/hdaudiodevs:1.7 src/sys/dev/hdaudio/hdaudiodevs:1.8
--- src/sys/dev/hdaudio/hdaudiodevs:1.7	Sat Jul  1 13:37:36 2023
+++ src/sys/dev/hdaudio/hdaudiodevs	Sat Apr  6 13:35:36 2024
@@ -1,4 +1,4 @@
-$NetBSD: hdaudiodevs,v 1.7 2023/07/01 13:37:36 nia Exp $
+$NetBSD: hdaudiodevs,v 1.8 2024/04/06 13:35:36 andvar Exp $
 
 /*
  * Copyright (c) 2010 Jared D. McNeill 
@@ -42,6 +42,7 @@ vendor	SIGMATEL2	0x111d	Sigmatel
 vendor	ANALOG		0x11d4	Analog Devices
 vendor	CONEXANT	0x14f1	Conexant
 vendor	VMWARE		0x15ad	VMware
+vendor	ZHAOXIN		0x1d17	Zhaoxin
 vendor	CMEDIA		0x434d	C-Media
 vendor	INTEL		0x8086	Intel
 vendor	SIGMATEL	0x8384	Sigmatel
@@ -261,3 +262,7 @@ product	SIGMATEL2	92HD81B1C5_1	0x76d5	92
 
 /* VMware */
 product	VMWARE		VIRTUAL_HDA	0x1975	Virtual HDA
+
+/* Zhaoxin */
+product	ZHAOXIN		KX6000_HDMI_1	0x9f8a	ZX-E HDMI/DP
+product	ZHAOXIN		KX6000_HDMI_2	0x9f8b	ZX-E HDMI/DP



CVS commit: src/sys/dev/hdaudio

2024-01-29 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Jan 29 18:58:54 UTC 2024

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
hdaudio(4): KNF, no functional change intended


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 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.31 src/sys/dev/hdaudio/hdafg.c:1.32
--- src/sys/dev/hdaudio/hdafg.c:1.31	Mon Jan 29 18:55:51 2024
+++ src/sys/dev/hdaudio/hdafg.c	Mon Jan 29 18:58:54 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: hdafg.c,v 1.31 2024/01/29 18:55:51 riastradh Exp $ */
+/* $NetBSD: hdafg.c,v 1.32 2024/01/29 18:58:54 riastradh Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd 
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.31 2024/01/29 18:55:51 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.32 2024/01/29 18:58:54 riastradh Exp $");
 
 #include 
 #include 
@@ -4282,9 +4282,11 @@ hdafg_freem(void *opaque, void *addr, si
 	struct hdaudio_audiodev *ad = opaque;
 	struct hdaudio_stream *st;
 
-	if (ad->ad_playback != NULL && addr == DMA_KERNADDR(>ad_playback->st_data))
+	if (ad->ad_playback != NULL &&
+	addr == DMA_KERNADDR(>ad_playback->st_data))
 		st = ad->ad_playback;
-	else if (ad->ad_capture != NULL && addr == DMA_KERNADDR(>ad_capture->st_data))
+	else if (ad->ad_capture != NULL &&
+	addr == DMA_KERNADDR(>ad_capture->st_data))
 		st = ad->ad_capture;
 	else
 		panic("bad hdafg hwbuf mem: %p (%zu bytes)", addr, size);



CVS commit: src/sys/dev/hdaudio

2024-01-29 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Jan 29 18:58:54 UTC 2024

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
hdaudio(4): KNF, no functional change intended


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 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.



CVS commit: src/sys/dev/hdaudio

2024-01-29 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Jan 29 18:55:51 UTC 2024

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
hdaudio(4): Tighten hdafg_freem.

The fix for PR kern/57890 in hdafg.c 1.29 included more conditionals
than needed, covering cases that can't happen: if allocm returns
null, audio(4) does not call freem; and if hdafg_allocm returns
nonnull, then what audio(4) passes to hdafg_freem had better be
either the playback or the capture buffer address.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 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.30 src/sys/dev/hdaudio/hdafg.c:1.31
--- src/sys/dev/hdaudio/hdafg.c:1.30	Tue Jul 18 13:35:57 2023
+++ src/sys/dev/hdaudio/hdafg.c	Mon Jan 29 18:55:51 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: hdafg.c,v 1.30 2023/07/18 13:35:57 riastradh Exp $ */
+/* $NetBSD: hdafg.c,v 1.31 2024/01/29 18:55:51 riastradh Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd 
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.30 2023/07/18 13:35:57 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.31 2024/01/29 18:55:51 riastradh Exp $");
 
 #include 
 #include 
@@ -4282,15 +4282,12 @@ hdafg_freem(void *opaque, void *addr, si
 	struct hdaudio_audiodev *ad = opaque;
 	struct hdaudio_stream *st;
 
-	if (ad == NULL)
-		return;
-
 	if (ad->ad_playback != NULL && addr == DMA_KERNADDR(>ad_playback->st_data))
 		st = ad->ad_playback;
 	else if (ad->ad_capture != NULL && addr == DMA_KERNADDR(>ad_capture->st_data))
 		st = ad->ad_capture;
 	else
-		return;
+		panic("bad hdafg hwbuf mem: %p (%zu bytes)", addr, size);
 
 	hdaudio_dma_free(st->st_host, >st_data);
 }



CVS commit: src/sys/dev/hdaudio

2024-01-29 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Jan 29 18:55:51 UTC 2024

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
hdaudio(4): Tighten hdafg_freem.

The fix for PR kern/57890 in hdafg.c 1.29 included more conditionals
than needed, covering cases that can't happen: if allocm returns
null, audio(4) does not call freem; and if hdafg_allocm returns
nonnull, then what audio(4) passes to hdafg_freem had better be
either the playback or the capture buffer address.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 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.



CVS commit: src/sys/dev/hdaudio

2023-07-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Jul 18 13:35:57 UTC 2023

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
hdafg(4): Do hotplug detection in kthread, not callout.

This can sometimes take a while (~1ms), and the logic to suspend the
callout on device suspend/resume was racy (PR kern/57322).

XXX pullup-8
XXX pullup-9
XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 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.



CVS commit: src/sys/dev/hdaudio

2023-07-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Jul 18 13:35:57 UTC 2023

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
hdafg(4): Do hotplug detection in kthread, not callout.

This can sometimes take a while (~1ms), and the logic to suspend the
callout on device suspend/resume was racy (PR kern/57322).

XXX pullup-8
XXX pullup-9
XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 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.29 src/sys/dev/hdaudio/hdafg.c:1.30
--- src/sys/dev/hdaudio/hdafg.c:1.29	Thu Jan  5 09:57:39 2023
+++ src/sys/dev/hdaudio/hdafg.c	Tue Jul 18 13:35:57 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: hdafg.c,v 1.29 2023/01/05 09:57:39 kardel Exp $ */
+/* $NetBSD: hdafg.c,v 1.30 2023/07/18 13:35:57 riastradh Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd 
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.29 2023/01/05 09:57:39 kardel Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.30 2023/07/18 13:35:57 riastradh Exp $");
 
 #include 
 #include 
@@ -71,6 +71,9 @@ __KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 
 #include 
 #include 
@@ -311,8 +314,12 @@ struct hdafg_softc {
 	intsc_pchan, sc_rchan;
 	audio_params_t			sc_pparam, sc_rparam;
 
-	struct callout			sc_jack_callout;
+	kmutex_t			sc_jack_lock;
+	kcondvar_t			sc_jack_cv;
+	struct lwp			*sc_jack_thread;
 	boolsc_jack_polling;
+	boolsc_jack_suspended;
+	boolsc_jack_dying;
 
 	struct {
 		uint32_t		afg_cap;
@@ -3512,16 +3519,18 @@ hdafg_configure_encodings(struct hdafg_s
 }
 
 static void
-hdafg_hp_switch_handler(void *opaque)
+hdafg_hp_switch_handler(struct hdafg_softc *sc)
 {
-	struct hdafg_softc *sc = opaque;
 	struct hdaudio_assoc *as = sc->sc_assocs;
 	struct hdaudio_widget *w;
 	uint32_t res = 0;
 	int i, j;
 
+	KASSERT(sc->sc_jack_polling);
+	KASSERT(mutex_owned(>sc_jack_lock));
+
 	if (!device_is_active(sc->sc_dev))
-		goto resched;
+		return;
 
 	for (i = 0; i < sc->sc_nassocs; i++) {
 		if (as[i].as_digital != HDAFG_AS_ANALOG &&
@@ -3580,9 +3589,28 @@ hdafg_hp_switch_handler(void *opaque)
 			}
 		}
 	}
+}
+
+static void
+hdafg_hp_switch_thread(void *opaque)
+{
+	struct hdafg_softc *sc = opaque;
+
+	KASSERT(sc->sc_jack_polling);
+
+	mutex_enter(>sc_jack_lock);
+	while (!sc->sc_jack_dying) {
+		if (sc->sc_jack_suspended) {
+			cv_wait(>sc_jack_cv, >sc_jack_lock);
+			continue;
+		}
+		hdafg_hp_switch_handler(sc);
+		(void)cv_timedwait(>sc_jack_cv, >sc_jack_lock,
+		HDAUDIO_HP_SENSE_PERIOD);
+	}
+	mutex_exit(>sc_jack_lock);
 
-resched:
-	callout_schedule(>sc_jack_callout, HDAUDIO_HP_SENSE_PERIOD);
+	kthread_exit(0);
 }
 
 static void
@@ -3592,6 +3620,7 @@ hdafg_hp_switch_init(struct hdafg_softc 
 	struct hdaudio_widget *w;
 	bool enable = false;
 	int i, j;
+	int error;
 
 	for (i = 0; i < sc->sc_nassocs; i++) {
 		if (as[i].as_hpredir < 0 && as[i].as_displaydev == false)
@@ -3650,11 +3679,24 @@ hdafg_hp_switch_init(struct hdafg_softc 
 			hda_trace1(sc, ",displayport");
 		hda_trace1(sc, "]\n");
 	}
-	if (enable) {
-		sc->sc_jack_polling = true;
-		hdafg_hp_switch_handler(sc);
-	} else
+	if (!enable) {
 		hda_trace(sc, "jack detect not enabled\n");
+		return;
+	}
+
+	mutex_init(>sc_jack_lock, MUTEX_DEFAULT, IPL_NONE);
+	cv_init(>sc_jack_cv, "hdafghp");
+	sc->sc_jack_polling = true;
+	error = kthread_create(PRI_NONE, KTHREAD_MPSAFE, /*ci*/NULL,
+	hdafg_hp_switch_thread, sc, >sc_jack_thread,
+	"%s hotplug detect", device_xname(sc->sc_dev));
+	if (error) {
+		aprint_error_dev(sc->sc_dev, "failed to create hotplug thread:"
+		" %d", error);
+		sc->sc_jack_polling = false;
+		cv_destroy(>sc_jack_cv);
+		mutex_destroy(>sc_jack_lock);
+	}
 }
 
 static void
@@ -3675,10 +3717,6 @@ hdafg_attach(device_t parent, device_t s
 	mutex_init(>sc_lock, MUTEX_DEFAULT, IPL_NONE);
 	mutex_init(>sc_intr_lock, MUTEX_DEFAULT, IPL_SCHED);
 
-	callout_init(>sc_jack_callout, 0);
-	callout_setfunc(>sc_jack_callout,
-	hdafg_hp_switch_handler, sc);
-
 	if (!pmf_device_register(self, hdafg_suspend, hdafg_resume))
 		aprint_error_dev(self, "couldn't establish power handler\n");
 
@@ -3825,8 +3863,16 @@ hdafg_detach(device_t self, int flags)
 	struct hdaudio_mixer *mx = sc->sc_mixers;
 	int nid;
 
-	callout_halt(>sc_jack_callout, NULL);
-	callout_destroy(>sc_jack_callout);
+	if (sc->sc_jack_polling) {
+		int error __diagused;
+
+		mutex_enter(>sc_jack_lock);
+		sc->sc_jack_dying = true;
+		cv_broadcast(>sc_jack_cv);
+		mutex_exit(>sc_jack_lock);
+		error = kthread_join(sc->sc_jack_thread);
+		KASSERTMSG(error == 0, "error=%d", error);
+	}
 
 	if (sc->sc_config)
 		prop_object_release(sc->sc_config);
@@ -3876,7 +3922,12 @@ hdafg_suspend(device_t self, const pmf_q
 {
 	struct 

CVS commit: src/sys/dev/hdaudio

2023-07-01 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sat Jul  1 13:37:48 UTC 2023

Modified Files:
src/sys/dev/hdaudio: hdaudiodevs.h hdaudiodevs_data.h

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/hdaudio/hdaudiodevs.h \
src/sys/dev/hdaudio/hdaudiodevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/hdaudio

2023-07-01 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sat Jul  1 13:37:48 UTC 2023

Modified Files:
src/sys/dev/hdaudio: hdaudiodevs.h hdaudiodevs_data.h

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/hdaudio/hdaudiodevs.h \
src/sys/dev/hdaudio/hdaudiodevs_data.h

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/hdaudiodevs.h
diff -u src/sys/dev/hdaudio/hdaudiodevs.h:1.7 src/sys/dev/hdaudio/hdaudiodevs.h:1.8
--- src/sys/dev/hdaudio/hdaudiodevs.h:1.7	Sat Apr 16 12:25:10 2022
+++ src/sys/dev/hdaudio/hdaudiodevs.h	Sat Jul  1 13:37:48 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: hdaudiodevs.h,v 1.7 2022/04/16 12:25:10 nia Exp $	*/
+/*	$NetBSD: hdaudiodevs.h,v 1.8 2023/07/01 13:37:48 nia Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
@@ -90,6 +90,7 @@
 #define	HDAUDIO_PRODUCT_REALTEK_ALC662	0x0662		/* ALC662 */
 #define	HDAUDIO_PRODUCT_REALTEK_ALC663	0x0663		/* ALC663 */
 #define	HDAUDIO_PRODUCT_REALTEK_ALC670	0x0670		/* ALC670 */
+#define	HDAUDIO_PRODUCT_REALTEK_ALC671	0x0671		/* ALC671 */
 #define	HDAUDIO_PRODUCT_REALTEK_ALC861	0x0861		/* ALC861 */
 #define	HDAUDIO_PRODUCT_REALTEK_ALC861_VD	0x0862		/* ALC861-VD */
 #define	HDAUDIO_PRODUCT_REALTEK_ALC880	0x0880		/* ALC880 */
Index: src/sys/dev/hdaudio/hdaudiodevs_data.h
diff -u src/sys/dev/hdaudio/hdaudiodevs_data.h:1.7 src/sys/dev/hdaudio/hdaudiodevs_data.h:1.8
--- src/sys/dev/hdaudio/hdaudiodevs_data.h:1.7	Sat Apr 16 12:25:10 2022
+++ src/sys/dev/hdaudio/hdaudiodevs_data.h	Sat Jul  1 13:37:48 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: hdaudiodevs_data.h,v 1.7 2022/04/16 12:25:10 nia Exp $	*/
+/*	$NetBSD: hdaudiodevs_data.h,v 1.8 2023/07/01 13:37:48 nia Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
@@ -114,174 +114,176 @@ static const uint32_t hdaudio_products[]
 	275, 0,
 	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC670, 
 	282, 0,
-	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC861, 
+	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC671, 
 	289, 0,
-	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC861_VD, 
+	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC861, 
 	296, 0,
+	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC861_VD, 
+	303, 0,
 	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC880, 
-	306, 0,
-	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC882, 
 	313, 0,
-	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC883, 
+	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC882, 
 	320, 0,
-	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC885, 
+	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC883, 
 	327, 0,
-	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC887, 
+	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC885, 
 	334, 0,
-	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC888, 
+	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC887, 
 	341, 0,
-	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC889, 
+	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC888, 
 	348, 0,
-	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC892, 
+	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC889, 
 	355, 0,
-	HDAUDIO_VENDOR_VIATECH, HDAUDIO_PRODUCT_VIATECH_VT1708, 
+	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC892, 
 	362, 0,
+	HDAUDIO_VENDOR_VIATECH, HDAUDIO_PRODUCT_VIATECH_VT1708, 
+	369, 0,
 	HDAUDIO_VENDOR_VIATECH, HDAUDIO_PRODUCT_VIATECH_VT1709, 
-	362, 0,
+	369, 0,
 	HDAUDIO_VENDOR_VIATECH, HDAUDIO_PRODUCT_VIATECH_VT170A, 
-	362, 0,
+	369, 0,
 	HDAUDIO_VENDOR_VIATECH, HDAUDIO_PRODUCT_VIATECH_VT170B, 
-	362, 0,
+	369, 0,
 	HDAUDIO_VENDOR_VIATECH, HDAUDIO_PRODUCT_VIATECH_VT1709_10CH_0, 
-	369, 376, 0,
+	376, 383, 0,
 	HDAUDIO_VENDOR_VIATECH, HDAUDIO_PRODUCT_VIATECH_VT1709_10CH_1, 
-	369, 376, 0,
+	376, 383, 0,
 	HDAUDIO_VENDOR_VIATECH, HDAUDIO_PRODUCT_VIATECH_VT1709_10CH_2, 
-	369, 376, 0,
+	376, 383, 0,
 	HDAUDIO_VENDOR_VIATECH, HDAUDIO_PRODUCT_VIATECH_VT1709_10CH_3, 
-	369, 376, 0,
+	376, 383, 0,
 	HDAUDIO_VENDOR_VIATECH, HDAUDIO_PRODUCT_VIATECH_VT1709_6CH_4, 
-	369, 381, 0,
+	376, 388, 0,
 	HDAUDIO_VENDOR_VIATECH, HDAUDIO_PRODUCT_VIATECH_VT1709_6CH_5, 
-	369, 381, 0,
+	376, 388, 0,
 	HDAUDIO_VENDOR_VIATECH, HDAUDIO_PRODUCT_VIATECH_VT1709_6CH_6, 
-	369, 381, 0,
+	376, 388, 0,
 	HDAUDIO_VENDOR_VIATECH, HDAUDIO_PRODUCT_VIATECH_VT1709_6CH_7, 
-	369, 381, 0,
+	376, 388, 0,
 	HDAUDIO_VENDOR_VIATECH, HDAUDIO_PRODUCT_VIATECH_VT1708B_8CH_0, 
-	385, 393, 0,
+	392, 400, 0,
 	HDAUDIO_VENDOR_VIATECH, HDAUDIO_PRODUCT_VIATECH_VT1708B_8CH_1, 
-	385, 393, 0,
+	392, 400, 0,
 	HDAUDIO_VENDOR_VIATECH, 

CVS commit: src/sys/dev/hdaudio

2023-07-01 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sat Jul  1 13:37:36 UTC 2023

Modified Files:
src/sys/dev/hdaudio: hdaudiodevs

Log Message:
Add Realtek ALC671 to hdaudiodevs, seen on Fujitsu Futro S720 thin client


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/hdaudio/hdaudiodevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/hdaudio

2023-07-01 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sat Jul  1 13:37:36 UTC 2023

Modified Files:
src/sys/dev/hdaudio: hdaudiodevs

Log Message:
Add Realtek ALC671 to hdaudiodevs, seen on Fujitsu Futro S720 thin client


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/hdaudio/hdaudiodevs

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/hdaudiodevs
diff -u src/sys/dev/hdaudio/hdaudiodevs:1.6 src/sys/dev/hdaudio/hdaudiodevs:1.7
--- src/sys/dev/hdaudio/hdaudiodevs:1.6	Sat Apr 16 12:24:06 2022
+++ src/sys/dev/hdaudio/hdaudiodevs	Sat Jul  1 13:37:36 2023
@@ -1,4 +1,4 @@
-$NetBSD: hdaudiodevs,v 1.6 2022/04/16 12:24:06 nia Exp $
+$NetBSD: hdaudiodevs,v 1.7 2023/07/01 13:37:36 nia Exp $
 
 /*
  * Copyright (c) 2010 Jared D. McNeill 
@@ -83,6 +83,7 @@ product	REALTEK		ALC660_VD	0x0660	ALC660
 product	REALTEK		ALC662		0x0662	ALC662
 product	REALTEK		ALC663		0x0663	ALC663
 product	REALTEK		ALC670		0x0670	ALC670
+product REALTEK		ALC671		0x0671	ALC671
 product	REALTEK		ALC861		0x0861	ALC861
 product	REALTEK		ALC861_VD	0x0862	ALC861-VD
 product	REALTEK		ALC880		0x0880	ALC880



CVS commit: src/sys/dev/hdaudio

2023-01-05 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Thu Jan  5 09:57:39 UTC 2023

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
ignore NULL for hdaudio_audiodev in hdafg_freem
also guard against NULL in ad_{capture,playback}
observed during shutdown on Lenovo W510


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 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.28 src/sys/dev/hdaudio/hdafg.c:1.29
--- src/sys/dev/hdaudio/hdafg.c:1.28	Tue May 24 06:28:00 2022
+++ src/sys/dev/hdaudio/hdafg.c	Thu Jan  5 09:57:39 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: hdafg.c,v 1.28 2022/05/24 06:28:00 andvar Exp $ */
+/* $NetBSD: hdafg.c,v 1.29 2023/01/05 09:57:39 kardel Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd 
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.28 2022/05/24 06:28:00 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.29 2023/01/05 09:57:39 kardel Exp $");
 
 #include 
 #include 
@@ -4226,9 +4226,12 @@ hdafg_freem(void *opaque, void *addr, si
 	struct hdaudio_audiodev *ad = opaque;
 	struct hdaudio_stream *st;
 
-	if (addr == DMA_KERNADDR(>ad_playback->st_data))
+	if (ad == NULL)
+		return;
+
+	if (ad->ad_playback != NULL && addr == DMA_KERNADDR(>ad_playback->st_data))
 		st = ad->ad_playback;
-	else if (addr == DMA_KERNADDR(>ad_capture->st_data))
+	else if (ad->ad_capture != NULL && addr == DMA_KERNADDR(>ad_capture->st_data))
 		st = ad->ad_capture;
 	else
 		return;



CVS commit: src/sys/dev/hdaudio

2023-01-05 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Thu Jan  5 09:57:39 UTC 2023

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
ignore NULL for hdaudio_audiodev in hdafg_freem
also guard against NULL in ad_{capture,playback}
observed during shutdown on Lenovo W510


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 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.



CVS commit: src/sys/dev/hdaudio

2022-04-16 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sat Apr 16 12:25:10 UTC 2022

Modified Files:
src/sys/dev/hdaudio: hdaudiodevs.h hdaudiodevs_data.h

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/hdaudio/hdaudiodevs.h \
src/sys/dev/hdaudio/hdaudiodevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/hdaudio

2022-04-16 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sat Apr 16 12:25:10 UTC 2022

Modified Files:
src/sys/dev/hdaudio: hdaudiodevs.h hdaudiodevs_data.h

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/hdaudio/hdaudiodevs.h \
src/sys/dev/hdaudio/hdaudiodevs_data.h

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/hdaudiodevs.h
diff -u src/sys/dev/hdaudio/hdaudiodevs.h:1.6 src/sys/dev/hdaudio/hdaudiodevs.h:1.7
--- src/sys/dev/hdaudio/hdaudiodevs.h:1.6	Tue Jun 29 21:04:02 2021
+++ src/sys/dev/hdaudio/hdaudiodevs.h	Sat Apr 16 12:25:10 2022
@@ -1,10 +1,10 @@
-/*	$NetBSD: hdaudiodevs.h,v 1.6 2021/06/29 21:04:02 pgoyette Exp $	*/
+/*	$NetBSD: hdaudiodevs.h,v 1.7 2022/04/16 12:25:10 nia Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: hdaudiodevs,v 1.5 2020/04/29 07:24:53 nia Exp
+ *	NetBSD: hdaudiodevs,v 1.6 2022/04/16 12:24:06 nia Exp
  */
 
 /*
@@ -184,6 +184,14 @@
 #define	HDAUDIO_PRODUCT_INTEL_G45_HDMI_2	0x2802		/* G45 HDMI/2 */
 #define	HDAUDIO_PRODUCT_INTEL_G45_HDMI_3	0x2803		/* G45 HDMI/3 */
 #define	HDAUDIO_PRODUCT_INTEL_G45_HDMI_4	0x2804		/* G45 HDMI/4 */
+#define	HDAUDIO_PRODUCT_INTEL_HASWELL_HDMI	0x2807		/* HDMI/DP */
+#define	HDAUDIO_PRODUCT_INTEL_BROADWELL_HDMI	0x2808		/* HDMI/DP */
+#define	HDAUDIO_PRODUCT_INTEL_SKYLAKE_HDMI	0x2809		/* HDMI/DP */
+#define	HDAUDIO_PRODUCT_INTEL_BROXTON_HDMI	0x280a		/* HDMI/DP */
+#define	HDAUDIO_PRODUCT_INTEL_KABYLAKE_HDMI	0x280b		/* HDMI/DP */
+#define	HDAUDIO_PRODUCT_INTEL_CANNONLAKE_HDMI	0x280c		/* HDMI/DP */
+#define	HDAUDIO_PRODUCT_INTEL_GEMINILAKE_HDMI	0x280d		/* HDMI/DP */
+#define	HDAUDIO_PRODUCT_INTEL_ICELAKE_HDMI	0x280f		/* HDMI/DP */
 #define	HDAUDIO_PRODUCT_INTEL_G45_HDMI_FB	0x29fb		/* G45 HDMI/FB */
 
 /* Sigmatel */
Index: src/sys/dev/hdaudio/hdaudiodevs_data.h
diff -u src/sys/dev/hdaudio/hdaudiodevs_data.h:1.6 src/sys/dev/hdaudio/hdaudiodevs_data.h:1.7
--- src/sys/dev/hdaudio/hdaudiodevs_data.h:1.6	Tue Jun 29 21:04:02 2021
+++ src/sys/dev/hdaudio/hdaudiodevs_data.h	Sat Apr 16 12:25:10 2022
@@ -1,10 +1,10 @@
-/*	$NetBSD: hdaudiodevs_data.h,v 1.6 2021/06/29 21:04:02 pgoyette Exp $	*/
+/*	$NetBSD: hdaudiodevs_data.h,v 1.7 2022/04/16 12:25:10 nia Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: hdaudiodevs,v 1.5 2020/04/29 07:24:53 nia Exp
+ *	NetBSD: hdaudiodevs,v 1.6 2022/04/16 12:24:06 nia Exp
  */
 
 /*
@@ -282,6 +282,22 @@ static const uint32_t hdaudio_products[]
 	653, 671, 0,
 	HDAUDIO_VENDOR_INTEL, HDAUDIO_PRODUCT_INTEL_G45_HDMI_4, 
 	653, 678, 0,
+	HDAUDIO_VENDOR_INTEL, HDAUDIO_PRODUCT_INTEL_HASWELL_HDMI, 
+	152, 0,
+	HDAUDIO_VENDOR_INTEL, HDAUDIO_PRODUCT_INTEL_BROADWELL_HDMI, 
+	152, 0,
+	HDAUDIO_VENDOR_INTEL, HDAUDIO_PRODUCT_INTEL_SKYLAKE_HDMI, 
+	152, 0,
+	HDAUDIO_VENDOR_INTEL, HDAUDIO_PRODUCT_INTEL_BROXTON_HDMI, 
+	152, 0,
+	HDAUDIO_VENDOR_INTEL, HDAUDIO_PRODUCT_INTEL_KABYLAKE_HDMI, 
+	152, 0,
+	HDAUDIO_VENDOR_INTEL, HDAUDIO_PRODUCT_INTEL_CANNONLAKE_HDMI, 
+	152, 0,
+	HDAUDIO_VENDOR_INTEL, HDAUDIO_PRODUCT_INTEL_GEMINILAKE_HDMI, 
+	152, 0,
+	HDAUDIO_VENDOR_INTEL, HDAUDIO_PRODUCT_INTEL_ICELAKE_HDMI, 
+	152, 0,
 	HDAUDIO_VENDOR_INTEL, HDAUDIO_PRODUCT_INTEL_G45_HDMI_FB, 
 	653, 685, 0,
 	HDAUDIO_VENDOR_SIGMATEL, HDAUDIO_PRODUCT_SIGMATEL_STAC9230X, 
@@ -444,7 +460,7 @@ static const char hdaudio_words[] = { ".
 	"MCP89\0" /* 1 refs @ 134 */
 	"GT240\0" /* 1 refs @ 140 */
 	"GT5xx\0" /* 1 refs @ 146 */
-	"HDMI/DP\0" /* 1 refs @ 152 */
+	"HDMI/DP\0" /* 9 refs @ 152 */
 	"Tegra124\0" /* 1 refs @ 160 */
 	"MCP67\0" /* 1 refs @ 169 */
 	"MCP73\0" /* 1 refs @ 175 */



CVS commit: src/sys/dev/hdaudio

2022-04-16 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sat Apr 16 12:24:06 UTC 2022

Modified Files:
src/sys/dev/hdaudio: hdaudiodevs

Log Message:
hdaudiodevs: Add some ~new Intel devices


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/hdaudio/hdaudiodevs

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/hdaudiodevs
diff -u src/sys/dev/hdaudio/hdaudiodevs:1.5 src/sys/dev/hdaudio/hdaudiodevs:1.6
--- src/sys/dev/hdaudio/hdaudiodevs:1.5	Wed Apr 29 07:24:53 2020
+++ src/sys/dev/hdaudio/hdaudiodevs	Sat Apr 16 12:24:06 2022
@@ -1,4 +1,4 @@
-$NetBSD: hdaudiodevs,v 1.5 2020/04/29 07:24:53 nia Exp $
+$NetBSD: hdaudiodevs,v 1.6 2022/04/16 12:24:06 nia Exp $
 
 /*
  * Copyright (c) 2010 Jared D. McNeill 
@@ -177,6 +177,14 @@ product	INTEL		G45_HDMI_1	0x2801	G45 HDM
 product	INTEL		G45_HDMI_2	0x2802	G45 HDMI/2
 product	INTEL		G45_HDMI_3	0x2803	G45 HDMI/3
 product	INTEL		G45_HDMI_4	0x2804	G45 HDMI/4
+product	INTEL		HASWELL_HDMI	0x2807	HDMI/DP
+product	INTEL		BROADWELL_HDMI	0x2808	HDMI/DP
+product	INTEL		SKYLAKE_HDMI	0x2809	HDMI/DP
+product	INTEL		BROXTON_HDMI	0x280a	HDMI/DP
+product	INTEL		KABYLAKE_HDMI	0x280b	HDMI/DP
+product	INTEL		CANNONLAKE_HDMI	0x280c	HDMI/DP
+product	INTEL		GEMINILAKE_HDMI	0x280d	HDMI/DP
+product	INTEL		ICELAKE_HDMI	0x280f	HDMI/DP
 product	INTEL		G45_HDMI_FB	0x29fb	G45 HDMI/FB
 
 /* Sigmatel */



CVS commit: src/sys/dev/hdaudio

2022-04-16 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sat Apr 16 12:24:06 UTC 2022

Modified Files:
src/sys/dev/hdaudio: hdaudiodevs

Log Message:
hdaudiodevs: Add some ~new Intel devices


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/hdaudio/hdaudiodevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/hdaudio

2022-01-06 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Fri Jan  7 07:34:10 UTC 2022

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
Safe vendor/product for reporting. Avoids repeated loading/unloading
of hdaudioverbose module.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 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.



CVS commit: src/sys/dev/hdaudio

2022-01-06 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Fri Jan  7 07:34:10 UTC 2022

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
Safe vendor/product for reporting. Avoids repeated loading/unloading
of hdaudioverbose module.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 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.25 src/sys/dev/hdaudio/hdafg.c:1.26
--- src/sys/dev/hdaudio/hdafg.c:1.25	Fri Dec 17 17:02:40 2021
+++ src/sys/dev/hdaudio/hdafg.c	Fri Jan  7 07:34:10 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: hdafg.c,v 1.25 2021/12/17 17:02:40 kre Exp $ */
+/* $NetBSD: hdafg.c,v 1.26 2022/01/07 07:34:10 mlelstv Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd 
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.25 2021/12/17 17:02:40 kre Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.26 2022/01/07 07:34:10 mlelstv Exp $");
 
 #include 
 #include 
@@ -328,6 +328,9 @@ struct hdafg_softc {
 
 	uint16_t			sc_fixed_rate;
 	boolsc_disable_dip;
+
+	charsc_name[MAX_AUDIO_DEV_LEN];
+	charsc_version[MAX_AUDIO_DEV_LEN];
 };
 
 static int	hdafg_match(device_t, cfdata_t, void *);
@@ -3660,7 +3663,6 @@ hdafg_attach(device_t parent, device_t s
 	struct hdafg_softc *sc = device_private(self);
 	audio_params_t defparams;
 	prop_dictionary_t args = opaque;
-	char vendor[MAX_AUDIO_DEV_LEN], product[MAX_AUDIO_DEV_LEN];
 	uint64_t fgptr = 0;
 	uint32_t astype = 0;
 	uint8_t nid = 0;
@@ -3686,10 +3688,10 @@ hdafg_attach(device_t parent, device_t s
 
 	prop_dictionary_get_uint16(args, "vendor-id", >sc_vendor);
 	prop_dictionary_get_uint16(args, "product-id", >sc_product);
-	hdaudio_findvendor(vendor, sizeof(vendor), sc->sc_vendor);
-	hdaudio_findproduct(product, sizeof(product), sc->sc_vendor,
+	hdaudio_findvendor(sc->sc_name, sizeof(sc->sc_name), sc->sc_vendor);
+	hdaudio_findproduct(sc->sc_version, sizeof(sc->sc_version), sc->sc_vendor,
 	sc->sc_product);
-	hda_print1(sc, ": %s %s%s\n", vendor, product,
+	hda_print1(sc, ": %s %s%s\n", sc->sc_name, sc->sc_version,
 	sc->sc_config ? " (custom configuration)" : "");
 
 	switch (sc->sc_vendor) {
@@ -4063,10 +4065,8 @@ hdafg_getdev(void *opaque, struct audio_
 	struct hdaudio_audiodev *ad = opaque;
 	struct hdafg_softc *sc = ad->ad_sc;
 
-	hdaudio_findvendor(audiodev->name, sizeof(audiodev->name),
-	sc->sc_vendor);
-	hdaudio_findproduct(audiodev->version, sizeof(audiodev->version),
-	sc->sc_vendor, sc->sc_product);
+	memcpy(audiodev->name, sc->sc_name, sizeof(audiodev->name));
+	memcpy(audiodev->version, sc->sc_version, sizeof(audiodev->version));
 	snprintf(audiodev->config, sizeof(audiodev->config),
 	"%02Xh", sc->sc_nid);
 



CVS commit: src/sys/dev/hdaudio

2021-12-17 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Dec 17 17:02:40 UTC 2021

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
One build break fixed, another appears...

Use the correct pointer, not the one used in the other piece of
code that changed at the same time..


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 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.24 src/sys/dev/hdaudio/hdafg.c:1.25
--- src/sys/dev/hdaudio/hdafg.c:1.24	Fri Dec 17 13:36:36 2021
+++ src/sys/dev/hdaudio/hdafg.c	Fri Dec 17 17:02:40 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: hdafg.c,v 1.24 2021/12/17 13:36:36 christos Exp $ */
+/* $NetBSD: hdafg.c,v 1.25 2021/12/17 17:02:40 kre Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd 
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.24 2021/12/17 13:36:36 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.25 2021/12/17 17:02:40 kre Exp $");
 
 #include 
 #include 
@@ -2888,7 +2888,7 @@ hdafg_build_mixers(struct hdafg_softc *s
 		mx[index].mx_di.un.v.num_channels = 2;	/* XXX */
 		mx[index].mx_di.mixer_class = HDAUDIO_MIXER_CLASS_OUTPUTS;
 		mx[index].mx_di.un.v.delta = 256 / 
-		(ctl->ctl_step ? ctl->ctl_step : 1);
+		(masterctl->ctl_step ? masterctl->ctl_step : 1);
 		strcpy(mx[index].mx_di.label.name, AudioNmaster);
 		strcpy(mx[index].mx_di.un.v.units.name, AudioNvolume);
 		hda_trace(sc, "  adding outputs.%s\n",



CVS commit: src/sys/dev/hdaudio

2021-12-17 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Dec 17 17:02:40 UTC 2021

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
One build break fixed, another appears...

Use the correct pointer, not the one used in the other piece of
code that changed at the same time..


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 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.



CVS commit: src/sys/dev/hdaudio

2021-12-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Dec 17 13:36:36 UTC 2021

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
If the step is 0, use 1 instead of always incrementing step by one to avoid
zerodivide (from RVP)


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 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.23 src/sys/dev/hdaudio/hdafg.c:1.24
--- src/sys/dev/hdaudio/hdafg.c:1.23	Wed Jun 10 22:39:30 2020
+++ src/sys/dev/hdaudio/hdafg.c	Fri Dec 17 08:36:36 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: hdafg.c,v 1.23 2020/06/11 02:39:30 thorpej Exp $ */
+/* $NetBSD: hdafg.c,v 1.24 2021/12/17 13:36:36 christos Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd 
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.23 2020/06/11 02:39:30 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.24 2021/12/17 13:36:36 christos Exp $");
 
 #include 
 #include 
@@ -2887,7 +2887,8 @@ hdafg_build_mixers(struct hdafg_softc *s
 		mx[index].mx_di.prev = mx[index].mx_di.next = AUDIO_MIXER_LAST;
 		mx[index].mx_di.un.v.num_channels = 2;	/* XXX */
 		mx[index].mx_di.mixer_class = HDAUDIO_MIXER_CLASS_OUTPUTS;
-		mx[index].mx_di.un.v.delta = 256 / (masterctl->ctl_step + 1);
+		mx[index].mx_di.un.v.delta = 256 / 
+		(ctl->ctl_step ? ctl->ctl_step : 1);
 		strcpy(mx[index].mx_di.label.name, AudioNmaster);
 		strcpy(mx[index].mx_di.un.v.units.name, AudioNvolume);
 		hda_trace(sc, "  adding outputs.%s\n",
@@ -2922,7 +2923,8 @@ hdafg_build_mixers(struct hdafg_softc *s
 		mx[index].mx_di.type = AUDIO_MIXER_VALUE;
 		mx[index].mx_di.prev = mx[index].mx_di.next = AUDIO_MIXER_LAST;
 		mx[index].mx_di.un.v.num_channels = 2;	/* XXX */
-		mx[index].mx_di.un.v.delta = 256 / (ctl->ctl_step + 1);
+		mx[index].mx_di.un.v.delta = 256 /
+		(ctl->ctl_step ? ctl->ctl_step : 1);
 		if (ctrlcnt[audiodev] > 0)
 			snprintf(mx[index].mx_di.label.name,
 			sizeof(mx[index].mx_di.label.name),



CVS commit: src/sys/dev/hdaudio

2021-12-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Dec 17 13:36:36 UTC 2021

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
If the step is 0, use 1 instead of always incrementing step by one to avoid
zerodivide (from RVP)


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 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.



CVS commit: src/sys/dev/hdaudio

2020-12-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Dec 28 19:31:44 UTC 2020

Modified Files:
src/sys/dev/hdaudio: hdaudio.c

Log Message:
If the Subordinate Node Count returns 0 nodes, complain and return instead
of trying to kmem_zalloc 0 bytes later on.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/hdaudio/hdaudio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/hdaudio

2020-12-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Dec 28 19:31:44 UTC 2020

Modified Files:
src/sys/dev/hdaudio: hdaudio.c

Log Message:
If the Subordinate Node Count returns 0 nodes, complain and return instead
of trying to kmem_zalloc 0 bytes later on.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/hdaudio/hdaudio.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/hdaudio.c
diff -u src/sys/dev/hdaudio/hdaudio.c:1.12 src/sys/dev/hdaudio/hdaudio.c:1.13
--- src/sys/dev/hdaudio/hdaudio.c:1.12	Mon Dec 28 16:49:58 2020
+++ src/sys/dev/hdaudio/hdaudio.c	Mon Dec 28 19:31:43 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: hdaudio.c,v 1.12 2020/12/28 16:49:58 jmcneill Exp $ */
+/* $NetBSD: hdaudio.c,v 1.13 2020/12/28 19:31:43 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd 
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hdaudio.c,v 1.12 2020/12/28 16:49:58 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdaudio.c,v 1.13 2020/12/28 19:31:43 jmcneill Exp $");
 
 #include 
 #include 
@@ -698,6 +698,7 @@ hdaudio_attach_fg(struct hdaudio_functio
 static void
 hdaudio_codec_attach(struct hdaudio_codec *co)
 {
+	struct hdaudio_softc *sc = co->co_host;
 	struct hdaudio_function_group *fg;
 	uint32_t vid, snc, fgrp;
 	int starting_node, num_nodes, nid;
@@ -714,7 +715,6 @@ hdaudio_codec_attach(struct hdaudio_code
 		return;
 
 #ifdef HDAUDIO_DEBUG
-	struct hdaudio_softc *sc = co->co_host;
 	uint32_t rid = hdaudio_command(co, 0, CORB_GET_PARAMETER,
 	COP_REVISION_ID);
 	hda_print(sc, "Codec%02X: %04X:%04X HDA %d.%d rev %d stepping %d\n",
@@ -725,6 +725,16 @@ hdaudio_codec_attach(struct hdaudio_code
 	starting_node = (snc >> 16) & 0xff;
 	num_nodes = snc & 0xff;
 
+	/*
+	 * If the total number of nodes is 0, there's nothing we can do.
+	 * This shouldn't happen, so complain about it.
+	 */
+	if (num_nodes == 0) {
+		hda_error(sc, "Codec%02X: No subordinate nodes found (%08x)\n",
+		co->co_addr, snc);
+		return;
+	}
+
 	co->co_nfg = num_nodes;
 	co->co_fg = kmem_zalloc(co->co_nfg * sizeof(*co->co_fg), KM_SLEEP);
 



CVS commit: src/sys/dev/hdaudio

2020-12-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Dec 28 16:49:58 UTC 2020

Modified Files:
src/sys/dev/hdaudio: hdaudio.c

Log Message:
Initialize DMA memory when allocating it. Should fix PR# 51734 (hdaudio
"RIRB timeout" on boot).


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/hdaudio/hdaudio.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/hdaudio.c
diff -u src/sys/dev/hdaudio/hdaudio.c:1.11 src/sys/dev/hdaudio/hdaudio.c:1.12
--- src/sys/dev/hdaudio/hdaudio.c:1.11	Thu Jun 11 02:39:30 2020
+++ src/sys/dev/hdaudio/hdaudio.c	Mon Dec 28 16:49:58 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: hdaudio.c,v 1.11 2020/06/11 02:39:30 thorpej Exp $ */
+/* $NetBSD: hdaudio.c,v 1.12 2020/12/28 16:49:58 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd 
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hdaudio.c,v 1.11 2020/06/11 02:39:30 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdaudio.c,v 1.12 2020/12/28 16:49:58 jmcneill Exp $");
 
 #include 
 #include 
@@ -179,6 +179,10 @@ hdaudio_dma_alloc(struct hdaudio_softc *
 	if (err)
 		goto destroy;
 
+	memset(dma->dma_addr, 0, dma->dma_size);
+	bus_dmamap_sync(sc->sc_dmat, dma->dma_map, 0, dma->dma_size,
+	BUS_DMASYNC_PREWRITE);
+
 	dma->dma_valid = true;
 	return 0;
 



CVS commit: src/sys/dev/hdaudio

2020-12-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Dec 28 16:49:58 UTC 2020

Modified Files:
src/sys/dev/hdaudio: hdaudio.c

Log Message:
Initialize DMA memory when allocating it. Should fix PR# 51734 (hdaudio
"RIRB timeout" on boot).


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/hdaudio/hdaudio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/hdaudio

2020-04-29 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Wed Apr 29 07:36:22 UTC 2020

Modified Files:
src/sys/dev/hdaudio: hdaudiodevs.h hdaudiodevs_data.h

Log Message:
hdaudiodevs: regen


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/hdaudio/hdaudiodevs.h \
src/sys/dev/hdaudio/hdaudiodevs_data.h

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/hdaudiodevs.h
diff -u src/sys/dev/hdaudio/hdaudiodevs.h:1.4 src/sys/dev/hdaudio/hdaudiodevs.h:1.5
--- src/sys/dev/hdaudio/hdaudiodevs.h:1.4	Tue Apr 28 21:48:20 2020
+++ src/sys/dev/hdaudio/hdaudiodevs.h	Wed Apr 29 07:36:22 2020
@@ -1,10 +1,10 @@
-/*	$NetBSD: hdaudiodevs.h,v 1.4 2020/04/28 21:48:20 jmcneill Exp $	*/
+/*	$NetBSD: hdaudiodevs.h,v 1.5 2020/04/29 07:36:22 nia Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: hdaudiodevs,v 1.4 2020/04/28 21:48:11 jmcneill Exp
+ *	NetBSD: hdaudiodevs,v 1.5 2020/04/29 07:24:53 nia Exp
  */
 
 /*
@@ -84,6 +84,7 @@
 #define	HDAUDIO_PRODUCT_REALTEK_ALC272	0x0272		/* ALC272 */
 #define	HDAUDIO_PRODUCT_REALTEK_ALC275	0x0275		/* ALC275 */
 #define	HDAUDIO_PRODUCT_REALTEK_ALC280	0x0280		/* ALC280 */
+#define	HDAUDIO_PRODUCT_REALTEK_ALC292	0x0292		/* ALC292 */
 #define	HDAUDIO_PRODUCT_REALTEK_ALC293	0x0293		/* ALC293 */
 #define	HDAUDIO_PRODUCT_REALTEK_ALC660_VD	0x0660		/* ALC660-VD */
 #define	HDAUDIO_PRODUCT_REALTEK_ALC662	0x0662		/* ALC662 */
Index: src/sys/dev/hdaudio/hdaudiodevs_data.h
diff -u src/sys/dev/hdaudio/hdaudiodevs_data.h:1.4 src/sys/dev/hdaudio/hdaudiodevs_data.h:1.5
--- src/sys/dev/hdaudio/hdaudiodevs_data.h:1.4	Tue Apr 28 21:48:20 2020
+++ src/sys/dev/hdaudio/hdaudiodevs_data.h	Wed Apr 29 07:36:22 2020
@@ -1,10 +1,10 @@
-/*	$NetBSD: hdaudiodevs_data.h,v 1.4 2020/04/28 21:48:20 jmcneill Exp $	*/
+/*	$NetBSD: hdaudiodevs_data.h,v 1.5 2020/04/29 07:36:22 nia Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: hdaudiodevs,v 1.4 2020/04/28 21:48:11 jmcneill Exp
+ *	NetBSD: hdaudiodevs,v 1.5 2020/04/29 07:24:53 nia Exp
  */
 
 /*
@@ -102,322 +102,324 @@ static const uint16_t hdaudio_products[]
 	230, 0,
 	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC280, 
 	237, 0,
-	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC293, 
+	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC292, 
 	244, 0,
-	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC660_VD, 
+	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC293, 
 	251, 0,
+	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC660_VD, 
+	258, 0,
 	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC662, 
-	261, 0,
-	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC663, 
 	268, 0,
-	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC670, 
+	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC663, 
 	275, 0,
-	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC861, 
+	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC670, 
 	282, 0,
-	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC861_VD, 
+	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC861, 
 	289, 0,
+	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC861_VD, 
+	296, 0,
 	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC880, 
-	299, 0,
-	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC882, 
 	306, 0,
-	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC883, 
+	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC882, 
 	313, 0,
-	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC885, 
+	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC883, 
 	320, 0,
-	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC887, 
+	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC885, 
 	327, 0,
-	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC888, 
+	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC887, 
 	334, 0,
-	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC889, 
+	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC888, 
 	341, 0,
-	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC892, 
+	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC889, 
 	348, 0,
-	HDAUDIO_VENDOR_VIATECH, HDAUDIO_PRODUCT_VIATECH_VT1708, 
+	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC892, 
 	355, 0,
+	HDAUDIO_VENDOR_VIATECH, HDAUDIO_PRODUCT_VIATECH_VT1708, 
+	362, 0,
 	HDAUDIO_VENDOR_VIATECH, HDAUDIO_PRODUCT_VIATECH_VT1709, 
-	355, 0,
+	362, 0,
 	HDAUDIO_VENDOR_VIATECH, HDAUDIO_PRODUCT_VIATECH_VT170A, 
-	355, 0,
+	362, 0,
 	HDAUDIO_VENDOR_VIATECH, HDAUDIO_PRODUCT_VIATECH_VT170B, 
-	355, 0,
+	362, 0,
 	HDAUDIO_VENDOR_VIATECH, HDAUDIO_PRODUCT_VIATECH_VT1709_10CH_0, 
-	362, 369, 0,
+	369, 376, 0,
 	

CVS commit: src/sys/dev/hdaudio

2020-04-29 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Wed Apr 29 07:36:22 UTC 2020

Modified Files:
src/sys/dev/hdaudio: hdaudiodevs.h hdaudiodevs_data.h

Log Message:
hdaudiodevs: regen


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/hdaudio/hdaudiodevs.h \
src/sys/dev/hdaudio/hdaudiodevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/hdaudio

2020-04-29 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Wed Apr 29 07:24:53 UTC 2020

Modified Files:
src/sys/dev/hdaudio: hdaudiodevs

Log Message:
hdaudiodevs: Add Realtek ALC292


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/hdaudio/hdaudiodevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/hdaudio

2020-04-29 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Wed Apr 29 07:24:53 UTC 2020

Modified Files:
src/sys/dev/hdaudio: hdaudiodevs

Log Message:
hdaudiodevs: Add Realtek ALC292


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/hdaudio/hdaudiodevs

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/hdaudiodevs
diff -u src/sys/dev/hdaudio/hdaudiodevs:1.4 src/sys/dev/hdaudio/hdaudiodevs:1.5
--- src/sys/dev/hdaudio/hdaudiodevs:1.4	Tue Apr 28 21:48:11 2020
+++ src/sys/dev/hdaudio/hdaudiodevs	Wed Apr 29 07:24:53 2020
@@ -1,4 +1,4 @@
-$NetBSD: hdaudiodevs,v 1.4 2020/04/28 21:48:11 jmcneill Exp $
+$NetBSD: hdaudiodevs,v 1.5 2020/04/29 07:24:53 nia Exp $
 
 /*
  * Copyright (c) 2010 Jared D. McNeill 
@@ -77,6 +77,7 @@ product	REALTEK		ALC270		0x0270	ALC270
 product	REALTEK		ALC272		0x0272	ALC272
 product	REALTEK		ALC275		0x0275	ALC275
 product	REALTEK		ALC280		0x0280	ALC280
+product	REALTEK		ALC292		0x0292	ALC292
 product	REALTEK		ALC293		0x0293	ALC293
 product	REALTEK		ALC660_VD	0x0660	ALC660-VD
 product	REALTEK		ALC662		0x0662	ALC662



CVS commit: src/sys/dev/hdaudio

2020-04-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Apr 28 21:48:20 UTC 2020

Modified Files:
src/sys/dev/hdaudio: hdaudiodevs.h hdaudiodevs_data.h

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/hdaudio/hdaudiodevs.h \
src/sys/dev/hdaudio/hdaudiodevs_data.h

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/hdaudiodevs.h
diff -u src/sys/dev/hdaudio/hdaudiodevs.h:1.3 src/sys/dev/hdaudio/hdaudiodevs.h:1.4
--- src/sys/dev/hdaudio/hdaudiodevs.h:1.3	Mon Jan 27 00:51:40 2020
+++ src/sys/dev/hdaudio/hdaudiodevs.h	Tue Apr 28 21:48:20 2020
@@ -1,10 +1,10 @@
-/*	$NetBSD: hdaudiodevs.h,v 1.3 2020/01/27 00:51:40 jmcneill Exp $	*/
+/*	$NetBSD: hdaudiodevs.h,v 1.4 2020/04/28 21:48:20 jmcneill Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: hdaudiodevs,v 1.3 2020/01/27 00:51:15 jmcneill Exp
+ *	NetBSD: hdaudiodevs,v 1.4 2020/04/28 21:48:11 jmcneill Exp
  */
 
 /*
@@ -84,6 +84,7 @@
 #define	HDAUDIO_PRODUCT_REALTEK_ALC272	0x0272		/* ALC272 */
 #define	HDAUDIO_PRODUCT_REALTEK_ALC275	0x0275		/* ALC275 */
 #define	HDAUDIO_PRODUCT_REALTEK_ALC280	0x0280		/* ALC280 */
+#define	HDAUDIO_PRODUCT_REALTEK_ALC293	0x0293		/* ALC293 */
 #define	HDAUDIO_PRODUCT_REALTEK_ALC660_VD	0x0660		/* ALC660-VD */
 #define	HDAUDIO_PRODUCT_REALTEK_ALC662	0x0662		/* ALC662 */
 #define	HDAUDIO_PRODUCT_REALTEK_ALC663	0x0663		/* ALC663 */
Index: src/sys/dev/hdaudio/hdaudiodevs_data.h
diff -u src/sys/dev/hdaudio/hdaudiodevs_data.h:1.3 src/sys/dev/hdaudio/hdaudiodevs_data.h:1.4
--- src/sys/dev/hdaudio/hdaudiodevs_data.h:1.3	Mon Jan 27 00:51:40 2020
+++ src/sys/dev/hdaudio/hdaudiodevs_data.h	Tue Apr 28 21:48:20 2020
@@ -1,10 +1,10 @@
-/*	$NetBSD: hdaudiodevs_data.h,v 1.3 2020/01/27 00:51:40 jmcneill Exp $	*/
+/*	$NetBSD: hdaudiodevs_data.h,v 1.4 2020/04/28 21:48:20 jmcneill Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: hdaudiodevs,v 1.3 2020/01/27 00:51:15 jmcneill Exp
+ *	NetBSD: hdaudiodevs,v 1.4 2020/04/28 21:48:11 jmcneill Exp
  */
 
 /*
@@ -102,320 +102,322 @@ static const uint16_t hdaudio_products[]
 	230, 0,
 	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC280, 
 	237, 0,
-	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC660_VD, 
+	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC293, 
 	244, 0,
+	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC660_VD, 
+	251, 0,
 	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC662, 
-	254, 0,
-	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC663, 
 	261, 0,
-	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC670, 
+	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC663, 
 	268, 0,
-	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC861, 
+	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC670, 
 	275, 0,
-	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC861_VD, 
+	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC861, 
 	282, 0,
+	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC861_VD, 
+	289, 0,
 	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC880, 
-	292, 0,
-	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC882, 
 	299, 0,
-	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC883, 
+	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC882, 
 	306, 0,
-	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC885, 
+	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC883, 
 	313, 0,
-	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC887, 
+	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC885, 
 	320, 0,
-	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC888, 
+	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC887, 
 	327, 0,
-	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC889, 
+	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC888, 
 	334, 0,
-	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC892, 
+	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC889, 
 	341, 0,
-	HDAUDIO_VENDOR_VIATECH, HDAUDIO_PRODUCT_VIATECH_VT1708, 
+	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC892, 
 	348, 0,
+	HDAUDIO_VENDOR_VIATECH, HDAUDIO_PRODUCT_VIATECH_VT1708, 
+	355, 0,
 	HDAUDIO_VENDOR_VIATECH, HDAUDIO_PRODUCT_VIATECH_VT1709, 
-	348, 0,
+	355, 0,
 	HDAUDIO_VENDOR_VIATECH, HDAUDIO_PRODUCT_VIATECH_VT170A, 
-	348, 0,
+	355, 0,
 	HDAUDIO_VENDOR_VIATECH, HDAUDIO_PRODUCT_VIATECH_VT170B, 
-	348, 0,
+	355, 0,
 	HDAUDIO_VENDOR_VIATECH, HDAUDIO_PRODUCT_VIATECH_VT1709_10CH_0, 
-	355, 362, 0,
+	362, 369, 0,
 	HDAUDIO_VENDOR_VIATECH, HDAUDIO_PRODUCT_VIATECH_VT1709_10CH_1, 
-	355, 362, 0,
+	362, 369, 0,
 	HDAUDIO_VENDOR_VIATECH, 

CVS commit: src/sys/dev/hdaudio

2020-04-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Apr 28 21:48:20 UTC 2020

Modified Files:
src/sys/dev/hdaudio: hdaudiodevs.h hdaudiodevs_data.h

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/hdaudio/hdaudiodevs.h \
src/sys/dev/hdaudio/hdaudiodevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/hdaudio

2020-04-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Apr 28 21:48:11 UTC 2020

Modified Files:
src/sys/dev/hdaudio: hdaudiodevs

Log Message:
Add Realtek ALC293


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/hdaudio/hdaudiodevs

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/hdaudiodevs
diff -u src/sys/dev/hdaudio/hdaudiodevs:1.3 src/sys/dev/hdaudio/hdaudiodevs:1.4
--- src/sys/dev/hdaudio/hdaudiodevs:1.3	Mon Jan 27 00:51:15 2020
+++ src/sys/dev/hdaudio/hdaudiodevs	Tue Apr 28 21:48:11 2020
@@ -1,4 +1,4 @@
-$NetBSD: hdaudiodevs,v 1.3 2020/01/27 00:51:15 jmcneill Exp $
+$NetBSD: hdaudiodevs,v 1.4 2020/04/28 21:48:11 jmcneill Exp $
 
 /*
  * Copyright (c) 2010 Jared D. McNeill 
@@ -77,6 +77,7 @@ product	REALTEK		ALC270		0x0270	ALC270
 product	REALTEK		ALC272		0x0272	ALC272
 product	REALTEK		ALC275		0x0275	ALC275
 product	REALTEK		ALC280		0x0280	ALC280
+product	REALTEK		ALC293		0x0293	ALC293
 product	REALTEK		ALC660_VD	0x0660	ALC660-VD
 product	REALTEK		ALC662		0x0662	ALC662
 product	REALTEK		ALC663		0x0663	ALC663



CVS commit: src/sys/dev/hdaudio

2020-04-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Apr 28 21:48:11 UTC 2020

Modified Files:
src/sys/dev/hdaudio: hdaudiodevs

Log Message:
Add Realtek ALC293


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/hdaudio/hdaudiodevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/hdaudio

2020-04-18 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sun Apr 19 04:13:10 UTC 2020

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
Make round_blocksize satisfy all of
- restrictions that existed before merging isaki-audio2 branch.
- better support for 6 channels hardware.
- audio layer's requirement.
This may help PR kern/54474.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 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.21 src/sys/dev/hdaudio/hdafg.c:1.22
--- src/sys/dev/hdaudio/hdafg.c:1.21	Sat Feb 15 03:04:45 2020
+++ src/sys/dev/hdaudio/hdafg.c	Sun Apr 19 04:13:09 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: hdafg.c,v 1.21 2020/02/15 03:04:45 isaki Exp $ */
+/* $NetBSD: hdafg.c,v 1.22 2020/04/19 04:13:09 isaki Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd 
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.21 2020/02/15 03:04:45 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.22 2020/04/19 04:13:09 isaki Exp $");
 
 #include 
 #include 
@@ -3942,12 +3942,28 @@ hdafg_set_format(void *opaque, int setmo
 	return 0;
 }
 
+/* LCM for round_blocksize */
+static u_int gcd(u_int, u_int);
+static u_int lcm(u_int, u_int);
+
+static u_int gcd(u_int a, u_int b)
+{
+
+	return (b == 0) ? a : gcd(b, a % b);
+}
+static u_int lcm(u_int a, u_int b)
+{
+
+	return a * b / gcd(a, b);
+}
+
 static int
 hdafg_round_blocksize(void *opaque, int blksize, int mode,
 const audio_params_t *param)
 {
 	struct hdaudio_audiodev *ad = opaque;
 	struct hdaudio_stream *st;
+	u_int minblksize;
 	int bufsize;
 
 	st = (mode == AUMODE_PLAY) ? ad->ad_playback : ad->ad_capture;
@@ -3957,6 +3973,15 @@ hdafg_round_blocksize(void *opaque, int 
 		return 128;
 	}
 
+	if (blksize > 8192)
+		blksize = 8192;
+
+	/* Make sure there are enough BDL descriptors */
+	bufsize = st->st_data.dma_size;
+	if (bufsize > HDAUDIO_BDL_MAX * blksize) {
+		blksize = bufsize / HDAUDIO_BDL_MAX;
+	}
+
 	/*
 	 * HD audio's buffer constraint looks like following:
 	 * - The buffer MUST start on a 128bytes boundary.
@@ -3964,13 +3989,15 @@ hdafg_round_blocksize(void *opaque, int 
 	 * - The buffer size is preferred multiple of 128bytes for efficiency.
 	 *
 	 * https://www.intel.co.jp/content/www/jp/ja/standards/high-definition-audio-specification.html , p70.
+	 *
+	 * Also, the audio layer requires that the blocksize must be a
+	 * multiple of the number of channels.
 	 */
+	minblksize = lcm(128, param->channels);
+	blksize = rounddown(blksize, minblksize);
+	if (blksize < minblksize)
+		blksize = minblksize;
 
-	/* Make sure there are enough BDL descriptors */
-	bufsize = st->st_data.dma_size;
-	if (bufsize > HDAUDIO_BDL_MAX * blksize) {
-		blksize = bufsize / HDAUDIO_BDL_MAX;
-	}
 	return blksize;
 }
 



CVS commit: src/sys/dev/hdaudio

2020-04-18 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sun Apr 19 04:13:10 UTC 2020

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
Make round_blocksize satisfy all of
- restrictions that existed before merging isaki-audio2 branch.
- better support for 6 channels hardware.
- audio layer's requirement.
This may help PR kern/54474.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 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.



CVS commit: src/sys/dev/hdaudio

2020-02-14 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sat Feb 15 03:04:45 UTC 2020

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
Enumerating probably always starts from sc->sc_startnode.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 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.20 src/sys/dev/hdaudio/hdafg.c:1.21
--- src/sys/dev/hdaudio/hdafg.c:1.20	Thu Jan 30 00:21:23 2020
+++ src/sys/dev/hdaudio/hdafg.c	Sat Feb 15 03:04:45 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: hdafg.c,v 1.20 2020/01/30 00:21:23 jmcneill Exp $ */
+/* $NetBSD: hdafg.c,v 1.21 2020/02/15 03:04:45 isaki Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd 
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.20 2020/01/30 00:21:23 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.21 2020/02/15 03:04:45 isaki Exp $");
 
 #include 
 #include 
@@ -796,7 +796,7 @@ hdafg_assoc_count_channels(struct hdafg_
 		if (as->as_dacs[i])
 			dacmap[as->as_dacs[i]] = 1;
 
-	for (i = 1; i < sc->sc_endnode; i++) {
+	for (i = sc->sc_startnode; i < sc->sc_endnode; i++) {
 		if (!dacmap[i])
 			continue;
 		w = hdafg_widget_lookup(sc, i);



CVS commit: src/sys/dev/hdaudio

2020-02-14 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sat Feb 15 03:04:45 UTC 2020

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
Enumerating probably always starts from sc->sc_startnode.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 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.



CVS commit: src/sys/dev/hdaudio

2020-02-07 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Feb  8 00:14:06 UTC 2020

Modified Files:
src/sys/dev/hdaudio: hdaudio.c

Log Message:
Read GCAP and version regs after taking the controller out of reset. Fixes
stream counts on my Radeon HD 7850.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/hdaudio/hdaudio.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/hdaudio.c
diff -u src/sys/dev/hdaudio/hdaudio.c:1.9 src/sys/dev/hdaudio/hdaudio.c:1.10
--- src/sys/dev/hdaudio/hdaudio.c:1.9	Fri Jul 26 11:13:46 2019
+++ src/sys/dev/hdaudio/hdaudio.c	Sat Feb  8 00:14:06 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: hdaudio.c,v 1.9 2019/07/26 11:13:46 jmcneill Exp $ */
+/* $NetBSD: hdaudio.c,v 1.10 2020/02/08 00:14:06 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd 
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hdaudio.c,v 1.9 2019/07/26 11:13:46 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdaudio.c,v 1.10 2020/02/08 00:14:06 jmcneill Exp $");
 
 #include 
 #include 
@@ -121,36 +121,21 @@ hdaudio_codec_init(struct hdaudio_softc 
 static void
 hdaudio_init(struct hdaudio_softc *sc)
 {
-	uint16_t gcap;
-	int nos, nis, nbidir;
-#if defined(HDAUDIO_DEBUG)
-	uint8_t vmin, vmaj;
-	int nsdo, addr64;
-#endif
-
-#if defined(HDAUDIO_DEBUG)
-	vmaj = hda_read1(sc, HDAUDIO_MMIO_VMAJ);
-	vmin = hda_read1(sc, HDAUDIO_MMIO_VMIN);
-
-	hda_print(sc, "High Definition Audio version %d.%d\n", vmaj, vmin);
-#endif
+	const uint8_t vmaj = hda_read1(sc, HDAUDIO_MMIO_VMAJ);
+	const uint8_t vmin = hda_read1(sc, HDAUDIO_MMIO_VMIN);
+	const uint16_t gcap = hda_read2(sc, HDAUDIO_MMIO_GCAP);
+	const int nis = HDAUDIO_GCAP_ISS(gcap);
+	const int nos = HDAUDIO_GCAP_OSS(gcap);
+	const int nbidir = HDAUDIO_GCAP_BSS(gcap);
+	const int nsdo = HDAUDIO_GCAP_NSDO(gcap);
+	const int addr64 = HDAUDIO_GCAP_64OK(gcap);
 
-	gcap = hda_read2(sc, HDAUDIO_MMIO_GCAP);
-	nis = HDAUDIO_GCAP_ISS(gcap);
-	nos = HDAUDIO_GCAP_OSS(gcap);
-	nbidir = HDAUDIO_GCAP_BSS(gcap);
+	hda_print(sc, "HDA ver. %d.%d, OSS %d, ISS %d, BSS %d, SDO %d%s\n",
+	vmaj, vmin, nos, nis, nbidir, nsdo, addr64 ? ", 64-bit" : "");
 
 	/* Initialize codecs and streams */
 	hdaudio_codec_init(sc);
 	hdaudio_stream_init(sc, nis, nos, nbidir);
-
-#if defined(HDAUDIO_DEBUG)
-	nsdo = HDAUDIO_GCAP_NSDO(gcap);
-	addr64 = HDAUDIO_GCAP_64OK(gcap);
-
-	hda_print(sc, "OSS %d ISS %d BSS %d SDO %d%s\n",
-	nos, nis, nbidir, nsdo, addr64 ? " 64-bit" : "");
-#endif
 }
 
 static int
@@ -795,8 +780,6 @@ hdaudio_attach(device_t dev, struct hdau
 	mutex_init(>sc_corb_mtx, MUTEX_DEFAULT, IPL_AUDIO);
 	mutex_init(>sc_stream_mtx, MUTEX_DEFAULT, IPL_AUDIO);
 
-	hdaudio_init(sc);
-
 	/*
 	 * Put the controller into a known state by entering and leaving
 	 * CRST as necessary.
@@ -814,6 +797,15 @@ hdaudio_attach(device_t dev, struct hdau
 	 * In reality, we need to wait longer than this.
 	 */
 	hda_delay(HDAUDIO_CODEC_DELAY);
+
+	/*
+	 * Read device capabilities
+	 */
+	hdaudio_init(sc);
+
+	/*
+	 * Detect codecs
+	 */
 	if (hdaudio_codec_probe(sc) == 0) {
 		hda_error(sc, "no codecs found\n");
 		err = ENODEV;



CVS commit: src/sys/dev/hdaudio

2020-02-07 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Feb  8 00:14:06 UTC 2020

Modified Files:
src/sys/dev/hdaudio: hdaudio.c

Log Message:
Read GCAP and version regs after taking the controller out of reset. Fixes
stream counts on my Radeon HD 7850.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/hdaudio/hdaudio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/hdaudio

2020-01-29 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Jan 30 00:21:23 UTC 2020

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
Only dump ELD info if HDAFG_HDMI_DEBUG is defined


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 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.19 src/sys/dev/hdaudio/hdafg.c:1.20
--- src/sys/dev/hdaudio/hdafg.c:1.19	Sat Jan 18 12:00:33 2020
+++ src/sys/dev/hdaudio/hdafg.c	Thu Jan 30 00:21:23 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: hdafg.c,v 1.19 2020/01/18 12:00:33 jmcneill Exp $ */
+/* $NetBSD: hdafg.c,v 1.20 2020/01/30 00:21:23 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd 
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.19 2020/01/18 12:00:33 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.20 2020/01/30 00:21:23 jmcneill Exp $");
 
 #include 
 #include 
@@ -889,6 +889,7 @@ hdafg_assoc_dump_dd(struct hdafg_softc *
 			return;
 		}
 
+#ifdef HDAFG_HDMI_DEBUG
 		hda_print(sc, "  ELD version=0x%x", ELD_VER());
 		hda_print1(sc, ",len=%u", hdi.eld.header.baseline_eld_len * 4);
 		hda_print1(sc, ",edid=0x%x", ELD_CEA_EDID_VER());
@@ -914,6 +915,7 @@ hdafg_assoc_dump_dd(struct hdafg_softc *
 CEA_MAX_BITRATE([i]));
 			hda_print1(sc, "\n");
 		}
+#endif
 	}
 }
 



CVS commit: src/sys/dev/hdaudio

2020-01-29 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Jan 30 00:21:23 UTC 2020

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
Only dump ELD info if HDAFG_HDMI_DEBUG is defined


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 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.



CVS commit: src/sys/dev/hdaudio

2020-01-26 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Jan 27 00:51:40 UTC 2020

Modified Files:
src/sys/dev/hdaudio: hdaudiodevs.h hdaudiodevs_data.h

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/hdaudio/hdaudiodevs.h \
src/sys/dev/hdaudio/hdaudiodevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/hdaudio

2020-01-26 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Jan 27 00:51:40 UTC 2020

Modified Files:
src/sys/dev/hdaudio: hdaudiodevs.h hdaudiodevs_data.h

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/hdaudio/hdaudiodevs.h \
src/sys/dev/hdaudio/hdaudiodevs_data.h

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/hdaudiodevs.h
diff -u src/sys/dev/hdaudio/hdaudiodevs.h:1.2 src/sys/dev/hdaudio/hdaudiodevs.h:1.3
--- src/sys/dev/hdaudio/hdaudiodevs.h:1.2	Sat May 30 14:12:57 2015
+++ src/sys/dev/hdaudio/hdaudiodevs.h	Mon Jan 27 00:51:40 2020
@@ -1,10 +1,10 @@
-/*	$NetBSD: hdaudiodevs.h,v 1.2 2015/05/30 14:12:57 jmcneill Exp $	*/
+/*	$NetBSD: hdaudiodevs.h,v 1.3 2020/01/27 00:51:40 jmcneill Exp $	*/
 
 /*
- * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
+ * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: hdaudiodevs,v 1.2 2015/05/30 14:12:42 jmcneill Exp
+ *	NetBSD: hdaudiodevs,v 1.3 2020/01/27 00:51:15 jmcneill Exp
  */
 
 /*
@@ -35,16 +35,21 @@
  * SUCH DAMAGE.
  */
 
-/* The following is duplicated from pci except SIGMATEL* and CMEDIA */
-#define	HDAUDIO_VENDOR_ATI	0x1002		/* ATI Technologies */
+/*
+ * Try to keep vendor and product names 15 characters or less. They are
+ * used by the AUDIO_GETDEV ioctl and copied into buffers that are
+ * constrained by MAX_AUDIO_DEV_LEN (sys/audioio.h).
+ */
+
+#define	HDAUDIO_VENDOR_ATI	0x1002		/* ATI */
 #define	HDAUDIO_VENDOR_NVIDIA	0x10de		/* NVIDIA */
-#define	HDAUDIO_VENDOR_REALTEK	0x10ec		/* Realtek Semiconductor */
-#define	HDAUDIO_VENDOR_VIATECH	0x1106		/* VIA TeCHnologies */
+#define	HDAUDIO_VENDOR_REALTEK	0x10ec		/* Realtek */
+#define	HDAUDIO_VENDOR_VIATECH	0x1106		/* VIA */
 #define	HDAUDIO_VENDOR_SIGMATEL2	0x111d		/* Sigmatel */
 #define	HDAUDIO_VENDOR_ANALOG	0x11d4		/* Analog Devices */
-#define	HDAUDIO_VENDOR_CONEXANT	0x14f1		/* Conexant Systems */
+#define	HDAUDIO_VENDOR_CONEXANT	0x14f1		/* Conexant */
 #define	HDAUDIO_VENDOR_VMWARE	0x15ad		/* VMware */
-#define	HDAUDIO_VENDOR_CMEDIA	0x434d		/* C-Media Electronics */
+#define	HDAUDIO_VENDOR_CMEDIA	0x434d		/* C-Media */
 #define	HDAUDIO_VENDOR_INTEL	0x8086		/* Intel */
 #define	HDAUDIO_VENDOR_SIGMATEL	0x8384		/* Sigmatel */
 
Index: src/sys/dev/hdaudio/hdaudiodevs_data.h
diff -u src/sys/dev/hdaudio/hdaudiodevs_data.h:1.2 src/sys/dev/hdaudio/hdaudiodevs_data.h:1.3
--- src/sys/dev/hdaudio/hdaudiodevs_data.h:1.2	Sat May 30 14:12:57 2015
+++ src/sys/dev/hdaudio/hdaudiodevs_data.h	Mon Jan 27 00:51:40 2020
@@ -1,10 +1,10 @@
-/*	$NetBSD: hdaudiodevs_data.h,v 1.2 2015/05/30 14:12:57 jmcneill Exp $	*/
+/*	$NetBSD: hdaudiodevs_data.h,v 1.3 2020/01/27 00:51:40 jmcneill Exp $	*/
 
 /*
- * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
+ * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: hdaudiodevs,v 1.2 2015/05/30 14:12:42 jmcneill Exp
+ *	NetBSD: hdaudiodevs,v 1.3 2020/01/27 00:51:15 jmcneill Exp
  */
 
 /*
@@ -36,551 +36,546 @@
  */
 
 static const uint16_t hdaudio_vendors[] = {
-	HDAUDIO_VENDOR_ATI, 1, 5, 0,
-	HDAUDIO_VENDOR_NVIDIA, 18, 0,
-	HDAUDIO_VENDOR_REALTEK, 25, 33, 0,
-	HDAUDIO_VENDOR_VIATECH, 47, 51, 0,
-	HDAUDIO_VENDOR_SIGMATEL2, 64, 0,
-	HDAUDIO_VENDOR_ANALOG, 73, 80, 0,
-	HDAUDIO_VENDOR_CONEXANT, 88, 97, 0,
-	HDAUDIO_VENDOR_VMWARE, 105, 0,
-	HDAUDIO_VENDOR_CMEDIA, 112, 120, 0,
-	HDAUDIO_VENDOR_INTEL, 132, 0,
-	HDAUDIO_VENDOR_SIGMATEL, 64, 0,
+	HDAUDIO_VENDOR_ATI, 1, 0,
+	HDAUDIO_VENDOR_NVIDIA, 5, 0,
+	HDAUDIO_VENDOR_REALTEK, 12, 0,
+	HDAUDIO_VENDOR_VIATECH, 20, 0,
+	HDAUDIO_VENDOR_SIGMATEL2, 24, 0,
+	HDAUDIO_VENDOR_ANALOG, 33, 40, 0,
+	HDAUDIO_VENDOR_CONEXANT, 48, 0,
+	HDAUDIO_VENDOR_VMWARE, 57, 0,
+	HDAUDIO_VENDOR_CMEDIA, 64, 0,
+	HDAUDIO_VENDOR_INTEL, 72, 0,
+	HDAUDIO_VENDOR_SIGMATEL, 24, 0,
 };
 
 static const uint16_t hdaudio_products[] = {
 	HDAUDIO_VENDOR_ATI, HDAUDIO_PRODUCT_ATI_RS600_HDMI_1, 
-	138, 144, 0,
+	78, 84, 0,
 	HDAUDIO_VENDOR_ATI, HDAUDIO_PRODUCT_ATI_RS600_HDMI_2, 
-	138, 144, 0,
+	78, 84, 0,
 	HDAUDIO_VENDOR_ATI, HDAUDIO_PRODUCT_ATI_RS690_780_HDMI, 
-	149, 144, 0,
+	89, 84, 0,
 	HDAUDIO_VENDOR_ATI, HDAUDIO_PRODUCT_ATI_R6xx_HDMI, 
-	159, 144, 0,
+	99, 84, 0,
 	HDAUDIO_VENDOR_NVIDIA, HDAUDIO_PRODUCT_NVIDIA_MCP77_78_HDMI_2, 
-	164, 144, 0,
+	104, 84, 0,
 	HDAUDIO_VENDOR_NVIDIA, HDAUDIO_PRODUCT_NVIDIA_MCP77_78_HDMI_3, 
-	164, 144, 0,
+	104, 84, 0,
 	HDAUDIO_VENDOR_NVIDIA, HDAUDIO_PRODUCT_NVIDIA_MCP77_78_HDMI_5, 
-	164, 144, 0,
+	104, 84, 0,
 	HDAUDIO_VENDOR_NVIDIA, HDAUDIO_PRODUCT_NVIDIA_MCP77_78_HDMI_6, 
-	164, 144, 0,
+	104, 84, 0,
 	HDAUDIO_VENDOR_NVIDIA, HDAUDIO_PRODUCT_NVIDIA_MCP79_7A_HDMI_7, 
-	173, 144, 0,
+	113, 84, 0,
 	

CVS commit: src/sys/dev/hdaudio

2020-01-26 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Jan 27 00:51:15 UTC 2020

Modified Files:
src/sys/dev/hdaudio: hdaudiodevs

Log Message:
Make sure that all vendor strings are shorter than 16 (MAX_AUDIO_DEV_LEN)
characters as the values are used in the AUDIO_GETDEV ioctl.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/hdaudio/hdaudiodevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/hdaudio

2020-01-26 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Jan 27 00:51:15 UTC 2020

Modified Files:
src/sys/dev/hdaudio: hdaudiodevs

Log Message:
Make sure that all vendor strings are shorter than 16 (MAX_AUDIO_DEV_LEN)
characters as the values are used in the AUDIO_GETDEV ioctl.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/hdaudio/hdaudiodevs

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/hdaudiodevs
diff -u src/sys/dev/hdaudio/hdaudiodevs:1.2 src/sys/dev/hdaudio/hdaudiodevs:1.3
--- src/sys/dev/hdaudio/hdaudiodevs:1.2	Sat May 30 14:12:42 2015
+++ src/sys/dev/hdaudio/hdaudiodevs	Mon Jan 27 00:51:15 2020
@@ -1,4 +1,4 @@
-$NetBSD: hdaudiodevs,v 1.2 2015/05/30 14:12:42 jmcneill Exp $
+$NetBSD: hdaudiodevs,v 1.3 2020/01/27 00:51:15 jmcneill Exp $
 
 /*
  * Copyright (c) 2010 Jared D. McNeill 
@@ -28,16 +28,21 @@ $NetBSD: hdaudiodevs,v 1.2 2015/05/30 14
  * SUCH DAMAGE.
  */
 
-/* The following is duplicated from pci except SIGMATEL* and CMEDIA */
-vendor	ATI		0x1002	ATI Technologies
+/*
+ * Try to keep vendor and product names 15 characters or less. They are
+ * used by the AUDIO_GETDEV ioctl and copied into buffers that are
+ * constrained by MAX_AUDIO_DEV_LEN (sys/audioio.h).
+ */
+
+vendor	ATI		0x1002	ATI
 vendor	NVIDIA		0x10de	NVIDIA
-vendor	REALTEK		0x10ec	Realtek Semiconductor
-vendor	VIATECH		0x1106	VIA TeCHnologies
+vendor	REALTEK		0x10ec	Realtek
+vendor	VIATECH		0x1106	VIA
 vendor	SIGMATEL2	0x111d	Sigmatel
 vendor	ANALOG		0x11d4	Analog Devices
-vendor	CONEXANT	0x14f1	Conexant Systems
+vendor	CONEXANT	0x14f1	Conexant
 vendor	VMWARE		0x15ad	VMware
-vendor	CMEDIA		0x434d	C-Media Electronics
+vendor	CMEDIA		0x434d	C-Media
 vendor	INTEL		0x8086	Intel
 vendor	SIGMATEL	0x8384	Sigmatel
 



CVS commit: src/sys/dev/hdaudio

2020-01-18 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Jan 18 12:00:33 UTC 2020

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
Make sure we have at least one of playback or capture streams setup before
attaching the audio layer.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 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.18 src/sys/dev/hdaudio/hdafg.c:1.19
--- src/sys/dev/hdaudio/hdafg.c:1.18	Sat Jun  8 08:02:38 2019
+++ src/sys/dev/hdaudio/hdafg.c	Sat Jan 18 12:00:33 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: hdafg.c,v 1.18 2019/06/08 08:02:38 isaki Exp $ */
+/* $NetBSD: hdafg.c,v 1.19 2020/01/18 12:00:33 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd 
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.18 2019/06/08 08:02:38 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.19 2020/01/18 12:00:33 jmcneill Exp $");
 
 #include 
 #include 
@@ -3781,6 +3781,12 @@ hdafg_attach(device_t parent, device_t s
 	sc->sc_audiodev.ad_playback = hdaudio_stream_establish(sc->sc_host,
 	HDAUDIO_STREAM_OSS, hdafg_stream_intr, >sc_audiodev);
 
+	if (sc->sc_audiodev.ad_capture == NULL &&
+	sc->sc_audiodev.ad_playback == NULL) {
+		hda_error(sc, "couldn't find any input or output streams\n");
+		return;
+	}
+
 	hda_debug(sc, "connecting streams\n");
 	defparams.channels = 2;
 	defparams.sample_rate = sc->sc_fixed_rate ? sc->sc_fixed_rate : 48000;



CVS commit: src/sys/dev/hdaudio

2020-01-18 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Jan 18 12:00:33 UTC 2020

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
Make sure we have at least one of playback or capture streams setup before
attaching the audio layer.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 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.



CVS commit: src/sys/dev/hdaudio

2019-07-26 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Jul 26 11:13:46 UTC 2019

Modified Files:
src/sys/dev/hdaudio: hdaudio.c

Log Message:
Even though the spec says SRST should read back as 1 after being set, this
does not appear to be the case with QEMU when using single byte accesses.

Instead of printing an error and giving up, continue and try to leave
stream reset state even if setting SRST times out.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/hdaudio/hdaudio.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/hdaudio.c
diff -u src/sys/dev/hdaudio/hdaudio.c:1.8 src/sys/dev/hdaudio/hdaudio.c:1.9
--- src/sys/dev/hdaudio/hdaudio.c:1.8	Fri Nov 24 17:51:10 2017
+++ src/sys/dev/hdaudio/hdaudio.c	Fri Jul 26 11:13:46 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: hdaudio.c,v 1.8 2017/11/24 17:51:10 jmcneill Exp $ */
+/* $NetBSD: hdaudio.c,v 1.9 2019/07/26 11:13:46 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd 
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hdaudio.c,v 1.8 2017/11/24 17:51:10 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdaudio.c,v 1.9 2019/07/26 11:13:46 jmcneill Exp $");
 
 #include 
 #include 
@@ -1172,10 +1172,6 @@ hdaudio_stream_reset(struct hdaudio_stre
 			break;
 		hda_delay(10);
 	} while (--retry > 0);
-	if (retry == 0) {
-		hda_error(sc, "timeout entering stream reset state\n");
-		return;
-	}
 
 	ctl0 &= ~HDAUDIO_CTL_SRST;
 	hda_write1(sc, HDAUDIO_SD_CTL0(snum), ctl0);



CVS commit: src/sys/dev/hdaudio

2019-07-26 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Jul 26 11:13:46 UTC 2019

Modified Files:
src/sys/dev/hdaudio: hdaudio.c

Log Message:
Even though the spec says SRST should read back as 1 after being set, this
does not appear to be the case with QEMU when using single byte accesses.

Instead of printing an error and giving up, continue and try to leave
stream reset state even if setting SRST times out.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/hdaudio/hdaudio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/hdaudio

2019-01-06 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Jan  7 01:03:05 UTC 2019

Modified Files:
src/sys/dev/hdaudio: hdaudioreg.h

Log Message:
s/1 << 31/1u << 31/.

XXX someone could __BIT() etc this file.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/hdaudio/hdaudioreg.h

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/hdaudioreg.h
diff -u src/sys/dev/hdaudio/hdaudioreg.h:1.2 src/sys/dev/hdaudio/hdaudioreg.h:1.3
--- src/sys/dev/hdaudio/hdaudioreg.h:1.2	Sat Oct 28 06:24:24 2017
+++ src/sys/dev/hdaudio/hdaudioreg.h	Mon Jan  7 01:03:05 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: hdaudioreg.h,v 1.2 2017/10/28 06:24:24 riastradh Exp $ */
+/* $NetBSD: hdaudioreg.h,v 1.3 2019/01/07 01:03:05 mrg Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd 
@@ -65,10 +65,10 @@
 #define	 HDAUDIO_STATESTS_SDIWAKE	0x7fff
 #define	HDAUDIO_MMIO_GSTS	0x010
 #define	HDAUDIO_MMIO_INTCTL	0x020
-#define	 HDAUDIO_INTCTL_GIE		(1 << 31)
+#define	 HDAUDIO_INTCTL_GIE		(1u << 31)
 #define	 HDAUDIO_INTCTL_CIE		(1 << 30)
 #define	HDAUDIO_MMIO_INTSTS	0x024
-#define	 HDAUDIO_INTSTS_GIS		(1 << 31)
+#define	 HDAUDIO_INTSTS_GIS		(1u << 31)
 #define	 HDAUDIO_INTSTS_CIS		(1 << 30)
 #define	 HDAUDIO_INTSTS_SIS_MASK	0x3fff
 #define	HDAUDIO_MMIO_WALCLK	0x030
@@ -225,7 +225,7 @@
 #define	  COP_GPIO_COUNT_NUM_GPIO(x)		  ((x) & 0xff)
 #define	 COP_VOLUME_KNOB_CAPABILITIES		 0x13
 #define	 COP_HDMI_LPCM_CAD			 0x20
-#define	  COP_LPCM_CAD_44_1_MS			  (1 << 31)
+#define	  COP_LPCM_CAD_44_1_MS			  (1u << 31)
 #define	  COP_LPCM_CAD_44_1			  (1 << 30)
 #define	  COP_LPCM_CAD_192K_24BIT		  (1 << 29)
 #define	  COP_LPCM_CAD_192K_20BIT		  (1 << 28)
@@ -292,7 +292,7 @@
 #define	CORB_SET_UNSOLICITED_RESPONSE		0x708
 #define	 COP_SET_UNSOLICITED_RESPONSE_ENABLE	 (1 << 7)
 #define	CORB_GET_PIN_SENSE			0xf09
-#define	 COP_GET_PIN_SENSE_PRESENSE_DETECT	 (1 << 31)
+#define	 COP_GET_PIN_SENSE_PRESENSE_DETECT	 (1u << 31)
 #define	 COP_GET_PIN_SENSE_ELD_VALID		 (1 << 30) /* digital */
 #define	 COP_GET_PIN_SENSE_IMPEDENCE_SENSE(x)	 ((x) & 0x7fff) /* analog */
 #define	CORB_SET_PIN_SENSE			0x709
@@ -390,7 +390,7 @@
 #define	 COP_DIP_PI_AUDIO_INFO			 COP_DIP_PI_GP(0)
 #define	 COP_DIP_BUFFER_SIZE(x)			 ((x) & 0xff)
 #define	CORB_GET_HDMI_ELD_DATA			0xf2f
-#define	 COP_ELD_VALID (1 << 31)
+#define	 COP_ELD_VALID (1u << 31)
 #define	 COP_ELD_DATA(x)			 (((x) >> 0) & 0xff)
 #define	CORB_GET_HDMI_DIP_INDEX			0xf30
 #define	CORB_SET_HDMI_DIP_INDEX			0x730



CVS commit: src/sys/dev/hdaudio

2019-01-06 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Jan  7 01:03:05 UTC 2019

Modified Files:
src/sys/dev/hdaudio: hdaudioreg.h

Log Message:
s/1 << 31/1u << 31/.

XXX someone could __BIT() etc this file.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/hdaudio/hdaudioreg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/hdaudio

2018-09-26 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Thu Sep 27 01:18:11 UTC 2018

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
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.15 -r1.16 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.15 src/sys/dev/hdaudio/hdafg.c:1.16
--- src/sys/dev/hdaudio/hdafg.c:1.15	Wed Feb 14 18:28:43 2018
+++ src/sys/dev/hdaudio/hdafg.c	Thu Sep 27 01:18:11 2018
@@ -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 
@@ -60,7 +60,7 @@
  */
 
 #include 
-__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 
 #include 
@@ -2102,25 +2102,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) {



CVS commit: src/sys/dev/hdaudio

2018-09-26 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Thu Sep 27 01:18:11 UTC 2018

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
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.15 -r1.16 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.



CVS commit: src/sys/dev/hdaudio

2018-02-14 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Wed Feb 14 18:28:43 UTC 2018

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
Remove dead code.

>From David Binderman in PR kern/53029


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 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.



CVS commit: src/sys/dev/hdaudio

2018-02-14 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Wed Feb 14 18:28:43 UTC 2018

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
Remove dead code.

>From David Binderman in PR kern/53029


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 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.14 src/sys/dev/hdaudio/hdafg.c:1.15
--- src/sys/dev/hdaudio/hdafg.c:1.14	Thu Jan  4 00:09:12 2018
+++ src/sys/dev/hdaudio/hdafg.c	Wed Feb 14 18:28:43 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: hdafg.c,v 1.14 2018/01/04 00:09:12 khorben Exp $ */
+/* $NetBSD: hdafg.c,v 1.15 2018/02/14 18:28:43 maya Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd 
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.14 2018/01/04 00:09:12 khorben Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.15 2018/02/14 18:28:43 maya Exp $");
 
 #include 
 #include 
@@ -1265,10 +1265,6 @@ hdafg_control_parse(struct hdafg_softc *
 
 	cnt = 0;
 	for (i = sc->sc_startnode; cnt < maxctls && i < sc->sc_endnode; i++) {
-		if (cnt >= maxctls) {
-			hda_error(sc, "ctl overflow\n");
-			break;
-		}
 		w = hdafg_widget_lookup(sc, i);
 		if (w == NULL || w->w_enable == false)
 			continue;



CVS commit: src/sys/dev/hdaudio

2018-01-03 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Thu Jan  4 00:09:12 UTC 2018

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
Fix off-by-one when calling snprintf(9) in hdafg_getdev()

This is actually harmless, since:
- the offset is too short rather than too long (no overflow)
- the struct audio_device comes from userland (no information leak)

"looks good to me" nat@


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 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.13 src/sys/dev/hdaudio/hdafg.c:1.14
--- src/sys/dev/hdaudio/hdafg.c:1.13	Fri Aug  4 00:25:23 2017
+++ src/sys/dev/hdaudio/hdafg.c	Thu Jan  4 00:09:12 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: hdafg.c,v 1.13 2017/08/04 00:25:23 mrg Exp $ */
+/* $NetBSD: hdafg.c,v 1.14 2018/01/04 00:09:12 khorben Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd 
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.13 2017/08/04 00:25:23 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.14 2018/01/04 00:09:12 khorben Exp $");
 
 #include 
 #include 
@@ -4058,7 +4058,7 @@ hdafg_getdev(void *opaque, struct audio_
 	sc->sc_vendor);
 	hdaudio_findproduct(audiodev->version, sizeof(audiodev->version),
 	sc->sc_vendor, sc->sc_product);
-	snprintf(audiodev->config, sizeof(audiodev->config) - 1,
+	snprintf(audiodev->config, sizeof(audiodev->config),
 	"%02Xh", sc->sc_nid);
 
 	return 0;



CVS commit: src/sys/dev/hdaudio

2018-01-03 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Thu Jan  4 00:09:12 UTC 2018

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
Fix off-by-one when calling snprintf(9) in hdafg_getdev()

This is actually harmless, since:
- the offset is too short rather than too long (no overflow)
- the struct audio_device comes from userland (no information leak)

"looks good to me" nat@


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 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.



CVS commit: src/sys/dev/hdaudio

2017-11-24 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Nov 24 17:51:10 UTC 2017

Modified Files:
src/sys/dev/hdaudio: hdaudio.c

Log Message:
Always go through RIRB startup process, initialize RIRB interrupt count
register, and ack RIRBs as we process them in polling mode.

XXX pullup


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/hdaudio/hdaudio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/hdaudio

2017-11-24 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Nov 24 17:51:10 UTC 2017

Modified Files:
src/sys/dev/hdaudio: hdaudio.c

Log Message:
Always go through RIRB startup process, initialize RIRB interrupt count
register, and ack RIRBs as we process them in polling mode.

XXX pullup


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/hdaudio/hdaudio.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/hdaudio.c
diff -u src/sys/dev/hdaudio/hdaudio.c:1.7 src/sys/dev/hdaudio/hdaudio.c:1.8
--- src/sys/dev/hdaudio/hdaudio.c:1.7	Fri Nov 24 14:00:04 2017
+++ src/sys/dev/hdaudio/hdaudio.c	Fri Nov 24 17:51:10 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: hdaudio.c,v 1.7 2017/11/24 14:00:04 jmcneill Exp $ */
+/* $NetBSD: hdaudio.c,v 1.8 2017/11/24 17:51:10 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd 
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hdaudio.c,v 1.7 2017/11/24 14:00:04 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdaudio.c,v 1.8 2017/11/24 17:51:10 jmcneill Exp $");
 
 #include 
 #include 
@@ -347,6 +347,9 @@ hdaudio_command_unlocked(struct hdaudio_
 	hdaudio_corb_enqueue(sc, co->co_addr, nid, control, param);
 	result = hdaudio_rirb_dequeue(sc, false);
 
+	/* Clear response interrupt status */
+	hda_write1(sc, HDAUDIO_MMIO_RIRBSTS, hda_read1(sc, HDAUDIO_MMIO_RIRBSTS));
+
 	return result;
 }
 
@@ -497,20 +500,21 @@ hdaudio_rirb_start(struct hdaudio_softc 
 	uint8_t rirbctl;
 	int retry = HDAUDIO_RIRB_TIMEOUT;
 
-	/* Start the RIRB if necessary */
+	/* Set the RIRB interrupt count */
+	hda_write2(sc, HDAUDIO_MMIO_RINTCNT, 1);
+
+	/* Start the RIRB */
 	rirbctl = hda_read1(sc, HDAUDIO_MMIO_RIRBCTL);
-	if ((rirbctl & (HDAUDIO_RIRBCTL_RUN|HDAUDIO_RIRBCTL_INT_EN)) == 0) {
-		rirbctl |= HDAUDIO_RIRBCTL_RUN;
-		rirbctl |= HDAUDIO_RIRBCTL_INT_EN;
-		hda_write1(sc, HDAUDIO_MMIO_RIRBCTL, rirbctl);
-		do {
-			hda_delay(10);
-			rirbctl = hda_read1(sc, HDAUDIO_MMIO_RIRBCTL);
-		} while (--retry > 0 && (rirbctl & HDAUDIO_RIRBCTL_RUN) == 0);
-		if (retry == 0) {
-			hda_error(sc, "timeout starting RIRB\n");
-			return ETIME;
-		}
+	rirbctl |= HDAUDIO_RIRBCTL_RUN;
+	rirbctl |= HDAUDIO_RIRBCTL_INT_EN;
+	hda_write1(sc, HDAUDIO_MMIO_RIRBCTL, rirbctl);
+	do {
+		hda_delay(10);
+		rirbctl = hda_read1(sc, HDAUDIO_MMIO_RIRBCTL);
+	} while (--retry > 0 && (rirbctl & HDAUDIO_RIRBCTL_RUN) == 0);
+	if (retry == 0) {
+		hda_error(sc, "timeout starting RIRB\n");
+		return ETIME;
 	}
 
 	return 0;
@@ -558,8 +562,6 @@ static int
 hdaudio_rirb_config(struct hdaudio_softc *sc)
 {
 	uint32_t rirbubase, rirblbase;
-	uint32_t rirbwp;
-	int retry = HDAUDIO_RIRB_TIMEOUT;
 
 	/* Program command buffer base address and size */
 	rirblbase = (uint32_t)DMA_DMAADDR(>sc_rirb);
@@ -570,15 +572,6 @@ hdaudio_rirb_config(struct hdaudio_softc
 
 	/* Clear the write pointer */
 	hda_write2(sc, HDAUDIO_MMIO_RIRBWP, HDAUDIO_RIRBWP_WP_RESET);
-	hda_write2(sc, HDAUDIO_MMIO_RIRBWP, 0);
-	do {
-		hda_delay(10);
-		rirbwp = hda_read2(sc, HDAUDIO_MMIO_RIRBWP);
-	} while (--retry > 0 && (rirbwp & HDAUDIO_RIRBWP_WP_RESET) != 0);
-	if (retry == 0) {
-		hda_error(sc, "timeout resetting RIRB\n");
-		return ETIME;
-	}
 	sc->sc_rirbrp = 0;
 
 	return 0;



CVS commit: src/sys/dev/hdaudio

2017-11-24 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Nov 24 14:00:04 UTC 2017

Modified Files:
src/sys/dev/hdaudio: hdaudio.c

Log Message:
Always access CORBCTL using hda_read1/hda_write1 (it is an 8-bit wide reg).
Reported by Michal Necasek.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/hdaudio/hdaudio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/hdaudio

2017-11-23 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Nov 24 00:30:29 UTC 2017

Modified Files:
src/sys/dev/hdaudio: hdaudio.c

Log Message:
Enter link reset even if GCTL says we are already in reset state. Fixes
hdaudio codec detection under VirtualBox on a "cold" boot.

XXX pullup


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/hdaudio/hdaudio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/hdaudio

2017-10-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Oct 28 06:24:24 UTC 2017

Modified Files:
src/sys/dev/hdaudio: hdaudioreg.h

Log Message:
Add #includes to make this compile.

 for __packed
 for uint32_t


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/hdaudio/hdaudioreg.h

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/hdaudioreg.h
diff -u src/sys/dev/hdaudio/hdaudioreg.h:1.1 src/sys/dev/hdaudio/hdaudioreg.h:1.2
--- src/sys/dev/hdaudio/hdaudioreg.h:1.1	Sat Mar 28 14:09:59 2015
+++ src/sys/dev/hdaudio/hdaudioreg.h	Sat Oct 28 06:24:24 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: hdaudioreg.h,v 1.1 2015/03/28 14:09:59 jmcneill Exp $ */
+/* $NetBSD: hdaudioreg.h,v 1.2 2017/10/28 06:24:24 riastradh Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd 
@@ -32,6 +32,9 @@
 #ifndef _HDAUDIOREG_H
 #define _HDAUDIOREG_H
 
+#include 
+#include 
+
 /*
  * High Definition Audio Audio PCI Configuration Space
  */



CVS commit: src/sys/dev/hdaudio

2017-10-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Oct 28 06:24:24 UTC 2017

Modified Files:
src/sys/dev/hdaudio: hdaudioreg.h

Log Message:
Add #includes to make this compile.

 for __packed
 for uint32_t


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/hdaudio/hdaudioreg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/hdaudio

2017-09-26 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Sep 26 09:24:22 UTC 2017

Modified Files:
src/sys/dev/hdaudio: hdafg_dd.c

Log Message:
In rev 1.0a of the Intel High Definition Audio Spec:

https://www.intel.com/content/www/us/en/standards/
high-definition-audio-specification.html

page 186 shows the layout of the baseline block of the ELD (EDID Like Data)
struct - and allows a reserved (effectively padding) area at the end of the
struct.  This is required to keep the struct an even number of words long
(size measured in units of 32 bits) while allowing for a variable length
monitor name, followed by a variable number of 3 byte structs - the
combination of which is not likely to be a multiple of 4.

Code here assumed that there was no padding, and objected to the ELD
format if any padding bytes existed (hdafg_dd_parse_info() would return
EINVAL) causing a "failed to parse ELD data" message (if HDAFG_HDMI_DEBUG
is defined) from hdafg_assoc_dump_dd() making it difficult (or at least
confusing) to debug HDMI related audio issues (hdafg_assoc_dump_dd would
not print most of the data it is expected to print) although this would
most likely have no effect on actual operations.

Change a test from a != to < (there must be enough data, not exactly the
amount needed) for the EINVAL.   As a consequence, the length after the
SAD data is parsed (the 3 byte structs) is no longer required to be 0,
so remove the KASSERT() (previously it was just useless, the code guaranteed
a 0 value, now it is incorrect.)   While here also change a related
diagnostic message to be slightly more informative as to what is being shown.

OK jmcneill@


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/hdaudio/hdafg_dd.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_dd.c
diff -u src/sys/dev/hdaudio/hdafg_dd.c:1.2 src/sys/dev/hdaudio/hdafg_dd.c:1.3
--- src/sys/dev/hdaudio/hdafg_dd.c:1.2	Fri Aug  4 00:25:23 2017
+++ src/sys/dev/hdaudio/hdafg_dd.c	Tue Sep 26 09:24:22 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: hdafg_dd.c,v 1.2 2017/08/04 00:25:23 mrg Exp $ */
+/* $NetBSD: hdafg_dd.c,v 1.3 2017/09/26 09:24:22 kre Exp $ */
 
 /*
  * Copyright (c) 2011 Jared D. McNeill 
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hdafg_dd.c,v 1.2 2017/08/04 00:25:23 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdafg_dd.c,v 1.3 2017/09/26 09:24:22 kre Exp $");
 
 #include 
 #include 
@@ -92,7 +92,7 @@ hdafg_dd_parse_info(uint8_t *data, size_
 	data += ELD_MNL(block);
 	datalen -= ELD_MNL(block);
 
-	if (datalen != ELD_SAD_COUNT(block) * sizeof(hdi->sad[0])) {
+	if (datalen < ELD_SAD_COUNT(block) * sizeof(hdi->sad[0])) {
 #ifdef HDAFG_HDMI_DEBUG
 		printf(" datalen %u sadcount %u sizeof sad %u\n",
 		(unsigned int)datalen,
@@ -109,10 +109,8 @@ hdafg_dd_parse_info(uint8_t *data, size_
 	}
 
 #ifdef HDAFG_HDMI_DEBUG
-	printf("datalen = %u\n", (unsigned int)datalen);
+	printf("hdafg eld padding ignored = %u\n", (unsigned int)datalen);
 #endif
-	KASSERT(datalen == 0);
-
 	return 0;
 }
 



CVS commit: src/sys/dev/hdaudio

2017-09-26 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Sep 26 09:24:22 UTC 2017

Modified Files:
src/sys/dev/hdaudio: hdafg_dd.c

Log Message:
In rev 1.0a of the Intel High Definition Audio Spec:

https://www.intel.com/content/www/us/en/standards/
high-definition-audio-specification.html

page 186 shows the layout of the baseline block of the ELD (EDID Like Data)
struct - and allows a reserved (effectively padding) area at the end of the
struct.  This is required to keep the struct an even number of words long
(size measured in units of 32 bits) while allowing for a variable length
monitor name, followed by a variable number of 3 byte structs - the
combination of which is not likely to be a multiple of 4.

Code here assumed that there was no padding, and objected to the ELD
format if any padding bytes existed (hdafg_dd_parse_info() would return
EINVAL) causing a "failed to parse ELD data" message (if HDAFG_HDMI_DEBUG
is defined) from hdafg_assoc_dump_dd() making it difficult (or at least
confusing) to debug HDMI related audio issues (hdafg_assoc_dump_dd would
not print most of the data it is expected to print) although this would
most likely have no effect on actual operations.

Change a test from a != to < (there must be enough data, not exactly the
amount needed) for the EINVAL.   As a consequence, the length after the
SAD data is parsed (the 3 byte structs) is no longer required to be 0,
so remove the KASSERT() (previously it was just useless, the code guaranteed
a 0 value, now it is incorrect.)   While here also change a related
diagnostic message to be slightly more informative as to what is being shown.

OK jmcneill@


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/hdaudio/hdafg_dd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



Re: CVS commit: src/sys/dev/hdaudio

2017-08-04 Thread Robert Elz
Date:Sat, 05 Aug 2017 04:29:33 +1000
From:matthew green 
Message-ID:  <3108.1501871...@splode.eterna.com.au>

  | we are talking about 7 lines that appear every time my monitor
  | goes out of power save.

That is strange, and suggests that the X server is somehow making
the system re-probe the audio - what is the HDMI source?   (Mine is
from the Intel integrated graphics in the CPU chip.)

I have even more lines, as I have added more debug to look and see why
things are failing, but the only place I can find it is in dmesg.boot,
the output from dmesg is filled with noise from the CD driver (from
attempting to read either an empty drive, or an audio, or blank (unwritten
yet) CD, and failing, and insisting on blathering about it ... now that is
spam that could be deleted ... it only happens when I do something CD related
of course, but over time, there's enough if it that there is nothing else
in the dmesg output - certainly no HDMI audio related messages, and the
monitor is going on and off all the time - though I do have the screen saver
disabled)

I also get USB mouse spam, if I do not have X running (that's rare enough
that it doesn't end up bothering me) but as long as the mouse is present,
and nothing is actually using it, every few minutes it seems to detatch and
reattach.

kre



re: CVS commit: src/sys/dev/hdaudio

2017-08-04 Thread matthew green
> We are talking about just 1 message at boot, compared with the rest of
> what is there, that is hardly "spam" - once one of the errors occurs, the

we are talking about 7 lines that appear every time my monitor
goes out of power save.  my dmesg is spammed and if my desktop
were to stay up long enough, fills it.

to be honest, the author of the code recommended i simply remove
all this code since it doesn't work.  i choose to allow someone
else to have a headstart fixing it.  it doesn't help or hurt the
use of hdmi audio on at least 4 systems i've tested.


.mrg.


re: CVS commit: src/sys/dev/hdaudio

2017-08-04 Thread matthew green
Robert Elz writes:
> Date:Fri, 4 Aug 2017 00:25:24 +
> From:"matthew green" 
> Message-ID:  <20170804002524.16ba1f...@cvs.netbsd.org>
> 
>   | put all the ELD debugging messages under #ifdef HDAFG_HDMI_DEBUG.
> 
> I am not sure that doing that with the ones that are hda_error() is
> the correct thing to do - if something is failing, getting an indication
> why, even when not debugging. seems like a good idea to me.

this code is not functional and only complains when it fails
to parse stuff, that probably is quite valid.  all it does is
whine, not actually do take any useful action.

ie, it's not useful and actively spams dmesg.  there's a
reasonable chance it is buggy -- it hasn't really been
tested properly or checked against the spec.

if someone wants to make this code work, then these could
be re-promoted, but for now they're garbage.


.mrg.


Re: CVS commit: src/sys/dev/hdaudio

2017-08-03 Thread Robert Elz
Date:Fri, 4 Aug 2017 00:25:24 +
From:"matthew green" 
Message-ID:  <20170804002524.16ba1f...@cvs.netbsd.org>

  | put all the ELD debugging messages under #ifdef HDAFG_HDMI_DEBUG.

I am not sure that doing that with the ones that are hda_error() is
the correct thing to do - if something is failing, getting an indication
why, even when not debugging. seems like a good idea to me.

kre



CVS commit: src/sys/dev/hdaudio

2017-08-03 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug  4 00:25:24 UTC 2017

Modified Files:
src/sys/dev/hdaudio: hdafg.c hdafg_dd.c

Log Message:
put all the ELD debugging messages under #ifdef HDAFG_HDMI_DEBUG.
this silences a frequent and largely useless series of messages
in my dmesg.  ok jmcneill.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/hdaudio/hdafg.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/hdaudio/hdafg_dd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/hdaudio

2017-08-03 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug  4 00:25:24 UTC 2017

Modified Files:
src/sys/dev/hdaudio: hdafg.c hdafg_dd.c

Log Message:
put all the ELD debugging messages under #ifdef HDAFG_HDMI_DEBUG.
this silences a frequent and largely useless series of messages
in my dmesg.  ok jmcneill.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/hdaudio/hdafg.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/hdaudio/hdafg_dd.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 src/sys/dev/hdaudio/hdafg.c:1.13
--- src/sys/dev/hdaudio/hdafg.c:1.12	Thu Jun  1 02:45:10 2017
+++ src/sys/dev/hdaudio/hdafg.c	Fri Aug  4 00:25:23 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: hdafg.c,v 1.12 2017/06/01 02:45:10 chs Exp $ */
+/* $NetBSD: hdafg.c,v 1.13 2017/08/04 00:25:23 mrg Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd 
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.12 2017/06/01 02:45:10 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.13 2017/08/04 00:25:23 mrg Exp $");
 
 #include 
 #include 
@@ -879,15 +879,19 @@ hdafg_assoc_dump_dd(struct hdafg_softc *
 			res = (*cmd)(sc->sc_codec, as->as_pins[pin],
 			CORB_GET_HDMI_ELD_DATA, i);
 			if (!(res & COP_ELD_VALID)) {
+#ifdef HDAFG_HDMI_DEBUG
 hda_error(sc, "bad ELD size (%u/%u)\n",
 i, elddatalen);
+#endif
 break;
 			}
 			elddata[i] = COP_ELD_DATA(res);
 		}
 
 		if (hdafg_dd_parse_info(elddata, elddatalen, ) != 0) {
+#ifdef HDAFG_HDMI_DEBUG
 			hda_error(sc, "failed to parse ELD data\n");
+#endif
 			return;
 		}
 
@@ -4342,7 +4346,9 @@ hdafg_unsol(device_t self, uint8_t tag)
 
 	switch (tag) {
 	case HDAUDIO_UNSOLTAG_EVENT_DD:
+#ifdef HDAFG_HDMI_DEBUG
 		hda_print(sc, "unsol: display device hotplug\n");
+#endif
 		for (i = 0; i < sc->sc_nassocs; i++) {
 			if (as[i].as_displaydev == false)
 continue;
@@ -4354,7 +4360,9 @@ hdafg_unsol(device_t self, uint8_t tag)
 		}
 		break;
 	default:
+#ifdef HDAFG_HDMI_DEBUG
 		hda_print(sc, "unsol: tag=%u\n", tag);
+#endif
 		break;
 	}
 

Index: src/sys/dev/hdaudio/hdafg_dd.c
diff -u src/sys/dev/hdaudio/hdafg_dd.c:1.1 src/sys/dev/hdaudio/hdafg_dd.c:1.2
--- src/sys/dev/hdaudio/hdafg_dd.c:1.1	Sat Mar 28 14:09:59 2015
+++ src/sys/dev/hdaudio/hdafg_dd.c	Fri Aug  4 00:25:23 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: hdafg_dd.c,v 1.1 2015/03/28 14:09:59 jmcneill Exp $ */
+/* $NetBSD: hdafg_dd.c,v 1.2 2017/08/04 00:25:23 mrg Exp $ */
 
 /*
  * Copyright (c) 2011 Jared D. McNeill 
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hdafg_dd.c,v 1.1 2015/03/28 14:09:59 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdafg_dd.c,v 1.2 2017/08/04 00:25:23 mrg Exp $");
 
 #include 
 #include 
@@ -50,12 +50,16 @@ hdafg_dd_parse_info(uint8_t *data, size_
 	struct eld_baseline_block *block = >eld;
 	unsigned int i;
 
+#ifdef HDAFG_HDMI_DEBUG
 	printf("hdafg_dd_parse_info: datalen=%u\n", (unsigned int)datalen);
+#endif
 
 	memset(hdi, 0, sizeof(*hdi));
 
 	if (datalen < sizeof(block->header)) {
+#ifdef HDAFG_HDMI_DEBUG
 		printf(" no room for header\n");
+#endif
 		return EINVAL;
 	}
 
@@ -65,7 +69,9 @@ hdafg_dd_parse_info(uint8_t *data, size_
 
 	if (datalen < block->header.baseline_eld_len * 4 ||
 	datalen < sizeof(*block) - sizeof(block->header)) {
+#ifdef HDAFG_HDMI_DEBUG
 		printf(" ack!\n");
+#endif
 		return EINVAL;
 	}
 
@@ -76,7 +82,9 @@ hdafg_dd_parse_info(uint8_t *data, size_
 	datalen -= sizeof(*block) - sizeof(block->header);
 
 	if (datalen < ELD_MNL(block)) {
+#ifdef HDAFG_HDMI_DEBUG
 		printf(" MNL=%u\n", ELD_MNL(block));
+#endif
 		return EINVAL;
 	}
 
@@ -85,10 +93,12 @@ hdafg_dd_parse_info(uint8_t *data, size_
 	datalen -= ELD_MNL(block);
 
 	if (datalen != ELD_SAD_COUNT(block) * sizeof(hdi->sad[0])) {
+#ifdef HDAFG_HDMI_DEBUG
 		printf(" datalen %u sadcount %u sizeof sad %u\n",
 		(unsigned int)datalen,
 		ELD_SAD_COUNT(block),
 		(unsigned int)sizeof(hdi->sad[0]));
+#endif
 		return EINVAL;
 	}
 	hdi->nsad = ELD_SAD_COUNT(block);
@@ -98,7 +108,9 @@ hdafg_dd_parse_info(uint8_t *data, size_
 		datalen -= sizeof(hdi->sad[i]);
 	}
 
+#ifdef HDAFG_HDMI_DEBUG
 	printf("datalen = %u\n", (unsigned int)datalen);
+#endif
 	KASSERT(datalen == 0);
 
 	return 0;



CVS commit: src/sys/dev/hdaudio

2017-04-18 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Tue Apr 18 16:30:21 UTC 2017

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
remove redundant assignments
nchan is overwritten before it is used in all cases. so is i.

from clang static analyzer
ok riastradh


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 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.



CVS commit: src/sys/dev/hdaudio

2017-04-18 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Tue Apr 18 16:30:21 UTC 2017

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
remove redundant assignments
nchan is overwritten before it is used in all cases. so is i.

from clang static analyzer
ok riastradh


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 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.10 src/sys/dev/hdaudio/hdafg.c:1.11
--- src/sys/dev/hdaudio/hdafg.c:1.10	Tue Oct 25 09:15:55 2016
+++ src/sys/dev/hdaudio/hdafg.c	Tue Apr 18 16:30:21 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: hdafg.c,v 1.10 2016/10/25 09:15:55 pgoyette Exp $ */
+/* $NetBSD: hdafg.c,v 1.11 2017/04/18 16:30:21 maya Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd 
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.10 2016/10/25 09:15:55 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.11 2017/04/18 16:30:21 maya Exp $");
 
 #include 
 #include 
@@ -1468,7 +1468,6 @@ hdafg_disable_useless(struct hdafg_softc
 	do {
 		done = 1;
 		/* Disable and mute controls for disabled widgets */
-		i = 0;
 		for (i = 0; i < sc->sc_nctls; i++) {
 			ctl = >sc_ctls[i];
 			if (ctl->ctl_enable == false)
@@ -2790,7 +2789,6 @@ hdafg_assign_mixers(struct hdafg_softc *
 		}
 	}
 	/* Treat unrequired as possible */
-	i = 0;
 	for (i = 0; i < sc->sc_nctls; i++) {
 		ctl = >sc_ctls[i];
 		if (ctl->ctl_audiomask == 0)
@@ -3424,13 +3422,13 @@ hdafg_configure_encodings(struct hdafg_s
 
 	sc->sc_pchan = sc->sc_rchan = 0;
 
-	for (nchan = 0, i = 0; i < sc->sc_nassocs; i++) {
+	for (i = 0; i < sc->sc_nassocs; i++) {
 		nchan = hdafg_assoc_count_channels(sc, [i],
 		HDAUDIO_PINDIR_OUT);
 		if (nchan > sc->sc_pchan)
 			sc->sc_pchan = nchan;
 	}
-	for (nchan = 0, i = 0; i < sc->sc_nassocs; i++) {
+	for (i = 0; i < sc->sc_nassocs; i++) {
 		nchan = hdafg_assoc_count_channels(sc, [i],
 		HDAUDIO_PINDIR_IN);
 		if (nchan > sc->sc_rchan)



CVS commit: src/sys/dev/hdaudio

2016-10-25 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Tue Oct 25 09:15:55 UTC 2016

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
Replace numeric magic-number constant with something a bit more meaningful.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 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.9 src/sys/dev/hdaudio/hdafg.c:1.10
--- src/sys/dev/hdaudio/hdafg.c:1.9	Sun Nov 15 23:03:50 2015
+++ src/sys/dev/hdaudio/hdafg.c	Tue Oct 25 09:15:55 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: hdafg.c,v 1.9 2015/11/15 23:03:50 jmcneill Exp $ */
+/* $NetBSD: hdafg.c,v 1.10 2016/10/25 09:15:55 pgoyette Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd 
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.9 2015/11/15 23:03:50 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.10 2016/10/25 09:15:55 pgoyette Exp $");
 
 #include 
 #include 
@@ -3663,7 +3663,7 @@ hdafg_attach(device_t parent, device_t s
 	struct hdafg_softc *sc = device_private(self);
 	audio_params_t defparams;
 	prop_dictionary_t args = opaque;
-	char vendor[16], product[16];
+	char vendor[MAX_AUDIO_DEV_LEN], product[MAX_AUDIO_DEV_LEN];
 	uint64_t fgptr = 0;
 	uint32_t astype = 0;
 	uint8_t nid = 0;



CVS commit: src/sys/dev/hdaudio

2016-10-25 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Tue Oct 25 09:15:55 UTC 2016

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
Replace numeric magic-number constant with something a bit more meaningful.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 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.



CVS commit: src/sys/dev/hdaudio

2015-12-23 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Dec 23 12:45:06 UTC 2015

Modified Files:
src/sys/dev/hdaudio: hdaudio.c hdaudiovar.h

Log Message:
get rid of HDAUDIO_FLAG_NO_STREAM_RESET hack


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/hdaudio/hdaudio.c
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/hdaudio/hdaudiovar.h

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/hdaudio.c
diff -u src/sys/dev/hdaudio/hdaudio.c:1.3 src/sys/dev/hdaudio/hdaudio.c:1.4
--- src/sys/dev/hdaudio/hdaudio.c:1.3	Sun Jul 26 17:54:33 2015
+++ src/sys/dev/hdaudio/hdaudio.c	Wed Dec 23 12:45:06 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: hdaudio.c,v 1.3 2015/07/26 17:54:33 jmcneill Exp $ */
+/* $NetBSD: hdaudio.c,v 1.4 2015/12/23 12:45:06 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd 
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hdaudio.c,v 1.3 2015/07/26 17:54:33 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdaudio.c,v 1.4 2015/12/23 12:45:06 jmcneill Exp $");
 
 #include 
 #include 
@@ -1215,8 +1215,7 @@ hdaudio_stream_start(struct hdaudio_stre
 	KASSERT(st->st_bdl.dma_valid == true);
 
 	hdaudio_stream_stop(st);
-	if ((sc->sc_flags & HDAUDIO_FLAG_NO_STREAM_RESET) == 0)
-		hdaudio_stream_reset(st);
+	hdaudio_stream_reset(st);
 
 	/*
 	 * Configure buffer descriptor list

Index: src/sys/dev/hdaudio/hdaudiovar.h
diff -u src/sys/dev/hdaudio/hdaudiovar.h:1.4 src/sys/dev/hdaudio/hdaudiovar.h:1.5
--- src/sys/dev/hdaudio/hdaudiovar.h:1.4	Sun Jul 26 17:54:33 2015
+++ src/sys/dev/hdaudio/hdaudiovar.h	Wed Dec 23 12:45:06 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: hdaudiovar.h,v 1.4 2015/07/26 17:54:33 jmcneill Exp $ */
+/* $NetBSD: hdaudiovar.h,v 1.5 2015/12/23 12:45:06 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd 
@@ -157,9 +157,6 @@ struct hdaudio_softc {
 	struct hdaudio_stream	sc_stream[HDAUDIO_MAX_STREAMS];
 	uint32_t		sc_stream_mask;
 	kmutex_t		sc_stream_mtx;
-
-	uint32_t		sc_flags;
-#define HDAUDIO_FLAG_NO_STREAM_RESET	0x0001
 };
 
 int	hdaudio_attach(device_t, struct hdaudio_softc *);



CVS commit: src/sys/dev/hdaudio

2015-12-23 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Dec 23 12:45:06 UTC 2015

Modified Files:
src/sys/dev/hdaudio: hdaudio.c hdaudiovar.h

Log Message:
get rid of HDAUDIO_FLAG_NO_STREAM_RESET hack


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/hdaudio/hdaudio.c
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/hdaudio/hdaudiovar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/hdaudio

2015-11-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Nov 15 23:03:50 UTC 2015

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
disable data island packet transmission on Tegra124 HDMI codec


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 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.



CVS commit: src/sys/dev/hdaudio

2015-11-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Nov 15 23:03:50 UTC 2015

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
disable data island packet transmission on Tegra124 HDMI codec


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 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.8 src/sys/dev/hdaudio/hdafg.c:1.9
--- src/sys/dev/hdaudio/hdafg.c:1.8	Wed Nov  4 21:04:11 2015
+++ src/sys/dev/hdaudio/hdafg.c	Sun Nov 15 23:03:50 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: hdafg.c,v 1.8 2015/11/04 21:04:11 christos Exp $ */
+/* $NetBSD: hdafg.c,v 1.9 2015/11/15 23:03:50 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd 
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.8 2015/11/04 21:04:11 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.9 2015/11/15 23:03:50 jmcneill Exp $");
 
 #include 
 #include 
@@ -329,6 +329,7 @@ struct hdafg_softc {
 	struct hdaudio_audiodev		sc_audiodev;
 
 	uint16_t			sc_fixed_rate;
+	boolsc_disable_dip;
 };
 
 static int	hdafg_match(device_t, cfdata_t, void *);
@@ -3112,6 +3113,9 @@ hdafg_stream_connect_hdmi(struct hdafg_s
 	hdaudio_command(sc->sc_codec, w->w_nid,
 	CORB_SET_HDMI_DIP_XMIT_CTRL, COP_DIP_XMIT_CTRL_DISABLE);
 
+	if (sc->sc_disable_dip)
+		return;
+
 	/* build new infoframe */
 	if (as->as_digital == HDAFG_AS_HDMI) {
 		dip = (uint8_t *)
@@ -3696,6 +3700,7 @@ hdafg_attach(device_t parent, device_t s
 		switch (sc->sc_product) {
 		case HDAUDIO_PRODUCT_NVIDIA_TEGRA124_HDMI:
 			sc->sc_fixed_rate = 44100;
+			sc->sc_disable_dip = true;
 			break;
 		}
 		break;



CVS commit: src/sys/dev/hdaudio

2015-11-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Nov  4 21:04:11 UTC 2015

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
mute the mixer with that has input children


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 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.7 src/sys/dev/hdaudio/hdafg.c:1.8
--- src/sys/dev/hdaudio/hdafg.c:1.7	Wed Nov  4 13:10:49 2015
+++ src/sys/dev/hdaudio/hdafg.c	Wed Nov  4 16:04:11 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: hdafg.c,v 1.7 2015/11/04 18:10:49 christos Exp $ */
+/* $NetBSD: hdafg.c,v 1.8 2015/11/04 21:04:11 christos Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd 
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.7 2015/11/04 18:10:49 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.8 2015/11/04 21:04:11 christos Exp $");
 
 #include 
 #include 
@@ -2049,32 +2049,36 @@ hdafg_prepare_pin_controls(struct hdafg_
 	}
 }
 
+#if defined(HDAFG_DEBUG) && HDAFG_DEBUG > 1
 static void
-hdafg_dump(struct hdafg_softc *sc)
+hdafg_dump_ctl(const struct hdafg_softc *sc, const struct hdaudio_control *ctl)
 {
-#if defined(HDAFG_DEBUG) && HDAFG_DEBUG > 1
-	struct hdaudio_control *ctl;
-	int i, type;
+	int type = ctl->ctl_widget ? ctl->ctl_widget->w_type : -1;
+	int i = (int)(ctl - sc->sc_ctls);
 
-	for (i = 0; i < sc->sc_nctls; i++) {
-		ctl = >sc_ctls[i];
-		type = (ctl->ctl_widget ? ctl->ctl_widget->w_type : -1);
-		hda_print(sc, "%03X: nid %02X type %d %s (%s) index %d",
-		i, (ctl->ctl_widget ? ctl->ctl_widget->w_nid : -1), type,
-		(ctl->ctl_ndir == HDAUDIO_PINDIR_IN) ? "in " : "out",
-		(ctl->ctl_dir == HDAUDIO_PINDIR_IN) ? "in " : "out",
-		ctl->ctl_index);
-		if (ctl->ctl_childwidget)
-			hda_print1(sc, " cnid %02X",
-			ctl->ctl_childwidget->w_nid);
-		else
-			hda_print1(sc, "  ");
-		hda_print1(sc, "\n");
-		hda_print(sc, " mute: %d step: %3d size: %3d off: %3d%s\n",
-		ctl->ctl_mute, ctl->ctl_step, ctl->ctl_size,
-		ctl->ctl_offset,
-		(ctl->ctl_enable == false) ? " [DISABLED]" : "");
-	}
+	hda_print(sc, "%03X: nid %02X type %d %s (%s) index %d",
+	i, (ctl->ctl_widget ? ctl->ctl_widget->w_nid : -1), type,
+	ctl->ctl_ndir == HDAUDIO_PINDIR_IN ? "in " : "out",
+	ctl->ctl_dir == HDAUDIO_PINDIR_IN ? "in " : "out",
+	ctl->ctl_index);
+
+	if (ctl->ctl_childwidget)
+		hda_print1(sc, " cnid %02X", ctl->ctl_childwidget->w_nid);
+	else
+		hda_print1(sc, "  ");
+	hda_print1(sc, "\n");
+	hda_print(sc, " mute: %d step: %3d size: %3d off: %3d%s\n",
+	ctl->ctl_mute, ctl->ctl_step, ctl->ctl_size,
+	ctl->ctl_offset, ctl->ctl_enable == false ? " [DISABLED]" : "");
+}
+#endif
+
+static void
+hdafg_dump(const struct hdafg_softc *sc)
+{
+#if defined(HDAFG_DEBUG) && HDAFG_DEBUG > 1
+	for (int i = 0; i < sc->sc_nctls; i++)
+		hdafg_dump_ctl(sc, >sc_ctls[i]);
 #endif
 }
 
@@ -2352,18 +2356,32 @@ hdafg_control_amp_set(struct hdaudio_con
 		hdafg_control_amp_set1(ctl, lmute, rmute, left, right, 1);
 }
 
+/*
+ * Muting the input pins directly does not work, we mute the mixers which
+ * are parents to them
+ */
 static bool
-hdafg_widget_is_input(const struct hdafg_softc *sc,
-const struct hdaudio_widget *w)
+hdafg_mixer_child_is_input(const struct hdafg_softc *sc,
+const struct hdaudio_control *ctl)
 {
+	const struct hdaudio_widget *w;
 	const struct hdaudio_assoc *as = sc->sc_assocs;
 
-	switch (w->w_type) {
+	switch (ctl->ctl_widget->w_type) {
 	case COP_AWCAP_TYPE_AUDIO_INPUT:
 		return true;
-	case COP_AWCAP_TYPE_PIN_COMPLEX:
+
+	case COP_AWCAP_TYPE_AUDIO_MIXER:
+		w = ctl->ctl_childwidget;
+		if (w == NULL)
+			return false;
+
+		if (w->w_type != COP_AWCAP_TYPE_PIN_COMPLEX)
+			return false;
+
 		if (as[w->w_bindas].as_dir == HDAUDIO_PINDIR_OUT)
 			return false;
+
 		switch (COP_CFG_DEFAULT_DEVICE(w->w_pin.config)) {
 		case COP_DEVICE_MIC_IN:
 		case COP_DEVICE_LINE_IN:
@@ -2373,6 +2391,7 @@ hdafg_widget_is_input(const struct hdafg
 		default:
 			return false;
 		}
+
 	default:
 		return false;
 	}
@@ -2394,8 +2413,7 @@ hdafg_control_commit(struct hdafg_softc 
 		if (z > ctl->ctl_step)
 			z = ctl->ctl_step;
 
-		if ((ctl->ctl_dir & HDAUDIO_PINDIR_IN) &&
-		hdafg_widget_is_input(sc, ctl->ctl_widget))
+		if (hdafg_mixer_child_is_input(sc, ctl))
 			hdafg_control_amp_set(ctl, HDAUDIO_AMP_MUTE_ALL, z, z);
 		else
 			hdafg_control_amp_set(ctl, HDAUDIO_AMP_MUTE_NONE, z, z);



CVS commit: src/sys/dev/hdaudio

2015-11-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Nov  4 21:04:11 UTC 2015

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
mute the mixer with that has input children


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 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.



CVS commit: src/sys/dev/hdaudio

2015-11-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Nov  4 14:11:09 UTC 2015

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
Startup with the mic muted to avoid feedback and spying.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 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.3 src/sys/dev/hdaudio/hdafg.c:1.4
--- src/sys/dev/hdaudio/hdafg.c:1.3	Sun Jul 26 15:06:26 2015
+++ src/sys/dev/hdaudio/hdafg.c	Wed Nov  4 09:11:09 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: hdafg.c,v 1.3 2015/07/26 19:06:26 jmcneill Exp $ */
+/* $NetBSD: hdafg.c,v 1.4 2015/11/04 14:11:09 christos Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd 
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.3 2015/07/26 19:06:26 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.4 2015/11/04 14:11:09 christos Exp $");
 
 #include 
 #include 
@@ -2367,7 +2367,10 @@ hdafg_control_commit(struct hdafg_softc 
 		z = ctl->ctl_offset;
 		if (z > ctl->ctl_step)
 			z = ctl->ctl_step;
-		hdafg_control_amp_set(ctl, HDAUDIO_AMP_MUTE_NONE, z, z);
+		if (ctl->ctl_dir & HDAUDIO_PINDIR_IN)
+			hdafg_control_amp_set(ctl, HDAUDIO_AMP_MUTE_ALL, z, z);
+		else
+			hdafg_control_amp_set(ctl, HDAUDIO_AMP_MUTE_NONE, z, z);
 	}
 }
 



CVS commit: src/sys/dev/hdaudio

2015-11-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Nov  4 15:01:56 UTC 2015

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
be more selective and mute only mic's. Suggested by jmcneill


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 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.



CVS commit: src/sys/dev/hdaudio

2015-11-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Nov  4 14:11:09 UTC 2015

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
Startup with the mic muted to avoid feedback and spying.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 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.



CVS commit: src/sys/dev/hdaudio

2015-11-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Nov  4 15:01:56 UTC 2015

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
be more selective and mute only mic's. Suggested by jmcneill


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 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.4 src/sys/dev/hdaudio/hdafg.c:1.5
--- src/sys/dev/hdaudio/hdafg.c:1.4	Wed Nov  4 09:11:09 2015
+++ src/sys/dev/hdaudio/hdafg.c	Wed Nov  4 10:01:56 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: hdafg.c,v 1.4 2015/11/04 14:11:09 christos Exp $ */
+/* $NetBSD: hdafg.c,v 1.5 2015/11/04 15:01:56 christos Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd 
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.4 2015/11/04 14:11:09 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.5 2015/11/04 15:01:56 christos Exp $");
 
 #include 
 #include 
@@ -2367,7 +2367,8 @@ hdafg_control_commit(struct hdafg_softc 
 		z = ctl->ctl_offset;
 		if (z > ctl->ctl_step)
 			z = ctl->ctl_step;
-		if (ctl->ctl_dir & HDAUDIO_PINDIR_IN)
+		if ((ctl->ctl_dir & HDAUDIO_PINDIR_IN) &&
+		ctl->ctl_widget->w_type == COP_AWCAP_TYPE_AUDIO_INPUT)
 			hdafg_control_amp_set(ctl, HDAUDIO_AMP_MUTE_ALL, z, z);
 		else
 			hdafg_control_amp_set(ctl, HDAUDIO_AMP_MUTE_NONE, z, z);



CVS commit: src/sys/dev/hdaudio

2015-11-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Nov  4 18:04:28 UTC 2015

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
more complex version to determine what is an input.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 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.5 src/sys/dev/hdaudio/hdafg.c:1.6
--- src/sys/dev/hdaudio/hdafg.c:1.5	Wed Nov  4 10:01:56 2015
+++ src/sys/dev/hdaudio/hdafg.c	Wed Nov  4 13:04:28 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: hdafg.c,v 1.5 2015/11/04 15:01:56 christos Exp $ */
+/* $NetBSD: hdafg.c,v 1.6 2015/11/04 18:04:28 christos Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd 
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.5 2015/11/04 15:01:56 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.6 2015/11/04 18:04:28 christos Exp $");
 
 #include 
 #include 
@@ -2352,6 +2352,32 @@ hdafg_control_amp_set(struct hdaudio_con
 		hdafg_control_amp_set1(ctl, lmute, rmute, left, right, 1);
 }
 
+static bool
+hdafg_widget_is_input(const struct hdafg_softc *sc,
+const struct hdaudio_widget *w)
+{
+	const struct hdaudio_assoc *as = sc->sc_assocs;
+
+	switch (w->w_type) {
+	case COP_AWCAP_TYPE_AUDIO_INPUT:
+		return true;
+	case COP_AWCAP_TYPE_PIN_COMPLEX:
+		if (as[w->w_bindas].as_dir == HDAUDIO_PINDIR_OUT)
+			return false;
+		switch (COP_CFG_DEFAULT_DEVICE(w->w_pin.config)) {
+		case COP_DEVICE_MIC_IN:
+		case COP_DEVICE_LINE_IN:
+		case COP_DEVICE_SPDIF_IN:
+		case COP_DEVICE_DIGITAL_OTHER_IN:
+			return true;
+		default:
+			return false;
+		}
+	default:
+		return false;
+	}
+}
+
 static void
 hdafg_control_commit(struct hdafg_softc *sc)
 {
@@ -2367,8 +2393,9 @@ hdafg_control_commit(struct hdafg_softc 
 		z = ctl->ctl_offset;
 		if (z > ctl->ctl_step)
 			z = ctl->ctl_step;
+
 		if ((ctl->ctl_dir & HDAUDIO_PINDIR_IN) &&
-		ctl->ctl_widget->w_type == COP_AWCAP_TYPE_AUDIO_INPUT)
+		hdafg_widget_is_input(sc, ctl->ctl_widget))
 			hdafg_control_amp_set(ctl, HDAUDIO_AMP_MUTE_ALL, z, z);
 		else
 			hdafg_control_amp_set(ctl, HDAUDIO_AMP_MUTE_NONE, z, z);



CVS commit: src/sys/dev/hdaudio

2015-11-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Nov  4 18:04:28 UTC 2015

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
more complex version to determine what is an input.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 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.



CVS commit: src/sys/dev/hdaudio

2015-11-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Nov  4 18:10:49 UTC 2015

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
Remove trailing and stray whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 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.6 src/sys/dev/hdaudio/hdafg.c:1.7
--- src/sys/dev/hdaudio/hdafg.c:1.6	Wed Nov  4 13:04:28 2015
+++ src/sys/dev/hdaudio/hdafg.c	Wed Nov  4 13:10:49 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: hdafg.c,v 1.6 2015/11/04 18:04:28 christos Exp $ */
+/* $NetBSD: hdafg.c,v 1.7 2015/11/04 18:10:49 christos Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd 
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.6 2015/11/04 18:04:28 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.7 2015/11/04 18:10:49 christos Exp $");
 
 #include 
 #include 
@@ -90,7 +90,7 @@ __KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.
 #include "hdmireg.h"
 
 #ifndef AUFMT_SURROUND_7_1
-#define	AUFMT_SURROUND_7_1 (AUFMT_DOLBY_5_1|AUFMT_SIDE_LEFT|AUFMT_SIDE_RIGHT)
+#define AUFMT_SURROUND_7_1 (AUFMT_DOLBY_5_1|AUFMT_SIDE_LEFT|AUFMT_SIDE_RIGHT)
 #endif
 
 #if defined(HDAFG_DEBUG)
@@ -99,24 +99,24 @@ static int hdafg_debug = HDAFG_DEBUG;
 static int hdafg_debug = 0;
 #endif
 
-#define	hda_debug(sc, ...)		\
+#define hda_debug(sc, ...)		\
 	if (hdafg_debug) hda_print(sc, __VA_ARGS__)
-#define	hda_debug1(sc, ...)		\
+#define hda_debug1(sc, ...)		\
 	if (hdafg_debug) hda_print1(sc, __VA_ARGS__)
 
 #define HDAUDIO_MIXER_CLASS_OUTPUTS	0
-#define	HDAUDIO_MIXER_CLASS_INPUTS	1
-#define	HDAUDIO_MIXER_CLASS_RECORD	2
-#define	HDAUDIO_MIXER_CLASS_LAST	HDAUDIO_MIXER_CLASS_RECORD
-
-#define	HDAUDIO_GPIO_MASK	0
-#define	HDAUDIO_GPIO_DIR	1
-#define	HDAUDIO_GPIO_DATA	2
+#define HDAUDIO_MIXER_CLASS_INPUTS	1
+#define HDAUDIO_MIXER_CLASS_RECORD	2
+#define HDAUDIO_MIXER_CLASS_LAST	HDAUDIO_MIXER_CLASS_RECORD
+
+#define HDAUDIO_GPIO_MASK	0
+#define HDAUDIO_GPIO_DIR	1
+#define HDAUDIO_GPIO_DATA	2
 
-#define	HDAUDIO_UNSOLTAG_EVENT_HP	0x01
-#define	HDAUDIO_UNSOLTAG_EVENT_DD	0x02
+#define HDAUDIO_UNSOLTAG_EVENT_HP	0x01
+#define HDAUDIO_UNSOLTAG_EVENT_DD	0x02
 
-#define	HDAUDIO_HP_SENSE_PERIOD		hz
+#define HDAUDIO_HP_SENSE_PERIOD		hz
 
 const u_int hdafg_possible_rates[] = {
 	8000, 11025, 16000, 22050, 32000, 44100,
@@ -168,21 +168,21 @@ static const char *hdafg_color[] = {
 	"Other"
 };
 
-#define	HDAUDIO_MAXFORMATS	24
-#define	HDAUDIO_MAXCONNECTIONS	32
-#define	HDAUDIO_MAXPINS		16
-#define	HDAUDIO_PARSE_MAXDEPTH	10
-
-#define	HDAUDIO_AMP_VOL_DEFAULT	(-1)
-#define	HDAUDIO_AMP_MUTE_DEFAULT (0x)
-#define	HDAUDIO_AMP_MUTE_NONE	0
-#define	HDAUDIO_AMP_MUTE_LEFT	(1 << 0)
-#define	HDAUDIO_AMP_MUTE_RIGHT	(1 << 1)
-#define	HDAUDIO_AMP_MUTE_ALL	(HDAUDIO_AMP_MUTE_LEFT | HDAUDIO_AMP_MUTE_RIGHT)
-#define	HDAUDIO_AMP_LEFT_MUTED(x)	((x) & HDAUDIO_AMP_MUTE_LEFT)
-#define	HDAUDIO_AMP_RIGHT_MUTED(x)	(((x) & HDAUDIO_AMP_MUTE_RIGHT) >> 1)
+#define HDAUDIO_MAXFORMATS	24
+#define HDAUDIO_MAXCONNECTIONS	32
+#define HDAUDIO_MAXPINS		16
+#define HDAUDIO_PARSE_MAXDEPTH	10
+
+#define HDAUDIO_AMP_VOL_DEFAULT (-1)
+#define HDAUDIO_AMP_MUTE_DEFAULT (0x)
+#define HDAUDIO_AMP_MUTE_NONE	0
+#define HDAUDIO_AMP_MUTE_LEFT	(1 << 0)
+#define HDAUDIO_AMP_MUTE_RIGHT	(1 << 1)
+#define HDAUDIO_AMP_MUTE_ALL	(HDAUDIO_AMP_MUTE_LEFT | HDAUDIO_AMP_MUTE_RIGHT)
+#define HDAUDIO_AMP_LEFT_MUTED(x)	((x) & HDAUDIO_AMP_MUTE_LEFT)
+#define HDAUDIO_AMP_RIGHT_MUTED(x)	(((x) & HDAUDIO_AMP_MUTE_RIGHT) >> 1)
 
-#define	HDAUDIO_ADC_MONITOR	1
+#define HDAUDIO_ADC_MONITOR	1
 
 enum hdaudio_pindir {
 	HDAUDIO_PINDIR_NONE = 0,
@@ -191,10 +191,10 @@ enum hdaudio_pindir {
 	HDAUDIO_PINDIR_INOUT = 3,
 };
 
-#define	hda_get_param(sc, cop)	\
+#define hda_get_param(sc, cop)	\
 	hdaudio_command((sc)->sc_codec, (sc)->sc_nid,		\
 	  CORB_GET_PARAMETER, COP_##cop)
-#define	hda_get_wparam(w, cop)	\
+#define hda_get_wparam(w, cop)	\
 	hdaudio_command((w)->w_afg->sc_codec, (w)->w_nid,	\
 	  CORB_GET_PARAMETER, COP_##cop)
 
@@ -206,10 +206,10 @@ struct hdaudio_assoc {
 	u_char			as_pincnt;
 	u_char			as_fakeredir;
 	int			as_digital;
-#define	HDAFG_AS_ANALOG		0
-#define	HDAFG_AS_SPDIF		1
-#define	HDAFG_AS_HDMI		2
-#define	HDAFG_AS_DISPLAYPORT	3
+#define HDAFG_AS_ANALOG		0
+#define HDAFG_AS_SPDIF		1
+#define HDAFG_AS_HDMI		2
+#define HDAFG_AS_DISPLAYPORT	3
 	bool			as_displaydev;
 	int			as_hpredir;
 	int			as_pins[HDAUDIO_MAXPINS];
@@ -261,7 +261,7 @@ struct hdaudio_control {
 	uint32_t		ctl_audiomask, ctl_paudiomask;
 };
 
-#define	HDAUDIO_CONTROL_GIVE(ctl)	((ctl)->ctl_step ? 1 : 0)
+#define HDAUDIO_CONTROL_GIVE(ctl)	((ctl)->ctl_step ? 1 : 0)
 
 struct hdaudio_mixer {
 	struct hdaudio_control		*mx_ctl;
@@ -483,11 +483,11 @@ hdafg_widget_connection_parse(struct hda
 	maxconns = 

CVS commit: src/sys/dev/hdaudio

2015-11-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Nov  4 18:10:49 UTC 2015

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
Remove trailing and stray whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 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.



CVS commit: src/sys/dev/hdaudio

2015-07-26 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul 26 19:06:26 UTC 2015

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
- Support multi-channel ( 2) output to HDMI sinks.
- Fix a bug in hdafg_set_params that could program converters using the
  wrong audio_params_t if auconv is in use
- Force Tegra124 HDMI codec to a fixed rate 44.1kHz


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 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.



CVS commit: src/sys/dev/hdaudio

2015-07-26 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul 26 17:54:33 UTC 2015

Modified Files:
src/sys/dev/hdaudio: hdaudio.c hdaudiovar.h

Log Message:
Skip stream reset if HDAUDIO_FLAG_NO_STREAM_RESET flag is set.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/hdaudio/hdaudio.c
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/hdaudio/hdaudiovar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



  1   2   >