summaryrefslogtreecommitdiff
path: root/include/sound/hda_chmap.h
diff options
context:
space:
mode:
authorSubhransu S. Prusty <subhransu.s.prusty@intel.com>2016-03-04 17:29:46 +0300
committerTakashi Iwai <tiwai@suse.de>2016-03-07 17:41:28 +0300
commit67b90cb84be8fde0e51f71834e15c32fbec08562 (patch)
tree2e3d5a7c1abb278db873482447414b9df3a91cf8 /include/sound/hda_chmap.h
parentcdb1ee3f6c55b028cebc6af0280851bf89dbce2d (diff)
downloadlinux-67b90cb84be8fde0e51f71834e15c32fbec08562.tar.xz
ALSA: hda - Create common chmap object
chmap object represents multichannel capability and contains chmap ops. Legacy driver is updated to use this. With next set of patches chmap object is moved to common to be reused by other drivers (ex: skylake ASoC hdmi driver). Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'include/sound/hda_chmap.h')
-rw-r--r--include/sound/hda_chmap.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/include/sound/hda_chmap.h b/include/sound/hda_chmap.h
new file mode 100644
index 000000000000..9ab20f0274a3
--- /dev/null
+++ b/include/sound/hda_chmap.h
@@ -0,0 +1,41 @@
+/*
+ * For multichannel support
+ */
+
+#ifndef __SOUND_HDA_CHMAP_H
+#define __SOUND_HDA_CHMAP_H
+
+#include <sound/hdaudio.h>
+
+struct cea_channel_speaker_allocation {
+ int ca_index;
+ int speakers[8];
+
+ /* derived values, just for convenience */
+ int channels;
+ int spk_mask;
+};
+struct hdac_chmap;
+
+struct hdac_chmap_ops {
+ /*
+ * Helpers for producing the channel map TLVs. These can be overridden
+ * for devices that have non-standard mapping requirements.
+ */
+ int (*chmap_cea_alloc_validate_get_type)(struct hdac_chmap *chmap,
+ struct cea_channel_speaker_allocation *cap, int channels);
+ void (*cea_alloc_to_tlv_chmap)
+ (struct cea_channel_speaker_allocation *cap,
+ unsigned int *chmap, int channels);
+
+ /* check that the user-given chmap is supported */
+ int (*chmap_validate)(int ca, int channels, unsigned char *chmap);
+};
+
+struct hdac_chmap {
+ unsigned int channels_max; /* max over all cvts */
+ struct hdac_chmap_ops ops;
+ struct hdac_device *hdac;
+};
+
+#endif /* __SOUND_HDA_CHMAP_H */