Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 132986
b: refs/heads/master
c: e64f14f
h: refs/heads/master
v: v3
  • Loading branch information
Takashi Iwai committed Jan 20, 2009
1 parent b33dd4b commit 02f6349
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8c441982fdc00f77b7aa609061c6411f47bcceda
refs/heads/master: e64f14f4e570d6ec5bc88abac92a3a27150756d7
43 changes: 33 additions & 10 deletions trunk/sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,9 @@ struct alc_spec {
unsigned int jack_present: 1;
unsigned int master_sw: 1;

/* other flags */
unsigned int no_analog :1; /* digital I/O only */

/* for virtual master */
hda_nid_t vmaster_nid;
#ifdef CONFIG_SND_HDA_POWER_SAVE
Expand Down Expand Up @@ -2019,11 +2022,13 @@ static int alc_build_controls(struct hda_codec *codec)
spec->multiout.dig_out_nid);
if (err < 0)
return err;
err = snd_hda_create_spdif_share_sw(codec,
&spec->multiout);
if (err < 0)
return err;
spec->multiout.share_spdif = 1;
if (!spec->no_analog) {
err = snd_hda_create_spdif_share_sw(codec,
&spec->multiout);
if (err < 0)
return err;
spec->multiout.share_spdif = 1;
}
}
if (spec->dig_in_nid) {
err = snd_hda_create_spdif_in_ctls(codec, spec->dig_in_nid);
Expand All @@ -2032,7 +2037,8 @@ static int alc_build_controls(struct hda_codec *codec)
}

/* if we have no master control, let's create it */
if (!snd_hda_find_mixer_ctl(codec, "Master Playback Volume")) {
if (!spec->no_analog &&
!snd_hda_find_mixer_ctl(codec, "Master Playback Volume")) {
unsigned int vmaster_tlv[4];
snd_hda_set_vmaster_tlv(codec, spec->vmaster_nid,
HDA_OUTPUT, vmaster_tlv);
Expand All @@ -2041,7 +2047,8 @@ static int alc_build_controls(struct hda_codec *codec)
if (err < 0)
return err;
}
if (!snd_hda_find_mixer_ctl(codec, "Master Playback Switch")) {
if (!spec->no_analog &&
!snd_hda_find_mixer_ctl(codec, "Master Playback Switch")) {
err = snd_hda_add_vmaster(codec, "Master Playback Switch",
NULL, alc_slave_sws);
if (err < 0)
Expand Down Expand Up @@ -3060,6 +3067,9 @@ static int alc_build_pcms(struct hda_codec *codec)
codec->num_pcms = 1;
codec->pcm_info = info;

if (spec->no_analog)
goto skip_analog;

info->name = spec->stream_name_analog;
if (spec->stream_analog_playback) {
if (snd_BUG_ON(!spec->multiout.dac_nids))
Expand All @@ -3083,6 +3093,7 @@ static int alc_build_pcms(struct hda_codec *codec)
}
}

skip_analog:
/* SPDIF for stream index #1 */
if (spec->multiout.dig_out_nid || spec->dig_in_nid) {
codec->num_pcms = 2;
Expand All @@ -3106,6 +3117,9 @@ static int alc_build_pcms(struct hda_codec *codec)
codec->spdif_status_reset = 1;
}

if (spec->no_analog)
return 0;

/* If the use of more than one ADC is requested for the current
* model, configure a second analog capture-only PCM.
*/
Expand Down Expand Up @@ -10468,8 +10482,14 @@ static int alc262_parse_auto_config(struct hda_codec *codec)
alc262_ignore);
if (err < 0)
return err;
if (!spec->autocfg.line_outs)
if (!spec->autocfg.line_outs) {
if (spec->autocfg.dig_out_pin || spec->autocfg.dig_in_pin) {
spec->multiout.max_channels = 2;
spec->no_analog = 1;
goto dig_only;
}
return 0; /* can't find valid BIOS pin config */
}
err = alc262_auto_create_multi_out_ctls(spec, &spec->autocfg);
if (err < 0)
return err;
Expand All @@ -10479,8 +10499,11 @@ static int alc262_parse_auto_config(struct hda_codec *codec)

spec->multiout.max_channels = spec->multiout.num_dacs * 2;

if (spec->autocfg.dig_out_pin)
dig_only:
if (spec->autocfg.dig_out_pin) {
spec->multiout.dig_out_nid = ALC262_DIGOUT_NID;
spec->dig_out_type = spec->autocfg.dig_out_type;
}
if (spec->autocfg.dig_in_pin)
spec->dig_in_nid = ALC262_DIGIN_NID;

Expand Down Expand Up @@ -10875,7 +10898,7 @@ static int patch_alc262(struct hda_codec *codec)
spec->capsrc_nids = alc262_capsrc_nids;
}
}
if (!spec->cap_mixer)
if (!spec->cap_mixer && !spec->no_analog)
set_capture_mixer(spec);

spec->vmaster_nid = 0x0c;
Expand Down

0 comments on commit 02f6349

Please sign in to comment.