From patchwork Tue Nov 17 10:07:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Pargmann X-Patchwork-Id: 545493 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 8FD7814145B for ; Tue, 17 Nov 2015 21:08:15 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753068AbbKQKIN (ORCPT ); Tue, 17 Nov 2015 05:08:13 -0500 Received: from metis.ext.4.pengutronix.de ([92.198.50.35]:52724 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752601AbbKQKIM (ORCPT ); Tue, 17 Nov 2015 05:08:12 -0500 Received: from dude.hi.pengutronix.de ([2001:67c:670:100:1d::7]) by metis.ext.pengutronix.de with esmtps (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1ZydBC-000529-HC; Tue, 17 Nov 2015 11:08:02 +0100 Received: from mpa by dude.hi.pengutronix.de with local (Exim 4.86) (envelope-from ) id 1ZydBC-0008Q0-6U; Tue, 17 Nov 2015 11:08:02 +0100 From: Markus Pargmann To: Linus Walleij Cc: Alexandre Courbot , devicetree@vger.kernel.org, linux-gpio@vger.kernel.org, kernel@pengutronix.de, Markus Pargmann Subject: [PATCH v3 1/2] dt-bindings: GPIO: Add gpio-initval Date: Tue, 17 Nov 2015 11:07:57 +0100 Message-Id: <1447754878-21099-2-git-send-email-mpa@pengutronix.de> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1447754878-21099-1-git-send-email-mpa@pengutronix.de> References: <1447754878-21099-1-git-send-email-mpa@pengutronix.de> X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::7 X-SA-Exim-Mail-From: mpa@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: devicetree@vger.kernel.org Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add a binding for GPIO initialization. Signed-off-by: Markus Pargmann --- Documentation/devicetree/bindings/gpio/gpio.txt | 34 ++++++++++++++++--------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/Documentation/devicetree/bindings/gpio/gpio.txt b/Documentation/devicetree/bindings/gpio/gpio.txt index 069cdf6f9dac..d11abfa13add 100644 --- a/Documentation/devicetree/bindings/gpio/gpio.txt +++ b/Documentation/devicetree/bindings/gpio/gpio.txt @@ -155,29 +155,39 @@ gpio-controller@00000000 { 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. +The GPIO chip may contain GPIO definitions. These define properties for single +GPIOs of this controller. -Each GPIO hog definition is represented as a child node of the GPIO controller. +There are two types of GPIO definitions: + +- GPIO hogging is a mechanism providing automatic GPIO request and + configuration as part of the gpio-controller driver's probe function. The + GPIO is held until the gpio-controller is removed. +- GPIO initialization provides an automatic initialization to known save + values. The GPIO can be used normally afterwards. + +Each GPIO definition is represented as a child node of the GPIO controller. Required properties: -- gpio-hog: A property specifying that this child node represent a GPIO hog. - gpios: Store the GPIO information (id, flags, ...). Shall contain the number of cells specified in its parent node (GPIO controller node). -Only one of the following properties scanned in the order shown below. -This means that when multiple properties are present they will be searched -in the order presented below and the first match is taken as the intended -configuration. + +Optional properties: +- line-name: The GPIO label name. If not present the node name is used. + + The following two options are mutually exclusive. One of them should be + specified, but not both: +- gpio-hog: A property specifying that this child node represent a GPIO hog. +- gpio-initval: This GPIO should be initialized to the specified configuration. + + The following three options are mutually exclusive. They change the setting of + the GPIO pin. One of them should be specified: - input: A property specifying to set the GPIO direction as input. - output-low A property specifying to set the GPIO direction as output with the value low. - output-high A property specifying to set the GPIO direction as output with the value high. -Optional properties: -- line-name: The GPIO label name. If not present the node name is used. - Example of two SOC GPIO banks defined as gpio-controller nodes: qe_pio_a: gpio-controller@1400 {