Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4483191ybb; Tue, 14 Apr 2020 08:10:49 -0700 (PDT) X-Google-Smtp-Source: APiQypIr965NfLXvrkk/owOXiqAUQQrdE8/VtsZBy39FIn0/4/tHVzgD6KWxfYTzx9P41LgJBW2O X-Received: by 2002:aa7:d5c6:: with SMTP id d6mr20821628eds.91.1586877048402; Tue, 14 Apr 2020 08:10:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586877048; cv=none; d=google.com; s=arc-20160816; b=cbTIqmhjVZ1TAS6IYchPTrfwCx8StK/9KDczV5SpZ6t+KZw7pS4sWouoG2RsJJIXAq UWkkB4gWNSuk6xUmuOwEq9g9Po9PdKEGkFqLKEDeb/B+7TA0x/uGt6E10jA4476sZ3Wo zcE8gjJMzR/4yV9+4YfsFBdCLXxTSlk4EyzbpLXZ+uUk59epD5V5ndRKaOe1nVxnGkJf /jFblBf2F66PrrGdmnGJxCYdrSsXh05+f1QZ3u7f2ohPLpv/7Qdi5DmrZN9slt4SsP3F 7Sb7H/k1YFuR/dsZzJGBw/86YGzaeRqf/d/869X5iI7PVRE6+zIPO0OG3oiKI0rswXWX Y6Ww== 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=P/jjcpDWJJCm/4UD6RSTptZqrE2MCrtUN9gDsEJ2RDk=; b=R2bJs30S5KVdOi/Cei6VpeOAStuKbmUdpjNEqRS7tIRm46HugyVx6jYQ+ejtHYRqHN mZ0Q2ti5LitU0t0B5elYNrCyvg9aCGZyGhujIxi2ersMBQUtTQfgEeytLbsZ/wpdLXOK kB1x3GXGWqohRL3MNJm94SkRiy+5ll9YLUHBilQ8lIRG2PLbnceo25IP/Wj1QUkK8QUb fIkS4ZlOjNSr5zTu8xwtTvjSkfdShbF1pm2ESF2DQ1yLaFntUJHeZg+kCt5SjcrsJEdF KepxPmO6x6P26NHV13pkeCuG6f71SqG/1PDAIZCrCD5g6bRuXC3Im39QGuGFXJ9i67k+ fp5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mbqoFFVi; spf=pass (google.com: best guess record for 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c26si9522608eds.33.2020.04.14.08.10.20; Tue, 14 Apr 2020 08:10:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for 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=@linaro.org header.s=google header.b=mbqoFFVi; spf=pass (google.com: best guess record for 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437408AbgDNJJg (ORCPT + 99 others); Tue, 14 Apr 2020 05:09:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2437383AbgDNJJa (ORCPT ); Tue, 14 Apr 2020 05:09:30 -0400 Received: from mail-lj1-x242.google.com (mail-lj1-x242.google.com [IPv6:2a00:1450:4864:20::242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0BD2C0A3BD0 for ; Tue, 14 Apr 2020 02:09:29 -0700 (PDT) Received: by mail-lj1-x242.google.com with SMTP id n17so11629057lji.8 for ; Tue, 14 Apr 2020 02:09:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=P/jjcpDWJJCm/4UD6RSTptZqrE2MCrtUN9gDsEJ2RDk=; b=mbqoFFVi/5Zv4uaWbNQuLuwUPh5Ix5igCOrh0j7iAHy/uLKhlxhSQPI+5JqGqgsyt8 z5RY4fB+g06qLRwyfLuanEa0deqAbfCpO0+YUOHH4a1bmtjivm4GXpXye+rCsl7pcjT3 Kyj5jZIKoA6JK42//jI1NxxtyisZe5GR4hirE8TPDp1XyPw3UhpQKXXqz8ipnpDrwm6b tjNAHT6X4t1YjkHsH7ltu8nB25Vyvqj7AqV34pJjeOM61ARCNMhx7GoqNmz/wxW6CiKd psmA42mmRiCX5+cEazZzf68zjL93WhKKPfk1FWu41gvFoMFsKidGNVJ0FT0FtITqKGD8 Q3jA== 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=P/jjcpDWJJCm/4UD6RSTptZqrE2MCrtUN9gDsEJ2RDk=; b=oxEMD8euZvyRAY3cD3Qz86h5u7IyB8izEwiZD7P9dSpL0BKI8MnoLmciZ43ueyKK6r QSLG/O4PMh66yctQsIg0Thh60UnPHHDnCFOKzD5PFG+hZ+DZzY3bVuq5xqU+sHC4ghcw 5Y079dGbROJg1cV1UaLrKugCV+0bxiWZYDVizpLAIQ+plMgpSZRRlj7tbnNZUAynkjDt B7QI04KpT7JaSAWD+N0DbhRU13tcAnd1sXwDq+Bw3i2KjOt2b4TwMDPO33du33Tsz3h0 07Wqj+rVn4em3cVyJi14dJalVEGYZ5pL2CkXjjzxCYhGBOFn9tS8rkVv0VWP81YnE6MB bHVw== X-Gm-Message-State: AGi0PuY8ACNGf/Bre3PBonCGHVOUuYSuFnqSi6WkSYvxZZeWfBl8YTdj 97RaDhCAdSEei5ya8plPsUBZPnxJvoU/XpBaM0pDtQ== X-Received: by 2002:a2e:9256:: with SMTP id v22mr12722064ljg.286.1586855368004; Tue, 14 Apr 2020 02:09:28 -0700 (PDT) MIME-Version: 1.0 References: <1585064650-16235-1-git-send-email-jprakash@codeaurora.org> <1585064650-16235-2-git-send-email-jprakash@codeaurora.org> <69b882b0-56ad-1b93-0a9d-2c7f96dd9d32@codeaurora.org> In-Reply-To: <69b882b0-56ad-1b93-0a9d-2c7f96dd9d32@codeaurora.org> From: Amit Kucheria Date: Tue, 14 Apr 2020 14:39:13 +0530 Message-ID: Subject: Re: [PATCH 1/3] iio: adc: Convert the QCOM SPMI ADC bindings to .yaml format To: Jishnu Prakash Cc: Andy Gross , Bjorn Andersson , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , LKML , Matthias Kaehlcke , Linus Walleij , Stephen Boyd , Jonathan.Cameron@huawei.com, Siddartha Mohanadoss , kgunda@codeaurora.org, aghayal@codeaurora.org, Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Rob Herring , Mark Rutland , Andy Gross , "open list:IIO SUBSYSTEM AND DRIVERS" , linux-arm-msm , linux-arm-msm-owner@vger.kernel.org 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 On Mon, Apr 6, 2020 at 5:15 PM Jishnu Prakash wrote: > > Hi Amit, > > On 4/3/2020 5:34 PM, Amit Kucheria wrote: > > > >> +required: > >> + - compatible > >> + - reg > >> + - '#address-cells' > >> + - '#size-cells' > >> + - '#io-channel-cells' > >> + > >> +patternProperties: > >> + "^[a-z0-9-_@]$": > >> + type: object > >> + description: | > >> + Represents the external channels which are connected to the ADC. > >> + For compatible property "qcom,spmi-vadc" following channels, also known as > >> + reference point channels, are used for result calibration and their channel > >> + configuration nodes should be defined: > >> + VADC_REF_625MV and/or VADC_SPARE1(based on PMIC version) VADC_REF_1250MV, > >> + VADC_GND_REF and VADC_VDD_VADC. > > Instead of this note for "qcom,spmi-vadc", you can enforce this > > through checks in YAML grammar. > > > > A simple example can be found in > > Documentation/devicetree/bindings/thermal/qcom-tsens.yaml. Look for > > the if, then, else clause which determines how many interrupts need to > > be defined. > > I have gone through tsens and other examples, but I'm not able to get a > way to apply this kind of constraint, on what child nodes should be present. > > In this case, the constraint would have to be that for compatible > property "qcom,spmi-vadc", there should be at least four child nodes and > those four should have their "reg" property fixed to the channel values > mentioned above. I can see how to apply constraints on a single property > like interrupts in tsens, but I'm not sure if there is a way to specify > a lower limit to the number of child nodes or something like "there > should be at least one child node with value 0x9 for its "reg" > property". I could not find any examples with constraints placed on > number of occurrences of a child node. > > Can you please share an example of such a constraint if you are aware of > any or suggest some way by which this kind of constraint can be specified? Hi Jishnu, I misread that particular property. I don't think it is possible to specify child nodes w/o splitting this binding into two, I think. Please go ahead with the rest of changes. I'll keep digging to see if this is possible. Regards, Amit