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

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

Merge "asoc: notify dp driver after disp codec probe"

parents df752383 358438b5
Loading
Loading
Loading
Loading
+29 −0
Original line number Diff line number Diff line
@@ -735,6 +735,10 @@ static int msm_ext_disp_audio_codec_rx_probe(
{
	struct msm_ext_disp_audio_codec_rx_data *codec_data;
	struct device_node *of_node_parent = NULL;
	struct msm_ext_disp_codec_id codec_info;
	int dai_id = DP_DAI1;
	int type;
	int rc = 0;

	codec_data = kzalloc(sizeof(struct msm_ext_disp_audio_codec_rx_data),
		GFP_KERNEL);
@@ -775,6 +779,31 @@ static int msm_ext_disp_audio_codec_rx_probe(
	dev_dbg(component->dev, "%s(): registered %s with ext disp core\n",
		__func__, component->name);

	mutex_lock(&codec_data->dp_ops_lock);

	/*Find a connected ext device to notify DisPlay*/
	for (dai_id = DP_DAI1; dai_id < DP_DAI_MAX; dai_id++)
	{
		if (dai_id == HDMI_MS_DAI)
			type = EXT_DISPLAY_TYPE_HDMI;
		else
			type = EXT_DISPLAY_TYPE_DP;

		SWITCH_DP_CODEC(codec_info, codec_data, dai_id, type);

		rc = msm_ext_disp_select_audio_codec(codec_data->ext_disp_core_pdev,
						&codec_info);
		if (!rc) {
			if(codec_data->ext_disp_ops.ready) {
				rc = codec_data->ext_disp_ops.ready(codec_data->ext_disp_core_pdev);
				if(!rc)
					break;
			}
		}
	}

	mutex_unlock(&codec_data->dp_ops_lock);

	return 0;
}