summaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_hdmi.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2010-08-03 14:21:00 +0200
committerTakashi Iwai <tiwai@suse.de>2010-08-03 14:21:00 +0200
commit92f10b3f5d53f9e35da5285eb8ea4bc88082b71e (patch)
tree26d90b68bb30f44921c54371d2cf248b9e4b247d /sound/pci/hda/patch_hdmi.c
parent1b0e372d7b52c9fc96348779015a6db7df7f286e (diff)
downloadblackbird-op-linux-92f10b3f5d53f9e35da5285eb8ea4bc88082b71e.tar.gz
blackbird-op-linux-92f10b3f5d53f9e35da5285eb8ea4bc88082b71e.zip
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)
* Callbacks
*/
+/* HBR should be Non-PCM, 8 channels */
+#define is_hbr_format(format) \
+ ((format & AC_FMT_TYPE_NON_PCM) && (format & AC_FMT_CHAN_MASK) == 7)
+
static int hdmi_setup_stream(struct hda_codec *codec, hda_nid_t nid,
u32 stream_tag, int format)
{
@@ -718,8 +722,7 @@ static int hdmi_setup_stream(struct hda_codec *codec, hda_nid_t nid,
AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
new_pinctl = pinctl & ~AC_PINCTL_EPT;
- /* Non-PCM, 8 channels */
- if ((format & 0x8000) && (format & 0x0f) == 7)
+ if (is_hbr_format(format))
new_pinctl |= AC_PINCTL_EPT_HBR;
else
new_pinctl |= AC_PINCTL_EPT_NATIVE;
@@ -736,7 +739,7 @@ static int hdmi_setup_stream(struct hda_codec *codec, hda_nid_t nid,
new_pinctl);
}
- if ((format & 0x8000) && (format & 0x0f) == 7 && !new_pinctl) {
+ if (is_hbr_format(format) && !new_pinctl) {
snd_printdd("hdmi_setup_stream: HBR is not supported\n");
return -EINVAL;
}
OpenPOWER on IntegriCloud