linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
To: linus.walleij@linaro.org, lee.jones@linaro.org
Cc: gnurou@gmail.com, robh+dt@kernel.org, mark.rutland@arm.com,
	linux-gpio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	patches@opensource.wolfsonmicro.com
Subject: [PATCH 1/2] mfd: arizona: Add GPIO maintain state flag
Date: Fri, 7 Apr 2017 13:38:44 +0100	[thread overview]
Message-ID: <1491568725-14882-1-git-send-email-ckeepax@opensource.wolfsonmicro.com> (raw)

The Arizona devices only maintain the state of output GPIOs whilst the
CODEC is active, this can cause issues if the CODEC suspends whilst
something is relying on the state of one of its GPIOs. However, in
many systems the CODEC GPIOs are used for audio related features
and thus the state of the GPIOs is unimportant whilst the CODEC is
suspended. Often keeping the CODEC resumed in such a system would
incur a power impact that is unacceptable.

Add a flag through the second cell of the GPIO specifier in device
tree, to allow the user to select whether a GPIO being configured as
an output should keep the CODEC resumed.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
---
 Documentation/devicetree/bindings/mfd/arizona.txt | 5 ++++-
 include/dt-bindings/mfd/arizona.h                 | 3 +++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/mfd/arizona.txt b/Documentation/devicetree/bindings/mfd/arizona.txt
index 8f2e282..6af0d82 100644
--- a/Documentation/devicetree/bindings/mfd/arizona.txt
+++ b/Documentation/devicetree/bindings/mfd/arizona.txt
@@ -30,7 +30,10 @@ Required properties:
 
   - gpio-controller : Indicates this device is a GPIO controller.
   - #gpio-cells : Must be 2. The first cell is the pin number and the
-    second cell is used to specify optional parameters (currently unused).
+    second cell is used to specify optional parameters, the following flags
+    are supported:
+      "ARIZONA_GP_MAINTAIN" the output of the GPIO must be maintained, this
+      prevents the CODEC going into low power mode.
 
   - AVDD-supply, DBVDD1-supply, CPVDD-supply : Power supplies for the device,
     as covered in Documentation/devicetree/bindings/regulator/regulator.txt
diff --git a/include/dt-bindings/mfd/arizona.h b/include/dt-bindings/mfd/arizona.h
index dedf46f..68f3782 100644
--- a/include/dt-bindings/mfd/arizona.h
+++ b/include/dt-bindings/mfd/arizona.h
@@ -77,6 +77,9 @@
 #define ARIZONA_GP_INPUT               (ARIZONA_GP_FN_GPIO | \
 					ARIZONA_GPN_DIR)
 
+/* Flags for the GPIO driver properties */
+#define ARIZONA_GP_MAINTAIN 0x80000000
+
 #define ARIZONA_32KZ_MCLK1 1
 #define ARIZONA_32KZ_MCLK2 2
 #define ARIZONA_32KZ_NONE  3
-- 
2.1.4


             reply	other threads:[~2017-04-07 12:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-07 12:38 Charles Keepax [this message]
2017-04-07 12:38 ` [PATCH 2/2] gpio: arizona: Add support for GPIOs that need to be maintained Charles Keepax
     [not found]   ` <1491568725-14882-2-git-send-email-ckeepax-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2017-04-08  3:41     ` kbuild test robot
2017-04-08  4:06   ` kbuild test robot
     [not found] ` <1491568725-14882-1-git-send-email-ckeepax-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2017-04-10 20:17   ` [PATCH 1/2] mfd: arizona: Add GPIO maintain state flag Rob Herring
2017-04-11  9:34     ` Richard Fitzgerald
2017-04-13  9:15       ` Charles Keepax
     [not found]         ` <20170413091513.GA1878-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2017-04-13 12:14           ` Linus Walleij
     [not found]             ` <CACRpkdZ6PBv72BCn1bXsvhcHD2+dsCdh=3F3Vnnm7AWZqyWrig-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-04-13 12:21               ` Richard Fitzgerald
2017-04-13 12:48                 ` Linus Walleij
     [not found]                   ` <CACRpkdYAgd+ovH5x+GpbqPqGNG8W=t3A_g1rpY6tha2=FPsfOA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-04-13 13:07                     ` Charles Keepax

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1491568725-14882-1-git-send-email-ckeepax@opensource.wolfsonmicro.com \
    --to=ckeepax@opensource.wolfsonmicro.com \
    --cc=devicetree@vger.kernel.org \
    --cc=gnurou@gmail.com \
    --cc=lee.jones@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=patches@opensource.wolfsonmicro.com \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).