Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b7756ede authored by Subhransu S. Prusty's avatar Subhransu S. Prusty Committed by Mark Brown
Browse files

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: default avatarSubhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 6a5ea5c5
Loading
Loading
Loading
Loading
+13 −0
Original line number Original line Diff line number Diff line
@@ -60,11 +60,17 @@ struct hdac_hdmi_cvt {
	struct hdac_hdmi_cvt_params params;
	struct hdac_hdmi_cvt_params params;
};
};


/* Currently only spk_alloc, more to be added */
struct hdac_hdmi_parsed_eld {
	u8 spk_alloc;
};

struct hdac_hdmi_eld {
struct hdac_hdmi_eld {
	bool	monitor_present;
	bool	monitor_present;
	bool	eld_valid;
	bool	eld_valid;
	int	eld_size;
	int	eld_size;
	char    eld_buffer[ELD_MAX_SIZE];
	char    eld_buffer[ELD_MAX_SIZE];
	struct	hdac_hdmi_parsed_eld info;
};
};


struct hdac_hdmi_pin {
struct hdac_hdmi_pin {
@@ -1008,6 +1014,12 @@ static int hdac_hdmi_add_cvt(struct hdac_ext_device *edev, hda_nid_t nid)
	return hdac_hdmi_query_cvt_params(&edev->hdac, cvt);
	return hdac_hdmi_query_cvt_params(&edev->hdac, cvt);
}
}


static void hdac_hdmi_parse_eld(struct hdac_ext_device *edev,
			struct hdac_hdmi_pin *pin)
{
	pin->eld.info.spk_alloc = pin->eld.eld_buffer[DRM_ELD_SPEAKER];
}

static void hdac_hdmi_present_sense(struct hdac_hdmi_pin *pin, int repoll)
static void hdac_hdmi_present_sense(struct hdac_hdmi_pin *pin, int repoll)
{
{
	struct hdac_ext_device *edev = pin->edev;
	struct hdac_ext_device *edev = pin->edev;
@@ -1065,6 +1077,7 @@ static void hdac_hdmi_present_sense(struct hdac_hdmi_pin *pin, int repoll)


				snd_jack_report(pcm->jack, SND_JACK_AVOUT);
				snd_jack_report(pcm->jack, SND_JACK_AVOUT);
			}
			}
			hdac_hdmi_parse_eld(edev, pin);


			print_hex_dump_bytes("ELD: ", DUMP_PREFIX_OFFSET,
			print_hex_dump_bytes("ELD: ", DUMP_PREFIX_OFFSET,
					pin->eld.eld_buffer, pin->eld.eld_size);
					pin->eld.eld_buffer, pin->eld.eld_size);