From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 69854C43463 for ; Thu, 17 Sep 2020 20:10:30 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F2AE520725 for ; Thu, 17 Sep 2020 20:10:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="D+1C1jqP"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Q0VtsHkh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F2AE520725 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=lJcFnUsQNtoufv4i5kzLT+slJ3Yx3Fuicob/jKBaI94=; b=D+1C1jqP0rHYnhgV9MKZqCIAZ I6jArElLpctXuMy3VWcSDEYwgqRdBozFp1ROajFCiJ9PCXQIGBG3cwTGHmvEo01l5yEETUQDWbpNf UFtCypOJ/M4tIjR7xIq0e3J6SD5RiAbXCS3jXlY6SGwsT6j1nMo7AGvcR2IvUHUMpa3iYrGNAhPj6 iC91CNTzf3Mem4VgwQu3kme+sSYIHKOE99QzwOXSw/HZBwaHaYfcNVh5ShipUMvhUqrmrxejq8Y+V rsRzHJsU8eq1yBiOFz5wGpq+CviAIVV5dgpMdpM3WTEmEslCZGTfgAUtiHICQ759OmgdDYExv//Ip 8w+ocPSLQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJ0ES-0002QG-Sr; Thu, 17 Sep 2020 20:10:16 +0000 Received: from perceval.ideasonboard.com ([2001:4b98:dc2:55:216:3eff:fef7:d647]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJ0EN-0002P2-LO; Thu, 17 Sep 2020 20:10:14 +0000 Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 361D6E42; Thu, 17 Sep 2020 22:10:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1600373406; bh=4DMjAbU38sRZa4Hb+7uteuEdS1wnI9GFHiIgCUgEZ/c=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Q0VtsHkhoUVlzTu7tNMMcMsFAPfpXoYMh4cRGn6MmDxvumEgpl8HoPhsaS9P5RQ0Y NVTFOFHBfusC0IIVq9IenTWY3skD0ldFuVOF8UWv0RFNF3NZ/lN8K6JSoJROzof6o8 kv65KBP9KWCuIrAttiiUNKk2jIgT65ueP7LagMtc= Date: Thu, 17 Sep 2020 23:09:36 +0300 From: Laurent Pinchart To: Krzysztof Kozlowski Subject: Re: [PATCH v2 01/13] dt-bindings: gpio: add common schema for GPIO controllers Message-ID: <20200917200936.GF3969@pendragon.ideasonboard.com> References: <20200917165301.23100-1-krzk@kernel.org> <20200917165301.23100-2-krzk@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200917165301.23100-2-krzk@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200917_161011_987305_96ADD567 X-CRM114-Status: GOOD ( 33.57 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Amelie Delaunay , Geert Uytterhoeven , Matti Vaittinen , Linus Walleij , alsa-devel@alsa-project.org, Stefan Agner , Bjorn Andersson , Paul Cercueil , Masahiro Yamada , Chris Brandt , Srinivas Kandagatla , Manivannan Sadhasivam , linux-riscv@lists.infradead.org, Fabio Estevam , linux-stm32@st-md-mailman.stormreply.com, Alexandre Torgue , linux-renesas-soc@vger.kernel.org, Laurent Pinchart , Anson Huang , Lee Jones , Takashi Iwai , Magnus Damm , Bartosz Golaszewski , Chen-Yu Tsai , Andy Gross , bcm-kernel-feedback-list@broadcom.com, NXP Linux Team , Andy Teng , Jacopo Mondi , Jaroslav Kysela , Sungbo Eo , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, Cristian Ciocaltea , Charles Keepax , Maxime Coquelin , Ray Jui , Sascha Hauer , Sean Wang , Maxime Ripard , linux-gpio@vger.kernel.org, Richard Fitzgerald , Rob Herring , linux-mediatek@lists.infradead.org, Paul Walmsley , Matthias Brugger , Sricharan R , Mauro Carvalho Chehab , Hoan Tran , linux-arm-kernel@lists.infradead.org, Niklas =?utf-8?Q?S=C3=B6derlund?= , Scott Branden , linux-unisoc@lists.infradead.org, - , Chris Packham , Liam Girdwood , Serge Semin , linux-kernel@vger.kernel.org, Paul Kocialkowski , Yash Shah , Kieran Bingham , Palmer Dabbelt , Mark Brown , Pengutronix Kernel Team , linux-media@vger.kernel.org, Shawn Guo , Andreas =?utf-8?Q?F=C3=A4rber?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Hi Krzysztof, Thank you for the patch. On Thu, Sep 17, 2020 at 06:52:49PM +0200, Krzysztof Kozlowski wrote: > Convert parts of gpio.txt bindings into common dtschema file for GPIO > controllers. How about deleting the part that has been converted from gpio.txt ? > The schema enforces proper naming of GPIO controller nodes and GPIO > hogs. > > The schema should be included by specific GPIO controllers bindings. Instead of including it manually, could we use a conditional select: to apply the schema automatically when a gpio-controller property is present ? > Signed-off-by: Krzysztof Kozlowski > > --- > > Changes since v1: > 1. Do not require compatible (some child nodes are gpio-controllers > without the compatible). > --- > .../devicetree/bindings/gpio/gpio-common.yaml | 125 ++++++++++++++++++ > 1 file changed, 125 insertions(+) > create mode 100644 Documentation/devicetree/bindings/gpio/gpio-common.yaml > > diff --git a/Documentation/devicetree/bindings/gpio/gpio-common.yaml b/Documentation/devicetree/bindings/gpio/gpio-common.yaml > new file mode 100644 > index 000000000000..af9f6c7feeec > --- /dev/null > +++ b/Documentation/devicetree/bindings/gpio/gpio-common.yaml > @@ -0,0 +1,125 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/gpio/gpio-common.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Common GPIO controller properties > + > +maintainers: > + - Krzysztof Kozlowski > + - Linus Walleij > + > +properties: > + nodename: > + pattern: "^(gpio-controller|gpio)(@[0-9a-f]+|-[0-9a-f]+)?$" > + > + '#gpio-cells': true > + gpio-controller: true > + gpio-ranges: true > + > + gpio-line-names: > + description: | > + Optionally, a GPIO controller may have a "gpio-line-names" property. This > + is an array of strings defining the names of the GPIO lines going out of > + the GPIO controller. This name should be the most meaningful producer > + name for the system, such as a rail name indicating the usage. Package > + names such as pin name are discouraged: such lines have opaque names > + (since they are by definition generic purpose) and such names are usually > + not very helpful. > + > + For example "MMC-CD", "Red LED Vdd" and "ethernet reset" are reasonable > + line names as they describe what the line is used for. "GPIO0" is not a > + good name to give to a GPIO line. > + > + Placeholders are discouraged: rather use the "" (blank string) if the use > + of the GPIO line is undefined in your design. The names are assigned > + starting from line offset 0 from left to right from the passed array. An > + incomplete array (where the number of passed named are less than ngpios) > + will still be used up until the last provided valid line index. > + > + gpio-reserved-ranges: > + description: > + Indicates the start and size of the GPIOs that can't be used. > + > + ngpios: > + description: | > + Optionally, a GPIO controller may have a "ngpios" property. This property > + indicates the number of in-use slots of available slots for GPIOs. The > + typical example is something like this: the hardware register is 32 bits > + wide, but only 18 of the bits have a physical counterpart. The driver is > + generally written so that all 32 bits can be used, but the IP block is > + reused in a lot of designs, some using all 32 bits, some using 18 and > + some using 12. In this case, setting "ngpios = <18>;" informs the driver > + that only the first 18 GPIOs, at local offset 0 .. 17, are in use. > + > + If these GPIOs do not happen to be the first N GPIOs at offset 0...N-1, > + an additional set of tuples is needed to specify which GPIOs are > + unusable, with the gpio-reserved-ranges binding. > + > +patternProperties: > + "^(hog-[0-9]+|.+-hog(-[0-9]+)?)$": > + type: object > + description: > + The GPIO chip may contain GPIO hog definitions. GPIO hogging is a mechanism > + providing automatic GPIO request and configuration as part of the > + gpio-controller's driver probe function. > + Each GPIO hog definition is represented as a child node of the GPIO controller. > + > + properties: > + gpio-hog: true > + gpios: true > + input: true > + output-high: true > + output-low: true > + line-name: > + description: > + The GPIO label name. If not present the node name is used. > + > + required: > + - gpio-hog > + - gpios > + > + oneOf: > + - required: > + - input > + - required: > + - output-high > + - required: > + - output-low > + > + additionalProperties: false > + > +required: > + - "#gpio-cells" > + - gpio-controller > + > +examples: > + - | > + gpio-controller@15000000 { > + compatible = "foo"; > + reg = <0x15000000 0x1000>; > + gpio-controller; > + #gpio-cells = <2>; > + ngpios = <18>; > + gpio-reserved-ranges = <0 4>, <12 2>; > + gpio-line-names = "MMC-CD", "MMC-WP", "VDD eth", "RST eth", "LED R", > + "LED G", "LED B", "Col A", "Col B", "Col C", "Col D", > + "Row A", "Row B", "Row C", "Row D", "NMI button", > + "poweroff", "reset"; > + }; > + > + - | > + gpio-controller@1400 { > + compatible = "fsl,qe-pario-bank-a", "fsl,qe-pario-bank"; > + reg = <0x1400 0x18>; > + gpio-controller; > + #gpio-cells = <2>; > + > + line-b-hog { > + gpio-hog; > + gpios = <6 0>; > + input; > + line-name = "foo-bar-gpio"; > + }; > + }; -- Regards, Laurent Pinchart _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv