On Mon, 12 Dec 2016 10:38:45 +0100, Arnaud Pouliquen wrote:
On 12/11/2016 07:09 AM, Takashi Sakamoto wrote:
On Dec 9 2016 01:37, Arnaud Pouliquen wrote:
Add user interface to provide channel mapping. In a first step this control is read only.
As TLV type, the control provides all configurations available for HDMI sink(ELD), and provides current channel mapping selected by codec based on ELD and number of channels specified by user on open. When control is called before the number of the channel is specified (i.e. hw_params is set), it returns all channels set to UNKNOWN.
Notice that SNDRV_CTL_TLVT_CHMAP_FIXED is used for all mappings, as no information is available from HDMI driver to allow channel swapping.
Signed-off-by: Arnaud Pouliquen arnaud.pouliquen@st.com
sound/soc/codecs/hdmi-codec.c | 346 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 345 insertions(+), 1 deletion(-)
diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c index f27d115..0cb83a3 100644 --- a/sound/soc/codecs/hdmi-codec.c +++ b/sound/soc/codecs/hdmi-codec.c @@ -18,12 +18,137 @@ #include <sound/pcm.h> #include <sound/pcm_params.h> #include <sound/soc.h> +#include <sound/tlv.h> #include <sound/pcm_drm_eld.h> #include <sound/hdmi-codec.h> #include <sound/pcm_iec958.h>
#include <drm/drm_crtc.h> /* This is only to get MAX_ELD_BYTES */
+#define HDMI_MAX_SPEAKERS 8
+/*
- CEA speaker placement for HDMI 1.4:
- FL FLC FC FRC FR FRW
LFE
- RL RLC RC RRC RR
- Speaker placement has to be extended to support HDMI 2.0
- */
+enum hdmi_codec_cea_spk_placement {
- FL = (1 << 0), /* Front Left */
- FC = (1 << 1), /* Front Center */
- FR = (1 << 2), /* Front Right */
- FLC = (1 << 3), /* Front Left Center */
- FRC = (1 << 4), /* Front Right Center */
- RL = (1 << 5), /* Rear Left */
- RC = (1 << 6), /* Rear Center */
- RR = (1 << 7), /* Rear Right */
- RLC = (1 << 8), /* Rear Left Center */
- RRC = (1 << 9), /* Rear Right Center */
- LFE = (1 << 10), /* Low Frequency Effect */
+};
BIT() macro in "linux/bitops.h" is available.
will be corrected in a v2
One slight caution: BIT() expands to an unsigned long type.
Takashi