亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? hda_generic.c

?? linux-2.6.15.6
?? C
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
/* * Universal Interface for Intel High Definition Audio Codec * * Generic widget tree parser * * Copyright (c) 2004 Takashi Iwai <tiwai@suse.de> * *  This driver is free software; you can redistribute it and/or modify *  it under the terms of the GNU General Public License as published by *  the Free Software Foundation; either version 2 of the License, or *  (at your option) any later version. * *  This driver is distributed in the hope that it will be useful, *  but WITHOUT ANY WARRANTY; without even the implied warranty of *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the *  GNU General Public License for more details. * *  You should have received a copy of the GNU General Public License *  along with this program; if not, write to the Free Software *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA */#include <sound/driver.h>#include <linux/init.h>#include <linux/slab.h>#include <linux/pci.h>#include <sound/core.h>#include "hda_codec.h"#include "hda_local.h"/* widget node for parsing */struct hda_gnode {	hda_nid_t nid;		/* NID of this widget */	unsigned short nconns;	/* number of input connections */	hda_nid_t conn_list[HDA_MAX_CONNECTIONS]; /* input connections */	unsigned int wid_caps;	/* widget capabilities */	unsigned char type;	/* widget type */	unsigned char pin_ctl;	/* pin controls */	unsigned char checked;	/* the flag indicates that the node is already parsed */	unsigned int pin_caps;	/* pin widget capabilities */	unsigned int def_cfg;	/* default configuration */	unsigned int amp_out_caps;	/* AMP out capabilities */	unsigned int amp_in_caps;	/* AMP in capabilities */	struct list_head list;};/* patch-specific record */struct hda_gspec {	struct hda_gnode *dac_node;	/* DAC node */	struct hda_gnode *out_pin_node;	/* Output pin (Line-Out) node */	struct hda_gnode *pcm_vol_node;	/* Node for PCM volume */	unsigned int pcm_vol_index;	/* connection of PCM volume */	struct hda_gnode *adc_node;	/* ADC node */	struct hda_gnode *cap_vol_node;	/* Node for capture volume */	unsigned int cur_cap_src;	/* current capture source */	struct hda_input_mux input_mux;	char cap_labels[HDA_MAX_NUM_INPUTS][16];	unsigned int def_amp_in_caps;	unsigned int def_amp_out_caps;	struct hda_pcm pcm_rec;		/* PCM information */	struct list_head nid_list;	/* list of widgets */};/* * retrieve the default device type from the default config value */#define defcfg_type(node) (((node)->def_cfg & AC_DEFCFG_DEVICE) >> AC_DEFCFG_DEVICE_SHIFT)#define defcfg_location(node) (((node)->def_cfg & AC_DEFCFG_LOCATION) >> AC_DEFCFG_LOCATION_SHIFT)/* * destructor */static void snd_hda_generic_free(struct hda_codec *codec){	struct hda_gspec *spec = codec->spec;	struct list_head *p, *n;	if (! spec)		return;	/* free all widgets */	list_for_each_safe(p, n, &spec->nid_list) {		struct hda_gnode *node = list_entry(p, struct hda_gnode, list);		kfree(node);	}	kfree(spec);}/* * add a new widget node and read its attributes */static int add_new_node(struct hda_codec *codec, struct hda_gspec *spec, hda_nid_t nid){	struct hda_gnode *node;	int nconns;	node = kzalloc(sizeof(*node), GFP_KERNEL);	if (node == NULL)		return -ENOMEM;	node->nid = nid;	nconns = snd_hda_get_connections(codec, nid, node->conn_list, HDA_MAX_CONNECTIONS);	if (nconns < 0) {		kfree(node);		return nconns;	}	node->nconns = nconns;	node->wid_caps = snd_hda_param_read(codec, nid, AC_PAR_AUDIO_WIDGET_CAP);	node->type = (node->wid_caps & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT;	if (node->type == AC_WID_PIN) {		node->pin_caps = snd_hda_param_read(codec, node->nid, AC_PAR_PIN_CAP);		node->pin_ctl = snd_hda_codec_read(codec, node->nid, 0, AC_VERB_GET_PIN_WIDGET_CONTROL, 0);		node->def_cfg = snd_hda_codec_read(codec, node->nid, 0, AC_VERB_GET_CONFIG_DEFAULT, 0);	}	if (node->wid_caps & AC_WCAP_OUT_AMP) {		if (node->wid_caps & AC_WCAP_AMP_OVRD)			node->amp_out_caps = snd_hda_param_read(codec, node->nid, AC_PAR_AMP_OUT_CAP);		if (! node->amp_out_caps)			node->amp_out_caps = spec->def_amp_out_caps;	}	if (node->wid_caps & AC_WCAP_IN_AMP) {		if (node->wid_caps & AC_WCAP_AMP_OVRD)			node->amp_in_caps = snd_hda_param_read(codec, node->nid, AC_PAR_AMP_IN_CAP);		if (! node->amp_in_caps)			node->amp_in_caps = spec->def_amp_in_caps;	}	list_add_tail(&node->list, &spec->nid_list);	return 0;}/* * build the AFG subtree */static int build_afg_tree(struct hda_codec *codec){	struct hda_gspec *spec = codec->spec;	int i, nodes, err;	hda_nid_t nid;	snd_assert(spec, return -EINVAL);	spec->def_amp_out_caps = snd_hda_param_read(codec, codec->afg, AC_PAR_AMP_OUT_CAP);	spec->def_amp_in_caps = snd_hda_param_read(codec, codec->afg, AC_PAR_AMP_IN_CAP);	nodes = snd_hda_get_sub_nodes(codec, codec->afg, &nid);	if (! nid || nodes < 0) {		printk(KERN_ERR "Invalid AFG subtree\n");		return -EINVAL;	}	/* parse all nodes belonging to the AFG */	for (i = 0; i < nodes; i++, nid++) {		if ((err = add_new_node(codec, spec, nid)) < 0)			return err;	}	return 0;}/* * look for the node record for the given NID *//* FIXME: should avoid the braindead linear search */static struct hda_gnode *hda_get_node(struct hda_gspec *spec, hda_nid_t nid){	struct list_head *p;	struct hda_gnode *node;	list_for_each(p, &spec->nid_list) {		node = list_entry(p, struct hda_gnode, list);		if (node->nid == nid)			return node;	}	return NULL;}/* * unmute (and set max vol) the output amplifier */static int unmute_output(struct hda_codec *codec, struct hda_gnode *node){	unsigned int val, ofs;	snd_printdd("UNMUTE OUT: NID=0x%x\n", node->nid);	val = (node->amp_out_caps & AC_AMPCAP_NUM_STEPS) >> AC_AMPCAP_NUM_STEPS_SHIFT;	ofs = (node->amp_out_caps & AC_AMPCAP_OFFSET) >> AC_AMPCAP_OFFSET_SHIFT;	if (val >= ofs)		val -= ofs;	val |= AC_AMP_SET_LEFT | AC_AMP_SET_RIGHT;	val |= AC_AMP_SET_OUTPUT;	return snd_hda_codec_write(codec, node->nid, 0, AC_VERB_SET_AMP_GAIN_MUTE, val);}/* * unmute (and set max vol) the input amplifier */static int unmute_input(struct hda_codec *codec, struct hda_gnode *node, unsigned int index){	unsigned int val, ofs;	snd_printdd("UNMUTE IN: NID=0x%x IDX=0x%x\n", node->nid, index);	val = (node->amp_in_caps & AC_AMPCAP_NUM_STEPS) >> AC_AMPCAP_NUM_STEPS_SHIFT;	ofs = (node->amp_in_caps & AC_AMPCAP_OFFSET) >> AC_AMPCAP_OFFSET_SHIFT;	if (val >= ofs)		val -= ofs;	val |= AC_AMP_SET_LEFT | AC_AMP_SET_RIGHT;	val |= AC_AMP_SET_INPUT;	// awk added - fixed to allow unmuting of indexed amps	val |= index << AC_AMP_SET_INDEX_SHIFT;	return snd_hda_codec_write(codec, node->nid, 0, AC_VERB_SET_AMP_GAIN_MUTE, val);}/* * select the input connection of the given node. */static int select_input_connection(struct hda_codec *codec, struct hda_gnode *node,				   unsigned int index){	snd_printdd("CONNECT: NID=0x%x IDX=0x%x\n", node->nid, index);	return snd_hda_codec_write(codec, node->nid, 0, AC_VERB_SET_CONNECT_SEL, index);}/* * clear checked flag of each node in the node list */static void clear_check_flags(struct hda_gspec *spec){	struct list_head *p;	struct hda_gnode *node;	list_for_each(p, &spec->nid_list) {		node = list_entry(p, struct hda_gnode, list);		node->checked = 0;	}}/* * parse the output path recursively until reach to an audio output widget * * returns 0 if not found, 1 if found, or a negative error code. */static int parse_output_path(struct hda_codec *codec, struct hda_gspec *spec,			     struct hda_gnode *node){	int i, err;	struct hda_gnode *child;	if (node->checked)		return 0;	node->checked = 1;	if (node->type == AC_WID_AUD_OUT) {		if (node->wid_caps & AC_WCAP_DIGITAL) {			snd_printdd("Skip Digital OUT node %x\n", node->nid);			return 0;		}		snd_printdd("AUD_OUT found %x\n", node->nid);		if (spec->dac_node) {			/* already DAC node is assigned, just unmute & connect */			return node == spec->dac_node;		}		spec->dac_node = node;		if (node->wid_caps & AC_WCAP_OUT_AMP) {			spec->pcm_vol_node = node;			spec->pcm_vol_index = 0;		}		return 1; /* found */	}	for (i = 0; i < node->nconns; i++) {		child = hda_get_node(spec, node->conn_list[i]);		if (! child)			continue;		err = parse_output_path(codec, spec, child);		if (err < 0)			return err;		else if (err > 0) {			/* found one,			 * select the path, unmute both input and output			 */			if (node->nconns > 1)				select_input_connection(codec, node, i);			unmute_input(codec, node, i);			unmute_output(codec, node);			if (! spec->pcm_vol_node) {				if (node->wid_caps & AC_WCAP_IN_AMP) {					spec->pcm_vol_node = node;					spec->pcm_vol_index = i;				} else if (node->wid_caps & AC_WCAP_OUT_AMP) {					spec->pcm_vol_node = node;					spec->pcm_vol_index = 0;				}			}			return 1;		}	}	return 0;}/* * Look for the output PIN widget with the given jack type * and parse the output path to that PIN. * * Returns the PIN node when the path to DAC is established. */static struct hda_gnode *parse_output_jack(struct hda_codec *codec,					   struct hda_gspec *spec,					   int jack_type){	struct list_head *p;	struct hda_gnode *node;	int err;	list_for_each(p, &spec->nid_list) {		node = list_entry(p, struct hda_gnode, list);		if (node->type != AC_WID_PIN)			continue;		/* output capable? */		if (! (node->pin_caps & AC_PINCAP_OUT))			continue;		if (jack_type >= 0) {			if (jack_type != defcfg_type(node))				continue;			if (node->wid_caps & AC_WCAP_DIGITAL)				continue; /* skip SPDIF */		} else {			/* output as default? */			if (! (node->pin_ctl & AC_PINCTL_OUT_EN))				continue;		}		clear_check_flags(spec);		err = parse_output_path(codec, spec, node);		if (err < 0)			return NULL;		else if (err > 0) {			/* unmute the PIN output */			unmute_output(codec, node);			/* set PIN-Out enable */			snd_hda_codec_write(codec, node->nid, 0,					    AC_VERB_SET_PIN_WIDGET_CONTROL,					    AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN);			return node;		}	}	return NULL;}/* * parse outputs */static int parse_output(struct hda_codec *codec){	struct hda_gspec *spec = codec->spec;	struct hda_gnode *node;	/*	 * Look for the output PIN widget	 */	/* first, look for the line-out pin */	node = parse_output_jack(codec, spec, AC_JACK_LINE_OUT);	if (node) /* found, remember the PIN node */		spec->out_pin_node = node;	/* look for the HP-out pin */	node = parse_output_jack(codec, spec, AC_JACK_HP_OUT);	if (node) {		if (! spec->out_pin_node)			spec->out_pin_node = node;	}	if (! spec->out_pin_node) {		/* no line-out or HP pins found,		 * then choose for the first output pin		 */		spec->out_pin_node = parse_output_jack(codec, spec, -1);		if (! spec->out_pin_node)			snd_printd("hda_generic: no proper output path found\n");	}	return 0;}/* * input MUX *//* control callbacks */static int capture_source_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo){	struct hda_codec *codec = snd_kcontrol_chip(kcontrol);	struct hda_gspec *spec = codec->spec;	return snd_hda_input_mux_info(&spec->input_mux, uinfo);}static int capture_source_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol){	struct hda_codec *codec = snd_kcontrol_chip(kcontrol);	struct hda_gspec *spec = codec->spec;	ucontrol->value.enumerated.item[0] = spec->cur_cap_src;	return 0;}static int capture_source_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol){	struct hda_codec *codec = snd_kcontrol_chip(kcontrol);	struct hda_gspec *spec = codec->spec;	return snd_hda_input_mux_put(codec, &spec->input_mux, ucontrol,				     spec->adc_node->nid, &spec->cur_cap_src);}/* * return the string name of the given input PIN widget */static const char *get_input_type(struct hda_gnode *node, unsigned int *pinctl){	unsigned int location = defcfg_location(node);	switch (defcfg_type(node)) {	case AC_JACK_LINE_IN:		if ((location & 0x0f) == AC_JACK_LOC_FRONT)			return "Front Line";		return "Line";	case AC_JACK_CD:		if (pinctl)			*pinctl |= AC_PINCTL_VREF_GRD;		return "CD";	case AC_JACK_AUX:		if ((location & 0x0f) == AC_JACK_LOC_FRONT)			return "Front Aux";		return "Aux";	case AC_JACK_MIC_IN:		if ((location & 0x0f) == AC_JACK_LOC_FRONT)			return "Front Mic";		return "Mic";	case AC_JACK_SPDIF_IN:		return "SPDIF";	case AC_JACK_DIG_OTHER_IN:		return "Digital";	}	return NULL;}/* * parse the nodes recursively until reach to the input PIN * * returns 0 if not found, 1 if found, or a negative error code. */static int parse_adc_sub_nodes(struct hda_codec *codec, struct hda_gspec *spec,			       struct hda_gnode *node){	int i, err;

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
蜜臀av性久久久久蜜臀aⅴ| 麻豆一区二区三| 日韩欧美在线影院| heyzo一本久久综合| 午夜电影网一区| 国产片一区二区三区| 欧美精品久久久久久久多人混战 | 麻豆精品新av中文字幕| 自拍av一区二区三区| 欧美本精品男人aⅴ天堂| 在线观看国产日韩| 91福利视频在线| 99久久99久久精品免费看蜜桃| 91在线国产观看| 狠狠色丁香婷综合久久| 日韩—二三区免费观看av| 亚洲国产精品人人做人人爽| 亚洲丝袜美腿综合| 亚洲色图20p| 欧美刺激脚交jootjob| 国产精品中文字幕欧美| 青青草97国产精品免费观看无弹窗版| 亚洲视频免费在线| 中文字幕中文乱码欧美一区二区| 日韩一区二区三区av| 7777精品伊人久久久大香线蕉的 | 无吗不卡中文字幕| 午夜电影网亚洲视频| 日本欧美一区二区在线观看| 天天爽夜夜爽夜夜爽精品视频| 亚洲国产一区在线观看| 日韩综合一区二区| 精品系列免费在线观看| 国产一区福利在线| 成人精品gif动图一区| 色八戒一区二区三区| 在线观看免费视频综合| 欧美三级三级三级爽爽爽| 欧美久久久久中文字幕| 精品精品国产高清一毛片一天堂| 亚洲欧美一区二区三区国产精品| 亚洲伦理在线免费看| 青青草97国产精品免费观看无弹窗版| 精品亚洲porn| 在线看一区二区| 国产肉丝袜一区二区| 一区二区三区**美女毛片| 精品写真视频在线观看| 色欧美乱欧美15图片| 精品欧美乱码久久久久久1区2区 | 亚洲九九爱视频| 一区二区三区精品| 激情欧美日韩一区二区| 97久久超碰精品国产| 日韩精品中文字幕一区 | 亚洲国产精品久久一线不卡| 精品在线观看视频| 精品污污网站免费看| 1024成人网| 成av人片一区二区| 精品国产三级a在线观看| 一区二区三区不卡在线观看| 看片的网站亚洲| 91精品婷婷国产综合久久| 亚洲美女淫视频| av激情亚洲男人天堂| 国产精品无码永久免费888| 久久精品国产精品亚洲红杏| 欧美在线免费观看亚洲| 中文字幕字幕中文在线中不卡视频| 国产一区二区三区精品视频| 日韩视频一区二区在线观看| 日一区二区三区| 欧美另类久久久品| 日本欧美久久久久免费播放网| 欧美亚洲愉拍一区二区| 一区二区成人在线| 4438x成人网最大色成网站| 性久久久久久久久| 欧美一区二区免费| 777a∨成人精品桃花网| 国产日韩欧美一区二区三区乱码| 国产在线精品一区二区夜色| 欧美网站一区二区| 国产精品视频九色porn| 成人爱爱电影网址| 一区二区三区四区激情| 色欧美乱欧美15图片| 日韩精品一区第一页| 精品噜噜噜噜久久久久久久久试看| 美国十次了思思久久精品导航| 日韩午夜小视频| 成年人国产精品| 婷婷激情综合网| 国产丝袜在线精品| 在线观看亚洲精品| 国内精品不卡在线| 亚洲高清中文字幕| 国产欧美一区二区三区网站 | 欧美日韩国产综合视频在线观看| 日本强好片久久久久久aaa| 国产精品久久久久久亚洲毛片| 91国内精品野花午夜精品| 久久 天天综合| 亚洲一区二区三区四区五区黄| 欧美mv和日韩mv国产网站| 91视频免费看| 国产呦萝稀缺另类资源| 亚洲成人www| 亚洲精选视频免费看| 欧美国产一区二区在线观看| 这里是久久伊人| 91麻豆高清视频| 成人福利视频网站| 国产盗摄一区二区| 精品无人码麻豆乱码1区2区| 午夜精品福利一区二区三区av| 日韩电影免费一区| 亚洲综合一二三区| 国产午夜精品美女毛片视频| 色婷婷精品大视频在线蜜桃视频 | 精品国产一区二区三区久久久蜜月| 色呦呦国产精品| 99视频一区二区三区| 成人99免费视频| av亚洲产国偷v产偷v自拍| 国产成人免费在线观看| 福利91精品一区二区三区| 丁香网亚洲国际| 成人黄色大片在线观看| 成人av在线资源网站| 91偷拍与自偷拍精品| 在线看国产一区| 91精品国产一区二区三区香蕉| 欧美一区二区三区男人的天堂| 欧美绝品在线观看成人午夜影视| 欧美人妖巨大在线| 日韩精品中午字幕| 国产欧美一区二区三区网站| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 91久久精品日日躁夜夜躁欧美| 日本高清不卡一区| 91精品国产麻豆| 久久久蜜桃精品| 亚洲一区二区成人在线观看| 日本美女一区二区三区| 国产成人精品一区二区三区四区| 99综合影院在线| 日韩欧美国产电影| 亚洲国产成人一区二区三区| 一区二区三区视频在线看| 六月婷婷色综合| 欧美三级欧美一级| 国产精品情趣视频| 美女被吸乳得到大胸91| 91偷拍与自偷拍精品| 精品国产91乱码一区二区三区 | 另类调教123区 | 成人午夜短视频| 日韩女优av电影| 亚洲一区二区三区精品在线| 国产一区二区主播在线| 欧美一区二区三区喷汁尤物| 中文字幕一区二区三区乱码在线| 蜜臀精品久久久久久蜜臀 | 91精品国产色综合久久不卡电影| 国产欧美精品一区二区色综合朱莉| 亚洲第一狼人社区| 色88888久久久久久影院野外| 国产天堂亚洲国产碰碰| 韩国女主播成人在线观看| 在线成人免费视频| 亚洲精品福利视频网站| av中文字幕亚洲| 日韩美女视频一区二区| 风间由美一区二区三区在线观看| 久久亚洲精华国产精华液 | 蓝色福利精品导航| 欧美一区二区精美| 国内外精品视频| 久久久美女艺术照精彩视频福利播放| 久久国产精品第一页| 欧美一区二区成人| 久久99热99| 国产亚洲综合在线| 不卡影院免费观看| 国产精品不卡一区| 欧美日韩国产综合一区二区| 午夜不卡av在线| 日韩免费观看2025年上映的电影 | 欧美96一区二区免费视频| 欧美色图在线观看| 日本伊人精品一区二区三区观看方式| 91麻豆精品久久久久蜜臀| 狠狠色狠狠色合久久伊人| 国产精品少妇自拍| 欧美日韩一区久久| 国产一区二区在线免费观看| 国产日韩欧美精品一区| 色呦呦日韩精品|