From: Mark Rutland <mark.rutland@arm.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Tomasz Figa <tomasz.figa@gmail.com>,
Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
Linus Walleij <linus.walleij@linaro.org>,
"swarren@wwwdotorg.org" <swarren@wwwdotorg.org>,
"ian.campbell@citrix.com" <ian.campbell@citrix.com>,
Pawel Moll <Pawel.Moll@arm.com>,
"galak@codeaurora.org" <galak@codeaurora.org>,
"rob.herring@calxeda.com" <rob.herring@calxeda.com>
Subject: Re: [PATCH v2 3/3] gpio: pcf857x: Add OF support
Date: Tue, 27 Aug 2013 15:44:26 +0100 [thread overview]
Message-ID: <20130827144426.GO19893@e106331-lin.cambridge.arm.com> (raw)
In-Reply-To: <2048253.b587MQDRGG@avalon>
On Tue, Aug 27, 2013 at 11:50:40AM +0100, Laurent Pinchart wrote:
> Hi Mark,
>
> On Tuesday 27 August 2013 11:39:49 Mark Rutland wrote:
> > On Sat, Aug 24, 2013 at 03:13:11PM +0100, Tomasz Figa wrote:
> > > On Saturday 24 of August 2013 02:54:07 Laurent Pinchart wrote:
> > > > On Saturday 24 August 2013 02:41:59 Tomasz Figa wrote:
> > > > > On Tuesday 20 of August 2013 01:04:54 Laurent Pinchart wrote:
> > > > > > Add DT bindings for the pcf857x-compatible chips and parse the
> > > > > > device tree node in the driver.
> > > > > >
> > > > > > Signed-off-by: Laurent Pinchart
> > > > > > <laurent.pinchart+renesas@ideasonboard.com>
> > > > > > ---
> > > > > >
> > > > > > .../devicetree/bindings/gpio/gpio-pcf857x.txt | 71 +++++++++++
> > > > > > drivers/gpio/gpio-pcf857x.c | 57 +++++++++--
> > > > > > 2 files changed, 119 insertions(+), 9 deletions(-)
> > > > > > create mode 100644
> > > > > > Documentation/devicetree/bindings/gpio/gpio-pcf857x.txt
> > > > > >
> > > > > > diff --git a/Documentation/devicetree/bindings/gpio/gpio-pcf857x.txt
> > > > > > b/Documentation/devicetree/bindings/gpio/gpio-pcf857x.txt new file
> > > > > > mode 100644
> > > > > > index 0000000..df94462
> > > > > > --- /dev/null
> > > > > > +++ b/Documentation/devicetree/bindings/gpio/gpio-pcf857x.txt
> > > > > > @@ -0,0 +1,71 @@
> > > >
> > > > [snip]
> > > >
> > > > > > + - pins-initial-state: Bitmask that specifies the initial state of
> > > > > > + each pin. When a bit is set to zero, the corresponding pin will
> > > > > > be
> > > > > > + initialized to the input (pulled-up) state. When the bit is
> > > > > > set to + one, the pin will be initialized the the low-level
> > > > > > output state. If + the property is not specified all pins will
> > > > > > be initialized to the + input state.
> > > > >
> > > > > Hmm, do you actually need to know whether those pins are outputs or
> > > > > inputs before they get used for first time? I believe any driver
> > > > > using GPIO will call gpio_direction_{in,out}put() before it starts
> > > > > using the pin, which will initialize the pin to a known state.
> > > > >
> > > > > What I'd suggest is making the driver handle this by having a bit mask
> > > > > that marks states of pins as defined and flagging all pins as
> > > > > undefined by default. Then any call to gpio_direction_output() or
> > > > > _input() would mark it as defined and direction of the pin could be
> > > > > stored in internal driver structures.
> > > >
> > > > The problem is that all pins are controlled through a single I2C write.
> > > > Setting the direction of a pin will set the direction of all other pins.
> > > > I thus need to know what the initial settings are to avoid glitches.
> >
> > I guess it's not possible to read the initial state from the hardware?
>
> I wish. Unfortunately it can only be written.
What a shame :(
Thanks,
Mark.
prev parent reply other threads:[~2013-08-27 14:44 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-19 23:04 [PATCH v2 0/3] pcf857x: Add OF support Laurent Pinchart
2013-08-19 23:04 ` [PATCH v2 1/3] gpio: pcf857x: Sort headers alphabetically Laurent Pinchart
2013-08-23 17:49 ` Linus Walleij
2013-08-19 23:04 ` [PATCH v2 2/3] gpio: pcf857x: Remove pdata argument to pcf857x_irq_domain_init() Laurent Pinchart
2013-08-23 17:52 ` Linus Walleij
2013-08-26 0:35 ` Kuninori Morimoto
2013-08-19 23:04 ` [PATCH v2 3/3] gpio: pcf857x: Add OF support Laurent Pinchart
2013-08-23 17:54 ` Linus Walleij
2013-08-23 23:40 ` Laurent Pinchart
2013-08-24 0:41 ` Tomasz Figa
2013-08-24 0:54 ` Laurent Pinchart
2013-08-24 14:13 ` Tomasz Figa
2013-08-25 0:15 ` Laurent Pinchart
2013-08-25 8:04 ` Sylwester Nawrocki
2013-08-27 10:39 ` Mark Rutland
2013-08-27 10:50 ` Laurent Pinchart
2013-08-27 14:44 ` Mark Rutland [this message]
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=20130827144426.GO19893@e106331-lin.cambridge.arm.com \
--to=mark.rutland@arm.com \
--cc=Pawel.Moll@arm.com \
--cc=devicetree@vger.kernel.org \
--cc=galak@codeaurora.org \
--cc=ian.campbell@citrix.com \
--cc=laurent.pinchart+renesas@ideasonboard.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rob.herring@calxeda.com \
--cc=swarren@wwwdotorg.org \
--cc=tomasz.figa@gmail.com \
/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).