Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2590904ybv; Mon, 24 Feb 2020 08:00:57 -0800 (PST) X-Google-Smtp-Source: APXvYqwl+2IZLNOB3KzlNtfctAEi1s9CzLI6D9f9YPTG8WpVLwJqpAfhP3iXl/RGvfqrtBuumPli X-Received: by 2002:a9d:6a85:: with SMTP id l5mr42908629otq.231.1582560056991; Mon, 24 Feb 2020 08:00:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582560056; cv=none; d=google.com; s=arc-20160816; b=oNp8FTdRNGiXKZNnyRiws2iOmW7SLEvFxqsO+cz/yhgRhvnRfLmP6C+EPDH6FP9218 SYqXWapVCJP29Ngv4vwvraJ1yRWlqzbctGywV3uD0mkKLpAskz7YZnsnGpF9JEwDhaLO N/JveJwozaelp3VEXkaC4zmfaDcNdXeF/VP1aYmZI+7dyrnZ3PT1KLwfJ86nk3Oozrcm 461H2ZLRVb5w0EdbZWb4fbrRuy8oZZpidvX3iueXpGWbhmXqfyRKIdh0aK33GOX6/S/V CFKC1vrtJy7qTLCv6IhAn/ZXFbqPhj0JPjuh9C8TL9w448qSQgUIeq3XMckUlAY2GHCv jzVg== 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:dkim-filter; bh=rh6OBdUNfww3vfiDk7WD78TGBu735cgnzCKrnQQSFwk=; b=CiHf3PlEoAmi1NMLJk/09zPJ6YvXl2T7N4AmBAjFntPOK4f+8+xNgHbnwB7ohcHcc5 RgM2wFIoOEGtFgeBEBNEE5Isfn7/DhEmOsqkGldZMbPrvzLA+8AwEZ49DGazaIndinOS uuHYn0whT64Cr+0WVZqbhy8X4EX5GeremIAS59HvPQkfYjlQnhGtynWq5wbjQgwgwIMR SC752nVpvddbYZdBR/9O/LgY1rHxgRmULMlTiTWH8mziwbN+4FgL8WQj2W1gcD6Co8vf B4kgIdYwwNhpxArmXyCSbRl237kBVfPryNdy+x+B2WobWUqWYyzOmWANf/VK0/3McM/g tRLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=frP9VDGV; 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=fail (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 p83si5396436oih.198.2020.02.24.08.00.43; Mon, 24 Feb 2020 08:00:56 -0800 (PST) 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=@nifty.com header.s=dec2015msa header.b=frP9VDGV; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727895AbgBXQAi (ORCPT + 99 others); Mon, 24 Feb 2020 11:00:38 -0500 Received: from conssluserg-05.nifty.com ([210.131.2.90]:27349 "EHLO conssluserg-05.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727359AbgBXQAh (ORCPT ); Mon, 24 Feb 2020 11:00:37 -0500 Received: from mail-vs1-f54.google.com (mail-vs1-f54.google.com [209.85.217.54]) (authenticated) by conssluserg-05.nifty.com with ESMTP id 01OG0UlE011600; Tue, 25 Feb 2020 01:00:31 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-05.nifty.com 01OG0UlE011600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1582560031; bh=rh6OBdUNfww3vfiDk7WD78TGBu735cgnzCKrnQQSFwk=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=frP9VDGV+IdXmi+d2H1VLwqNi9TOUHIUpDWaGV0WsA9WBVGXo82zaO7VQ9ZV7l7lB cNqERuRmFO09j53hlRurJ0XJlIsdtcWE7jKsB5bLXjjxush2tHAF9DtHSnvzcD6Twb tfW7AnOy8BNvd+nN+Drt2gopc8j1zZZRrPTuiB8+VmO005XNNQDsqRzsRan/r29dp2 FzopPo/MpG/p5iMhHqrK7o9Bw0Og+koZWMhRfasK0aOLol+6Gm1E1ceEAVb4pHplCe tonTF8rzDZBl8mHk/8qSJPQ4XB0+IcKvR39Ojwue3IKWhISkDYYqVdJa0SNdtPesZg qYM+IR2xN68+A== X-Nifty-SrcIP: [209.85.217.54] Received: by mail-vs1-f54.google.com with SMTP id 7so5975443vsr.10; Mon, 24 Feb 2020 08:00:30 -0800 (PST) X-Gm-Message-State: APjAAAVPy1Sba5M+aIwFGx953Qg95Uxoj38z6fOnY5i6+1JbcHP0Xo3j 7+TO4ZLQVuleD3aS0wLGzDjPC2Yz9pxwYUdCRaI= X-Received: by 2002:a67:fa4b:: with SMTP id j11mr27414888vsq.155.1582560029807; Mon, 24 Feb 2020 08:00:29 -0800 (PST) MIME-Version: 1.0 References: <20200221021002.18795-1-yamada.masahiro@socionext.com> <20200221021002.18795-2-yamada.masahiro@socionext.com> <20200221153215.GA9815@bogus> In-Reply-To: From: Masahiro Yamada Date: Tue, 25 Feb 2020 00:59:53 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/3] dt-bindings: gpio: Convert UniPhier GPIO to json-schema To: Rob Herring Cc: DTML , Frank Rowand , Bartosz Golaszewski , "David S. Miller" , Greg Kroah-Hartman , Jonathan Cameron , Linus Walleij , Mark Rutland , Mauro Carvalho Chehab , linux-arm-kernel , "open list:GPIO SUBSYSTEM" , Linux Kernel 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 Rob, On Mon, Feb 24, 2020 at 11:52 PM Rob Herring wrote: > > On Fri, Feb 21, 2020 at 11:33 PM Masahiro Yamada wrote: > > > > Hi Rob, > > > > On Sat, Feb 22, 2020 at 12:32 AM Rob Herring wrote: > > > > > > On Fri, 21 Feb 2020 11:10:01 +0900, Masahiro Yamada wrote: > > > > Convert the UniPhier GPIO controller binding to DT schema format. > > > > > > > > I omitted the 'gpio-ranges' property because it is defined in the > > > > dt-schema project (/schemas/gpio/gpio.yaml). > > > > > > > > As of writing, the 'gpio-ranges-group-names' is not defined in that > > > > file despite it is a common property described in > > > > Documentation/devicetree/bindings/gpio/gpio.txt > > > > So, I defined it in this schema. > > > > > > > > Signed-off-by: Masahiro Yamada > > > > --- > > > > > > > > I have a question about the range about 'ngpio'. > > > > > > > > ngpios: > > > > minimum: 0 > > > > maximum: 512 > > > > > > > > The 'ngpio' property is already defined as 'uint32' in the dt-schema tool: > > > > https://github.com/robherring/dt-schema/blob/master/schemas/gpio/gpio.yaml#L20 > > > > > > > > 'uint32' is unsigned, so 'minimum: 0' looks too obvious. > > > > > > > > I cannot omit the minimum because minimum and maximum depend on each other. > > > > I just put a sensible number, 512, in maximum. > > > > > > > > If this range is entirely unneeded, I will delete it. > > > > > > This property is generally for when you can have some number less > > > than a maximum number implied by the compatible string. > > > > > > If there is really no max (e.g. 2^32 - 1 is valid), then just do > > > 'ngpios: true' > > > > > > What does ': true' mean? > > It's a schema that always passes validation. It's purpose here is just > to say you are using this common property for this binding. OK, I see two useful cases: [1] Documenting purpose in order to clarify that you are using this property [2] You need to explicitly specify ': true' if you have 'additionalProperties: false' . Otherwise, the following warning is displayed: ... do not match any of the regexes: 'pinctrl-[0-9]+' For [1], it is already clear that this binding is using ngpios from 'require' require: - ngpios > > > > If it is documented somewhere, > > could you point me to the reference? > > https://github.com/devicetree-org/dt-schema/blob/master/schemas/gpio/gpio.yaml > > > > > Even if I remove the 'ngpio' entirely > > from my dt-schema, the 'ngpio' is checked > > correctly. > > Yes, if you change it to a string value for example, it should fail. > (Only if DT_SCHEMA_FILES is not set without my kbuild changes) > > You should also add 'additionalProperties: false' at the top level of > your schema and then it will also fail if you don't list ngpios in > properties. Hmm, I am confused. 'require: - ngpios' will warn if you don't list ngpios. 'additionalProperties: false' will warn if you list other properties than what is explicitly specified. BTW, I will not add 'additionalProperties: false' in this binding. The real DT files have interrupt-parent = <&aidet>; (arch/arm64/boot/dts/socionext/uniphier-ld20.dtsi line 324) but, commit 791d3ef2e11100449837dc0b6fe884e60ca3a484 removed interrupt-parent from bindings. -- Best Regards Masahiro Yamada