Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp293984pxu; Thu, 15 Oct 2020 04:17:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvBAU6bZN80y8oKS22jwMRIAG1xTRPMDek0rtV1cvCX/an1rXlBG16QMhQQqyFDt5H/bPq X-Received: by 2002:a05:6402:21c5:: with SMTP id bi5mr3914585edb.380.1602760625055; Thu, 15 Oct 2020 04:17:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602760625; cv=none; d=google.com; s=arc-20160816; b=er+jL3sxnxUygHf8d5eRbTmnixnUJl9ADA3HTPTWCaT29b5wRavBobjBmbHrnh2xxU S+QbR1OVfw4k2f7DEEFxKnfM1PD3QyQPemMNMeX0Lu4VJjpefhtMuCNUnJshGdoRB8tw xNK6VgjJ8XT1T1IHNY4IKmfNiw8vD7IlfbyHueCttOc6L8/0w2TO9Z4Xv4ZqHEpBUU/f X35RLeaE99MYMD5LdeD+nzET+7arY4LVrnspO7ienTtW31gNR9azVqk2y2XZk412mFV8 nKGsuByrP7j9eGBfAn1xF6RbIDWyuzik0tpTybW19h4G4hNvHkh20bbqJARwmM/63QhP e//w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=3iwCAX5npGCg/zxSeU8NRUPXRIk3oCwTQT9lW7fSAek=; b=VC27HFNPT6pTm8UTfO4skdPtlcd2VN4Jw/g2ADz9kmf23lAmHNh/2xQpKDKXosq2WY yn9Xint7R0Fjc82wvGLVkC4pmxtnLHWl967Fe3ONPmX78TsT0ZZM+92xadV5MgOYNIqk hA3ay2Jq1r/mrTGfYp84l595FO+EKyzPAFlvkrLUy8SE8WwNcT5EAxR+Yv7xKqC0j7Kd 3lAPNOMjaJQqsg+caNKO+W9RigaKgpa4EnyBAbtB2Swo3MVHUdUiUff9FLgWEzZD17Sy bxtxkH6Ok6eBmWNV+ubmSthBciVgSkneZpgOYJVjnqlLd37eM5JyfXHtejjbjwg6lgsf dVsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="fZ9DK/wR"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p62si1814218edp.261.2020.10.15.04.16.42; Thu, 15 Oct 2020 04:17:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="fZ9DK/wR"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730066AbgJOH7z (ORCPT + 99 others); Thu, 15 Oct 2020 03:59:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730052AbgJOH7y (ORCPT ); Thu, 15 Oct 2020 03:59:54 -0400 Received: from mail-io1-xd43.google.com (mail-io1-xd43.google.com [IPv6:2607:f8b0:4864:20::d43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B79C0C0613D3 for ; Thu, 15 Oct 2020 00:59:53 -0700 (PDT) Received: by mail-io1-xd43.google.com with SMTP id k21so3155820ioa.9 for ; Thu, 15 Oct 2020 00:59:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3iwCAX5npGCg/zxSeU8NRUPXRIk3oCwTQT9lW7fSAek=; b=fZ9DK/wR5Q8YUrG20w9OUQzsdTlEfyeuToJdEqyFacXEV+lBftlXXjjyjCS6wZQwgc /01SjIDNc3HRCZR4tg5qJk4JRwXrj1G9lNss5cENSApQhRF3wC4xi0uYfZf1fudpG1AO oPJ1f/J6kf3roUEQk65x9Y1TpOfzGc5A1/1OY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3iwCAX5npGCg/zxSeU8NRUPXRIk3oCwTQT9lW7fSAek=; b=IdhsDdq0+gh+negr7FjJ+wjAmRBPmkf2jqKjmSMGLaviTu30fCKy4hUvtfVhwLdFsy lmZHpqAH07qPA4ES3hORoECGEMwgPh8qyLg7l17uHIMRpsiQCYN+dU4ZBWT7vgUgJ0D/ +dC0BsgepwPWZXQ8X7uuvf94/vwCGfqi/VIGL99tQe4EKvEcX/hhLByE90S99FY/uf03 JqjeouWFC5IgoNRUKhPU+n/KjjygXbdLppF1bPSzQrSmkeCRx+g/lq7Um3Vm0cccE6mx XkwwVGnQHY2pLHRpf2cgCwcH6SrOoMNdESqEo6aMAT/z3awLiLla9o0p9HRiT76AMinD eTtQ== X-Gm-Message-State: AOAM530RxTN3YF6TYz3W8pNQ40l3AdzRVMLQ2C2X8bQgUagLA/Qb0n5p xuI391TIJYSNGHRiHCTtShLVE9T4nxuVrF7ASGZMlg== X-Received: by 2002:a02:b617:: with SMTP id h23mr2508854jam.71.1602748792641; Thu, 15 Oct 2020 00:59:52 -0700 (PDT) MIME-Version: 1.0 References: <20200914080619.4178587-1-cychiang@chromium.org> <20200914080619.4178587-3-cychiang@chromium.org> <7bdc0d63-27b1-f99e-c5f8-65f880733d16@linaro.org> In-Reply-To: <7bdc0d63-27b1-f99e-c5f8-65f880733d16@linaro.org> From: Cheng-yi Chiang Date: Thu, 15 Oct 2020 15:59:26 +0800 Message-ID: Subject: Re: [PATCH v11 2/3] ASoC: qcom: dt-bindings: Add sc7180 machine bindings To: Srinivas Kandagatla Cc: linux-kernel , Mark Brown , Taniya Das , Rohit kumar , Banajit Goswami , Patrick Lai , Andy Gross , Bjorn Andersson , Liam Girdwood , Rob Herring , Jaroslav Kysela , Takashi Iwai , Stephan Gerhold , Matthias Brugger , Heiko Stuebner , Srinivasa Rao , Doug Anderson , Dylan Reid , Tzung-Bi Shih , Linux ARM , linux-arm-msm , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , "moderated list:ARM/Mediatek SoC support" , "open list:ARM/Rockchip SoC..." Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 13, 2020 at 6:36 PM Srinivas Kandagatla wrote: > > Hi Cheng, > > Sorry for such late review w.r.t compatibles, > Hi Srini, Thank you for taking another look! > On 14/09/2020 09:06, Cheng-Yi Chiang wrote: > > +--- > > +$id:http://devicetree.org/schemas/sound/qcom,sc7180.yaml# > > +$schema:http://devicetree.org/meta-schemas/core.yaml# > > + > > +title: Qualcomm Technologies Inc. SC7180 ASoC sound card driver > > + > > +maintainers: > > + - Rohit kumar > > + - Cheng-Yi Chiang > > + > > +description: > > + This binding describes the SC7180 sound card which uses LPASS for audio. > > + > > +properties: > > + compatible: > > + const: qcom,sc7180-sndcard-rt5682-m98357-1mic > > This information can come from the dai link description itself, why > should compatible string have this information? I think dailink description is not enough to specify everything machine driver needs to know. E.g. there is a variation where there are front mic and rear mic. We need to tell the machine driver about it so it can create proper widget, route, and controls. The codec combination also matters. There will be a variation where rt5682 is replaced with adau7002 for dmic. Although machine driver can derive some information by looking at dailink, I think specifying it explicitly in the compatible string is easier to tell what machine driver should do, e.g. setting PLL related to rt5682 or not. > > Can't we have better compatible string with actual board name or use the > same compatible name as used by other boards? > > > Can you give us some details on the advantages of doing this way? Machine driver can easily tell what is expected when it sees the compatible string (or model property, as you suggested below). E.g. in 1-mic v.s. 2-mic case, the patch by Ajye Huang: "[v1,2/2] ASoC: qcom: sc7180: Modify machine driver for 2mic" You can see widget, route, controls are used according to the configuration. The alternative approach is to check whether "dmic-gpio" property exists to decide adding these stuff or not. But it makes the intent less easier to understand. > > Or am I missing something? > > AFAIU, you should add proper board name / model name to the compatible > string rather than describe how its connected. Connection is already > part of dai link definition. > > On the other hand model property can include variant information. > This can also be used to set card long name which will help in UCM2. > > > The reason I had to bring this up is because the use-space (ucm in this > case) will not be in a position to differentiate between different board > variants to select correct mixer controls, so its going to be a pain! I think your suggestions makes sense since we need to consider UCM. Having the card with the same name doing different things will be confusing to user (and to UCM). I'll follow your suggestion to use the same compatible string, and put the board variation information in card name using model property. Thanks a lot for the great help! > > > > Thanks, > srini