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: Ray Zhang <rayz@codeaurora.org>
This commit is contained in:
Ray Zhang 2017-03-28 23:43:44 +08:00
parent 15a311d026
commit 839e05b97a
2 changed files with 14 additions and 5 deletions

View file

@ -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;
}

View file

@ -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);
};
/*