Merge "ipc: apr: add qcom,subsys-name for apr" into audio-drivers.lnx.3.0

This commit is contained in:
Linux Build Service Account 2018-06-07 22:17:06 -07:00 committed by Gerrit - the friendly Code Review server
commit 8fe64bdfd0

View file

@ -43,6 +43,7 @@ static struct apr_client client[APR_DEST_MAX][APR_CLIENT_MAX];
static void *apr_pkt_ctx; static void *apr_pkt_ctx;
static wait_queue_head_t modem_wait; static wait_queue_head_t modem_wait;
static bool is_modem_up; static bool is_modem_up;
static char *subsys_name = NULL;
/* Subsystem restart: QDSP6 data, functions */ /* Subsystem restart: QDSP6 data, functions */
static struct workqueue_struct *apr_reset_workqueue; static struct workqueue_struct *apr_reset_workqueue;
static void apr_reset_deregister(struct work_struct *work); static void apr_reset_deregister(struct work_struct *work);
@ -1108,8 +1109,7 @@ static void apr_cleanup(void)
int i, j, k; int i, j, k;
of_platform_depopulate(apr_priv->dev); of_platform_depopulate(apr_priv->dev);
subsys_notif_deregister("apr_modem"); subsys_notif_deregister(subsys_name);
subsys_notif_deregister("apr_adsp");
if (apr_reset_workqueue) { if (apr_reset_workqueue) {
flush_workqueue(apr_reset_workqueue); flush_workqueue(apr_reset_workqueue);
destroy_workqueue(apr_reset_workqueue); destroy_workqueue(apr_reset_workqueue);
@ -1127,7 +1127,7 @@ static void apr_cleanup(void)
static int apr_probe(struct platform_device *pdev) static int apr_probe(struct platform_device *pdev)
{ {
int i, j, k; int i, j, k, ret = 0;
init_waitqueue_head(&modem_wait); init_waitqueue_head(&modem_wait);
@ -1163,10 +1163,26 @@ static int apr_probe(struct platform_device *pdev)
spin_lock(&apr_priv->apr_lock); spin_lock(&apr_priv->apr_lock);
apr_priv->is_initial_boot = true; apr_priv->is_initial_boot = true;
spin_unlock(&apr_priv->apr_lock); spin_unlock(&apr_priv->apr_lock);
subsys_notif_register("apr_adsp", AUDIO_NOTIFIER_ADSP_DOMAIN, ret = of_property_read_string(pdev->dev.of_node,
&adsp_service_nb); "qcom,subsys-name",
subsys_notif_register("apr_modem", AUDIO_NOTIFIER_MODEM_DOMAIN, (const char **)(&subsys_name));
&modem_service_nb); if (ret) {
pr_err("%s: missing subsys-name entry in dt node\n", __func__);
return -EINVAL;
}
if (!strcmp(subsys_name, "apr_adsp")) {
subsys_notif_register("apr_adsp",
AUDIO_NOTIFIER_ADSP_DOMAIN,
&adsp_service_nb);
} else if (!strcmp(subsys_name, "apr_modem")) {
subsys_notif_register("apr_modem",
AUDIO_NOTIFIER_MODEM_DOMAIN,
&modem_service_nb);
} else {
pr_err("%s: invalid subsys-name %s\n", __func__, subsys_name);
return -EINVAL;
}
apr_tal_init(); apr_tal_init();
return apr_debug_init(); return apr_debug_init();