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

Commit 1db02978 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

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

parents e10adfe4 6569d150
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;