Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp2045225ybh; Fri, 17 Jul 2020 08:02:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/S3+RD73poUTyF+Q/TQI5mRMvk8rxSVY0zVm91hcwKeHjrQXOsw3Cx9t+KLawsyabcAg+ X-Received: by 2002:a17:906:1447:: with SMTP id q7mr8463327ejc.363.1594998174472; Fri, 17 Jul 2020 08:02:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594998174; cv=none; d=google.com; s=arc-20160816; b=OM4wBH2gHFC4ciEpUrhH2lpjv4sB2GXphS1GfQ0uvfziVfFD6O3ZgzzHpd0OL1RiMw PBQV5ShsVV5ZS1DK2lp4Ji52ds3sV0QN9ZYbFHVy8iEQKDQ+TQYuE7fXC6zLm2BVxQaq U9adIObJzyFWA0/StfEMbrIAlPOmqd4sESdo821ANFYeod3LcgGQMUWtWqC9Corsl2O5 u5LMspV7wGx04me7oNjRyCfLnAVILL0Vl7KwH/5ECgVaaRcs2sr/Sje41U23XJ6jn2LU 9BA43GbIvt5iGGMtQJ9KYL6etlt8vLUHjINuDoSVJssDb5gbvWg9rhsgqVUAmMTr457l JuAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=7Aj8c3ItAShnnsLNIQ3E8MXZ0tu8sMgycVZ8H2IhzgY=; b=mOeecFv5FqMvfkEznnmsKQmerxsmXBHuI2X5HY4m7QQaNM48eeg0PFviDTtOjCZHwW fomY0N/U/NAsyOnQVvqUq2PPWP/Z+Ddnq/0gd+eno7a4mF6kbI366l6zY0CPe6UJq7EL yRuHVoNFeskeGNENADJGaY/FE9bHAiqsYaqEmqOVzvAmRc9sPqKXj5q+E5w3wVbm/tLF P3hy1gUZfly6CFMFsUTlsPuhHJ85XPhFnwx729vLerXa4hZsqk/QdITzMf5DGWQvnUki pWWIkjdbKfOU724JkwA9DbRKO70mEENQAVC6Jws4sRYBr4ixeZkMt8I2DSS+EqTLdOyk Hlhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=YooeeixG; 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 p6si5460923edx.295.2020.07.17.08.02.26; Fri, 17 Jul 2020 08:02:54 -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=YooeeixG; 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 S1726832AbgGQPCH (ORCPT + 99 others); Fri, 17 Jul 2020 11:02:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726401AbgGQPCD (ORCPT ); Fri, 17 Jul 2020 11:02:03 -0400 Received: from mail-vs1-xe41.google.com (mail-vs1-xe41.google.com [IPv6:2607:f8b0:4864:20::e41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8373CC0619D3 for ; Fri, 17 Jul 2020 08:02:03 -0700 (PDT) Received: by mail-vs1-xe41.google.com with SMTP id o184so5020977vsc.0 for ; Fri, 17 Jul 2020 08:02:03 -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=7Aj8c3ItAShnnsLNIQ3E8MXZ0tu8sMgycVZ8H2IhzgY=; b=YooeeixG0/jkhNIRHh3/Ok41dsT/OX3z2lbp1dsvYYWgOvjgGAeQzWt4/nwPKnz3Mv uXq028FmcWMT8/xVvpnT5J5b/dVVSVDK5eofaCaIcodv7fnB3wrg/uKVe0+25lcrLv/3 WamTri+dPxncC4RrX/4vmXrs97xe8dnN1V6/E= 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=7Aj8c3ItAShnnsLNIQ3E8MXZ0tu8sMgycVZ8H2IhzgY=; b=qM/o6alGjJnTr72o7RIEbUaxi8IoR8eJCa3k2uRsq1xJVKkrLiGo8pTotICLOdk2Cl TrSJYas2Sg8yTFUYxfrBR6/wES9UOGJV3Y8KihghhrTgWlXEDXcDYzZOVRwUdupkgb+/ XFh3AWeNDRc+W6yi33PrXC5C7SA1hT7Vh+BFNTm7tbgX5gydSFRPm2vRGbmgdgTH/F7Q Wi0mVXLW96Wc7JgvQ7sVHgGhzDUyWwUYRovA0XzhwUyw51L5yLaLp42jPy1cCd61JoFM MOBxKYdzP89N4sTyS1jtCH9un8kQq0iyostgpEJU7BGvDIicqf2fkyq/CA74XB3vEYdK WwqQ== X-Gm-Message-State: AOAM530I5MES24QHKkCHSANCFNacO9DI/KqyEN1Capt37hnSs+EpwbFJ 1IgfRprSyWB1+Vjpr2uXyJ6EAWf/qts= X-Received: by 2002:a67:fe8e:: with SMTP id b14mr7884909vsr.133.1594998122196; Fri, 17 Jul 2020 08:02:02 -0700 (PDT) Received: from mail-vk1-f172.google.com (mail-vk1-f172.google.com. [209.85.221.172]) by smtp.gmail.com with ESMTPSA id v63sm1325867vkf.45.2020.07.17.08.02.00 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 17 Jul 2020 08:02:01 -0700 (PDT) Received: by mail-vk1-f172.google.com with SMTP id q85so2179618vke.4 for ; Fri, 17 Jul 2020 08:02:00 -0700 (PDT) X-Received: by 2002:a1f:3d4a:: with SMTP id k71mr7624402vka.65.1594998119832; Fri, 17 Jul 2020 08:01:59 -0700 (PDT) MIME-Version: 1.0 References: <20200717120207.3471030-1-cychiang@chromium.org> In-Reply-To: <20200717120207.3471030-1-cychiang@chromium.org> From: Doug Anderson Date: Fri, 17 Jul 2020 08:01:48 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/2] ASoC: qcom: dt-bindings: Add sc7180 machine bindings To: Cheng-Yi Chiang Cc: LKML , Mark Brown , Taniya Das , Rohit kumar , Banajit Goswami , Patrick Lai , Andy Gross , Bjorn Andersson , Liam Girdwood , Rob Herring , Jaroslav Kysela , Takashi Iwai , Dylan Reid , tzungbi@chromium.org, Linux ARM , linux-arm-msm , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , ALSA Development Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Fri, Jul 17, 2020 at 5:02 AM Cheng-Yi Chiang wrote: > > Add devicetree bindings documentation file for sc7180 sound card. > > Signed-off-by: Cheng-Yi Chiang > --- > .../bindings/sound/qcom,sc7180.yaml | 123 ++++++++++++++++++ > 1 file changed, 123 insertions(+) A bit of a mechanical review since my audio knowledge is not strong. > create mode 100644 Documentation/devicetree/bindings/sound/qcom,sc7180.yaml > > diff --git a/Documentation/devicetree/bindings/sound/qcom,sc7180.yaml b/Documentation/devicetree/bindings/sound/qcom,sc7180.yaml > new file mode 100644 > index 000000000000..d60d2880d991 > --- /dev/null > +++ b/Documentation/devicetree/bindings/sound/qcom,sc7180.yaml > @@ -0,0 +1,123 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$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. nit: you don't need the pipe at the end of the "description" line. That means that newlines are important and you don't need it. > +definitions: I haven't yet seen much yaml using definitions like this. It feels like overkill for some of these properties, especially ones that are only ever used once in the "properties:" section and are/or are really simple. > + link-name: > + description: Indicates dai-link name and PCM stream name. > + $ref: /schemas/types.yaml#/definitions/string > + maxItems: 1 > + > + dai: > + type: object > + properties: > + sound-dai: > + maxItems: 1 > + $ref: /schemas/types.yaml#/definitions/phandle-array > + description: phandle array of the codec or CPU DAI > + > + required: > + - sound-dai > + > + unidirectional: > + description: Specify direction of unidirectional dai link. > + 0 for playback only. 1 for capture only. > + $ref: /schemas/types.yaml#/definitions/uint32 So if the property isn't there then it's _not_ unidirectional and if it is there then this specifies the direction, right? I almost wonder if this should just be two boolean properties, like: playback-only; capture-only; ...but I guess I'd leave it to Rob and/or Mark to say what they liked better. In any case if you keep it how you have it then you should use yaml to force it to be either 0 or 1 if present. > + > +properties: > + compatible: > + contains: > + enum: > + - qcom,sc7180-sndcard Just: properties: compatible: const: qcom,sc7180-sndcard > + audio-routing: > + $ref: /schemas/types.yaml#/definitions/non-unique-string-array > + description: |- > + A list of the connections between audio components. Each entry is a > + pair of strings, the first being the connection's sink, the second > + being the connection's source. You don't need the "|-" after the "description:". That says newlines are important but strip the newline from the end. > + model: > + $ref: /schemas/types.yaml#/definitions/string > + description: User specified audio sound card name > + > +patternProperties: > + "^dai-link-[0-9]+$": > + description: | > + Each subnode represents a dai link. Subnodes of each dai links would be > + cpu/codec dais. From looking at "simple-card.yaml", I'm gonna guess that instead of encoding the link number in the name of the node that you should actually use a unit address and a reg in the subnodes. ...also, again your description doesn't need the "|" at the end. Maybe will be useful to you? > + type: object > + > + properties: > + link-name: > + $ref: "#/definitions/link-name" > + > + unidirectional: > + $ref: "#/definitions/unidirectional" > + > + cpu: > + $ref: "#/definitions/dai" > + > + codec: > + $ref: "#/definitions/dai" > + > + required: > + - link-name > + - cpu > + - codec > + > + additionalProperties: false > + > +examples: > + > + - | > + snd { Can you use the full node name "sound" here? > + compatible = "qcom,sc7180-sndcard"; > + model = "sc7180-snd-card"; > + > + pinctrl-names = "default"; > + pinctrl-0 = <&sec_mi2s_active &sec_mi2s_dout_active > + &sec_mi2s_ws_active &pri_mi2s_active > + &pri_mi2s_dout_active &pri_mi2s_ws_active > + &pri_mi2s_din_active &pri_mi2s_mclk_active>; I think pinctrl is usually not in the dt examples. ...also, shouldn't the mi2s pinctrl be in the i2s nodes, not in the overall sound node? > + audio-routing = > + "Headphone Jack", "HPOL", > + "Headphone Jack", "HPOR"; > + > + dai-link-0 { > + link-name = "MultiMedia0"; > + cpu { > + sound-dai = <&lpass_cpu 0>; > + }; > + > + codec { > + sound-dai = <&alc5682 0>; > + }; > + }; > + > + dai-link-1 { > + link-name = "MultiMedia1"; > + unidirectional = <0>; > + cpu { > + sound-dai = <&lpass_cpu 1>; > + }; > + > + codec { > + sound-dai = <&max98357a>; > + }; > + }; > + }; > -- > 2.28.0.rc0.105.gf9edc3c819-goog >