All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Amadeusz Sławiński" <amadeuszx.slawinski@linux.intel.com>
To: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
	bjorn.andersson@linaro.org, broonie@kernel.org, robh@kernel.org
Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org,
	bgoswami@codeaurora.org, tiwai@suse.de, plai@codeaurora.org,
	lgirdwood@gmail.com
Subject: Re: [PATCH v3 14/20] ASoC: qdsp6: audioreach: add q6apm support
Date: Tue, 3 Aug 2021 16:20:23 +0200	[thread overview]
Message-ID: <111d4d4f-06f0-b7ca-579a-316e87f24f86@linux.intel.com> (raw)
In-Reply-To: <20210803125411.28066-15-srinivas.kandagatla@linaro.org>

On 8/3/2021 2:54 PM, Srinivas Kandagatla wrote:
> Add support to q6apm (Audio Process Manager) component which is
> core Audioreach service running in the DSP.
> 
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> ---

...

> diff --git a/sound/soc/qcom/qdsp6/q6apm.c b/sound/soc/qcom/qdsp6/q6apm.c
> new file mode 100644
> index 000000000000..6b0b11204f88
> --- /dev/null
> +++ b/sound/soc/qcom/qdsp6/q6apm.c
> @@ -0,0 +1,662 @@
> +// SPDX-License-Identifier: GPL-2.0
> +// Copyright (c) 2020, Linaro Limited
> +
> +#include <dt-bindings/soc/qcom,gpr.h>
> +#include <linux/delay.h>
> +#include <linux/jiffies.h>
> +#include <linux/kernel.h>
> +#include <linux/module.h>
> +#include <linux/of.h>
> +#include <linux/of_platform.h>
> +#include <linux/sched.h>
> +#include <linux/slab.h>
> +#include <linux/soc/qcom/apr.h>
> +#include <linux/wait.h>
> +#include <sound/soc.h>
> +#include <sound/soc-dapm.h>
> +#include <sound/pcm.h>
> +#include "audioreach.h"
> +#include "q6apm.h"
> +
> +/* Graph Management */
> +struct apm_graph_mgmt_cmd {
> +	struct apm_module_param_data param_data;
> +	uint32_t num_sub_graphs;
> +	uint32_t sub_graph_id_list[0];uint32_t sub_graph_id_list[];


> +} __packed;
> +

...

> +
> +static struct audioreach_graph *q6apm_get_audioreach_graph(struct q6apm *apm,
> +						      uint32_t graph_id)
> +{
> +	struct audioreach_graph *graph;
> +	struct audioreach_graph_info *info;
> +	unsigned long flags;
> +
> +	spin_lock_irqsave(&apm->lock, flags);
> +	graph = idr_find(&apm->graph_idr, graph_id);
> +	spin_unlock_irqrestore(&apm->lock, flags);
> +
> +	if (graph) {
> +		kref_get(&graph->refcount);
> +		return graph;
> +	}
> +
> +	info = idr_find(&apm->graph_info_idr, graph_id);
> +
> +	if (!info)
> +		return ERR_PTR(-ENODEV);
> +
> +	graph = kzalloc(sizeof(*graph), GFP_KERNEL);
> +	if (!graph)
> +		return ERR_PTR(-ENOMEM);
> +
> +	graph->apm = apm;
> +	graph->info = info;
> +	graph->id = graph_id;
> +
> +	/* Assuming Linear Graphs only for now! */
> +	graph->graph = audioreach_alloc_graph_pkt(apm, &info->sg_list, graph_id);
> +	if (IS_ERR(graph->graph))
> +		return ERR_PTR(-ENOMEM);
Shouldn't graph be freed before returning here?

> +
> +	spin_lock(&apm->lock);
> +	idr_alloc(&apm->graph_idr, graph, graph_id,
> +		  graph_id + 1, GFP_ATOMIC);
> +	spin_unlock(&apm->lock);
> +
> +	kref_init(&graph->refcount);
> +
> +	q6apm_send_cmd_sync(apm, graph->graph, 0);
> +
> +	return graph;
> +}
> +

