From patchwork Fri Oct 30 11:03:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 55828 Delivered-To: patch@linaro.org Received: by 10.112.61.134 with SMTP id p6csp1132038lbr; Fri, 30 Oct 2015 04:03:35 -0700 (PDT) X-Received: by 10.50.65.8 with SMTP id t8mr2200765igs.74.1446203015755; Fri, 30 Oct 2015 04:03:35 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i134si6958275ioi.31.2015.10.30.04.03.35; Fri, 30 Oct 2015 04:03:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dkim=neutral (body hash did not verify) header.i=@linaro_org.20150623.gappssmtp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758776AbbJ3LDe (ORCPT + 4 others); Fri, 30 Oct 2015 07:03:34 -0400 Received: from mail-lb0-f178.google.com ([209.85.217.178]:33404 "EHLO mail-lb0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758783AbbJ3LDd (ORCPT ); Fri, 30 Oct 2015 07:03:33 -0400 Received: by lbbec13 with SMTP id ec13so48465282lbb.0 for ; Fri, 30 Oct 2015 04:03:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro_org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=JylTGGQ5OvyWiP/J2c07Q1CVODBslwlMHnfuXcsfq4M=; b=T6DI7He4Ev3duPdInNlrJJqbnfEDtQYEiSKYASbEGSUU48ahJALFbOAewxPwkPZmdq Z/Prbae6+Hb6hr8mUbTsFicdNFK/c5cxR//9HW83aR5jaGk2HyhQo5RQjqeyWE4nix2K GDhA1mXHIxZwKyXJhPBE3o//t2ol4Fniyi3AF7SgL08tLLsbWDRFxZHvZJBHTulRcKhS 2kRhGIStIICMca4+Sa6oWGJPgQrC5uEgF/geYZ0OxVUez2y3PMAIpFwDzZRz1DNkj5+y fJYDdZQTzACgCPEXZNhIDDRZPFd+Sy2Ld8zzHhV56L8kYfcqqg9x1N6cGK5KRyzKlhX/ GUPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=JylTGGQ5OvyWiP/J2c07Q1CVODBslwlMHnfuXcsfq4M=; b=ABNO/heaZ8OqHXznuoXfJLPKcjKryra5SVl8ts3LR8ryI/cHt+OOq4EcA4X3nB0+h0 STQILZNSPGVXsKmkEdHre6/FAiluL9/GaAnnTYV87XEm4H7QGdzRazcTt6MIrwnbL+ze EMJ1znIimx1Kh6SoF9TvbiequbZul22Et5o2SfK4+5JFsJwk2+sE9X5HeNA3bjwNm49d 8/ZMv4adoiioQ95/AIJZYzrDS8xtK6Df8+KP/SI6XcH6veW77LAKBtDSY4Dvz7jJ/hST /iVSspB+nDut9v+M1anBxhjfqpBuPBvwoLArirytm3//zxvxQ5WlUqhE9OBWVxt/HBtf s7wA== X-Gm-Message-State: ALoCoQknZlUbDbrE0uKPXO/l4ELY5RXFz28bQ0TFkiWtClxW27afvOUcv5bxlt2xthjauWCy5AK2 X-Received: by 10.112.13.199 with SMTP id j7mr3510313lbc.87.1446203012096; Fri, 30 Oct 2015 04:03:32 -0700 (PDT) Received: from localhost.localdomain ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id t204sm1142189lfd.41.2015.10.30.04.03.30 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Oct 2015 04:03:31 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org, Alexandre Courbot Cc: Linus Walleij , devicetree@vger.kernel.org, Pramod Kumar , Jonas Gorski Subject: [PATCH] gpio: dt-bindings: document the official use of "ngpios" Date: Fri, 30 Oct 2015 12:03:22 +0100 Message-Id: <1446203002-7910-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 2.4.3 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org There are a bunch of drivers that utilize the "ngpios" DT property without any vendor prefix. Try to start cleaning up the mess by defining what we mean by this property. Cc: devicetree@vger.kernel.org Cc: Pramod Kumar Cc: Jonas Gorski Signed-off-by: Linus Walleij --- Documentation/devicetree/bindings/gpio/gpio.txt | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) -- 2.4.3 -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/Documentation/devicetree/bindings/gpio/gpio.txt b/Documentation/devicetree/bindings/gpio/gpio.txt index 63b1b9039ce8..9b081e6143a0 100644 --- a/Documentation/devicetree/bindings/gpio/gpio.txt +++ b/Documentation/devicetree/bindings/gpio/gpio.txt @@ -129,6 +129,30 @@ Every GPIO controller node must contain both an empty "gpio-controller" property, and a #gpio-cells integer property, which indicates the number of cells in a gpio-specifier. +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, an +additional bitmask is needed to specify which GPIOs are actually in use, +and which are dummies. The bindings for this case has not yet been +specified, but should be specified if/when such hardware appears. + +Example: + +gpio-controller@00000000 { + compatible = "foo"; + reg = <0x00000000 0x1000>; + gpio-controller; + #gpio-cells = <2>; + ngpios = <18>; +} + 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.