aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_hdmi.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2010-08-03 08:21:00 -0400
committerTakashi Iwai <tiwai@suse.de>2010-08-03 08:21:00 -0400
commit92f10b3f5d53f9e35da5285eb8ea4bc88082b71e (patch)
tree26d90b68bb30f44921c54371d2cf248b9e4b247d /sound/pci/hda/patch_hdmi.c
parent1b0e372d7b52c9fc96348779015a6db7df7f286e (diff)
ALSA: hda - Define AC_FMT_* constants
Define constants for the HD-audio stream format bits, and replace the magic numbers in codes. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_hdmi.c')
-rw-r--r--sound/pci/hda/patch_hdmi.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 8534792591fc..522e0748ee99 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -698,6 +698,10 @@ static void hdmi_unsol_event(struct hda_codec *codec, unsigned int res)
698 * Callbacks 698 * Callbacks
699 */ 699 */
700 700
701/* HBR should be Non-PCM, 8 channels */
702#define is_hbr_format(format) \
703 ((format & AC_FMT_TYPE_NON_PCM) && (format & AC_FMT_CHAN_MASK) == 7)
704
701static int hdmi_setup_stream(struct hda_codec *codec, hda_nid_t nid, 705static int hdmi_setup_stream(struct hda_codec *codec, hda_nid_t nid,
702 u32 stream_tag, int format) 706 u32 stream_tag, int format)
703{ 707{
@@ -718,8 +722,7 @@ static int hdmi_setup_stream(struct hda_codec *codec, hda_nid_t nid,
718 AC_VERB_GET_PIN_WIDGET_CONTROL, 0); 722 AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
719 723
720 new_pinctl = pinctl & ~AC_PINCTL_EPT; 724 new_pinctl = pinctl & ~AC_PINCTL_EPT;
721 /* Non-PCM, 8 channels */ 725 if (is_hbr_format(format))
722 if ((format & 0x8000) && (format & 0x0f) == 7)
723 new_pinctl |= AC_PINCTL_EPT_HBR; 726 new_pinctl |= AC_PINCTL_EPT_HBR;
724 else 727 else
725 new_pinctl |= AC_PINCTL_EPT_NATIVE; 728 new_pinctl |= AC_PINCTL_EPT_NATIVE;
@@ -736,7 +739,7 @@ static int hdmi_setup_stream(struct hda_codec *codec, hda_nid_t nid,
736 new_pinctl); 739 new_pinctl);
737 } 740 }
738 741
739 if ((format & 0x8000) && (format & 0x0f) == 7 && !new_pinctl) { 742 if (is_hbr_format(format) && !new_pinctl) {
740 snd_printdd("hdmi_setup_stream: HBR is not supported\n"); 743 snd_printdd("hdmi_setup_stream: HBR is not supported\n");
741 return -EINVAL; 744 return -EINVAL;
742 } 745 }