Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp499352lqh; Fri, 31 May 2024 07:49:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWO5sdrUiopFR8EUMnpDrZh0FpXYFEb2jFWicUpPidGbnVhjQ3xYVa+eCawLuBnbwEu0FPNbuX5bFwNnr8fnimPhvSwaVnfkqTQTmut6g== X-Google-Smtp-Source: AGHT+IFfkYOZjljS+LuI6SMsEm+Ro3jvzFQWwxo/YZUfOjJpGnQbqMid5ZsI5WzB5SM86nUdhYVq X-Received: by 2002:a54:4511:0:b0:3c9:64b4:a7b with SMTP id 5614622812f47-3d1e3478703mr2226226b6e.4.1717166940790; Fri, 31 May 2024 07:49:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717166940; cv=pass; d=google.com; s=arc-20160816; b=Ez4kbWOgO/t7l/g8FhRu6GhYjK4U8SPJPVGy63FeP4tV8JdDTGTkQGkSDyUZSlLFg5 4Q9b8xVDbctp/sbyzj+aXvI+mxwDCj+aTfcgvDHsBCMpy4gBJckoB2HIsmrsEfjEqeTf duj+vuGn98pME5r6cx+OImnJqBs/kZ8V3i73Bu8rEQ/ct6fsNazMhWw5Cc/uI6r7rIsC KXoU8g+X8h72OfFG7USH28XK6ni8V49WZ+mBY+PgS8QGnJQ9fI8mxVyzDKnRzYdg7Bhj KPTe3YSuoMbXGJWLNtxuz+3V5IqXM6/JePfhnjZUkNV/2zf0F+syYLdrcsJHKDSkcX6u i2pQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=15wjPcTOFOUhpp8bI9Wct9yknG0QDZrXHhWFECQl8jQ=; fh=7/yLsd/37PBH4oAT3OUpasb2Jq95C8ark0fmbtOu5rI=; b=QeEjGcPNk1+S9rzYcl+DfGcgbdUvnLepX5Ufr8hBcL5z2b+9tLNQbccm0DG7YMchx9 +b3P0DHFvdjZYmf4RCd3kgeCkRQtE4cD1ZQW4FseBbt9auebm3DT8uknBqd3QSsknDqK jWDz5roz8m8HOMtf3LND7pMPEKt16C11PUigH09O5lGtPYSst2oeNT4tENht7U9DNls1 kMJUEr1U10Wvc/1dPzFbd/gWR482K1Yz8DyhkbUIMGiT8sKlVnsVsFD+oDBVHniAhCB2 V9V4SdxwxQhyjfNnVdaAIvp3qhPaB+U0f1TMWdRWoAgKbcQE3LGUbYPGCOrNFVHlk+17 f5qw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XG8EPRYs; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-197002-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197002-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6ae4b416e94si22285036d6.408.2024.05.31.07.49.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 07:49:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-197002-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XG8EPRYs; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-197002-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197002-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 7BBEE1C23560 for ; Fri, 31 May 2024 14:49:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DB98657C8E; Fri, 31 May 2024 14:48:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="XG8EPRYs" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 81FE87602B for ; Fri, 31 May 2024 14:48:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717166936; cv=none; b=AK4+OcBqKDMCXZJrAjmRFGkNYudUmKXlBeiNPX+gMKTay2tth+qbOkNJg+ao19yYReErwf5zWh8HpqJH1BOq1q5CXJ3GwIbH7/b7n3ZNs3VsqhtYR92QHQ49FY+Xoc/o+PFyRSOcZgZcGqX2xE8iSet8WH1dlmIn31YrXliNdxc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717166936; c=relaxed/simple; bh=MG4XTF460ME3QysgJdn6KSQKbYDcjfrewhgJYyzES+8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=st6qATkPHqtc2F8fCEeHwway4fSkYWtesJspYaFI/NHfZLi4m0K6+T0geO0YjcJkpjH9wS6GPV58B6ZYPVgO7n5Oy6E8ifPVDWx49fQyGf0Jr9wy79aEhm23ZZlK1ygh3pnLOcSGvfGlfjblpnWUrRaxVrymzXjeEnawKrEspYE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=XG8EPRYs; arc=none smtp.client-ip=198.175.65.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717166935; x=1748702935; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=MG4XTF460ME3QysgJdn6KSQKbYDcjfrewhgJYyzES+8=; b=XG8EPRYsaZoy0KFio2Ju+Rvec97a8r9lEhiHxVmVCiD9ZpJLQznY/1DI xTap5rkRGiLVEq7mwngORjlA75IK+rKLWREqirOhNa2Chf5f5LKEa+fMt xgVbHZ+u6G7YFWaPGlbZpy4/UN9jQQGEISSjJ6DKNcYpjvoiocLgSECWi 5XY1YboequMxCp4GwJCCr4ODJzx2M6ou1xVAWn9YmoyPEp+2TDXu7RjG4 Ewim5EgtTq99avI7fcZKVFpZ2Ux6RnlA3iVgU6R86o+z7jVfqWYbB5BS3 YG2PQg95F4QmppFJG5imZTI0Xm9nbeYdHGeqHM/DA0SbVZ0fJV3v/dVcB Q==; X-CSE-ConnectionGUID: kaUPsBW7Q3OINUgMZZjlgA== X-CSE-MsgGUID: fzds1pj1RGWZpcg0MT9i6g== X-IronPort-AV: E=McAfee;i="6600,9927,11088"; a="24288606" X-IronPort-AV: E=Sophos;i="6.08,204,1712646000"; d="scan'208";a="24288606" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2024 07:47:59 -0700 X-CSE-ConnectionGUID: eiuozHKnS2iAMwXvlG0LLQ== X-CSE-MsgGUID: ztnHMCkNRxanqV1Z1AVwhw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,204,1712646000"; d="scan'208";a="59361042" Received: from ibganev-desk.amr.corp.intel.com (HELO [10.125.108.40]) ([10.125.108.40]) by fmviesa002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2024 07:47:56 -0700 Message-ID: Date: Fri, 31 May 2024 09:46:55 -0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4] ASoc: tas2781: Enable RCA-based playback without DSP firmware download To: Shenghao Ding , broonie@kernel.org Cc: andriy.shevchenko@linux.intel.com, lgirdwood@gmail.com, perex@perex.cz, 13916275206@139.com, alsa-devel@alsa-project.org, i-salazar@ti.com, linux-kernel@vger.kernel.org, j-chadha@ti.com, liam.r.girdwood@intel.com, jaden-yue@ti.com, yung-chuan.liao@linux.intel.com, dipa@ti.com, yuhsuan@google.com, tiwai@suse.de, baojun.xu@ti.com, soyer@irl.hu, Baojun.Xu@fpt.com, judyhsiao@google.com, navada@ti.com, cujomalainey@google.com, aanya@ti.com, nayeem.mahmud@ti.com, savyasanchi.shukla@netradyne.com, flaviopr@microsoft.com, jesse-ji@ti.com References: <20240531052636.565-1-shenghao-ding@ti.com> Content-Language: en-US From: Pierre-Louis Bossart In-Reply-To: <20240531052636.565-1-shenghao-ding@ti.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit > -enum tasdevice_dsp_fw_state { > - TASDEVICE_DSP_FW_NONE = 0, > +enum tasdevice_fw_state { > + /* Driver in startup mode, not load any firmware. */ > TASDEVICE_DSP_FW_PENDING, > + /* DSP firmware in the system, but parsing error. */ > TASDEVICE_DSP_FW_FAIL, > + /* > + * Only RCA (Reconfigurable Architecture) firmware load > + * successfully. > + */ > + TASDEVICE_RCA_FW_OK, > + /* Both RCA and DSP firmware load successfully. */ > TASDEVICE_DSP_FW_ALL_OK, I appreciate the effort to document the states, but for the RCA cases we can have two 'success' states? > - tas_priv->fw_state = TASDEVICE_DSP_FW_PENDING; > + tas_priv->fw_state = TASDEVICE_RCA_FW_OK; > scnprintf(tas_priv->coef_binaryname, 64, "%s_coef.bin", > tas_priv->dev_name); > ret = tasdevice_dsp_parser(tas_priv); > if (ret) { > dev_err(tas_priv->dev, "dspfw load %s error\n", > tas_priv->coef_binaryname); > - tas_priv->fw_state = TASDEVICE_DSP_FW_FAIL; > goto out; > } > - tasdevice_dsp_create_ctrls(tas_priv); > + > + /* > + * If no dsp-related kcontrol created, the dsp resource will be freed. > + */ > + ret = tasdevice_dsp_create_ctrls(tas_priv); > + if (ret) { > + dev_err(tas_priv->dev, "dsp controls error\n"); > + goto out; > + } > > tas_priv->fw_state = TASDEVICE_DSP_FW_ALL_OK; from this code, it seems that the RCA case goes from RCA_FW_OK to TASDEVICE_DSP_FW_ALL_OK, so there's a difference between the two states, no? > @@ -466,14 +474,14 @@ static int tasdevice_startup(struct snd_pcm_substream *substream, > { > struct snd_soc_component *codec = dai->component; > struct tasdevice_priv *tas_priv = snd_soc_component_get_drvdata(codec); > - int ret = 0; > > - if (tas_priv->fw_state != TASDEVICE_DSP_FW_ALL_OK) { > - dev_err(tas_priv->dev, "DSP bin file not loaded\n"); > - ret = -EINVAL; > + switch (tas_priv->fw_state) { > + case TASDEVICE_RCA_FW_OK: > + case TASDEVICE_DSP_FW_ALL_OK: > + return 0; > + default: > + return -EINVAL; maybe keep the error logs?