From: Eduardo Valentin <edubezval@gmail.com>
To: Fabio Estevam <festevam@gmail.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
Alexandre Courbot <gnurou@gmail.com>,
Ulises Brindis <ubrindis56@gmail.com>,
Fabio Estevam <fabio.estevam@freescale.com>,
"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
Russell King <linux@arm.linux.org.uk>
Subject: Re: [PATCH 2/2] gpio/mxc: implement reading output gpio value
Date: Wed, 5 Aug 2015 12:46:03 -0700 [thread overview]
Message-ID: <20150805194602.GB1230@localhost.localdomain> (raw)
In-Reply-To: <CAOMZO5DPYL43QNwYRiGJ_rd2eqm64wg+zACK6viWbC_aFH=qsQ@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1659 bytes --]
On Wed, Aug 05, 2015 at 03:11:40PM -0300, Fabio Estevam wrote:
> Hi Eduardo,
>
> On Wed, Aug 5, 2015 at 3:02 PM, Eduardo Valentin <edubezval@gmail.com> wrote:
> >
> > Hello Fabio,
> >
> > On Wed, Aug 05, 2015 at 02:43:05PM -0300, Fabio Estevam wrote:
> >> Hi Eduardo,
> >>
> >> On Wed, Aug 5, 2015 at 2:23 PM, Eduardo Valentin <edubezval@gmail.com> wrote:
> >> > In current implementation, reading the value of an output gpio
> >> > always return 0. The reason is because when a gpio is configured
> >>
> >> Have you tried setting the SION bit for the pad?
> >
> > No, I haven't. From the bit description, it looks like it does a
> > different thing of what we would achieve with this patch. The SION bit
> > is a overwrite to the pad configuration. That is, the pin will be INPUT
> > always.
> >
> > We don't want to force it to be input. We simply want to be able to read
> > the value of an output GPIO. That is achievable by reading a different
> > register. In case the GPIO is configured as output, the GPIO block
> > documentation states its value can be read from GPIO_PSR.
> > This approach works fine, as the GPIO will be output and we can still
> > read its value.
>
> Setting the SION bit allows you to do exactly that. Please see:
> http://lists.infradead.org/pipermail/linux-arm-kernel/2014-July/271774.html
OK. Then, what is the recommendation? Do we set this by default in the
driver code or this is left for DTS pinmux configuration?
To me seams like a bug in the gpio driver still, as the possibility to
read the value of an output gpio is missing/inconsistent.
>
> Regards,
>
> Fabio Estevam
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]
next prev parent reply other threads:[~2015-08-05 19:46 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-05 17:23 [PATCH 0/2] couple of fixes on IMX gpio driver Eduardo Valentin
2015-08-05 17:23 ` [PATCH 1/2] gpio/mxc: mask gpio interrupts in suspend Eduardo Valentin
2015-08-13 12:47 ` Linus Walleij
2015-08-05 17:23 ` [PATCH 2/2] gpio/mxc: implement reading output gpio value Eduardo Valentin
2015-08-05 17:43 ` Fabio Estevam
2015-08-05 18:02 ` Eduardo Valentin
2015-08-05 18:11 ` Fabio Estevam
2015-08-05 19:46 ` Eduardo Valentin [this message]
2015-08-05 20:44 ` Fabio Estevam
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=20150805194602.GB1230@localhost.localdomain \
--to=edubezval@gmail.com \
--cc=fabio.estevam@freescale.com \
--cc=festevam@gmail.com \
--cc=gnurou@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=ubrindis56@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