Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp440682ybe; Wed, 4 Sep 2019 02:07:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqz6aECltGKJq9/UbwaEXV7Xw2ucknKoJtwkfUFrkCvEtsOp41pSNvr1f3NxpNd0laQnk4/Y X-Received: by 2002:a17:90a:2e15:: with SMTP id q21mr3794010pjd.97.1567588059967; Wed, 04 Sep 2019 02:07:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567588059; cv=none; d=google.com; s=arc-20160816; b=FLFHtZcxgOi+nR49lu8SLfmBt9KNfAy5aOLmQnSf7xKojATGhJzcR1kise2bQoewFi wXVAu0/inmbIgXMAZv40TKyqMoAnV0f0TxKsCMjvEC/VmLDfKubdkDFmPy+hGgULzkit ORc4AIoEdDvS0W6dPUlZ2lFa/j10j21nv47vFvd8OpmkIHRRxz12RFXRYn38MqdpX0iw lXq9UMHO1JEykfkkDHmSswYjbpwAsNMevOoO+6JVd4Fwf6/j+FKsVu5Avlpsm/pNcbFr XrekwACbPtVtf7GqW9eA+ue3s3TUh977CIyHGmDUo6uJOFpg+UnXfbMjqNC+HzA2Jdlx RFlQ== 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=IHIVLKERSi9ohEB6YtIe1vHrpME0x1asTlSDFHTVuLg=; b=DvR9vnIH8olCmkj5YzTw9zw8xe1OtJNfHNzaWxbbyRkscsCML3WFsRfCei+eOVso3h H8Rp4ZppBOK03kkF+Pf7NzshbcY9SeMluj/EK/ZUghX5lF+mIUV3xWZs7uTv4Ur7qg3i znMoFHvqNUlz4zgdG3ipzK9b3Hgvva59c04u8d9HWJGDEv0uRXj2kgSiTfm1FOoQH0Z4 Qfh7HWyAFfvCNf8S4+nUH8ZKlKd5Nakb2o3ADFUFEgmRb+eXapDOKI+GZO5WMUoBAIg5 mEU6DFiXUZipM1mskUv6x1Ao6UeCVYy3gF8/0YSr6MQcWIBHnzuPYFzVbiePhh5V1hVv 4f9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SbUL5oSc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m5si1848441pjv.91.2019.09.04.02.07.24; Wed, 04 Sep 2019 02:07:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SbUL5oSc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729489AbfIDJG3 (ORCPT + 99 others); Wed, 4 Sep 2019 05:06:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:34844 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727144AbfIDJG2 (ORCPT ); Wed, 4 Sep 2019 05:06:28 -0400 Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 199892339E; Wed, 4 Sep 2019 09:06:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567587987; bh=EOQcGVJ6OuDmcoR+UhqLOItk6Uldp6Kp+u0aoDcoTrc=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=SbUL5oScju8aqdkKXaEH+CLZTc/GskaW/IOHPyNgRiBmDNvDEJwzQgaBZ0zTfOL5z +vqeoa1MgUs+FrLTyZcHaiy8NltzgewYw2/Z2dvhdPqrlV3CRcpuXJp3mE565N4M+i FrDdqHCVZ6e9f6fLxpH4FxNRVBtKdI4WHTMRZvtI= Received: by mail-qk1-f177.google.com with SMTP id f13so18842922qkm.9; Wed, 04 Sep 2019 02:06:27 -0700 (PDT) X-Gm-Message-State: APjAAAWglR6rpNcHI8m+gZCitflQGJpP+A12fXUz3t5pfwA49fm2ymSI RqKhFhmsg5mQ/h1J4QwQNtB1kaEbHeDmbe98SQ== X-Received: by 2002:a05:620a:1356:: with SMTP id c22mr18142847qkl.119.1567587986249; Wed, 04 Sep 2019 02:06:26 -0700 (PDT) MIME-Version: 1.0 References: <20190903080336.32288-1-philippe.schenker@toradex.com> <20190903080336.32288-4-philippe.schenker@toradex.com> In-Reply-To: From: Rob Herring Date: Wed, 4 Sep 2019 10:06:14 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 3/3] dt-bindings: regulator: add regulator-fixed-clock binding To: Philippe Schenker Cc: Max Krummenacher , Marcel Ziswiler , Luka Pivk , "s.hauer@pengutronix.de" , "broonie@kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "shawnguo@kernel.org" , Stefan Agner , "lgirdwood@gmail.com" , "mark.rutland@arm.com" 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 Wed, Sep 4, 2019 at 9:07 AM Philippe Schenker wrote: > > On Tue, 2019-09-03 at 09:45 +0100, Rob Herring wrote: > > On Tue, Sep 3, 2019 at 9:03 AM Philippe Schenker > > wrote: > > > This adds the documentation to the compatible regulator-fixed-clock > > > > Please explain what that is in this patch. > > Hi Rob and thanks for your comments. I will change this commit message > for a possible v2 into this: > > This adds the documentation to the compatible regulator-fixed-clock. > This binding is a special binding of regulator-fixed and adds the > ability to add a clock to regulator-fixed, so the regulator can be > enabled and disabled with that clock. > If the special compatible regulator-fixed-clock is used it is mandatory > to supply a clock. > > > > > > > > > Signed-off-by: Philippe Schenker > > > > > > --- > > > > > > .../bindings/regulator/fixed-regulator.yaml | 18 > > > +++++++++++++++++- > > > 1 file changed, 17 insertions(+), 1 deletion(-) > > > > > > diff --git a/Documentation/devicetree/bindings/regulator/fixed- > > > regulator.yaml b/Documentation/devicetree/bindings/regulator/fixed- > > > regulator.yaml > > > index a650b457085d..5fd081e80b43 100644 > > > --- a/Documentation/devicetree/bindings/regulator/fixed- > > > regulator.yaml > > > +++ b/Documentation/devicetree/bindings/regulator/fixed- > > > regulator.yaml > > > @@ -19,9 +19,19 @@ description: > > > allOf: > > > - $ref: "regulator.yaml#" > > > > > > +select: > > > + properties: > > > + compatible: > > > + contains: > > > + const: regulator-fixed-clock > > > + required: > > > + - clocks > > > > You don't need this. > > > > If you add a new compatible, then this should probably be a new schema > > doc. Is the 'gpio' property valid in this case as if a clock is the > > enable, can you also have a gpio enable? That said, it seems like the > > new compatible is only for validating the DT in the driver. You could > > just use a clock if present and default to current behavior if not. > > It's not the kernel's job to validate DTs. > > The gpio property is valid with this compatible. I added regulator- > fixed-clock to regulator-fixed hence I also don't want to create a new > schema file. Okay, if all the other properties are valid then adding to this file is fine. > With the above select statement I wanted to state clocks as required > when the compatible regulator-fixed-clock is given. select is not the right way to do that. select is for whether to apply the schema to a node or not. What you have will silently not apply the schema if 'clocks' is missing or compatible is 'regulator-fixed'. Essentially what you need to do here is: if: properties: compatible: contains: const: regulator-fixed-clock then: required: - clocks Rob