Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp385675rwe; Thu, 1 Sep 2022 00:45:17 -0700 (PDT) X-Google-Smtp-Source: AA6agR618gZDX38IGf+3xDGP+HH1bpZHIZqE0RYnhuil2fZ/4VPC0qaOElPlTDQN4ODoJ0WbiYoQ X-Received: by 2002:a63:334f:0:b0:42b:15a6:826a with SMTP id z76-20020a63334f000000b0042b15a6826amr24913802pgz.14.1662018317396; Thu, 01 Sep 2022 00:45:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662018317; cv=none; d=google.com; s=arc-20160816; b=hUTxXMnISAlFAGUS2XP6R7bYfa3mk7SjM+xQ/k3LegqfCl/fMf6SkKZNtN2e/Mne2a TAutPkUWcPjOY9dGYpkRQ61fa7UDUng4c/akdiVwEaDEkFXrpBnHvGgbIBOuptebNlJS X65ynclLwzinv7WBu3nYeN+OTqkWVQ81iJOvI72268lcjo2N818o+8eiodz62A5YoNW7 Osfwmd36qDNeCmRarzAn2aD7KBI7qvIJg/zZja5RCqzJazqqy9oGowBF1vBLo9NaEXOG yGOkTNMcNu3ne0hUSXCJ1E2t28vwbkEBv21Lq5Xp7yiOYQK8vosiMr1dZl/1wwZZA6/J +2TQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=JWfT+qeNC2CT3Ipogz2ktqK+tonEIf45b3bHsAFEBxU=; b=X2N5fIxJqmgGsHghPzcfyI1EOKWdEAcElhtg8T61yssZ0bJ2F31QPemVxbzaXOzxuE d5pL+CF5n9fClH/YKeD0XW8OXzlJ3FIhR8uwvy0RfPgp2no7mVjd5yMYYPwxBShgnuPz hSHJqNRZWd5AZtWXgKRD5VGrMENqmTFjHLsnxH4AcwJQa0gJctPsSJiD63d2VKv2YdWD uZ/WJFSC3qjgHdRtkkgLr0a4lozobbTVs/OkW7Csh/4EX0/mNQWUeL02pY39zZurOeWV de6E+rRHze1VvOkF8wzq7q0Z8Pzp6r1ayZTHuV5gqPlVZsnaHvAd53Xn+8t1H/iHYIs+ k37Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=U08bGpTC; 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 o21-20020a656a55000000b0042bc6e8d3f7si7700070pgu.642.2022.09.01.00.45.06; Thu, 01 Sep 2022 00:45:17 -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=U08bGpTC; 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 S233775AbiIAHcV (ORCPT + 99 others); Thu, 1 Sep 2022 03:32:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233913AbiIAHcA (ORCPT ); Thu, 1 Sep 2022 03:32:00 -0400 Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53F78126DE4 for ; Thu, 1 Sep 2022 00:28:58 -0700 (PDT) Received: by mail-lj1-x22c.google.com with SMTP id k22so16947477ljg.2 for ; Thu, 01 Sep 2022 00:28:57 -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=OX7IqzV8WQEmbugS0+rz3d7YgH7uwBgdmxNzBXwN5V38ixgoNOjWgiLrDkqgByqKVw vrjRNiocb/WWhw/6JuG+Ge6NjW+YFxs9qIcbcHMM38lqkbyBwMCb45EvbL5YIOniKzPx pugjMJXc97eFJvfvK8BTepRppDc2Q6ETnwNt/pTjeP7+D/XEbtgyfAP6c2JQpqThuTKl BeCk1cWtYWaZNoCucBsGEr6BKamFbWkf1yQLGKRrTaOojvutd0FEvOR1Uc2NbCuI0uDb DulFwWY6eMnES660jDvqRt3Bum2xJMr4redlmn3nx9fIUiIqVCLcBMVZoQKUgWp0CmVB AZ2w== X-Gm-Message-State: ACgBeo1cslQsZatiiqj9w7YMlEJXfBCaGdLDttUcraOOl2AdYjI0Egx6 PnAJf0rmOS4CRagyF24sHuD1Vg== 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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 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