diff options
author | Subhransu S. Prusty <subhransu.s.prusty@intel.com> | 2016-03-04 15:29:46 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2016-03-07 15:41:28 +0100 |
commit | 67b90cb84be8fde0e51f71834e15c32fbec08562 (patch) | |
tree | 2e3d5a7c1abb278db873482447414b9df3a91cf8 /include/sound/hda_chmap.h | |
parent | ALSA: compress: fix more typos (diff) | |
download | linux-67b90cb84be8fde0e51f71834e15c32fbec08562.tar.xz linux-67b90cb84be8fde0e51f71834e15c32fbec08562.zip |
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.h | 41 |
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 */ |