From patchwork Thu Sep 13 07:47:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 146613 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp295108ljw; Thu, 13 Sep 2018 00:47:40 -0700 (PDT) X-Google-Smtp-Source: ANB0VdalRJrl6J4sLdiTPE/jxtgYpHcHhOUSn61CviTXt7YJwG2oywp4g6z+eCF5kx4L3Ea1vN+x X-Received: by 2002:a62:54c7:: with SMTP id i190-v6mr6113149pfb.155.1536824860001; Thu, 13 Sep 2018 00:47:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536824859; cv=none; d=google.com; s=arc-20160816; b=DhW7r17POzrirpQuNo3bECo5PSA0ME0J/bCYfwIT6efCv+hpEb/zW403RmAwmfwQal QpAv+BOqgw1NjA6i0j7mmXRWc5m+qiautaNSxbegjBMFEqt52O0gyxdeG3Q36Vr//f9q Ejk0GHHDMMrwHSZtMHXJh8Dx5xn92pUw6S0WQb9L0PUt7Yhjqv3QlD/X3sbcbI6cLVhm pq+l0iWj4hYDk9MnU2jBiKSgsA2CuDaBRgKk6kI7P7Cq5H9Q6CxVdnhk3gB5dizYZcPP hsLcO6r82YL6rKF3Z4pQh6fZKeM+QYx9r5pxxkW5BBHUEt9nlor/M4c9clogOCynpgMd BwTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=Sfd+D+m8S+WVwwFJNC23hnZj/HKydxEEqIH9rv0Advo=; b=UxIXSih858vLlRiNUvHO9geUkEuyWt1u+eax16+hfxgrqQRWMtebfnMowQa+hQIFKZ 9ljqKA8U4YkmLroj71e9qLfsVVTcTvtxr9D8X9sG5wkP+PE9UjJXhxrQnju9CybceoaV ki/vEhE/O0oRvK7YyRKw6DpIGToPxZT6/vb3QhasaLl0AIpp2iZ/Jj9RUj9yhmeSck1c 3F/7Ubilo0axOEGoO6zHq4DbgNcBfVDeGiJxt0xkOquwYulcEWUESavXNuRDo0j2c2Oj u4XMSctbqxLOF49mwr8Uj16ibFnYPWHHcGtU71OsLD3487NVSdgFaW1+mFNhlcuPNnIL GLug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aqCISbO2; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a27-v6si3485998pfh.164.2018.09.13.00.47.39; Thu, 13 Sep 2018 00:47:39 -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; dkim=pass header.i=@linaro.org header.s=google header.b=aqCISbO2; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726726AbeIMMzz (ORCPT + 5 others); Thu, 13 Sep 2018 08:55:55 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:39211 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726697AbeIMMzz (ORCPT ); Thu, 13 Sep 2018 08:55:55 -0400 Received: by mail-lf1-f67.google.com with SMTP id v77-v6so3955700lfa.6 for ; Thu, 13 Sep 2018 00:47:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=Sfd+D+m8S+WVwwFJNC23hnZj/HKydxEEqIH9rv0Advo=; b=aqCISbO2Gqf++3qUqCwCujEtCNTh3vC6wIuxZarFaJG7EMy4ujZRncnqOpts9F/PT6 o8PbxpoPkohoqe36lBQZsFThE2BgsWDvNirtqaGXAHQi9zNgGW4o7fZDnftdnrzjbr4j ZNXqjO1z780PhLsQIbGuWL2GHFSXiAIRtBB7s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Sfd+D+m8S+WVwwFJNC23hnZj/HKydxEEqIH9rv0Advo=; b=BxJH9Hqp7QsQNWEk9GwXH9KXQytV7zd/66ANkEWXX6KIPm2FF3GqFqS3WlEF4frGZf e95Sy9NrKpBD+ViOa7n5TPzMhZMM3qKDxdK06sKxM47Qiucf3biGYhIvktz2JIpG/Vwb 8SmfKw8F7mzUHIZ/oSw9g3fPBgbcaJYTRMzyIbkJy3TTTV5H1d2uYq41HIFKqY4eH8ue wruo/ENjmKVRcZMvATOzpCpafpUawj/S5B/dsgJwxm0NJs8jwGFtaTS/kkMF/gUng6zO 01wg1u73h7UWlHrzgCeXzG3USD6ooBOKjDsBOKiUjjO9M6ENc2YiT/5Q08fG+tjcrFJP LO2A== X-Gm-Message-State: APzg51DzsZ9W7SUCFpcUQAkDj4NQxnHbGM50cVxb9gjQCHfi0OaeJu+l x8Duq0bM11UjsKEzdMPFSeStwPXFGwY= X-Received: by 2002:a19:518a:: with SMTP id g10-v6mr4075444lfl.136.1536824856703; Thu, 13 Sep 2018 00:47:36 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id 135-v6sm562954ljj.35.2018.09.13.00.47.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Sep 2018 00:47:34 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Linus Walleij , devicetree@vger.kernel.org, Rob Herring Subject: [PATCH] gpio: OF: Remove bad practice examples Date: Thu, 13 Sep 2018 09:47:32 +0200 Message-Id: <20180913074732.5911-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org We remove the references to anything but two-cell GPIO specifiers and just mention that controllers need to specify their bindings and that we strongly recommend two-cell bindings. Cc: devicetree@vger.kernel.org Cc: Rob Herring Signed-off-by: Linus Walleij --- .../devicetree/bindings/gpio/gpio.txt | 24 +++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) -- 2.17.1 diff --git a/Documentation/devicetree/bindings/gpio/gpio.txt b/Documentation/devicetree/bindings/gpio/gpio.txt index 3afaa396adf7..f0ba154b5723 100644 --- a/Documentation/devicetree/bindings/gpio/gpio.txt +++ b/Documentation/devicetree/bindings/gpio/gpio.txt @@ -27,30 +27,24 @@ and bit-banged data signals: gpio-controller; #gpio-cells = <2>; }; - gpio2: gpio2 { - gpio-controller; - #gpio-cells = <1>; - }; [...] - enable-gpios = <&gpio2 2>; data-gpios = <&gpio1 12 0>, <&gpio1 13 0>, <&gpio1 14 0>, <&gpio1 15 0>; -Note that gpio-specifier length is controller dependent. In the -above example, &gpio1 uses 2 cells to specify a gpio, while &gpio2 -only uses one. - -gpio-specifier may encode: bank, pin position inside the bank, -whether pin is open-drain and whether pin is logically inverted. +In the above example, &gpio1 uses 2 cells to specify a gpio. The first cell is +a local offset to the GPIO line and the second cell represent consumer flags, +such as if the consumer desire the line to be active low (inverted) or open +drain. This is the recommended practice. -Exact meaning of each specifier cell is controller specific, and must -be documented in the device tree binding for the device. +The exact meaning of each specifier cell is controller specific, and must be +documented in the device tree binding for the device, but it is strongly +recommended to use the two-cell approach. -Most controllers are however specifying a generic flag bitfield -in the last cell, so for these, use the macros defined in +Most controllers are specifying a generic flag bitfield in the last cell, so +for these, use the macros defined in include/dt-bindings/gpio/gpio.h whenever possible: Example of a node using GPIOs: