On 28/09/2021 09:23, Amadeusz Sławiński wrote:
On 9/27/2021 3:55 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@xxxxxxxxxx>
---
(...)
+++ b/sound/soc/qcom/qdsp6/q6apm.c
@@ -0,0 +1,597 @@
+// 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[];
+} __packed;
+
+#define APM_GRAPH_MGMT_PSIZE(n) ALIGN(sizeof(struct
apm_graph_mgmt_cmd) + \
+ n * sizeof(uint32_t), 8)
Possible struct_size again
Yes, we could use struct_size here.
+
+int q6apm_send_cmd_sync(struct q6apm *apm, struct gpr_pkt *pkt,
uint32_t rsp_opcode)
There seems to be 'tab' in argument list?
That's true, in vi I could not spot this by just looking.
+{
+ gpr_device_t *gdev = apm->gdev;
+
+ return audioreach_send_cmd_sync(&gdev->dev, gdev, &apm->result,
&apm->lock,
+ NULL, &apm->wait, pkt, rsp_opcode);
+}
+
(...)