Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1680341ybe; Tue, 3 Sep 2019 01:46:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqxoaE9i7B9vcwhY+GnuXQfy4As4dHMTFVoDGKMoTWhKWCOMkJ7781yp4BF5DENB0lbIXCos X-Received: by 2002:a63:534d:: with SMTP id t13mr29429495pgl.313.1567500418240; Tue, 03 Sep 2019 01:46:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567500418; cv=none; d=google.com; s=arc-20160816; b=jhbce9ww9IBqXUQx5bCuC8+FipCekbHdJXUmfmHkZAXAHpSgyd76UWXvzVxzjSvdDZ ZDr7ZTwqQJfqmzz6yhBKgCTVPsPlm38BpEk7GeY6sJy4dHwrLvcWAuYgZrgms8qRR+ZE GWIkeDfU32+o9Nbm1HEcgOtD7fZItdm1q5Gomy6JRXHx1+avKia2OgURLWQD2MMTWDFp lb9DF9aF753iqKsYlzyNqYmt6M5DpTOyr1lomr9mL9ppXIRlMuLDjG8eIvkRjor4kJ/s IcqCEm8n++Q86cTfIHTM0/ZE4cLgqA0GWLkPvmG86PcKcEJbONcOPBZ0q4sqHpPpMWxJ 3+Lw== 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=5eQERJZvkka6RW8bL8plp1qlPhA9MWhuA5GfzvlZ2GA=; b=aM24tBeKkPF9kFohCsyQZhY4YzKrxjL9ja+AuCEf6c6cQp2RDVGfcurp70xGnflTyp kfZZgXWBEIiJ3si9UbRJle5bee+qh5LMb9CYRrRvGKqaAki+TdFJXoeCZ1E6DcAAGP6g xtNLtvXt37FZP6fpsaxeXy4O1THoRbkwPOhVBGPBR4hbiZotI18ANfP5vPtDun5G6ZPa 9l2HgfjFROBtj8hkVLldpBbovOOh4OkFb3qJNWb+9RrUzUVALQ2pvdDFDoAMm/uim86d S3Hpomz4LzS+ck10dWGj7kER6v/+TNkV83UDQO4+YxWZBs7CSrAQm6TFULHqGwyp2C7R 9QMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YGDSdqYi; 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 l89si5519565pjb.36.2019.09.03.01.46.42; Tue, 03 Sep 2019 01:46:58 -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=YGDSdqYi; 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 S1728222AbfICIp1 (ORCPT + 99 others); Tue, 3 Sep 2019 04:45:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:34756 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727667AbfICIp1 (ORCPT ); Tue, 3 Sep 2019 04:45:27 -0400 Received: from mail-qt1-f177.google.com (mail-qt1-f177.google.com [209.85.160.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 EF497230F2; Tue, 3 Sep 2019 08:45:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567500326; bh=TfLcqVZI8L0vFKtsZxUpSt1VNzMBPAPesOSpXiHIeLw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=YGDSdqYiACbjr7nYurhrPCyfi+SGa8k5xiy/AroGa84SfqqLM5CKNXbiOqDSUmWsH LwlzP+7IlDam5RrAgkvU4DRbv5YIIHsRuZEiQOMp9VOIrkNh49bOJEftCcYmwodQEb 629XJZxqNUOEuztnd5zXo80cqCohKFQqCgRT6LyQ= Received: by mail-qt1-f177.google.com with SMTP id o12so7192604qtf.3; Tue, 03 Sep 2019 01:45:25 -0700 (PDT) X-Gm-Message-State: APjAAAUImicItQGNgkPkyTXaXrWTeF6Tqz6tB4r2DrpX7bYVEoEAA6x/ 0ESWnhmn+5kfGICIujqrLiTBkykEWHzgOViJeg== X-Received: by 2002:a05:6214:10e1:: with SMTP id q1mr21183926qvt.148.1567500325065; Tue, 03 Sep 2019 01:45:25 -0700 (PDT) MIME-Version: 1.0 References: <20190903080336.32288-1-philippe.schenker@toradex.com> <20190903080336.32288-4-philippe.schenker@toradex.com> In-Reply-To: <20190903080336.32288-4-philippe.schenker@toradex.com> From: Rob Herring Date: Tue, 3 Sep 2019 09:45:13 +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: "linux-kernel@vger.kernel.org" , Mark Brown , Shawn Guo , Sascha Hauer , Liam Girdwood , "devicetree@vger.kernel.org" , Max Krummenacher , Stefan Agner , Marcel Ziswiler , Mark Rutland , Luka Pivk 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 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. > > 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. > > properties: > compatible: > - const: regulator-fixed > + items: > + - const: regulator-fixed > + - const: regulator-fixed-clock This says you must have 'compatible = "regulator-fixed", "regulator-fixed-clock";'. What you want is: enum: - regulator-fixed - regulator-fixed-clock > regulator-name: true > > @@ -29,6 +39,12 @@ properties: > description: gpio to use for enable control > maxItems: 1 > > + clocks: > + description: > + clock to use for enable control. This binding is only available if > + the compatible is chosen to regulator-fixed-clock. The clock binding > + is mandatory if compatible is chosen to regulator-fixed-clock. Need to define how many clocks (maxItems: 1). > + > startup-delay-us: > description: startup time in microseconds > $ref: /schemas/types.yaml#/definitions/uint32 > -- > 2.23.0 >