Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp746519rwn; Thu, 15 Sep 2022 06:03:17 -0700 (PDT) X-Google-Smtp-Source: AA6agR7DnUOB1OBmhO5zLtD3+NQJ8pirPO27lXjZUFfxHrk/LosPbU3tMjp2Ip1K0f/Fk/zdAxMU X-Received: by 2002:a05:6402:5002:b0:444:26fd:d341 with SMTP id p2-20020a056402500200b0044426fdd341mr35564526eda.351.1663246996999; Thu, 15 Sep 2022 06:03:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663246996; cv=none; d=google.com; s=arc-20160816; b=G7Lc/Pja19lc3i0qkC2Zc5gp5h/H0R2qwdwR3RaXKkBo4DGVUpKHG0SbLYRKi3darJ gTHjb8ugPtlPJUpDNW9wtdGmAgLg96NMe895cpgG4SyPXSnTEBNIOlZwgt1TPqLbtHhB SZt6T9fJbKikN/j+M3zHiyW8I68KJ+/VQugBkJxsmhO7mP6WVqZaFuaqCaOl9v9qcZlP kdA9LlX0kMbgcTvtnc2uYPIcaI2iJ9W0bf3JhuFH9JsXyBNc/KsqvRocbgY5pqChnn4N yQSZTlBIfzMjtJGnP3YgVI/SVQtQsOKOwT5dklJgQTmsw/xfKkzQwJs6/S2+VWd26fAA txtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=IeAgNZtS8X1tLcgH+uLrT6e6JPredzlWXqw/7cX/H9c=; b=D+Bn8QlxzL2IMpWp5AiPqckomNhZOFhQCBurrYyjonj+lpRsfoqq2jDgMKiCcoxuKX 5JUOXuhPvxNSuJpNfVjszfT80rRwJ1aUktwibq3luQL4OrmvU3vFoUEZ0Jy/IFP9X5rL A8Nm5qaRGMxslGeEzU83yd3/UDDG1p7I2PUnZ0akDQ+wPEeszxjdOUqVAIWkQP7dFaSc g7NVNvkcW2rhnMkDsNTdBHJhoKgg9eJIDrD5JVFTvhJtPU7LE3cCcJiYvv+yhtRKdVzV Wn0MM4UQeB9xJZxlKpV6gvotNaZyr01ntV/FCB/cqG4G40vWYwpkn6/KUmxFpJP3d6XI J4yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NpEnD4+5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id di22-20020a170906731600b0073d68aa1384si15054965ejc.185.2022.09.15.06.02.49; Thu, 15 Sep 2022 06:03:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NpEnD4+5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229911AbiIOMj2 (ORCPT + 99 others); Thu, 15 Sep 2022 08:39:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229954AbiIOMjG (ORCPT ); Thu, 15 Sep 2022 08:39:06 -0400 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3607B844DD for ; Thu, 15 Sep 2022 05:39:01 -0700 (PDT) Received: by mail-wm1-x32f.google.com with SMTP id az6so13829899wmb.4 for ; Thu, 15 Sep 2022 05:39:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=IeAgNZtS8X1tLcgH+uLrT6e6JPredzlWXqw/7cX/H9c=; b=NpEnD4+5UvjApkez7BQRb2H/jI+T6RSMCDPJAnkFcvgXSPoETTKktjQDdmNcFHKOu7 4wZwR0mf9x+JYp5535hBJcYkUgxbr1Fjqll2o8Iz3WrqhfAGa3H1i+HYFrOw/kkKKAtg K1TvILDY1H6J7y8oJG+7RNhKJHm5ueTYTl+RW3+OtXg9lRXESR7fj2V2FskBqsppVz/F LOXuolIGk5olSXyopf2OwoJt1uzFmu6ywiWuU0RQTsmBhQwpZ3oxDk/yPgyAl5ZCvUHd Evf2/6ARERpQn+ZYEbPh7zoMRUQ8pBD/hGEchnASctsbydhzlkJZWORHqCJHjbXE9asX roKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=IeAgNZtS8X1tLcgH+uLrT6e6JPredzlWXqw/7cX/H9c=; b=aAWOnwIl7T361J9qBFPVXRk364/HkZ1KA5yPmUCOgAkpgF/87pEnQEmGGrsvYVr133 kwDR65vmDgr3GvRcLR5EUrmu+1KP3cGVlmflBzunj+m5tPgrlI+6ZpA+5l59HI2ely7A RKA1l+Cqp7pOaUM3BsQiYRtVTq9WMLinoY6VlPYkWHX+aDawaPHoXt4azL83VkSBM4mF XnDO1a86CkknMypRCHa/XCHy34fLBvF8ErCrTGVw65N85fmoA3Z0UL2v7AcckTxemma7 o4PoT7xj5JgIEExeszW0Om6z71sDZ95y8Bc0OYV4zGBLXVAXbuJ4NgvWJo05tO/lc+qm 1Wyg== X-Gm-Message-State: ACgBeo2bsDxEi9qvtXVEA5ZatbsXGtsm0RwUkYN3QOtAK+t61+Cjuo/3 j0um+nQVxEJHQSFJJ2T4vVC9HQ== X-Received: by 2002:a05:600c:4f53:b0:3b4:9aad:7845 with SMTP id m19-20020a05600c4f5300b003b49aad7845mr6561451wmq.159.1663245540816; Thu, 15 Sep 2022 05:39:00 -0700 (PDT) Received: from srini-hackbox.lan (cpc90716-aztw32-2-0-cust825.18-1.cable.virginm.net. [86.26.103.58]) by smtp.gmail.com with ESMTPSA id bg13-20020a05600c3c8d00b003a5f4fccd4asm3112559wmb.35.2022.09.15.05.38.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Sep 2022 05:39:00 -0700 (PDT) From: Srinivas Kandagatla To: broonie@kernel.org Cc: lgirdwood@gmail.com, bgoswami@quicinc.com, perex@perex.cz, tiwai@suse.com, linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH 9/9] ASoC: qdsp6: audioreach: add support to enable module command Date: Thu, 15 Sep 2022 13:38:37 +0100 Message-Id: <20220915123837.11591-10-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20220915123837.11591-1-srinivas.kandagatla@linaro.org> References: <20220915123837.11591-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add support to enable Module command which is required for logging module to be able to debug. Signed-off-by: Srinivas Kandagatla --- sound/soc/qcom/qdsp6/audioreach.c | 37 +++++++++++++++++++++++++++++++ sound/soc/qcom/qdsp6/audioreach.h | 5 +++++ 2 files changed, 42 insertions(+) diff --git a/sound/soc/qcom/qdsp6/audioreach.c b/sound/soc/qcom/qdsp6/audioreach.c index 05b58239cab6..e88ace794d4f 100644 --- a/sound/soc/qcom/qdsp6/audioreach.c +++ b/sound/soc/qcom/qdsp6/audioreach.c @@ -729,6 +729,42 @@ static int audioreach_sal_set_media_format(struct q6apm_graph *graph, return rc; } +static int audioreach_module_enable(struct q6apm_graph *graph, + struct audioreach_module *module, + bool enable) +{ + struct apm_module_param_data *param_data; + struct param_id_module_enable *param; + int payload_size; + struct gpr_pkt *pkt; + int rc; + void *p; + + payload_size = sizeof(*param) + APM_MODULE_PARAM_DATA_SIZE; + + pkt = audioreach_alloc_apm_cmd_pkt(payload_size, APM_CMD_SET_CFG, 0); + if (IS_ERR(pkt)) + return PTR_ERR(pkt); + + p = (void *)pkt + GPR_HDR_SIZE + APM_CMD_HDR_SIZE; + + param_data = p; + param_data->module_instance_id = module->instance_id; + param_data->error_code = 0; + param_data->param_id = PARAM_ID_MODULE_ENABLE; + param_data->param_size = sizeof (*param); + p = p + APM_MODULE_PARAM_DATA_SIZE; + param = p; + + param->enable = enable; + + rc = q6apm_send_cmd_sync(graph->apm, pkt, 0); + + kfree(pkt); + + return rc; +} + static int audioreach_mfc_set_media_format(struct q6apm_graph *graph, struct audioreach_module *module, struct audioreach_module_config *cfg) @@ -1075,6 +1111,7 @@ int audioreach_set_media_format(struct q6apm_graph *graph, struct audioreach_mod switch (module->module_id) { case MODULE_ID_DATA_LOGGING: + audioreach_module_enable(graph, module, true); rc = audioreach_logging_set_media_format(graph, module); break; case MODULE_ID_PCM_DEC: diff --git a/sound/soc/qcom/qdsp6/audioreach.h b/sound/soc/qcom/qdsp6/audioreach.h index 707dfbdbc156..1d1d47d47d40 100644 --- a/sound/soc/qcom/qdsp6/audioreach.h +++ b/sound/soc/qcom/qdsp6/audioreach.h @@ -537,6 +537,11 @@ struct payload_media_fmt_pcm { uint8_t channel_mapping[]; } __packed; +#define PARAM_ID_MODULE_ENABLE 0x08001026 +struct param_id_module_enable { + uint32_t enable; +} __packed; + #define PARAM_ID_CODEC_DMA_INTF_CFG 0x08001063 struct param_id_codec_dma_intf_cfg { -- 2.21.0