From: rohitkr@codeaurora.org (Rohit Kumar)
To: linux-arm-kernel@lists.infradead.org
Subject: [alsa-devel] [RESEND PATCH v2 09/15] ASoC: qcom: qdsp6: Add support to Q6CORE
Date: Wed, 7 Feb 2018 17:45:53 +0530 [thread overview]
Message-ID: <39d78468-db2b-05ce-9602-c76b083d7f75@codeaurora.org> (raw)
In-Reply-To: <20171214173402.19074-10-srinivas.kandagatla@linaro.org>
On 12/14/2017 11:03 PM, srinivas.kandagatla at linaro.org wrote:
> From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
>
> This patch adds support to core apr service, which is used to query
> status of other static and dynamic services on the dsp.
>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> ---
> sound/soc/qcom/Kconfig | 5 +
> sound/soc/qcom/qdsp6/Makefile | 1 +
> sound/soc/qcom/qdsp6/q6core.c | 227 ++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 233 insertions(+)
> create mode 100644 sound/soc/qcom/qdsp6/q6core.c
>
> diff --git a/sound/soc/qcom/Kconfig b/sound/soc/qcom/Kconfig
> index 7ebdb879a8a3..121b9c957024 100644
> --- a/sound/soc/qcom/Kconfig
> +++ b/sound/soc/qcom/Kconfig
> @@ -56,11 +56,16 @@ config SND_SOC_QDSP6_ASM
> tristate
> default n
>
> +config SND_SOC_QDSP6_CORE
> + tristate
> + default n
> +
> config SND_SOC_QDSP6
> tristate "SoC ALSA audio driver for QDSP6"
> select SND_SOC_QDSP6_AFE
> select SND_SOC_QDSP6_ADM
> select SND_SOC_QDSP6_ASM
> + select SND_SOC_QDSP6_CORE
> help
> To add support for MSM QDSP6 Soc Audio.
> This will enable sound soc platform specific
> diff --git a/sound/soc/qcom/qdsp6/Makefile b/sound/soc/qcom/qdsp6/Makefile
> index 49dd3ccab27b..ad7f10691e54 100644
> --- a/sound/soc/qcom/qdsp6/Makefile
> +++ b/sound/soc/qcom/qdsp6/Makefile
> @@ -1,3 +1,4 @@
> obj-$(CONFIG_SND_SOC_QDSP6_AFE) += q6afe.o
> obj-$(CONFIG_SND_SOC_QDSP6_ADM) += q6adm.o
> obj-$(CONFIG_SND_SOC_QDSP6_ASM) += q6asm.o
> +obj-$(CONFIG_SND_SOC_QDSP6_CORE) += q6core.o
> diff --git a/sound/soc/qcom/qdsp6/q6core.c b/sound/soc/qcom/qdsp6/q6core.c
> new file mode 100644
> index 000000000000..d4e2dbc62489
> --- /dev/null
> +++ b/sound/soc/qcom/qdsp6/q6core.c
> @@ -0,0 +1,227 @@
> +/* SPDX-License-Identifier: GPL-2.0
> +* Copyright (c) 2017, Linaro Limited
> +*/
> +#include <linux/slab.h>
> +#include <linux/wait.h>
> +#include <linux/kernel.h>
> +#include <linux/module.h>
> +#include <linux/sched.h>
> +#include <linux/jiffies.h>
[..]
> +
> + dev_set_drvdata(&adev->dev, core);
> +
> + core->adev = adev;
> + init_waitqueue_head(&core->wait);
> +
> + do {
> + if (!q6core_is_adsp_ready(core)) {
> + dev_info(&adev->dev, "ADSP Audio isn't ready\n");
> + } else {
> + dev_info(&adev->dev, "ADSP Audio is ready\n");
> +
If q6core_is_adsp_ready() return failure, then we should not call and
ADSP API.
> + ret = q6core_get_svc_versions(core);
> + if (!ret)
> + q6core_add_static_services(core);
> +
> + break;
> + }
> + } while (time_after(timeout, jiffies));
> +
I think we should defer probe if q6core_is_adsp_ready() returns failure
and timeouts.
> + return ret;
> +}
> +
> +static int q6core_exit(struct apr_device *adev)
> +{
> + return 0;
> +}
> +
> +static const struct apr_device_id core_id[] = {
> + {"Q6CORE", APR_DOMAIN_ADSP, APR_SVC_ADSP_CORE, APR_CLIENT_AUDIO},
> + { },
> +};
> +
> +static struct apr_driver qcom_q6core_driver = {
> + .probe = q6core_probe,
> + .remove = q6core_exit,
> + .callback = core_callback,
> + .id_table = core_id,
> + .driver = {
> + .name = "qcom-q6core",
> + },
> +};
> +
> +module_apr_driver(qcom_q6core_driver);
> +
> +MODULE_AUTHOR("Srinivas Kandagatla <srinivas.kandagatla@linaro.org");
> +MODULE_DESCRIPTION("q6 core");
> +MODULE_LICENSE("GPL v2");
next prev parent reply other threads:[~2018-02-07 12:15 UTC|newest]
Thread overview: 66+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-14 17:33 [RESEND PATCH v2 00/15] ASoC: qcom: Add support to QDSP6 based audio srinivas.kandagatla at linaro.org
2017-12-14 17:33 ` [RESEND PATCH v2 01/15] dt-bindings: soc: qcom: Add bindings for APR bus srinivas.kandagatla at linaro.org
2017-12-16 17:27 ` Rob Herring
2017-12-18 9:50 ` Srinivas Kandagatla
2018-01-03 0:35 ` Bjorn Andersson
2018-01-03 16:26 ` Srinivas Kandagatla
2017-12-14 17:33 ` [RESEND PATCH v2 02/15] soc: qcom: add support to APR bus driver srinivas.kandagatla at linaro.org
2018-01-01 23:29 ` Bjorn Andersson
2018-01-03 16:26 ` Srinivas Kandagatla
2017-12-14 17:33 ` [RESEND PATCH v2 03/15] ASoC: qcom: qdsp6: Add common qdsp6 helper functions srinivas.kandagatla at linaro.org
2018-01-02 0:19 ` Bjorn Andersson
2018-01-03 16:26 ` Srinivas Kandagatla
2017-12-14 17:33 ` [RESEND PATCH v2 04/15] ASoC: qcom: qdsp6: Add support to Q6AFE srinivas.kandagatla at linaro.org
2018-01-02 0:45 ` Bjorn Andersson
2018-01-03 16:26 ` Srinivas Kandagatla
2017-12-14 17:33 ` [RESEND PATCH v2 05/15] ASoC: qcom: qdsp6: Add support to Q6ADM srinivas.kandagatla at linaro.org
2018-01-02 1:50 ` Bjorn Andersson
2018-01-03 16:26 ` Srinivas Kandagatla
2017-12-14 17:33 ` [RESEND PATCH v2 06/15] ASoC: qcom: qdsp6: Add support to Q6ASM srinivas.kandagatla at linaro.org
2018-01-02 4:43 ` Bjorn Andersson
2018-01-03 16:26 ` Srinivas Kandagatla
2017-12-14 17:33 ` [RESEND PATCH v2 07/15] ASoC: qcom: q6asm: Add support to memory map and unmap srinivas.kandagatla at linaro.org
2018-01-02 5:48 ` Bjorn Andersson
2018-01-03 16:26 ` Srinivas Kandagatla
2018-01-03 19:39 ` Bjorn Andersson
2017-12-14 17:33 ` [RESEND PATCH v2 08/15] ASoC: qcom: q6asm: add support to audio stream apis srinivas.kandagatla at linaro.org
2018-01-02 20:08 ` Bjorn Andersson
2018-01-03 16:26 ` Srinivas Kandagatla
2018-01-13 8:42 ` [alsa-devel] " Rohit Kumar
2017-12-14 17:33 ` [RESEND PATCH v2 09/15] ASoC: qcom: qdsp6: Add support to Q6CORE srinivas.kandagatla at linaro.org
2018-01-02 22:15 ` Bjorn Andersson
2018-01-03 16:27 ` Srinivas Kandagatla
2018-02-07 12:15 ` Rohit Kumar [this message]
2017-12-14 17:33 ` [RESEND PATCH v2 10/15] ASoC: qcom: qdsp6: Add support to q6routing driver srinivas.kandagatla at linaro.org
2018-01-02 23:00 ` Bjorn Andersson
2018-01-03 16:27 ` Srinivas Kandagatla
2017-12-14 17:33 ` [RESEND PATCH v2 11/15] ASoC: qcom: qdsp6: Add support to q6afe dai driver srinivas.kandagatla at linaro.org
2018-01-02 23:28 ` Bjorn Andersson
2018-01-03 16:27 ` Srinivas Kandagatla
2018-02-07 11:34 ` [alsa-devel] " Rohit Kumar
2018-02-07 11:40 ` Srinivas Kandagatla
2017-12-14 17:33 ` [RESEND PATCH v2 12/15] ASoC: qcom: qdsp6: Add support to q6asm " srinivas.kandagatla at linaro.org
2018-01-03 0:03 ` Bjorn Andersson
2018-01-03 16:27 ` Srinivas Kandagatla
2018-01-13 8:45 ` [alsa-devel] " Rohit Kumar
2017-12-14 17:34 ` [RESEND PATCH v2 13/15] dt-bindings: sound: qcom: Add devicetree bindings for apq8096 srinivas.kandagatla at linaro.org
2017-12-16 17:44 ` Rob Herring
2017-12-18 9:49 ` Srinivas Kandagatla
2018-01-03 0:28 ` Bjorn Andersson
2018-01-03 16:27 ` Srinivas Kandagatla
2018-01-03 19:49 ` Bjorn Andersson
2017-12-14 17:34 ` [RESEND PATCH v2 14/15] ASoC: qcom: apq8096: Add db820c machine driver srinivas.kandagatla at linaro.org
2018-01-03 0:16 ` Bjorn Andersson
2018-01-03 16:27 ` Srinivas Kandagatla
2018-01-03 20:04 ` Bjorn Andersson
2018-01-03 17:20 ` Stephen Boyd
2018-01-03 18:36 ` Srinivas Kandagatla
2018-01-03 19:41 ` Stephen Boyd
2018-01-04 9:25 ` Srinivas Kandagatla
2018-01-04 12:02 ` Mark Brown
2018-01-04 13:44 ` Srinivas Kandagatla
2018-01-04 14:03 ` Mark Brown
2017-12-14 17:34 ` [RESEND PATCH v2 15/15] arm64: dts: msm8996: db820c: Add sound card support srinivas.kandagatla at linaro.org
2018-01-03 0:22 ` Bjorn Andersson
2018-01-03 16:27 ` Srinivas Kandagatla
2018-01-03 20:01 ` Bjorn Andersson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=39d78468-db2b-05ce-9602-c76b083d7f75@codeaurora.org \
--to=rohitkr@codeaurora.org \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).