From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D8279ECAAD3 for ; Thu, 1 Sep 2022 07:32:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233722AbiIAHce (ORCPT ); Thu, 1 Sep 2022 03:32:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233548AbiIAHcK (ORCPT ); Thu, 1 Sep 2022 03:32:10 -0400 Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF77D12BC07 for ; Thu, 1 Sep 2022 00:28:59 -0700 (PDT) Received: by mail-lj1-x234.google.com with SMTP id k18so10566209lji.13 for ; Thu, 01 Sep 2022 00:28:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc; bh=JWfT+qeNC2CT3Ipogz2ktqK+tonEIf45b3bHsAFEBxU=; b=U08bGpTCBUkzRa9qDDUxPPJY9H5aZwby0Ihz6i9A2pZh+4DEQGs9qvCtLelKwDAkJh +Lvd7yeUF1/UlLZXezQt/VGyoOMfkFThGnImM9qBIH6ab9nQlyYjfsJYZHWAjwaSND4D 0XiaNAfBOH0dsSrY7GM1HH/73SD/yJ457vDE8fuKTUTxOJO+2YQOQAtWJGrT/1WbSv6S Tr0xjz1ARJ7rfR20YM/+gHw4+JyP2ilQbZKgjl0JzZBNR14Hktv1+8da4PLdUcrWliFL R5X+W4U3EWNIATK+AtdiUo/DA1m5yvfr/crc6QQAm/bGEEKl0498ApyTAiZsFcTvvCpk bT8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc; bh=JWfT+qeNC2CT3Ipogz2ktqK+tonEIf45b3bHsAFEBxU=; b=v5FKDgEde8CaYFkbdMwf1V3UbjYkERr693qAs76JLLCnBi4zWHpnG5ShAYXonnwFtS UglHcBijRcQAjxDLiIlM7BHgBML+ZFCaRP/j+nUw21wUEsTe4fiXbk/R0Amh21ZfiLIN mp6pHKLVY2FaXlXRecqjpbjHibUC3J7/KmnVSsrrzuZoka+YpQBt+aeXOOb9Vwh0kNGu ZZTK9jPUFye0hQT5l5iU9SM8Xs3WpvQNYwGtUlY0Ajoo9yzsaGxj36PNVT+/q8PFG4U7 WMfdy2BNwe91QZ9tVSbDNPBmd9ML55itbPwRJc8iAYSha2wa9zSkNtqvbBPLDFPtWHRJ 7RVw== X-Gm-Message-State: ACgBeo0qfJOBTPdd2D6O2VUS4YVveYJJ5eDjYfOJssPAm/pF5eTuAiIT /ukT8aFaD59nS/5xvMFrJnal8OLnaduzcPyP X-Google-Smtp-Source: AA6agR7wyn4mb8cX3p67uFfHPU+JkbXoaTyVz81XLi4YVfOhv+6H5UDNEufviysPXbybIUB/Zcy+2w== X-Received: by 2002:a05:651c:204d:b0:25e:3111:419f with SMTP id t13-20020a05651c204d00b0025e3111419fmr5492973ljo.320.1662017330935; Thu, 01 Sep 2022 00:28:50 -0700 (PDT) Received: from [192.168.28.124] (balticom-73-99-134.balticom.lv. [109.73.99.134]) by smtp.gmail.com with ESMTPSA id m9-20020ac24249000000b00492f37e428asm2251246lfl.172.2022.09.01.00.28.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 01 Sep 2022 00:28:50 -0700 (PDT) Message-ID: Date: Thu, 1 Sep 2022 10:28:49 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 Subject: Re: [PATCH 2/6] ASoC: codecs: wsa-macro: add support for sm8450 and sc8280xp Content-Language: en-US To: Srinivas Kandagatla , Rob Herring Cc: broonie@kernel.org, krzysztof.kozlowski+dt@linaro.org, perex@perex.cz, tiwai@suse.com, pierre-louis.bossart@linux.intel.com, linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <20220818134619.3432-1-srinivas.kandagatla@linaro.org> <20220818134619.3432-3-srinivas.kandagatla@linaro.org> <20220818171222.GG1978870-robh@kernel.org> <9c9226d9-8470-6672-d8ce-3fb1e4df3fda@linaro.org> <5da6171a-4949-9cc7-2967-6cc39a7955c8@linaro.org> From: Krzysztof Kozlowski In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On 31/08/2022 13:37, Srinivas Kandagatla wrote: > > > On 31/08/2022 10:19, Krzysztof Kozlowski wrote: >> On 31/08/2022 12:17, Srinivas Kandagatla wrote: >>> >>> >>> On 18/08/2022 18:12, Rob Herring wrote: >>>> On Thu, Aug 18, 2022 at 02:46:15PM +0100, Srinivas Kandagatla wrote: >>>>> Add compatible for sm8450 and sc8280xp. >>>>> >>>>> Signed-off-by: Srinivas Kandagatla >>>>> --- >>>>> sound/soc/codecs/lpass-wsa-macro.c | 2 ++ >>>>> 1 file changed, 2 insertions(+) >>>>> >>>>> diff --git a/sound/soc/codecs/lpass-wsa-macro.c b/sound/soc/codecs/lpass-wsa-macro.c >>>>> index 27da6c6c3c5a..f82c297ea3ab 100644 >>>>> --- a/sound/soc/codecs/lpass-wsa-macro.c >>>>> +++ b/sound/soc/codecs/lpass-wsa-macro.c >>>>> @@ -2561,6 +2561,8 @@ static const struct dev_pm_ops wsa_macro_pm_ops = { >>>>> static const struct of_device_id wsa_macro_dt_match[] = { >>>>> {.compatible = "qcom,sc7280-lpass-wsa-macro"}, >>>>> {.compatible = "qcom,sm8250-lpass-wsa-macro"}, >>>>> + {.compatible = "qcom,sm8450-lpass-wsa-macro"}, >>>>> + {.compatible = "qcom,sc8280xp-lpass-wsa-macro" }, >>>> >>>> Looks like these are backwards compatible with the existing versions, >>>> why not reflect that in the binding? >>> Backward compatibility is not always true, some of the registers and >>> there defaults tend to change across SoCs. Having SoC specific >>> compatible could help us deal with this and also make code more inline >>> with other codec macros in LPASS IP. >> >> I am not saying that there should be no SoC specific compatible. This >> one is a must, but the question why duplicating the entries and not >> using fallback? > > You mean using fallback compatible "qcom,sc7280-lpass-wsa-macro" in > sc8280xp devicetree and not add new compatibles in the driver? > > The reason for adding this new compatible strings is that macros in this > lpass codec that differ form each SoC. > ex: [PATCH 6/6] ASoC: codecs: tx-macro: add support for sm8450 and > sc8280xp and there is a pending patch on va-macro that has soundwire > controller frame sync and reset control which is moved from tx-macro to > va-macro. > > so DT might endup with mix of compatibles for same LPASS Codec like this: > > "qcom,sc7280-lpass-wsa-macro" > "qcom,sc8280xp-lpass-va-macro" > "qcom,sc8280xp-lpass-tx-macro" > "qcom,sc8280xp-lpass-rx-macro" > > AFAIU, the fallback thing will work for things that are identical but in > this case they differ across SoCs, and having SoC specific compatibles > in now would help handle this. Ahh, I see now. The true problem is that driver encodes compatibles in several places. That's very confusing design - variants should be rather customized via driver data, not via multiple of_device_is_compatible() inside the code. Best regards, Krzysztof