...


  reply	other threads:[~2021-08-03 14:22 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-03 12:53 [PATCH v3 00/20] ASoC: qcom: Add AudioReach support Srinivas Kandagatla
2021-08-03 12:53 ` Srinivas Kandagatla
2021-08-03 12:53 ` [PATCH v3 01/20] soc: dt-bindings: qcom: apr: convert to yaml Srinivas Kandagatla
2021-08-03 12:53   ` Srinivas Kandagatla
2021-08-03 12:53 ` [PATCH v3 02/20] soc: qcom: apr: make code more reuseable Srinivas Kandagatla
2021-08-03 12:53   ` Srinivas Kandagatla
2021-08-03 12:53 ` [PATCH v3 03/20] soc: dt-bindings: qcom: add gpr bindings Srinivas Kandagatla
2021-08-03 12:53   ` Srinivas Kandagatla
2021-08-03 12:53 ` [PATCH v3 04/20] soc: qcom: apr: Add GPR support Srinivas Kandagatla
2021-08-03 12:53   ` Srinivas Kandagatla
2021-08-03 12:53 ` [PATCH v3 05/20] ASoC: dt-bindings: replace q6afe bindings with q6dsp-audio-ports Srinivas Kandagatla
2021-08-03 12:53   ` Srinivas Kandagatla
2021-08-04 17:53   ` Mark Brown
2021-08-04 17:53     ` Mark Brown
2021-08-05  9:16     ` Srinivas Kandagatla
2021-08-05  9:16       ` Srinivas Kandagatla
2021-08-11 18:19       ` Rob Herring
2021-08-11 18:19         ` Rob Herring
2021-08-03 12:53 ` [PATCH v3 06/20] ASoC: dt-bindings: replace q6afe-clk with q6dsp audio clk bindings Srinivas Kandagatla
2021-08-03 12:53   ` Srinivas Kandagatla
2021-08-11 18:24   ` Rob Herring
2021-08-11 18:24     ` Rob Herring
2021-08-03 12:53 ` [PATCH v3 07/20] ASoC: dt-bindings: replace q6asm with q6dsp audio stream bindings Srinivas Kandagatla
2021-08-03 12:53   ` Srinivas Kandagatla
2021-08-03 12:53 ` [PATCH v3 08/20] ASoC: qdsp6: q6afe-dai: move lpass audio ports to common file Srinivas Kandagatla
2021-08-03 12:53   ` Srinivas Kandagatla
2021-08-03 12:54 ` [PATCH v3 09/20] ASoC: qdsp6: q6afe-clocks: move audio-clocks " Srinivas Kandagatla
2021-08-03 12:54   ` Srinivas Kandagatla
2021-08-03 12:54 ` [PATCH v3 10/20] ASoC: dt-bindings: q6dsp: add q6apm-dai compatible Srinivas Kandagatla
2021-08-03 12:54   ` Srinivas Kandagatla
2021-08-04 18:01   ` Mark Brown
2021-08-04 18:01     ` Mark Brown
2021-08-05  9:16     ` Srinivas Kandagatla
2021-08-05  9:16       ` Srinivas Kandagatla
2021-08-03 12:54 ` [PATCH v3 11/20] ASoC: dt-bindings: q6dsp: add q6apm-bedai compatible Srinivas Kandagatla
2021-08-03 12:54   ` Srinivas Kandagatla
2021-08-04 18:01   ` Mark Brown
2021-08-04 18:01     ` Mark Brown
2021-08-05  9:16     ` Srinivas Kandagatla
2021-08-05  9:16       ` Srinivas Kandagatla
2021-08-03 12:54 ` [PATCH v3 12/20] ASoC: dt-bindings: q6dsp-clocks: add q6prm clocks compatible Srinivas Kandagatla
2021-08-03 12:54   ` Srinivas Kandagatla
2021-08-04 18:02   ` Mark Brown
2021-08-04 18:02     ` Mark Brown
2021-08-05  9:17     ` Srinivas Kandagatla
2021-08-05  9:17       ` Srinivas Kandagatla
2021-08-03 12:54 ` [PATCH v3 13/20] ASoC: qdsp6: audioreach: add basic pkt alloc support Srinivas Kandagatla
2021-08-03 12:54   ` Srinivas Kandagatla
2021-08-03 14:19   ` Amadeusz Sławiński
2021-08-03 14:39     ` Srinivas Kandagatla
2021-08-04 18:09   ` Mark Brown
2021-08-04 18:09     ` Mark Brown
2021-08-05  9:17     ` Srinivas Kandagatla
2021-08-05  9:17       ` Srinivas Kandagatla
2021-08-03 12:54 ` [PATCH v3 14/20] ASoC: qdsp6: audioreach: add q6apm support Srinivas Kandagatla
2021-08-03 12:54   ` Srinivas Kandagatla
2021-08-03 14:20   ` Amadeusz Sławiński [this message]
2021-08-03 14:48     ` Srinivas Kandagatla
2021-08-03 12:54 ` [PATCH v3 15/20] ASoC: qdsp6: audioreach: add module configuration command helpers Srinivas Kandagatla
2021-08-03 12:54   ` Srinivas Kandagatla
2021-08-03 12:54 ` [PATCH v3 16/20] ASoC: qdsp6: audioreach: add topology support Srinivas Kandagatla
2021-08-03 12:54   ` Srinivas Kandagatla
2021-08-03 14:21   ` Amadeusz Sławiński
2021-08-03 14:47     ` Srinivas Kandagatla
2021-08-03 12:54 ` [PATCH v3 17/20] ASoC: qdsp6: audioreach: add q6apm-dai support Srinivas Kandagatla
2021-08-03 12:54   ` Srinivas Kandagatla
2021-08-03 12:54 ` [PATCH v3 18/20] ASoC: qdsp6: audioreach: add bedai support Srinivas Kandagatla
2021-08-03 12:54   ` Srinivas Kandagatla
2021-08-03 12:54 ` [PATCH v3 19/20] ASoC: qdsp6: audioreach: add q6prm support Srinivas Kandagatla
2021-08-03 12:54   ` Srinivas Kandagatla
2021-08-03 12:54 ` [PATCH v3 20/20] ASoC: qdsp6: audioreach: add support for q6prm-clocks Srinivas Kandagatla
2021-08-03 12:54   ` Srinivas Kandagatla
2021-08-03 15:00 ` [PATCH v3 00/20] ASoC: qcom: Add AudioReach support Pierre-Louis Bossart
2021-08-03 15:03   ` Srinivas Kandagatla

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=111d4d4f-06f0-b7ca-579a-316e87f24f86@linux.intel.com \
    --to=amadeuszx.slawinski@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=bgoswami@codeaurora.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=plai@codeaurora.org \
    --cc=robh@kernel.org \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=tiwai@suse.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.