ASoC: hdmi-codec: reorder channel allocation list
authorJonas Karlman <jonas@kwiboo.se>
Fri, 15 Nov 2024 04:43:44 +0000 (04:43 +0000)
committerMark Brown <broonie@kernel.org>
Fri, 15 Nov 2024 13:43:00 +0000 (13:43 +0000)
commit82ff5abc2edcfba0c0f1a1be807795e2876f46e9
tree3b0065e9a28401ddbd16733244522f123ed14e0d
parent9a5a75bf1f485e2d109303a996d147b94c5e79c9
ASoC: hdmi-codec: reorder channel allocation list

The ordering in hdmi_codec_get_ch_alloc_table_idx() results in
wrong channel allocation for a number of cases, e.g. when ELD
reports FL|FR|LFE|FC|RL|RR or FL|FR|LFE|FC|RL|RR|RC|RLC|RRC:

ca_id 0x01 with speaker mask FL|FR|LFE is selected instead of
ca_id 0x03 with speaker mask FL|FR|LFE|FC for 4 channels

and

ca_id 0x04 with speaker mask FL|FR|RC gets selected instead of
ca_id 0x0b with speaker mask FL|FR|LFE|FC|RL|RR for 6 channels

Fix this by reordering the channel allocation list with most
specific speaker masks at the top.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
Link: https://patch.msgid.link/20241115044344.3510979-1-christianshewitt@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/hdmi-codec.c