diff options
| -rw-r--r-- | sound/pci/hda/patch_hdmi.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index 9850c5b481ea..c505fd5d338c 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c | |||
| @@ -69,6 +69,7 @@ struct hdmi_spec_per_pin { | |||
| 69 | struct hda_codec *codec; | 69 | struct hda_codec *codec; |
| 70 | struct hdmi_eld sink_eld; | 70 | struct hdmi_eld sink_eld; |
| 71 | struct delayed_work work; | 71 | struct delayed_work work; |
| 72 | int repoll_count; | ||
| 72 | }; | 73 | }; |
| 73 | 74 | ||
| 74 | struct hdmi_spec { | 75 | struct hdmi_spec { |
| @@ -748,7 +749,7 @@ static void hdmi_setup_audio_infoframe(struct hda_codec *codec, int pin_idx, | |||
| 748 | * Unsolicited events | 749 | * Unsolicited events |
| 749 | */ | 750 | */ |
| 750 | 751 | ||
| 751 | static void hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, bool retry); | 752 | static void hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll); |
| 752 | 753 | ||
| 753 | static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res) | 754 | static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res) |
| 754 | { | 755 | { |
| @@ -766,7 +767,7 @@ static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res) | |||
| 766 | if (pin_idx < 0) | 767 | if (pin_idx < 0) |
| 767 | return; | 768 | return; |
| 768 | 769 | ||
| 769 | hdmi_present_sense(&spec->pins[pin_idx], true); | 770 | hdmi_present_sense(&spec->pins[pin_idx], 1); |
| 770 | } | 771 | } |
| 771 | 772 | ||
| 772 | static void hdmi_non_intrinsic_event(struct hda_codec *codec, unsigned int res) | 773 | static void hdmi_non_intrinsic_event(struct hda_codec *codec, unsigned int res) |
| @@ -960,7 +961,7 @@ static int hdmi_read_pin_conn(struct hda_codec *codec, int pin_idx) | |||
| 960 | return 0; | 961 | return 0; |
| 961 | } | 962 | } |
| 962 | 963 | ||
| 963 | static void hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, bool retry) | 964 | static void hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll) |
| 964 | { | 965 | { |
| 965 | struct hda_codec *codec = per_pin->codec; | 966 | struct hda_codec *codec = per_pin->codec; |
| 966 | struct hdmi_eld *eld = &per_pin->sink_eld; | 967 | struct hdmi_eld *eld = &per_pin->sink_eld; |
| @@ -989,7 +990,7 @@ static void hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, bool retry) | |||
| 989 | if (eld_valid) { | 990 | if (eld_valid) { |
| 990 | if (!snd_hdmi_get_eld(eld, codec, pin_nid)) | 991 | if (!snd_hdmi_get_eld(eld, codec, pin_nid)) |
| 991 | snd_hdmi_show_eld(eld); | 992 | snd_hdmi_show_eld(eld); |
| 992 | else if (retry) { | 993 | else if (repoll) { |
| 993 | queue_delayed_work(codec->bus->workq, | 994 | queue_delayed_work(codec->bus->workq, |
| 994 | &per_pin->work, | 995 | &per_pin->work, |
| 995 | msecs_to_jiffies(300)); | 996 | msecs_to_jiffies(300)); |
| @@ -1004,7 +1005,10 @@ static void hdmi_repoll_eld(struct work_struct *work) | |||
| 1004 | struct hdmi_spec_per_pin *per_pin = | 1005 | struct hdmi_spec_per_pin *per_pin = |
| 1005 | container_of(to_delayed_work(work), struct hdmi_spec_per_pin, work); | 1006 | container_of(to_delayed_work(work), struct hdmi_spec_per_pin, work); |
| 1006 | 1007 | ||
| 1007 | hdmi_present_sense(per_pin, false); | 1008 | if (per_pin->repoll_count++ > 6) |
| 1009 | per_pin->repoll_count = 0; | ||
| 1010 | |||
| 1011 | hdmi_present_sense(per_pin, per_pin->repoll_count); | ||
| 1008 | } | 1012 | } |
| 1009 | 1013 | ||
| 1010 | static int hdmi_add_pin(struct hda_codec *codec, hda_nid_t pin_nid) | 1014 | static int hdmi_add_pin(struct hda_codec *codec, hda_nid_t pin_nid) |
| @@ -1235,7 +1239,7 @@ static int generic_hdmi_build_jack(struct hda_codec *codec, int pin_idx) | |||
| 1235 | if (err < 0) | 1239 | if (err < 0) |
| 1236 | return err; | 1240 | return err; |
| 1237 | 1241 | ||
| 1238 | hdmi_present_sense(per_pin, false); | 1242 | hdmi_present_sense(per_pin, 0); |
| 1239 | return 0; | 1243 | return 0; |
| 1240 | } | 1244 | } |
| 1241 | 1245 | ||
