linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: eric.nelson@boundarydevices.com (Eric Nelson)
To: linux-arm-kernel@lists.infradead.org
Subject: More GPIO madness on iMX6 - and the crappy ARM port of Linux
Date: Fri, 17 Jan 2014 12:33:43 -0700	[thread overview]
Message-ID: <52D98597.6010409@boundarydevices.com> (raw)
In-Reply-To: <52D980C8.9020809@boundarydevices.com>

Hi Russell,

On 01/17/2014 12:13 PM, Eric Nelson wrote:
> Hi Russell,
>
> On 01/17/2014 11:47 AM, Russell King - ARM Linux wrote:
>>
 >> <snip>
>>
>> So, this brings up three obvious questions:
>>
>> 1. What should gpio_get_value() return for an output?
>
> It seems that this is pretty well specified.
>
> To quote Documentation/gpio/gpio-legacy.txt:
>      >> When reading the value of an output pin, the value
>      >> returned should be what's seen on the pin ... that
>      >> won't always match the specified output value, because
>      >> of issues including open-drain signaling and output
>      >> latencies.
>
> Documentation/gpio/gpio.txt is a little less clear, but implies
> the same:
>      >> If you are "driving" the signal high but
>      >> gpiod_get_value(gpio) reports a low value (after
>      >> the appropriate rise time passes), you know some other
>      >> component is driving the shared signal low
>
>> 2. What should be reported in /sys/kernel/debug/gpio for an output?
>> 3. Should iMX6 (and similar) GPIOs always have the SION bit set in
>>     their DT descriptions?
>>
>> Discuss.
>>
>
> Each signal accessed using the GPIO subsystem **must** have
> the SION bit set and the values returned should be the value
> from the PSR registers.
>

Because the MUX registers are very consistent, it appears
that a fix for this that sets the SION bit is simple (almost
mechanical) in the imx*pinfunc.h files.

It seems that each of the declarations matching

	#define MX*GPIO_something

should have bit four set in the mux_mode column.

I'd be happy to work up a patch if there's agreement here
(and I can't think of any rationale for not setting these).

Regards,


Eric

  reply	other threads:[~2014-01-17 19:33 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-17 18:47 More GPIO madness on iMX6 - and the crappy ARM port of Linux Russell King - ARM Linux
2014-01-17 19:13 ` Eric Nelson
2014-01-17 19:33   ` Eric Nelson [this message]
2014-01-17 19:40 ` Stephen Warren
2014-01-17 20:20   ` Uwe Kleine-König
2014-01-17 20:43     ` Russell King - ARM Linux
2014-01-17 21:53       ` Linus Walleij
2014-01-17 23:09     ` Eric Nelson
2014-01-17 20:24   ` Russell King - ARM Linux
2014-01-17 20:42     ` Stephen Warren
2014-01-17 20:53       ` Russell King - ARM Linux
2014-01-17 22:43         ` Linus Walleij
2014-01-21  2:55           ` Alexandre Courbot
2014-01-21  7:11             ` Lothar Waßmann
2014-01-21  9:26             ` Linus Walleij
2014-01-17 19:57 ` Arnaud Patard (Rtp)
2014-01-17 20:12   ` Eric Nelson
2014-01-17 20:33     ` Arnaud Patard (Rtp)
2014-01-17 22:02       ` Eric Nelson

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=52D98597.6010409@boundarydevices.com \
    --to=eric.nelson@boundarydevices.com \
    --cc=linux-arm-kernel@lists.infradead.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).