Subhransu S. Prusty | 67b90cb | 2016-03-04 19:59:46 +0530 | [diff] [blame^] | 1 | /* |
| 2 | * For multichannel support |
| 3 | */ |
| 4 | |
| 5 | #ifndef __SOUND_HDA_CHMAP_H |
| 6 | #define __SOUND_HDA_CHMAP_H |
| 7 | |
| 8 | #include <sound/hdaudio.h> |
| 9 | |
| 10 | struct cea_channel_speaker_allocation { |
| 11 | int ca_index; |
| 12 | int speakers[8]; |
| 13 | |
| 14 | /* derived values, just for convenience */ |
| 15 | int channels; |
| 16 | int spk_mask; |
| 17 | }; |
| 18 | struct hdac_chmap; |
| 19 | |
| 20 | struct hdac_chmap_ops { |
| 21 | /* |
| 22 | * Helpers for producing the channel map TLVs. These can be overridden |
| 23 | * for devices that have non-standard mapping requirements. |
| 24 | */ |
| 25 | int (*chmap_cea_alloc_validate_get_type)(struct hdac_chmap *chmap, |
| 26 | struct cea_channel_speaker_allocation *cap, int channels); |
| 27 | void (*cea_alloc_to_tlv_chmap) |
| 28 | (struct cea_channel_speaker_allocation *cap, |
| 29 | unsigned int *chmap, int channels); |
| 30 | |
| 31 | /* check that the user-given chmap is supported */ |
| 32 | int (*chmap_validate)(int ca, int channels, unsigned char *chmap); |
| 33 | }; |
| 34 | |
| 35 | struct hdac_chmap { |
| 36 | unsigned int channels_max; /* max over all cvts */ |
| 37 | struct hdac_chmap_ops ops; |
| 38 | struct hdac_device *hdac; |
| 39 | }; |
| 40 | |
| 41 | #endif /* __SOUND_HDA_CHMAP_H */ |