ipc: apr: add qcom,subsys-name for apr
Add qcom,subsys-name for apr driver. Based on the property, registration of notifier is done for the right co-processor, from which notification needs to be received. Change-Id: Id492c8b24d1a4cf0bcab37700a1e9c61c9067041 Signed-off-by: Meng Wang <mengw@codeaurora.org>
This commit is contained in:
30
ipc/apr.c
30
ipc/apr.c
@@ -43,6 +43,7 @@ static struct apr_client client[APR_DEST_MAX][APR_CLIENT_MAX];
|
||||
static void *apr_pkt_ctx;
|
||||
static wait_queue_head_t modem_wait;
|
||||
static bool is_modem_up;
|
||||
static char *subsys_name = NULL;
|
||||
/* Subsystem restart: QDSP6 data, functions */
|
||||
static struct workqueue_struct *apr_reset_workqueue;
|
||||
static void apr_reset_deregister(struct work_struct *work);
|
||||
@@ -1108,8 +1109,7 @@ static void apr_cleanup(void)
|
||||
int i, j, k;
|
||||
|
||||
of_platform_depopulate(apr_priv->dev);
|
||||
subsys_notif_deregister("apr_modem");
|
||||
subsys_notif_deregister("apr_adsp");
|
||||
subsys_notif_deregister(subsys_name);
|
||||
if (apr_reset_workqueue) {
|
||||
flush_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)
|
||||
{
|
||||
int i, j, k;
|
||||
int i, j, k, ret = 0;
|
||||
|
||||
init_waitqueue_head(&modem_wait);
|
||||
|
||||
@@ -1163,10 +1163,26 @@ static int apr_probe(struct platform_device *pdev)
|
||||
spin_lock(&apr_priv->apr_lock);
|
||||
apr_priv->is_initial_boot = true;
|
||||
spin_unlock(&apr_priv->apr_lock);
|
||||
subsys_notif_register("apr_adsp", AUDIO_NOTIFIER_ADSP_DOMAIN,
|
||||
&adsp_service_nb);
|
||||
subsys_notif_register("apr_modem", AUDIO_NOTIFIER_MODEM_DOMAIN,
|
||||
&modem_service_nb);
|
||||
ret = of_property_read_string(pdev->dev.of_node,
|
||||
"qcom,subsys-name",
|
||||
(const char **)(&subsys_name));
|
||||
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();
|
||||
return apr_debug_init();
|
||||
|
Verwijs in nieuw issue
Block a user