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

Commit 839e05b9 authored by Ray Zhang's avatar Ray Zhang
Browse files

msm: ext_disp: add audio ops to notify codec status



In some cases the audio codec is not ready when display
is up, while the interface driver doesn't know how to
respond without knowing audio codec's status. So add an
audio ops to support this case.

CRs-Fixed: 2010135
Change-Id: I4a19f57858a5ed2999daefc0192d62bef332453b
Signed-off-by: default avatarRay Zhang <rayz@codeaurora.org>
parent 15a311d0
Loading
Loading
Loading
Loading
+12 −5
Original line number Diff line number Diff line
@@ -654,6 +654,7 @@ int msm_ext_disp_register_audio_codec(struct platform_device *pdev,
{
	int ret = 0;
	struct msm_ext_disp *ext_disp = NULL;
	struct msm_ext_disp_list *node = NULL;

	if (!pdev || !ops) {
		pr_err("Invalid params\n");
@@ -671,17 +672,23 @@ int msm_ext_disp_register_audio_codec(struct platform_device *pdev,
	if ((ext_disp->current_disp != EXT_DISPLAY_TYPE_MAX)
			&& ext_disp->ops) {
		pr_err("Codec already registered\n");
		ret = -EINVAL;
		goto end;
		mutex_unlock(&ext_disp->lock);
		return -EINVAL;
	}

	ext_disp->ops = ops;

	pr_debug("audio codec registered\n");

end:
	mutex_unlock(&ext_disp->lock);

	list_for_each_entry(node, &ext_disp->display_list, list) {
		struct msm_ext_disp_init_data *data = node->data;

		if (data->codec_ops.codec_ready)
			data->codec_ops.codec_ready(data->pdev);
	}

	pr_debug("audio codec registered\n");

	return ret;
}

+2 −0
Original line number Diff line number Diff line
@@ -114,6 +114,7 @@ struct msm_ext_disp_intf_ops {
 * @cable_status: cable connected/disconnected
 * @get_intf_id: id of connected interface
 * @acknowledge: acknowledge audio status
 * @codec_ready: notify when codec is ready
 */
struct msm_ext_disp_audio_codec_ops {
	int (*audio_info_setup)(struct platform_device *pdev,
@@ -124,6 +125,7 @@ struct msm_ext_disp_audio_codec_ops {
	int (*get_intf_id)(struct platform_device *pdev);
	void (*teardown_done)(struct platform_device *pdev);
	int (*acknowledge)(struct platform_device *pdev, u32 ack);
	void (*codec_ready)(struct platform_device *pdev);
};

/*