[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkdZwUnf3qfJr7btC7Bz5VXfPGaevmc3A3MTnimSXAj06+A@mail.gmail.com>
Date: Wed, 20 Apr 2016 16:56:50 +0200
From: Linus Walleij <linus.walleij@...aro.org>
To: Patrice CHOTARD <patrice.chotard@...com>
Cc: Lee Jones <lee.jones@...aro.org>,
Alexandre Courbot <gnurou@...il.com>,
"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
Maxime Coquelin <maxime.coquelin@...com>,
amelie.delaunay@...com, Shawn Guo <shawnguo@...nel.org>,
Sascha Hauer <kernel@...gutronix.de>,
Dinh Nguyen <dinguyen@...nsource.altera.com>,
Viresh Kumar <vireshk@...nel.org>,
Shiraz Hashim <shiraz.linux.kernel@...il.com>,
Stephen Warren <swarren@...dotorg.org>,
Thierry Reding <thierry.reding@...il.com>
Subject: Re: [PATCH 8/8] gpio: stmpe: configure GPIO as output by default
On Tue, Apr 19, 2016 at 2:18 PM, <patrice.chotard@...com> wrote:
> From: Patrice Chotard <patrice.chotard@...com>
>
> Configures all GPIOs as output, in order to minimize power
> consumption when GPIOs are unused.
>
> Signed-off-by: Amelie DELAUNAY <amelie.delaunay@...com>
> Signed-off-by: Patrice Chotard <patrice.chotard@...com>
Not only do you set them all to outout but also:
> + /* To minimize power consumption, configure unused GPIOs as outputs */
> + for (i = 0; i < stmpe_gpio->chip.ngpio; i++)
> + stmpe_gpio_direction_output(&stmpe_gpio->chip, i, 0);
You are driving them all low.
Now GPIO is general purpose: what if they are connected to a
line with a pull-up resistor?
That is not saving power, instead consuming more than if you
were setting them all to 1.
I am afraid this is wrong.
What you need is to be able to define in the DT (or similar)
a set of initial values for the GPIO lines, and set them to
0 for this design.
Such bindings have been discussed but no conclusion
or merged patch has emerged. Please help out in driving
a standard for this!
Yours,
Linus Walleij
Powered by blists - more mailing lists