Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp467237rwi; Thu, 27 Oct 2022 03:52:11 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6o2+Rc/GFkVHo35jUmY1g/+4f4B2shAmt4GB5LhxlN8y97pIRPOuK3DnQwuxGMk4EgkwW9 X-Received: by 2002:a17:903:32c2:b0:186:9cf5:68c7 with SMTP id i2-20020a17090332c200b001869cf568c7mr23173146plr.143.1666867930914; Thu, 27 Oct 2022 03:52:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666867930; cv=none; d=google.com; s=arc-20160816; b=qLyC5wyv+wXTwcVBF1w904WEaGFRaQNUvNpmufGezhoumYqmSsG5dLCBEC4m/xkXHu UFc/+bR1PF5t5FyObaJUPEllqxovmwuSq5XTarzxp3DFymdQoUIaaAO+iIy+pvt4JTdT BLHW7Im6YTy/DWdGdMjk9v9KQjZxqO+Jm6zvx02+uZd10G+4b4l5wiG/1P8phFyEV+AU C2vVwYO8oYpj9jPlHFSP4agIf4bpYd1fc0sShezRt6lr4QoYl8sVt60gScmRjDia7hH/ BkK99nFWsg6n64Fs8O8BrTlM5r+XoQ5e2y1aT3ACXAKhWRloa/1ZT7A+SwM4rGb3vcvY xIoA== 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=Zia5PwPjvTpWqvNWhun5tKRspbVbRhZxzacUZUNqQiU=; b=Ya/Qtt9eWVhXVbbiAL/LEVk0Ez6IH6OSXtq+Hfis8s3OBnkJ9OGELYwL91ittke3/H XIApWzwEHcOEEu35JTjfD/xyv1vMaSj6kDxBy1BuR+TKi6Bd1sM6rqHkxpAS83PWSm1X vxDpPAh9Xip9ie6UCY3tqJN8gfwBMkRIt8y8p+ETE8cKCS/eRTkFLhMSTl+HfRtt0Gu4 iU3vrztpqiFOmIRRb9RiUk2UNzWljmy9YOe+XcC9CpisamhM5mJdJRcw2NsHJryCi6Ks Rk7UDBMSZp/CGoDr0obRBCL8qvML9iNg+wpKxyyRb2Wv4IFdqbYTUGTZsuXnjIuUrTlt oquA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="RiqJKL/u"; 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 b6-20020a056a00114600b00536fa6bbb11si1492589pfm.344.2022.10.27.03.51.59; Thu, 27 Oct 2022 03:52:10 -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="RiqJKL/u"; 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 S235075AbiJ0K2R (ORCPT + 99 others); Thu, 27 Oct 2022 06:28:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235015AbiJ0K1r (ORCPT ); Thu, 27 Oct 2022 06:27:47 -0400 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF82810EA0B for ; Thu, 27 Oct 2022 03:27:44 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id bs21so1399978wrb.4 for ; Thu, 27 Oct 2022 03:27:44 -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 :message-id:reply-to; bh=Zia5PwPjvTpWqvNWhun5tKRspbVbRhZxzacUZUNqQiU=; b=RiqJKL/uMRA9zydHwoUZ5K0l+UFfgJ2Ly3Y/TDxZoEHQc3AoYv1TQ8z+HHo99c4kKX g+hYBuGaDNneX0KX+Q3CABFrJcHJwkBhBL3q0DEHRP9fWAGeLKACv333S3XFUBlJ8smQ rRmclfpV4OFtnYsmvxkoFQ2ayz2ahSH64yiU7zXxrmi/ObRHFHHEDFQziZE4/cAbFZsZ 9t/2QpmZtJnGh+wrDTzo8UG4K+Kt6d2DZw6q/A2FSho5y0YUGFa1CYdfIo6R2bt8YQ4B jcp8lNlMn+wta3Hi4z3D2nnZsQ1SPm8+akuEqO8DvBGxrzZZkcPMjarF9Ds+cv1POJa5 4jGg== 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:message-id:reply-to; bh=Zia5PwPjvTpWqvNWhun5tKRspbVbRhZxzacUZUNqQiU=; b=cN0fBIJqmQDol4QfgiLj+vOpF8uvVSkEYHorVFDL+zOI++GsQzESLKBtRkGC7RIIqA zh4Ib0JMBB4u0XfIXfFKC/iOYt5Y+SwYUphGeAyXNuh5Fk7O4vcfu9MhBv0JVef1Ycdd I9HLMWZIEQpPulUfCIvXf4GDU+PdIwhsHcSYx7PGFyJr0M5JxaVLKcgENMy/be8USyEf jEpEuKk5o8tCtL5c1VfXSlARpvffs1lasw4V9gEr9pgX0G44elsYgjEYw3/XaRNNMutU CI4z8fcl9/Z/AYHgDVvYR48fnggex1qr3dBVd01E7sHNPcVhJSbnW6jmLj25TZfaW3e5 Pm8w== X-Gm-Message-State: ACrzQf0EHXonFYViJHkLphvI1Z8lFWDqUcxTLvDafU9HR8E3scF60qVD syExwAl9pGwROwN99u2r6MVTkg== X-Received: by 2002:adf:d1c9:0:b0:225:f98:d602 with SMTP id b9-20020adfd1c9000000b002250f98d602mr32014812wrd.419.1666866463209; Thu, 27 Oct 2022 03:27:43 -0700 (PDT) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id fc7-20020a05600c524700b003b505d26776sm5088674wmb.5.2022.10.27.03.27.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Oct 2022 03:27:42 -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 v3 3/9] ASoC: qdsp6: audioreach: update dapm kcontrol private data Date: Thu, 27 Oct 2022 11:27:04 +0100 Message-Id: <20221027102710.21407-4-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20221027102710.21407-1-srinivas.kandagatla@linaro.org> References: <20221027102710.21407-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 Update kcontrol private date to include more information like graph id and module instance id which its connected to. Also maintain this virtual dapm mixer widget in a list so that we could lookup while FE and BE connection are added. Signed-off-by: Srinivas Kandagatla --- sound/soc/qcom/qdsp6/q6apm.c | 1 + sound/soc/qcom/qdsp6/q6apm.h | 1 + sound/soc/qcom/qdsp6/topology.c | 19 ++++++++++++++++++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/sound/soc/qcom/qdsp6/q6apm.c b/sound/soc/qcom/qdsp6/q6apm.c index 794019286c70..81e2d7090fb4 100644 --- a/sound/soc/qcom/qdsp6/q6apm.c +++ b/sound/soc/qcom/qdsp6/q6apm.c @@ -731,6 +731,7 @@ static int apm_probe(gpr_device_t *gdev) apm->gdev = gdev; init_waitqueue_head(&apm->wait); + INIT_LIST_HEAD(&apm->widget_list); idr_init(&apm->graph_idr); idr_init(&apm->graph_info_idr); idr_init(&apm->sub_graphs_idr); diff --git a/sound/soc/qcom/qdsp6/q6apm.h b/sound/soc/qcom/qdsp6/q6apm.h index 54eadadf712c..96ad5ea2ae07 100644 --- a/sound/soc/qcom/qdsp6/q6apm.h +++ b/sound/soc/qcom/qdsp6/q6apm.h @@ -58,6 +58,7 @@ struct q6apm { struct mutex lock; uint32_t state; + struct list_head widget_list; struct idr graph_idr; struct idr graph_info_idr; struct idr sub_graphs_idr; diff --git a/sound/soc/qcom/qdsp6/topology.c b/sound/soc/qcom/qdsp6/topology.c index 9a3d9e0eae53..0c4886d30131 100644 --- a/sound/soc/qcom/qdsp6/topology.c +++ b/sound/soc/qcom/qdsp6/topology.c @@ -16,7 +16,11 @@ #include "audioreach.h" struct snd_ar_control { + u32 graph_id; /* Graph ID */ u32 sgid; /* Sub Graph ID */ + u32 module_instance_id; /* Connected Module Instance ID */ + struct snd_soc_dapm_widget *w; + struct list_head node; struct snd_soc_component *scomp; }; @@ -692,6 +696,7 @@ static int audioreach_widget_load_mixer(struct snd_soc_component *component, struct snd_soc_tplg_vendor_value_elem *w_elem; struct snd_soc_tplg_vendor_array *w_array; struct snd_ar_control *scontrol; + struct q6apm *data = dev_get_drvdata(component->dev); struct snd_soc_dobj *dobj; int tkn_count = 0; @@ -711,6 +716,9 @@ static int audioreach_widget_load_mixer(struct snd_soc_component *component, case AR_TKN_U32_SUB_GRAPH_INSTANCE_ID: scontrol->sgid = le32_to_cpu(w_elem->value); break; + case AR_TKN_DAI_INDEX: + scontrol->graph_id = le32_to_cpu(w_elem->value); + break; default: /* ignore other tokens */ break; } @@ -718,6 +726,9 @@ static int audioreach_widget_load_mixer(struct snd_soc_component *component, w_elem++; } + scontrol->w = w; + list_add_tail(&scontrol->node, &data->widget_list); + return 0; } @@ -819,7 +830,10 @@ static int audioreach_widget_unload(struct snd_soc_component *scomp, if (w->id == snd_soc_dapm_mixer) { /* virtual widget */ - kfree(dobj->private); + struct snd_ar_control *scontrol = dobj->private; + + list_del(&scontrol->node); + kfree(scontrol); return 0; } @@ -998,6 +1012,9 @@ static int audioreach_control_load_mix(struct snd_soc_component *scomp, case AR_TKN_U32_SUB_GRAPH_INSTANCE_ID: scontrol->sgid = le32_to_cpu(c_elem->value); break; + case AR_TKN_DAI_INDEX: + scontrol->graph_id = le32_to_cpu(c_elem->value); + break; default: /* Ignore other tokens */ break; -- 2.21.0