socsvn commit: r306988 - soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve

iateaca at FreeBSD.org iateaca at FreeBSD.org
Sat Jul 30 14:38:11 UTC 2016


Author: iateaca
Date: Sat Jul 30 14:38:10 2016
New Revision: 306988
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=306988

Log:
  add one audio input node and one pin widget line-in nodes
  
  
  M    bhyve/hda_codec.c

Modified:
  soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve/hda_codec.c

Modified: soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve/hda_codec.c
==============================================================================
--- soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve/hda_codec.c	Sat Jul 30 11:17:36 2016	(r306987)
+++ soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve/hda_codec.c	Sat Jul 30 14:38:10 2016	(r306988)
@@ -16,9 +16,12 @@
 #define HDA_CODEC_FG_NID			0x01
 #define HDA_CODEC_AUDIO_OUTPUT_NID		0x02
 #define HDA_CODEC_PIN_OUTPUT_NID		0x03
+#define HDA_CODEC_AUDIO_INPUT_NID		0x04
+#define HDA_CODEC_PIN_INPUT_NID			0x05
 
-#define HDA_CODEC_STREAMS_COUNT			0x01
+#define HDA_CODEC_STREAMS_COUNT			0x02
 #define HDA_CODEC_STREAM_OUTPUT			0x00
+#define HDA_CODEC_STREAM_INPUT			0x01
 
 #define HDA_CODEC_PARAMS_COUNT			0x14
 #define HDA_CODEC_CONN_LIST_COUNT		0x01
@@ -47,14 +50,17 @@
 #define HDA_CODEC_FMT_CHAN_MASK			(0x0f << 0)
 
 #define HDA_CODEC_AUDIO_WCAP_OUTPUT		(0x00 << HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_SHIFT)
+#define HDA_CODEC_AUDIO_WCAP_INPUT		(0x01 << HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_SHIFT)
 #define HDA_CODEC_AUDIO_WCAP_PIN		(0x04 << HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_SHIFT)
 #define HDA_CODEC_AUDIO_WCAP_CONN_LIST		(1 << HDA_PARAM_AUDIO_WIDGET_CAP_CONN_LIST_SHIFT)
 #define HDA_CODEC_AUDIO_WCAP_FORMAT_OVR		(1 << HDA_PARAM_AUDIO_WIDGET_CAP_FORMAT_OVR_SHIFT)
 #define HDA_CODEC_AUDIO_WCAP_AMP_OVR		(1 << HDA_PARAM_AUDIO_WIDGET_CAP_AMP_OVR_SHIFT)
 #define HDA_CODEC_AUDIO_WCAP_OUT_AMP		(1 << HDA_PARAM_AUDIO_WIDGET_CAP_OUT_AMP_SHIFT)
+#define HDA_CODEC_AUDIO_WCAP_IN_AMP		(1 << HDA_PARAM_AUDIO_WIDGET_CAP_IN_AMP_SHIFT)
 #define HDA_CODEC_AUDIO_WCAP_STEREO		(1 << HDA_PARAM_AUDIO_WIDGET_CAP_STEREO_SHIFT)
 
 #define HDA_CODEC_PIN_CAP_OUTPUT		(1 << HDA_PARAM_PIN_CAP_OUTPUT_CAP_SHIFT)
+#define HDA_CODEC_PIN_CAP_INPUT			(1 << HDA_PARAM_PIN_CAP_INPUT_CAP_SHIFT)
 #define HDA_CODEC_PIN_CAP_PRESENCE_DETECT	(1 << HDA_PARAM_PIN_CAP_PRESENCE_DETECT_CAP_SHIFT)
 
 #define HDA_CODEC_OUTPUT_AMP_CAP_MUTE_CAP	(1 << HDA_PARAM_OUTPUT_AMP_CAP_MUTE_CAP_SHIFT)
@@ -67,8 +73,10 @@
 
 #define HDA_CODEC_PIN_SENSE_PRESENCE_PLUGGED	(1 << 31)
 #define HDA_CODEC_PIN_WIDGET_CTRL_OUT_ENABLE	(1 << HDA_CMD_GET_PIN_WIDGET_CTRL_OUT_ENABLE_SHIFT)
+#define HDA_CODEC_PIN_WIDGET_CTRL_IN_ENABLE	(1 << HDA_CMD_GET_PIN_WIDGET_CTRL_IN_ENABLE_SHIFT)
 
 #define HDA_CONFIG_DEFAULTCONF_COLOR_BLACK	(0x01 << HDA_CONFIG_DEFAULTCONF_COLOR_SHIFT)
+#define HDA_CONFIG_DEFAULTCONF_COLOR_RED	(0x05 << HDA_CONFIG_DEFAULTCONF_COLOR_SHIFT)
 
 #define HDA_CODEC_BUF_SIZE			HDA_FIFO_SIZE
 
