diff options
author | Wu Fengguang <fengguang.wu@intel.com> | 2011-11-16 03:29:48 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-11-16 04:44:58 -0500 |
commit | 2d1b439bdb3cee0ae5ccbd7f65e1e5852b1c2718 (patch) | |
tree | cafe2d6ab6fe09981468ad61c13bd22d2f8fd079 /sound/pci | |
parent | 744626dada90cb1231a65b08874aa7a9f11c2ea8 (diff) |
ALSA: hda - move eld->spk_alloc fixup to hdmi_update_eld()
It looks more natural and saves two lines of code.
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/hda/hda_eld.c | 8 | ||||
-rw-r--r-- | sound/pci/hda/patch_hdmi.c | 10 |
2 files changed, 8 insertions, 10 deletions
diff --git a/sound/pci/hda/hda_eld.c b/sound/pci/hda/hda_eld.c index a065d6d2d6ff..7ae7578bdcc0 100644 --- a/sound/pci/hda/hda_eld.c +++ b/sound/pci/hda/hda_eld.c | |||
@@ -297,6 +297,14 @@ static int hdmi_update_eld(struct hdmi_eld *e, | |||
297 | buf + ELD_FIXED_BYTES + mnl + 3 * i); | 297 | buf + ELD_FIXED_BYTES + mnl + 3 * i); |
298 | } | 298 | } |
299 | 299 | ||
300 | /* | ||
301 | * HDMI sink's ELD info cannot always be retrieved for now, e.g. | ||
302 | * in console or for audio devices. Assume the highest speakers | ||
303 | * configuration, to _not_ prohibit multi-channel audio playback. | ||
304 | */ | ||
305 | if (!e->spk_alloc) | ||
306 | e->spk_alloc = 0xffff; | ||
307 | |||
300 | e->eld_valid = true; | 308 | e->eld_valid = true; |
301 | return 0; | 309 | return 0; |
302 | 310 | ||
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index a76139b60154..9850c5b481ea 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c | |||
@@ -757,7 +757,6 @@ static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res) | |||
757 | int pd = !!(res & AC_UNSOL_RES_PD); | 757 | int pd = !!(res & AC_UNSOL_RES_PD); |
758 | int eldv = !!(res & AC_UNSOL_RES_ELDV); | 758 | int eldv = !!(res & AC_UNSOL_RES_ELDV); |
759 | int pin_idx; | 759 | int pin_idx; |
760 | struct hdmi_eld *eld; | ||
761 | 760 | ||
762 | printk(KERN_INFO | 761 | printk(KERN_INFO |
763 | "HDMI hot plug event: Codec=%d Pin=%d Presence_Detect=%d ELD_Valid=%d\n", | 762 | "HDMI hot plug event: Codec=%d Pin=%d Presence_Detect=%d ELD_Valid=%d\n", |
@@ -766,17 +765,8 @@ static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res) | |||
766 | pin_idx = pin_nid_to_pin_index(spec, pin_nid); | 765 | pin_idx = pin_nid_to_pin_index(spec, pin_nid); |
767 | if (pin_idx < 0) | 766 | if (pin_idx < 0) |
768 | return; | 767 | return; |
769 | eld = &spec->pins[pin_idx].sink_eld; | ||
770 | 768 | ||
771 | hdmi_present_sense(&spec->pins[pin_idx], true); | 769 | hdmi_present_sense(&spec->pins[pin_idx], true); |
772 | |||
773 | /* | ||
774 | * HDMI sink's ELD info cannot always be retrieved for now, e.g. | ||
775 | * in console or for audio devices. Assume the highest speakers | ||
776 | * configuration, to _not_ prohibit multi-channel audio playback. | ||
777 | */ | ||
778 | if (!eld->spk_alloc) | ||
779 | eld->spk_alloc = 0xffff; | ||
780 | } | 770 | } |
781 | 771 | ||
782 | static void hdmi_non_intrinsic_event(struct hda_codec *codec, unsigned int res) | 772 | static void hdmi_non_intrinsic_event(struct hda_codec *codec, unsigned int res) |