aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSubhransu S. Prusty <subhransu.s.prusty@intel.com>2016-04-14 00:37:28 -0400
committerMark Brown <broonie@kernel.org>2016-04-28 13:49:24 -0400
commitb7756edeb7d03b675e10b4862dccc8deb4b0ca17 (patch)
treeb12095047163bdf3bf854b1238f953393ef2e70d
parent6a5ea5c5d1d35e9b81fca88535cd584d9332961d (diff)
ASoC: hdac_hdmi: parse eld for channel map capability
This patch parses ELD speaker allocation data block to find sink's chmap capability. Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/codecs/hdac_hdmi.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c
index 26f9459cb3bc..64ffe93b0f7b 100644
--- a/sound/soc/codecs/hdac_hdmi.c
+++ b/sound/soc/codecs/hdac_hdmi.c
@@ -60,11 +60,17 @@ struct hdac_hdmi_cvt {
60 struct hdac_hdmi_cvt_params params; 60 struct hdac_hdmi_cvt_params params;
61}; 61};
62 62
63/* Currently only spk_alloc, more to be added */
64struct hdac_hdmi_parsed_eld {
65 u8 spk_alloc;
66};
67
63struct hdac_hdmi_eld { 68struct hdac_hdmi_eld {
64 bool monitor_present; 69 bool monitor_present;
65 bool eld_valid; 70 bool eld_valid;
66 int eld_size; 71 int eld_size;
67 char eld_buffer[ELD_MAX_SIZE]; 72 char eld_buffer[ELD_MAX_SIZE];
73 struct hdac_hdmi_parsed_eld info;
68}; 74};
69 75
70struct hdac_hdmi_pin { 76struct hdac_hdmi_pin {
@@ -1008,6 +1014,12 @@ static int hdac_hdmi_add_cvt(struct hdac_ext_device *edev, hda_nid_t nid)
1008 return hdac_hdmi_query_cvt_params(&edev->hdac, cvt); 1014 return hdac_hdmi_query_cvt_params(&edev->hdac, cvt);
1009} 1015}
1010 1016
1017static void hdac_hdmi_parse_eld(struct hdac_ext_device *edev,
1018 struct hdac_hdmi_pin *pin)
1019{
1020 pin->eld.info.spk_alloc = pin->eld.eld_buffer[DRM_ELD_SPEAKER];
1021}
1022
1011static void hdac_hdmi_present_sense(struct hdac_hdmi_pin *pin, int repoll) 1023static void hdac_hdmi_present_sense(struct hdac_hdmi_pin *pin, int repoll)
1012{ 1024{
1013 struct hdac_ext_device *edev = pin->edev; 1025 struct hdac_ext_device *edev = pin->edev;
@@ -1065,6 +1077,7 @@ static void hdac_hdmi_present_sense(struct hdac_hdmi_pin *pin, int repoll)
1065 1077
1066 snd_jack_report(pcm->jack, SND_JACK_AVOUT); 1078 snd_jack_report(pcm->jack, SND_JACK_AVOUT);
1067 } 1079 }
1080 hdac_hdmi_parse_eld(edev, pin);
1068 1081
1069 print_hex_dump_bytes("ELD: ", DUMP_PREFIX_OFFSET, 1082 print_hex_dump_bytes("ELD: ", DUMP_PREFIX_OFFSET,
1070 pin->eld.eld_buffer, pin->eld.eld_size); 1083 pin->eld.eld_buffer, pin->eld.eld_size);