Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 316126
b: refs/heads/master
c: 4b6ace9
h: refs/heads/master
v: v3
  • Loading branch information
Takashi Iwai committed Jun 15, 2012
1 parent 5a75fc0 commit 3e21730
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c20c5a841cbe47f5b7812b57bd25397497e5fbc0
refs/heads/master: 4b6ace9e7176d93f819cec9df47faadaaceead4b
20 changes: 20 additions & 0 deletions trunk/sound/pci/hda/patch_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1377,6 +1377,19 @@ static int simple_playback_build_pcms(struct hda_codec *codec)
return 0;
}

/* unsolicited event for jack sensing */
static void simple_hdmi_unsol_event(struct hda_codec *codec,
unsigned int res)
{
snd_hda_jack_get_action(codec, res >> AC_UNSOL_RES_TAG_SHIFT);
snd_hda_jack_report_sync(codec);
}

/* generic_hdmi_build_jack can be used for simple_hdmi, too,
* as long as spec->pins[] is set correctly
*/
#define simple_hdmi_build_jack generic_hdmi_build_jack

static int simple_playback_build_controls(struct hda_codec *codec)
{
struct hdmi_spec *spec = codec->spec;
Expand All @@ -1389,6 +1402,11 @@ static int simple_playback_build_controls(struct hda_codec *codec)
spec->cvts[i].cvt_nid);
if (err < 0)
return err;
if (codec->patch_ops.unsol_event) {
err = simple_hdmi_build_jack(codec, i);
if (err < 0)
return err;
}
}

return 0;
Expand Down Expand Up @@ -1876,6 +1894,7 @@ static struct hda_verb viahdmi_basic_init[] = {
static int via_hdmi_init(struct hda_codec *codec)
{
snd_hda_sequence_write(codec, viahdmi_basic_init);
snd_hda_jack_report_sync(codec);
return 0;
}

Expand All @@ -1884,6 +1903,7 @@ static const struct hda_codec_ops via_hdmi_patch_ops = {
.build_pcms = simple_playback_build_pcms,
.init = via_hdmi_init,
.free = simple_playback_free,
.unsol_event = simple_hdmi_unsol_event,
};

static struct hda_pcm_stream via_hdmi_digital_playback = {
Expand Down

0 comments on commit 3e21730

Please sign in to comment.