aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_realtek.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-07-27 06:54:26 -0400
committerTakashi Iwai <tiwai@suse.de>2009-07-27 06:54:26 -0400
commita22d543a95e82e5ad0ee1a44aad54fd6b6bf52a8 (patch)
tree34ab56e73bd25338588a83e8e1b28e4ce94810b1 /sound/pci/hda/patch_realtek.c
parenta3daf68931679dbd96342099e4d61a99ba98315c (diff)
ALSA: hda - Introduce get_wcaps_type() macro
Add a helper macro to retrieve the widget type from wiget cap bits. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_realtek.c')
-rw-r--r--sound/pci/hda/patch_realtek.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index e1563f48243f..df87c01e27dd 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -415,7 +415,7 @@ static int alc_mux_enum_put(struct snd_kcontrol *kcontrol,
415 mux_idx = adc_idx >= spec->num_mux_defs ? 0 : adc_idx; 415 mux_idx = adc_idx >= spec->num_mux_defs ? 0 : adc_idx;
416 imux = &spec->input_mux[mux_idx]; 416 imux = &spec->input_mux[mux_idx];
417 417
418 type = (get_wcaps(codec, nid) & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT; 418 type = get_wcaps_type(get_wcaps(codec, nid));
419 if (type == AC_WID_AUD_MIX) { 419 if (type == AC_WID_AUD_MIX) {
420 /* Matrix-mixer style (e.g. ALC882) */ 420 /* Matrix-mixer style (e.g. ALC882) */
421 unsigned int *cur_val = &spec->cur_mux[adc_idx]; 421 unsigned int *cur_val = &spec->cur_mux[adc_idx];
@@ -4623,7 +4623,7 @@ static int patch_alc880(struct hda_codec *codec)
4623 /* check whether NID 0x07 is valid */ 4623 /* check whether NID 0x07 is valid */
4624 unsigned int wcap = get_wcaps(codec, alc880_adc_nids[0]); 4624 unsigned int wcap = get_wcaps(codec, alc880_adc_nids[0]);
4625 /* get type */ 4625 /* get type */
4626 wcap = (wcap & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT; 4626 wcap = get_wcaps_type(wcap);
4627 if (wcap != AC_WID_AUD_IN) { 4627 if (wcap != AC_WID_AUD_IN) {
4628 spec->adc_nids = alc880_adc_nids_alt; 4628 spec->adc_nids = alc880_adc_nids_alt;
4629 spec->num_adc_nids = ARRAY_SIZE(alc880_adc_nids_alt); 4629 spec->num_adc_nids = ARRAY_SIZE(alc880_adc_nids_alt);
@@ -6266,7 +6266,7 @@ static int patch_alc260(struct hda_codec *codec)
6266 if (!spec->adc_nids && spec->input_mux) { 6266 if (!spec->adc_nids && spec->input_mux) {
6267 /* check whether NID 0x04 is valid */ 6267 /* check whether NID 0x04 is valid */
6268 unsigned int wcap = get_wcaps(codec, 0x04); 6268 unsigned int wcap = get_wcaps(codec, 0x04);
6269 wcap = (wcap & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT; 6269 wcap = get_wcaps_type(wcap);
6270 /* get type */ 6270 /* get type */
6271 if (wcap != AC_WID_AUD_IN || spec->input_mux->num_items == 1) { 6271 if (wcap != AC_WID_AUD_IN || spec->input_mux->num_items == 1) {
6272 spec->adc_nids = alc260_adc_nids_alt; 6272 spec->adc_nids = alc260_adc_nids_alt;
@@ -9460,7 +9460,7 @@ static int alc882_parse_auto_config(struct hda_codec *codec)
9460 spec->init_verbs[0] = alc883_auto_init_verbs; 9460 spec->init_verbs[0] = alc883_auto_init_verbs;
9461 /* if ADC 0x07 is available, initialize it, too */ 9461 /* if ADC 0x07 is available, initialize it, too */
9462 wcap = get_wcaps(codec, 0x07); 9462 wcap = get_wcaps(codec, 0x07);
9463 wcap = (wcap & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT; 9463 wcap = get_wcaps_type(wcap);
9464 if (wcap == AC_WID_AUD_IN) 9464 if (wcap == AC_WID_AUD_IN)
9465 add_verb(spec, alc882_adc1_init_verbs); 9465 add_verb(spec, alc882_adc1_init_verbs);
9466 9466
@@ -9577,7 +9577,7 @@ static int patch_alc882(struct hda_codec *codec)
9577 hda_nid_t nid = alc882_adc_nids[i]; 9577 hda_nid_t nid = alc882_adc_nids[i];
9578 unsigned int wcap = get_wcaps(codec, nid); 9578 unsigned int wcap = get_wcaps(codec, nid);
9579 /* get type */ 9579 /* get type */
9580 wcap = (wcap & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT; 9580 wcap = get_wcaps_type(wcap);
9581 if (wcap != AC_WID_AUD_IN) 9581 if (wcap != AC_WID_AUD_IN)
9582 continue; 9582 continue;
9583 spec->private_adc_nids[spec->num_adc_nids] = nid; 9583 spec->private_adc_nids[spec->num_adc_nids] = nid;
@@ -11460,7 +11460,7 @@ static int patch_alc262(struct hda_codec *codec)
11460 unsigned int wcap = get_wcaps(codec, 0x07); 11460 unsigned int wcap = get_wcaps(codec, 0x07);
11461 11461
11462 /* get type */ 11462 /* get type */
11463 wcap = (wcap & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT; 11463 wcap = get_wcaps_type(wcap);
11464 if (wcap != AC_WID_AUD_IN) { 11464 if (wcap != AC_WID_AUD_IN) {
11465 spec->adc_nids = alc262_adc_nids_alt; 11465 spec->adc_nids = alc262_adc_nids_alt;
11466 spec->num_adc_nids = 11466 spec->num_adc_nids =
@@ -12536,7 +12536,7 @@ static int patch_alc268(struct hda_codec *codec)
12536 int i; 12536 int i;
12537 12537
12538 /* get type */ 12538 /* get type */
12539 wcap = (wcap & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT; 12539 wcap = get_wcaps_type(wcap);
12540 if (wcap != AC_WID_AUD_IN || spec->input_mux->num_items == 1) { 12540 if (wcap != AC_WID_AUD_IN || spec->input_mux->num_items == 1) {
12541 spec->adc_nids = alc268_adc_nids_alt; 12541 spec->adc_nids = alc268_adc_nids_alt;
12542 spec->num_adc_nids = ARRAY_SIZE(alc268_adc_nids_alt); 12542 spec->num_adc_nids = ARRAY_SIZE(alc268_adc_nids_alt);
@@ -13991,8 +13991,7 @@ static hda_nid_t alc861_look_for_dac(struct hda_codec *codec, hda_nid_t pin)
13991 return 0; 13991 return 0;
13992 for (i = 0; i < num; i++) { 13992 for (i = 0; i < num; i++) {
13993 unsigned int type; 13993 unsigned int type;
13994 type = (get_wcaps(codec, srcs[i]) & AC_WCAP_TYPE) 13994 type = get_wcaps_type(get_wcaps(codec, srcs[i]));
13995 >> AC_WCAP_TYPE_SHIFT;
13996 if (type != AC_WID_AUD_OUT) 13995 if (type != AC_WID_AUD_OUT)
13997 continue; 13996 continue;
13998 for (j = 0; j < spec->multiout.num_dacs; j++) 13997 for (j = 0; j < spec->multiout.num_dacs; j++)