Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp683178rwl; Wed, 29 Mar 2023 07:12:44 -0700 (PDT) X-Google-Smtp-Source: AKy350YWLOUfxr5mikqLHObQwIgwTCtbdamrPwHfNRMyIqR27gWTb3b2gBG3fWeL2NQ4mOTHYTYd X-Received: by 2002:a17:90b:1bc7:b0:23f:b35a:534e with SMTP id oa7-20020a17090b1bc700b0023fb35a534emr21574786pjb.29.1680099164242; Wed, 29 Mar 2023 07:12:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680099164; cv=none; d=google.com; s=arc-20160816; b=D1keKJv8WZG14QIyq3M6y3RuuyXRRGJRNAsfci7NDQYSE7JJfURQjvtw0nAoN0ZP8A MD/JEx1tqVE2p4yRd4Fi3EPDFfXU4TySFJzWB5TTX1IsljPgBGe4IQM01myrDWkpv+AA Jrx4q3ukvfM/pa/nOMj09+ct8L7Yde31S+LuT+BJDPQR5JTnftmu4MEwYzscX6705aEj kRhioWo9F+Dorfoi4v1ZJb4VxTmTw3ytEMrtHsAeSZiLcMrPLpOifjtKCFXXOh5rJe9T 4pl9VZyo6sXe6phYjox9rBzlypjh9FZcS/XsqQjjG7t7wKsGmQ0P4MUQAAKecPpV9cG+ zplw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=JGh/hvjvBMdxlLHaLhPm0XGhnA/5dNCgYG0Izty01zk=; b=Rz1onfY+whmPvgI3yZhR7JFLW0Ed7rd9yK2NYSutuKBOLgJtT5A4xYN/88fdNFmPrG 0rKmzP5Y/EuVQeAgB+G9vPBzmIJEOitVlkgMSYsLVQxliGbVkv2RDIcjCTPDkIYPAUw9 3EwZsdO32RbmDrJywqATly9H6mrlIbMP3rMGwBeva01mKWT/8sFwkXELzzzXZ134/ncA R4ttj5xtyaHrS0ELJPZlCuwK0nxjT407acxDYAuXiSMGOUryGQO+sIUFaBCtSDz8WQsF aZfq9Usu3JSOqCSQVIKyZBditEVtryWJ+etEqO595WijpFzKd4jysQVorYm7g2oq4+Rr 8JUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=Lj+BjEli; 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=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u12-20020a170903124c00b0019d05b5c15asi9435138plh.276.2023.03.29.07.12.28; Wed, 29 Mar 2023 07:12:44 -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=@cirrus.com header.s=PODMain02222019 header.b=Lj+BjEli; 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=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229854AbjC2OHz (ORCPT + 99 others); Wed, 29 Mar 2023 10:07:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229682AbjC2OHx (ORCPT ); Wed, 29 Mar 2023 10:07:53 -0400 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B68355A3; Wed, 29 Mar 2023 07:06:50 -0700 (PDT) Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32T9DfFW021397; Wed, 29 Mar 2023 09:05:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=PODMain02222019; bh=JGh/hvjvBMdxlLHaLhPm0XGhnA/5dNCgYG0Izty01zk=; b=Lj+BjEli4LAR+SVPbVtGv1Z25ZfCumbCwZbmMK3gRw8ibqGwcZyJQTAJNfHYKu5KPkkR 0YCrOwntWbwCorS9iMVOwhG7dp2uqfB6X957z5dQ0OLhATv4q3QlU2yj3r8Ebc27Fb/E 868E2zgbUj2opyXcnrkTdTlOb27OGMqFABGC7Hm6AG8qwGW7rYOm/9EO0hWKuwCeLLwS u9qrw4sy/IadIt0j8dmDjGXO7TJxddL/hgbRteAW28cHen+qmB3rL4ED9cqWj1zNCNg8 NTRQak/Ir47EQfyRGsKLCFOPwhVGqCD6ewx/oorhfnrjhH4hu2LTCG3GC9+Z3axKiz8y sA== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3pmjghgc9q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 29 Mar 2023 09:05:25 -0500 Received: from ediex01.ad.cirrus.com (198.61.84.80) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.25; Wed, 29 Mar 2023 09:05:24 -0500 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.2.1118.25 via Frontend Transport; Wed, 29 Mar 2023 09:05:24 -0500 Received: from ediswmail.ad.cirrus.com (ediswmail.ad.cirrus.com [198.61.86.93]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 2BA5111DA; Wed, 29 Mar 2023 14:05:24 +0000 (UTC) Date: Wed, 29 Mar 2023 14:05:24 +0000 From: Charles Keepax To: Jianhua Lu CC: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Richard Fitzgerald , Simon Trimmer , Cristian Ciocaltea , , , , <~postmarketos/upstreaming@lists.sr.ht>, Subject: Re: [PATCH] Asoc: wm_adsp: Add support for loading firmware with prefix name Message-ID: <20230329140524.GU68926@ediswmail.ad.cirrus.com> References: <20230329130525.15830-1-lujianhua000@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20230329130525.15830-1-lujianhua000@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Proofpoint-GUID: EeUUs62KZ6mNxdeiDQAx0DvUuftRFwmz X-Proofpoint-ORIG-GUID: EeUUs62KZ6mNxdeiDQAx0DvUuftRFwmz X-Proofpoint-Spam-Reason: safe X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,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 On Wed, Mar 29, 2023 at 09:05:25PM +0800, Jianhua Lu wrote: > For platform using fdt, system_name is NULL, it doesn't provide > a way to load firmware with prefix name, so add it. > > Signed-off-by: Jianhua Lu > --- > sound/soc/codecs/wm_adsp.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c > index 216120b68b64..17481e42d440 100644 > --- a/sound/soc/codecs/wm_adsp.c > +++ b/sound/soc/codecs/wm_adsp.c > @@ -760,6 +760,10 @@ static int wm_adsp_request_firmware_file(struct wm_adsp *dsp, > *filename = kasprintf(GFP_KERNEL, "%s%s-%s-%s-%s.%s", dir, dsp->part, > dsp->fwf_name, wm_adsp_fw[dsp->fw].file, system_name, > filetype); > + else if (asoc_component_prefix) > + *filename = kasprintf(GFP_KERNEL, "%s%s-%s-%s-%s.%s", dir, dsp->part, > + dsp->fwf_name, wm_adsp_fw[dsp->fw].file, asoc_component_prefix, > + filetype); > else > *filename = kasprintf(GFP_KERNEL, "%s%s-%s-%s.%s", dir, dsp->part, dsp->fwf_name, > wm_adsp_fw[dsp->fw].file, filetype); > @@ -831,6 +835,16 @@ static int wm_adsp_request_firmware_files(struct wm_adsp *dsp, > NULL, "bin"); > return 0; > } > + } else if (asoc_component_prefix) { > + if (!wm_adsp_request_firmware_file(dsp, wmfw_firmware, wmfw_filename, > + cirrus_dir, NULL, > + asoc_component_prefix, "wmfw")) { > + adsp_dbg(dsp, "Found '%s'\n", *wmfw_filename); > + wm_adsp_request_firmware_file(dsp, coeff_firmware, coeff_filename, > + cirrus_dir, NULL, > + asoc_component_prefix, "bin"); > + return 0; > + } > } This direction seems slightly problematic, especially in the context of amps (which I presume this relates to, please let know if that is wrong). It would probably be better to be fixing things up such that the amp in question sets system_name when registered through DT. Generally speaking the idea is the amp tuning is going to be specific to the enclosure/speaker involved, so a generic tuning for say left amps doesn't really make a lot of sense. Thanks, Charles