From patchwork Sat Jul 4 16:19:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dirk Behme X-Patchwork-Id: 491288 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 4CCA6140771 for ; Sun, 5 Jul 2015 18:32:09 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=xi15qn1k; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750873AbbGEIcI (ORCPT ); Sun, 5 Jul 2015 04:32:08 -0400 Received: from mail-wi0-f179.google.com ([209.85.212.179]:37474 "EHLO mail-wi0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750978AbbGEIcH (ORCPT ); Sun, 5 Jul 2015 04:32:07 -0400 Received: by wicgi11 with SMTP id gi11so128917007wic.0 for ; Sun, 05 Jul 2015 01:32:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=3Tq4vJ7kzd0hzB72p0K5CkJBqfR2hhH7hkt9SFiVVw0=; b=xi15qn1kLfibEDzgquJshvX9vSmSaC8o92RV7GKY/IsBZKT9vHmrfyNdZoKOaHGmoZ 0c9dIFzTvMeQPibzcWE0lbbBF3GTVCQLHVDZbtu+lWy9YjTYih4b5sZE5NphsNOwuJmA xaCk/ZVS8FRPcu0bLISSgIMZmaa3w66vh+nlPWynoY5pjo7kZl9B5C8lLMz0ok/QOTaY W8PtC+I/u/Wa44TthT+oyd2faBCToPmxkLiIdui2fwrlPeEeFG5T38ZCXSbDi1cSxpz1 2bEH8HrL8HZk+SlRY7jwkubAF0Ytyu0fNAWhk87QRrxWiBjt4Rgxj8Sum8TeR5Sioj8p 8L8g== X-Received: by 10.180.98.134 with SMTP id ei6mr71934405wib.49.1436026752243; Sat, 04 Jul 2015 09:19:12 -0700 (PDT) Received: from localhost.localdomain (p4FEE0D02.dip0.t-ipconnect.de. [79.238.13.2]) by mx.google.com with ESMTPSA id v3sm37797652wiz.14.2015.07.04.09.19.10 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 04 Jul 2015 09:19:11 -0700 (PDT) From: Dirk Behme To: linux-gpio@vger.kernel.org Cc: Dirk Behme Subject: [PATCH] Documentation: gpio: consumer: describe active low property Date: Sat, 4 Jul 2015 18:19:08 +0200 Message-Id: <1436026748-4452-1-git-send-email-dirk.behme@gmail.com> X-Mailer: git-send-email 2.4.5 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org I've been searching for any documentation of 'the active-low property of a GPIO' already mentioned in this documenation. But couldn't find any. Add it. Sigend-off-by: Dirk Behme Acked-by: Alexandre Courbot --- Documentation/gpio/consumer.txt | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/Documentation/gpio/consumer.txt b/Documentation/gpio/consumer.txt index 75542b9..f1a6e20 100644 --- a/Documentation/gpio/consumer.txt +++ b/Documentation/gpio/consumer.txt @@ -236,6 +236,32 @@ The active-low state of a GPIO can also be queried using the following call: Note that these functions should only be used with great moderation ; a driver should not have to care about the physical line level. +The active-low property +----------------------- + +As a driver should not have to care about the physical line level, all of the +gpiod_set_xxx_value_xxx() functions do take the active-low property into account. +This does mean that they check whether the GPIO is configured to be active-low. And +if so, they manipulate the passed value before the physical line level is driven. + +With this, all the gpiod_set_xxx_value_xxx() functions interpret the parameter +"value" as "active" ("1") or "inactive" ("0"). The physical line level will be +driven accordingly. + +As an example, if the active-low poperty for a dedicated GPIO is set, and the +gpiod_set_xxx_value_xxx() passes "active" ("1"), the physical line level will be +driven low. + +To summarize: + +Function (example) active-low proporty physical line +gpiod_set_raw_value(desc, 0); don't care low +gpiod_set_raw_value(desc, 1); don't care high +gpiod_set_value(desc, 0); n/a low +gpiod_set_value(desc, 1); n/a high +gpiod_set_value(desc, 0); active-low high +gpiod_set_value(desc, 1); active-low low + Set multiple GPIO outputs with a single function call -----------------------------------------------------