Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1242201pxk; Fri, 18 Sep 2020 07:31:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKmqioVaPLAadpd5XdTDK/WouPa7zHoiLpa7SIqiDsOEnFkvtiT7Q6y5mT7dCd99bkQxm9 X-Received: by 2002:a17:906:2ac5:: with SMTP id m5mr36077594eje.210.1600439507859; Fri, 18 Sep 2020 07:31:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600439507; cv=none; d=google.com; s=arc-20160816; b=n77oI5ZmSg5Bz+hHIKDYf0p4TqSWqTK9BhqtBXyeB+rOwo6U+ztO+gdtzmhJmkLiOa bem/KTQIjoK7mfo1CkkEYyfQuxKOYTDGbrgoi1aRQRUH3f20uiYPAh+ECQELhoS2DFhp iF8znOZz2g9sAPkasACpWKBrWOMb8eBdsfDR10R31OSrbiwcusfssHqn4OqnSzHlrmOw 3qNN6gI7BbKe6qEvxkVzTYohGWpyUPAXAjoC++1PlFCJ1hJfKH70DxvOayDUicLn3nTw VpVGSPGxdWaT+lLPtn2P44DLsW+Ux26Vxg4myiW5hFu+g8HTBX/Yf8tUZCA6YkLRrIeh HeqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=iBnJbri6gtnHcEaY9k4s6ZfFH7rFl0826h9jQg3bZzI=; b=wwyzZ4Hu5QRDiiZE67xGrev4HV8EykSwK+IRI8rkw9Z3xMUH1Ow7J0OuSQlScaCVSF 6MW4FxM9yRji2jGanfHiYAiymIXFmtnn50t3TwnhWmc/VeXoVyuJBIeLpLZB32yTG9GH 61NxY6hVjKJhw/dSBrgnN9FaZ0tcYPaI5EvHnD8VEabsDJnyYeaiBzvJqYsl+AcHyeC8 7GVfptB28VGSaqNTLP1VLjnZkSdiYlSJAt0iRVXIZjomC+Js4wLQkkm00L4cL9lcF0wl fJmjoT/shjXoWp0/w5sdbSW8pAS7vYrO/frGsJhLTgHiRq083qlqzXNt3IYgo+YxNaBK HmTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=M78Nd8HJ; spf=pass (google.com: 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bs18si2245511edb.597.2020.09.18.07.31.22; Fri, 18 Sep 2020 07:31:47 -0700 (PDT) Received-SPF: pass (google.com: 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=@kernel.org header.s=default header.b=M78Nd8HJ; spf=pass (google.com: 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726549AbgIROaS (ORCPT + 99 others); Fri, 18 Sep 2020 10:30:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:42616 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725955AbgIROaR (ORCPT ); Fri, 18 Sep 2020 10:30:17 -0400 Received: from mail-ot1-f49.google.com (mail-ot1-f49.google.com [209.85.210.49]) (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 7449A2396D; Fri, 18 Sep 2020 14:30:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600439415; bh=BzRCCHrMyRtEbFXS+WPF2C06UQOXtwZQ6+AR7KwiNeY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=M78Nd8HJqpaE3j9eXFP+0zTJkt2DJ3JP2vG2rY2s+E2Ucjhb1yZtupM/PYNzuUdOV 7j9z8YCTnNoaiuky8aGripKJaCqvG3MNujOgGJ57GaOrjyaHNHJWRRh2mRAdM4mzf/ 0+TNIX/OYTI78EOul2yVt4CZmk8rrF0HMp4lqS3s= Received: by mail-ot1-f49.google.com with SMTP id a2so5528319otr.11; Fri, 18 Sep 2020 07:30:15 -0700 (PDT) X-Gm-Message-State: AOAM532yQ4ObGx0RRqNObm0vMioebQcY79P4fcFTvc63A6dO6JrV2Nvh VFP4l8AqTF2AMbkI4se2Zg2iLnqxZ12qVBdp0g== X-Received: by 2002:a05:6830:1008:: with SMTP id a8mr21429982otp.107.1600439413814; Fri, 18 Sep 2020 07:30:13 -0700 (PDT) MIME-Version: 1.0 References: <20200917165301.23100-1-krzk@kernel.org> <20200917165301.23100-2-krzk@kernel.org> In-Reply-To: <20200917165301.23100-2-krzk@kernel.org> From: Rob Herring Date: Fri, 18 Sep 2020 08:30:02 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 01/13] dt-bindings: gpio: add common schema for GPIO controllers To: Krzysztof Kozlowski Cc: Linus Walleij , Bartosz Golaszewski , Ray Jui , Scott Branden , "maintainer:BROADCOM BCM7XXX ARM ARCHITECTURE" , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Manivannan Sadhasivam , Andy Gross , Bjorn Andersson , Palmer Dabbelt , Paul Walmsley , Hoan Tran , Serge Semin , Masahiro Yamada , Jacopo Mondi , Kieran Bingham , Laurent Pinchart , =?UTF-8?Q?Niklas_S=C3=B6derlund?= , Mauro Carvalho Chehab , Charles Keepax , Richard Fitzgerald , Lee Jones , Maxime Coquelin , Alexandre Torgue , =?UTF-8?Q?Andreas_F=C3=A4rber?= , Maxime Ripard , Chen-Yu Tsai , Matthias Brugger , Geert Uytterhoeven , Liam Girdwood , Mark Brown , Chris Packham , Anson Huang , Sungbo Eo , Stefan Agner , Srinivas Kandagatla , Magnus Damm , Yash Shah , Paul Kocialkowski , - , Matti Vaittinen , Amelie Delaunay , Cristian Ciocaltea , Paul Cercueil , Andy Teng , Sean Wang , Sricharan R , Chris Brandt , Jaroslav Kysela , Takashi Iwai , "open list:GPIO SUBSYSTEM" , devicetree@vger.kernel.org, linux-arm-kernel , "linux-kernel@vger.kernel.org" , linux-unisoc@lists.infradead.org, linux-arm-msm , linux-riscv , Linux Media Mailing List , Linux-ALSA , "moderated list:ARM/STM32 ARCHITECTURE" , "moderated list:ARM/Mediatek SoC support" , "open list:MEDIA DRIVERS FOR RENESAS - FCP" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 17, 2020 at 10:53 AM Krzysztof Kozlowski wrote: > > Convert parts of gpio.txt bindings into common dtschema file for GPIO > controllers. The schema enforces proper naming of GPIO controller nodes > and GPIO hogs. Did you not see my previous reply about a common schema? We already have a common GPIO and hog schema in dtschema. Please add to it whatever is missing. My goal is all common schema end up in dtschema, but I haven't pushed folks to do that yet. Ones I've done are there though. One issue is what's in dtschema should be GPL/BSD and the existing text bindings are default GPL, so there's a relicensing exercise. In some cases, the schema is there but I haven't copied over the descriptions. Rob > + 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"; > + }; > + }; > -- > 2.17.1 >