Loading drivers/soc/qcom/qdsp6v2/apr_v2.c +2 −1 Original line number Diff line number Diff line /* * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved. * Copyright (c) 2012-2016, 2018 The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading @@ -25,6 +25,7 @@ enum apr_subsys_state apr_get_subsys_state(void) { return apr_get_q6_state(); } EXPORT_SYMBOL(apr_get_subsys_state); void apr_set_subsys_state(void) { Loading drivers/soc/qcom/qdsp6v2/apr_v3.c +2 −1 Original line number Diff line number Diff line /* * Copyright (c) 2013-2016, The Linux Foundation. All rights reserved. * Copyright (c) 2013-2016, 2018 The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading @@ -25,6 +25,7 @@ enum apr_subsys_state apr_get_subsys_state(void) { return apr_get_modem_state(); } EXPORT_SYMBOL(apr_get_subsys_state); void apr_set_subsys_state(void) { Loading sound/soc/codecs/bg_codec.c +9 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ #include <sound/soc.h> #include <sound/soc-dapm.h> #include <sound/tlv.h> #include <linux/qdsp6v2/apr.h> #include <sound/info.h> #include <soc/qcom/bg_glink.h> #include "bg_codec.h" Loading Loading @@ -864,6 +865,14 @@ static int bg_cdc_probe(struct platform_device *pdev) { struct bg_cdc_priv *bg_cdc; int ret = 0; int adsp_state; adsp_state = apr_get_subsys_state(); if (adsp_state != APR_SUBSYS_LOADED) { pr_err("%s:Adsp is not loaded yet %d\n", __func__, adsp_state); return -EPROBE_DEFER; } bg_cdc = kzalloc(sizeof(struct bg_cdc_priv), GFP_KERNEL); Loading sound/soc/codecs/pktzr.c +6 −6 Original line number Diff line number Diff line Loading @@ -65,6 +65,7 @@ struct pktzr_priv { struct platform_device *pdev; pktzr_data_cmd_cb_fn data_cmd_cb; int num_channels; bool pktzr_init_complete; }; static struct pktzr_priv *ppriv; Loading Loading @@ -103,8 +104,8 @@ static int pktzr_send_pkt(void *payload, uint32_t size, void *rsp, int rc = 0; pr_debug("%s: cmd=%d sync=%d size=%d\n", __func__, cmd, sync_cmd, size); if (!ppriv) { pr_err("packetizer not initialized"); if (!ppriv || !ppriv->pktzr_init_complete) { pr_err_ratelimited("packetizer not initialized\n"); return -EINVAL; } mutex_lock(&ppriv->pktzr_lock); Loading Loading @@ -242,22 +243,21 @@ int pktzr_init(void *pdev, struct bg_glink_ch_cfg *ch_info, int num_channels, pr_err("%s: Failed to open channel\n", __func__); goto err; } ppriv->token = i; } ppriv->num_channels = num_channels; ppriv->data_cmd_cb = func; ppriv->token = 0; ppriv->pdev = pdev; init_completion(&ppriv->thread_complete); mutex_init(&ppriv->pktzr_lock); INIT_LIST_HEAD(&ppriv->ch_list); ppriv->pktzr_init_complete = true; done: return 0; err: for (i = 0; i < ppriv->token; i++) bg_cdc_channel_close(ppriv->pdev, ppriv->ch_info[i]); ppriv->token = 0; bg_cdc_channel_close(pdev, ppriv->ch_info[i]); if (ppriv) kzfree(ppriv); ppriv = NULL; Loading Loading
drivers/soc/qcom/qdsp6v2/apr_v2.c +2 −1 Original line number Diff line number Diff line /* * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved. * Copyright (c) 2012-2016, 2018 The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading @@ -25,6 +25,7 @@ enum apr_subsys_state apr_get_subsys_state(void) { return apr_get_q6_state(); } EXPORT_SYMBOL(apr_get_subsys_state); void apr_set_subsys_state(void) { Loading
drivers/soc/qcom/qdsp6v2/apr_v3.c +2 −1 Original line number Diff line number Diff line /* * Copyright (c) 2013-2016, The Linux Foundation. All rights reserved. * Copyright (c) 2013-2016, 2018 The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading @@ -25,6 +25,7 @@ enum apr_subsys_state apr_get_subsys_state(void) { return apr_get_modem_state(); } EXPORT_SYMBOL(apr_get_subsys_state); void apr_set_subsys_state(void) { Loading
sound/soc/codecs/bg_codec.c +9 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ #include <sound/soc.h> #include <sound/soc-dapm.h> #include <sound/tlv.h> #include <linux/qdsp6v2/apr.h> #include <sound/info.h> #include <soc/qcom/bg_glink.h> #include "bg_codec.h" Loading Loading @@ -864,6 +865,14 @@ static int bg_cdc_probe(struct platform_device *pdev) { struct bg_cdc_priv *bg_cdc; int ret = 0; int adsp_state; adsp_state = apr_get_subsys_state(); if (adsp_state != APR_SUBSYS_LOADED) { pr_err("%s:Adsp is not loaded yet %d\n", __func__, adsp_state); return -EPROBE_DEFER; } bg_cdc = kzalloc(sizeof(struct bg_cdc_priv), GFP_KERNEL); Loading
sound/soc/codecs/pktzr.c +6 −6 Original line number Diff line number Diff line Loading @@ -65,6 +65,7 @@ struct pktzr_priv { struct platform_device *pdev; pktzr_data_cmd_cb_fn data_cmd_cb; int num_channels; bool pktzr_init_complete; }; static struct pktzr_priv *ppriv; Loading Loading @@ -103,8 +104,8 @@ static int pktzr_send_pkt(void *payload, uint32_t size, void *rsp, int rc = 0; pr_debug("%s: cmd=%d sync=%d size=%d\n", __func__, cmd, sync_cmd, size); if (!ppriv) { pr_err("packetizer not initialized"); if (!ppriv || !ppriv->pktzr_init_complete) { pr_err_ratelimited("packetizer not initialized\n"); return -EINVAL; } mutex_lock(&ppriv->pktzr_lock); Loading Loading @@ -242,22 +243,21 @@ int pktzr_init(void *pdev, struct bg_glink_ch_cfg *ch_info, int num_channels, pr_err("%s: Failed to open channel\n", __func__); goto err; } ppriv->token = i; } ppriv->num_channels = num_channels; ppriv->data_cmd_cb = func; ppriv->token = 0; ppriv->pdev = pdev; init_completion(&ppriv->thread_complete); mutex_init(&ppriv->pktzr_lock); INIT_LIST_HEAD(&ppriv->ch_list); ppriv->pktzr_init_complete = true; done: return 0; err: for (i = 0; i < ppriv->token; i++) bg_cdc_channel_close(ppriv->pdev, ppriv->ch_info[i]); ppriv->token = 0; bg_cdc_channel_close(pdev, ppriv->ch_info[i]); if (ppriv) kzfree(ppriv); ppriv = NULL; Loading