diff options
Diffstat (limited to 'sound/pci/hda/patch_hdmi.c')
-rw-r--r-- | sound/pci/hda/patch_hdmi.c | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index bb8cfc68cd73..66dc7e651758 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c | |||
@@ -1005,8 +1005,6 @@ static void hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, bool retry) | |||
1005 | msecs_to_jiffies(300)); | 1005 | msecs_to_jiffies(300)); |
1006 | } | 1006 | } |
1007 | } | 1007 | } |
1008 | |||
1009 | snd_hda_input_jack_report(codec, pin_nid); | ||
1010 | } | 1008 | } |
1011 | 1009 | ||
1012 | static void hdmi_repoll_eld(struct work_struct *work) | 1010 | static void hdmi_repoll_eld(struct work_struct *work) |
@@ -1232,21 +1230,15 @@ static int generic_hdmi_build_pcms(struct hda_codec *codec) | |||
1232 | 1230 | ||
1233 | static int generic_hdmi_build_jack(struct hda_codec *codec, int pin_idx) | 1231 | static int generic_hdmi_build_jack(struct hda_codec *codec, int pin_idx) |
1234 | { | 1232 | { |
1235 | int err; | 1233 | char hdmi_str[32] = "HDMI/DP"; |
1236 | char hdmi_str[32]; | ||
1237 | struct hdmi_spec *spec = codec->spec; | 1234 | struct hdmi_spec *spec = codec->spec; |
1238 | struct hdmi_spec_per_pin *per_pin = &spec->pins[pin_idx]; | 1235 | struct hdmi_spec_per_pin *per_pin = &spec->pins[pin_idx]; |
1239 | int pcmdev = spec->pcm_rec[pin_idx].device; | 1236 | int pcmdev = spec->pcm_rec[pin_idx].device; |
1240 | 1237 | ||
1241 | snprintf(hdmi_str, sizeof(hdmi_str), "HDMI/DP,pcm=%d", pcmdev); | 1238 | if (pcmdev > 0) |
1242 | 1239 | sprintf(hdmi_str + strlen(hdmi_str), ",pcm=%d", pcmdev); | |
1243 | err = snd_hda_input_jack_add(codec, per_pin->pin_nid, | ||
1244 | SND_JACK_VIDEOOUT, pcmdev > 0 ? hdmi_str : NULL); | ||
1245 | if (err < 0) | ||
1246 | return err; | ||
1247 | 1240 | ||
1248 | hdmi_present_sense(per_pin, false); | 1241 | return snd_hda_jack_add_kctl(codec, per_pin->pin_nid, hdmi_str, 0); |
1249 | return 0; | ||
1250 | } | 1242 | } |
1251 | 1243 | ||
1252 | static int generic_hdmi_build_controls(struct hda_codec *codec) | 1244 | static int generic_hdmi_build_controls(struct hda_codec *codec) |
@@ -1276,10 +1268,8 @@ static int generic_hdmi_build_controls(struct hda_codec *codec) | |||
1276 | 1268 | ||
1277 | if (err < 0) | 1269 | if (err < 0) |
1278 | return err; | 1270 | return err; |
1279 | err = snd_hda_jack_add_kctl(codec, per_pin->pin_nid, | 1271 | |
1280 | "HDMI", pin_idx); | 1272 | hdmi_present_sense(per_pin, false); |
1281 | if (err < 0) | ||
1282 | return err; | ||
1283 | } | 1273 | } |
1284 | 1274 | ||
1285 | return 0; | 1275 | return 0; |