Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 270370
b: refs/heads/master
c: 0b6c49b
h: refs/heads/master
v: v3
  • Loading branch information
David Henningsson authored and Takashi Iwai committed Sep 21, 2011
1 parent 605e135 commit aeaea1b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 8 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: 42cf0d0155539ef1933e63453e5169a4f631d7e7
refs/heads/master: 0b6c49b59fb272c1a20f79202693ed1072e9548c
31 changes: 24 additions & 7 deletions trunk/sound/pci/hda/patch_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -967,19 +967,12 @@ static int hdmi_add_pin(struct hda_codec *codec, hda_nid_t pin_nid)

per_pin->pin_nid = pin_nid;

err = snd_hda_input_jack_add(codec, pin_nid,
SND_JACK_VIDEOOUT, NULL);
if (err < 0)
return err;

err = hdmi_read_pin_conn(codec, pin_idx);
if (err < 0)
return err;

spec->num_pins++;

hdmi_present_sense(codec, pin_nid, eld);

return 0;
}

Expand Down Expand Up @@ -1162,6 +1155,25 @@ static int generic_hdmi_build_pcms(struct hda_codec *codec)
return 0;
}

static int generic_hdmi_build_jack(struct hda_codec *codec, int pin_idx)
{
int err;
char hdmi_str[32];
struct hdmi_spec *spec = codec->spec;
struct hdmi_spec_per_pin *per_pin = &spec->pins[pin_idx];
int pcmdev = spec->pcm_rec[pin_idx].device;

snprintf(hdmi_str, sizeof(hdmi_str), "HDMI/DP,pcm=%d", pcmdev);

err = snd_hda_input_jack_add(codec, per_pin->pin_nid,
SND_JACK_VIDEOOUT, pcmdev > 0 ? hdmi_str : NULL);
if (err < 0)
return err;

hdmi_present_sense(codec, per_pin->pin_nid, &per_pin->sink_eld);
return 0;
}

static int generic_hdmi_build_controls(struct hda_codec *codec)
{
struct hdmi_spec *spec = codec->spec;
Expand All @@ -1170,6 +1182,11 @@ static int generic_hdmi_build_controls(struct hda_codec *codec)

for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) {
struct hdmi_spec_per_pin *per_pin = &spec->pins[pin_idx];

err = generic_hdmi_build_jack(codec, pin_idx);
if (err < 0)
return err;

err = snd_hda_create_spdif_out_ctls(codec,
per_pin->pin_nid,
per_pin->mux_nids[0]);
Expand Down

0 comments on commit aeaea1b

Please sign in to comment.