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

Commit 6569d150 authored by Narender Ankem's avatar Narender Ankem Committed by Sudarsan Ramesh
Browse files

msm: dp: fix no audio over DP on device bootup



In case of DP interface as primary, if device boots up with
DP connected, external interface driver is unable to notify
audio events as audio codec is getting registered later.
Add change to send audio event once audio codec gets registered.

Change-Id: I8d630adf892714ff2eb4d6039dc058b54c425b83
Signed-off-by: default avatarNarender Ankem <nankam@codeaurora.org>
Signed-off-by: default avatarSudarsan Ramesh <sudarame@codeaurora.org>
parent f16a067b
Loading
Loading
Loading
Loading
+13 −3
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ struct msm_ext_disp {
	bool audio_session_on;
	struct list_head display_list;
	struct mutex lock;
	bool update_audio;
};

static const unsigned int msm_ext_disp_supported_cable[] = {
@@ -288,8 +289,6 @@ static int msm_ext_disp_audio_config(struct platform_device *pdev,

	if (state == EXT_DISPLAY_CABLE_CONNECT) {
		ret = msm_ext_disp_select_audio_codec(pdev, codec);
		if (ret)
			pr_err("error setting audio codec\n");
	} else {
		mutex_lock(&ext_disp->lock);
		if (ext_disp->ops)
@@ -393,6 +392,14 @@ int msm_ext_disp_register_audio_codec(struct platform_device *pdev,

	pr_debug("audio codec registered\n");

	if (ext_disp->update_audio) {
		ext_disp->update_audio = false;
		msm_ext_disp_update_audio_ops(ext_disp,
				&ext_disp->current_codec);
		msm_ext_disp_process_audio(ext_disp, &ext_disp->current_codec,
				EXT_DISPLAY_CABLE_CONNECT);
	}

end:
	mutex_unlock(&ext_disp->lock);
	if (ext_disp->current_codec.type != EXT_DISPLAY_TYPE_MAX)
@@ -426,7 +433,9 @@ int msm_ext_disp_select_audio_codec(struct platform_device *pdev,
	mutex_lock(&ext_disp->lock);

	if (!ext_disp->ops) {
		pr_err("Codec is not registered\n");
		pr_warn("Codec is not registered\n");
		ext_disp->update_audio = true;
		ext_disp->current_codec = *codec;
		ret = -EINVAL;
		goto end;
	}
@@ -616,6 +625,7 @@ static int msm_ext_disp_probe(struct platform_device *pdev)

	INIT_LIST_HEAD(&ext_disp->display_list);
	ext_disp->current_codec.type = EXT_DISPLAY_TYPE_MAX;
	ext_disp->update_audio = false;

	return ret;