Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp18988565rwd; Wed, 28 Jun 2023 03:35:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5gb5E+zZRZp6zyPsj+W9qadtYRgEgvK9M/Sx1pvjYce9tCzdVWH0Y8NfHTJqOvLzm15H4i X-Received: by 2002:a17:907:2d26:b0:992:1bb2:61d9 with SMTP id gs38-20020a1709072d2600b009921bb261d9mr4264859ejc.54.1687948530709; Wed, 28 Jun 2023 03:35:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687948530; cv=none; d=google.com; s=arc-20160816; b=VJNaH8NJCf25NbCE2ZwC5IDOhs1YOKWF3TswZSAZcC15dDT7Wos7sqzTcl/Y45z3YN 3Rj7nxEnDlEJGzBpSv2L/XDmsLlUbxGYk0EJdTW6glS+mhQZ2gF4qxYRxeYgM7+JNC02 HS7e5OXluk+7d0yCgFjHT4X2G3C9xHVRfqYJ9ybWUrk1X0NkL/Mv3sGfRGo5E9PRHQAG w1qHKApfQqWisX/fST4blasD/9vRW2h1E0HR+08I15ufOpILgs1OuGFaylaKa6uFmOpI yLcdq1Yn6ShG0uwPP18g4hKfn+R49siw3VEi2Ta8eOjoeKN2JJH6/8sx6aEt73BDHMVk SqLw== 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=QndBu+Ea73+5HZm45UHtALLqjv/Bpq0i3QEOMrOjFEA=; fh=ANVQFiC6mDhjeU+YM+r8EhAOx8zfpTZwkKvCCAMPXF8=; b=noAl2IOrww4xDGAjVlmyNbTVGVVDuPxB/SbKmrkO4ANOJy8MOaVpi7AadjTEAHzT+m AuYEiq4CiQOdmN92Gjg4fq0lUAP9MW33KA3MJFp0jT+QleZ8ugYdhvTAeRWu4GdZTG0m WkhTP6BhP2fj/Ea0Zo75S6nOYKz00oXZYbPyokZtRLIr0VVQNvCPnoYtyfeB71yogHnH AVm2xnlLBB9szCZKlfSEeLGhSGZFedzePPbyDEIzt6reHErSLmoXh04WUHT8sOIzreyB 9WQ79MAn3SpfTdpJ/JLbZ+mSceBZrXuQoFHVZMhX9sEbOlFJGRuxIwV54tzIYYtHLkuX y3ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xXvqIFxI; 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 m19-20020a1709066d1300b009888b617ebbsi5067856ejr.606.2023.06.28.03.35.06; Wed, 28 Jun 2023 03:35:30 -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=xXvqIFxI; 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 S231696AbjF1K3A (ORCPT + 99 others); Wed, 28 Jun 2023 06:29:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229982AbjF1K0m (ORCPT ); Wed, 28 Jun 2023 06:26:42 -0400 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00D392D7E for ; Wed, 28 Jun 2023 03:26:40 -0700 (PDT) Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-3fbb40ce844so1804365e9.0 for ; Wed, 28 Jun 2023 03:26:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687947999; x=1690539999; 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=QndBu+Ea73+5HZm45UHtALLqjv/Bpq0i3QEOMrOjFEA=; b=xXvqIFxIGebSeM10VHUvp6JelIbH0a8Ghpt64wKknXwMSWL95vKtz40Urf/l2eRZyA cjijU5zSPWNmwFnS43WQxxT2utoqGcRzSyayFdaRLw0YHKXIWNe5nbZlSY5r5IUciEtW Sur/5jylNwWcOGVtBJ3bEGewf7JLwbJrpY2LUxwj92DLECfudE3uVlpVGlrPXyKYapA9 H1yc3NgwjRve8v2SGiIZGEu2TQDAlBD3bjDUzFPwr1kBUwjVLXE4764tZgl9hFDs1Yak lZrusYucIwYjDAT76FMkcFZmsRM6Gyn/Z02PodY4GX3iq+EfHcdaJnfC15T9MvKCvs4P ocEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687947999; x=1690539999; 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=QndBu+Ea73+5HZm45UHtALLqjv/Bpq0i3QEOMrOjFEA=; b=WjLFcKCL4h6AGxS4EU7lysKX1R49Foz0eo3qpEX7kw5VLz970CfmNTJ5aQz2s9eS/J ttOELcP3uF8R28CpZBuKAsLjq1PqrO0GtZGO5PXAh0c8qJxaxsxSgmByNFNwUGkWRYVW oA6qbXZQflv/Tlr996LVMFlSHdKujwDGC+o/qcaHHHiuoXaXWe2RKe/qLYuZYYCUWjfQ WA0FrhlG8G9OZHirB/vPx+978L98FTTzG/5+fx5/4EjFWXuED5kxZbic2sgwdukpfD6o YGNYYkRCLvCH6eJpvzDFJyd2Gj+H/qYrA8IlLo1c6PAFEGSM4vazlgLLHqoB9E2YKZwe 7KSA== X-Gm-Message-State: AC+VfDwl+WX1IZAL6PNqis6NHIzjtjsXObSMNTMl0ItWC0+v9zkPJZDb e3CDbZw/t2hRRSgUU8NeoySJrw== X-Received: by 2002:adf:e741:0:b0:313:ee2e:dae1 with SMTP id c1-20020adfe741000000b00313ee2edae1mr7605993wrn.18.1687947999424; Wed, 28 Jun 2023 03:26:39 -0700 (PDT) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id a10-20020a5d53ca000000b003140555c0ddsm2467780wrw.56.2023.06.28.03.26.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jun 2023 03:26:39 -0700 (PDT) From: Srinivas Kandagatla To: krzysztof.kozlowski+dt@linaro.org, andersson@kernel.org, broonie@kernel.org Cc: robh+dt@kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, dmitry.baryshkov@linaro.org, johan+linaro@kernel.org, perex@perex.cz, tiwai@suse.com, lgirdwood@gmail.com, ckeepax@opensource.cirrus.com, kuninori.morimoto.gx@renesas.com, linux-kernel@vger.kernel.org, pierre-louis.bossart@linux.intel.com, alsa-devel@alsa-project.org, Srinivas Kandagatla Subject: [PATCH 2/3] ASoC: qcom: q6apm: add support for reading firmware name from DT Date: Wed, 28 Jun 2023 11:26:20 +0100 Message-Id: <20230628102621.15016-3-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20230628102621.15016-1-srinivas.kandagatla@linaro.org> References: <20230628102621.15016-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,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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 Currently firmware file name is autogenerated based on card name and model number, however this imposed a restriction of finding firmware in a single firmware path. Platform specific firmwares are normally located in sub folders of the SoC. Provide more flexibity by reading firmware-name from DT. Signed-off-by: Srinivas Kandagatla --- sound/soc/qcom/qdsp6/topology.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/sound/soc/qcom/qdsp6/topology.c b/sound/soc/qcom/qdsp6/topology.c index cccc59b570b9..ccb4efc15648 100644 --- a/sound/soc/qcom/qdsp6/topology.c +++ b/sound/soc/qcom/qdsp6/topology.c @@ -1258,16 +1258,16 @@ static struct snd_soc_tplg_ops audioreach_tplg_ops = { int audioreach_tplg_init(struct snd_soc_component *component) { - struct snd_soc_card *card = component->card; struct device *dev = component->dev; const struct firmware *fw; - char *tplg_fw_name; + const char *tplg_fw_name; int ret; - /* Inline with Qualcomm UCM configs and linux-firmware path */ - tplg_fw_name = kasprintf(GFP_KERNEL, "qcom/%s/%s-tplg.bin", card->driver_name, card->name); - if (!tplg_fw_name) - return -ENOMEM; + ret = of_property_read_string(dev->of_node, "firmware-name", &tplg_fw_name); + if (ret < 0) { + dev_err(dev, "firmware-name property missing in Device tree\n"); + return ret; + } ret = request_firmware(&fw, tplg_fw_name, dev); if (ret < 0) { @@ -1283,8 +1283,6 @@ int audioreach_tplg_init(struct snd_soc_component *component) release_firmware(fw); err: - kfree(tplg_fw_name); - return ret; } EXPORT_SYMBOL_GPL(audioreach_tplg_init); -- 2.21.0