@@ -175,7 +183,7 @@
 		[HDA_PARAM_SUB_NODE_COUNT] = 0x00010001,				/* 1 Subnode, StartNid = 1 */
 	},
 	[HDA_CODEC_FG_NID] = {
-		[HDA_PARAM_SUB_NODE_COUNT] = 0x00020002,				/* 2 Subnodes, StartNid = 2 */
+		[HDA_PARAM_SUB_NODE_COUNT] = 0x00020004,				/* 4 Subnodes, StartNid = 2 */
 		[HDA_PARAM_FCT_GRP_TYPE] = HDA_PARAM_FCT_GRP_TYPE_NODE_TYPE_AUDIO,
 		[HDA_PARAM_SUPP_PCM_SIZE_RATE] = (0x1f << 16) | 0x7ff,			/* B8 - B32, 8.0 - 192.0kHz */
 		[HDA_PARAM_SUPP_STREAM_FORMATS] = HDA_CODEC_SUPP_STREAM_FORMATS_PCM,
@@ -189,7 +197,7 @@
 						HDA_CODEC_AUDIO_WCAP_AMP_OVR |
 						HDA_CODEC_AUDIO_WCAP_OUT_AMP |
 						HDA_CODEC_AUDIO_WCAP_STEREO,
-		[HDA_PARAM_SUPP_PCM_SIZE_RATE] = (0x1a << 16) | 0x7ff,			/* B16, B24, B32; 8.0 - 192.0kHz */
+		[HDA_PARAM_SUPP_PCM_SIZE_RATE] = (0x02 << 16) | 0x7fc,			/* B16, 16.0 - 192.0kHz */
 		[HDA_PARAM_SUPP_STREAM_FORMATS] = HDA_CODEC_SUPP_STREAM_FORMATS_PCM,
 		[HDA_PARAM_INPUT_AMP_CAP] = 0x00,					/* None */
 		[HDA_PARAM_CONN_LIST_LENGTH] = 0x00,
@@ -208,12 +216,37 @@
 		[HDA_PARAM_CONN_LIST_LENGTH] = 0x01,
 		[HDA_PARAM_OUTPUT_AMP_CAP] = 0x00,					/* None */
 	},
+	[HDA_CODEC_AUDIO_INPUT_NID] = {
+		[HDA_PARAM_AUDIO_WIDGET_CAP] =	HDA_CODEC_AUDIO_WCAP_INPUT |
+						HDA_CODEC_AUDIO_WCAP_CONN_LIST |
+						HDA_CODEC_AUDIO_WCAP_FORMAT_OVR |
+						HDA_CODEC_AUDIO_WCAP_AMP_OVR |
+						HDA_CODEC_AUDIO_WCAP_IN_AMP |
+						HDA_CODEC_AUDIO_WCAP_STEREO,
+		[HDA_PARAM_SUPP_PCM_SIZE_RATE] = (0x02 << 16) | 0x7fc,			/* B16, 16.0 - 192.0kHz */
+		[HDA_PARAM_SUPP_STREAM_FORMATS] = HDA_CODEC_SUPP_STREAM_FORMATS_PCM,
+		[HDA_PARAM_OUTPUT_AMP_CAP] = 0x00,					/* None */
+		[HDA_PARAM_CONN_LIST_LENGTH] = 0x01,
+		[HDA_PARAM_INPUT_AMP_CAP] =	HDA_CODEC_OUTPUT_AMP_CAP_MUTE_CAP |
+						HDA_CODEC_OUTPUT_AMP_CAP_STEPSIZE |
+						HDA_CODEC_OUTPUT_AMP_CAP_NUMSTEPS |
+						HDA_CODEC_OUTPUT_AMP_CAP_OFFSET,
+	},
+	[HDA_CODEC_PIN_INPUT_NID] = {
+		[HDA_PARAM_AUDIO_WIDGET_CAP] =	HDA_CODEC_AUDIO_WCAP_PIN |
+						HDA_CODEC_AUDIO_WCAP_STEREO,
+		[HDA_PARAM_PIN_CAP] =		HDA_CODEC_PIN_CAP_INPUT |
+						HDA_CODEC_PIN_CAP_PRESENCE_DETECT,
+		[HDA_PARAM_INPUT_AMP_CAP] = 0x00,					/* None */
+		[HDA_PARAM_OUTPUT_AMP_CAP] = 0x00,					/* None */
+	},
 };
 
 #define HDA_CODEC_NODES_COUNT			(ARRAY_SIZE(hda_codec_parameters))
 
 static const uint8_t hda_codec_conn_list[HDA_CODEC_NODES_COUNT][HDA_CODEC_CONN_LIST_COUNT] = {
-	[HDA_CODEC_PIN_OUTPUT_NID] = {0x02},
+	[HDA_CODEC_PIN_OUTPUT_NID] = {HDA_CODEC_AUDIO_OUTPUT_NID},
+	[HDA_CODEC_AUDIO_INPUT_NID] = {HDA_CODEC_PIN_INPUT_NID},
 };
 
 static const uint32_t hda_codec_conf_default[HDA_CODEC_NODES_COUNT] = {
@@ -221,10 +254,15 @@
 						HDA_CONFIG_DEFAULTCONF_DEVICE_LINE_OUT |
 						HDA_CONFIG_DEFAULTCONF_COLOR_BLACK |
 						(0x01 << HDA_CONFIG_DEFAULTCONF_ASSOCIATION_SHIFT),
+	[HDA_CODEC_PIN_INPUT_NID] =		HDA_CONFIG_DEFAULTCONF_CONNECTIVITY_JACK |
+						HDA_CONFIG_DEFAULTCONF_DEVICE_LINE_IN |
+						HDA_CONFIG_DEFAULTCONF_COLOR_RED |
+						(0x02 << HDA_CONFIG_DEFAULTCONF_ASSOCIATION_SHIFT),
 };
 
 static const uint8_t hda_codec_pin_ctrl_default[HDA_CODEC_NODES_COUNT] = {
 	[HDA_CODEC_PIN_OUTPUT_NID] = HDA_CODEC_PIN_WIDGET_CTRL_OUT_ENABLE,
+	[HDA_CODEC_PIN_INPUT_NID] = HDA_CODEC_PIN_WIDGET_CTRL_IN_ENABLE,
 };
 
 static const verb_func_t hda_codec_verb_handlers[HDA_CODEC_NODES_COUNT] = {


More information about the svn-soc-all mailing list