From: robert.jarzmik@free.fr (Robert Jarzmik)
To: linux-arm-kernel@lists.infradead.org
Subject: GPIO sysfs : set a wake source
Date: Thu, 16 May 2013 21:39:00 +0200 [thread overview]
Message-ID: <87ip2ig1ez.fsf@free.fr> (raw)
In-Reply-To: <51926177.1050600@wwwdotorg.org> (Stephen Warren's message of "Tue, 14 May 2013 10:08:23 -0600")
Stephen Warren <swarren@wwwdotorg.org> writes:
> On 05/14/2013 03:29 AM, Linus Walleij wrote:
>> On Thu, May 9, 2013 at 2:59 PM, Robert Jarzmik <robert.jarzmik@free.fr> wrote:
>>
>>> I was thinking on how to remove all "gpio_request()" from my board code
>>> (arch/arm/mach-pxa/mioa701.c).
>>>
>>> I have a small difficulty with the functionality provided by gpiolib in
>>> userspace. This is what I need :
>>> - define a gpio as an input
>>> - define this gpio to be an interrupt source
>>> - define this interrupt to be a wake-up source
>>
>> This sounds like trying to remove board code by moving it to userspace
>> and basically starting to implement stuff that belongs in the kernel
>> in userspace just because someone says we should get rid of board
>> files :-)
No, really, even it's true that it comes from someone asking me, now I have
though it a bit more through.
>> Don't go down this path, let the kernel handle this kind of stuff.
Oh really, where ?
Let me show you why it can't be a module.
In my case, I have a 2G modem connected to the soc :
- the modem and 1 SoC UART are connected (TX, RX, CTS, ...)
- the modem and SoC are connected through several gpios
- one or two control to power up and reset the modem
- one connected to the modem "ring" signal (the one I want a wakeup for).
So I have no module to handle my modem :
- UART is handled by pxa-uart
- control/reset by gpiolib
- ring ... by nobody
So my point is that this ring *should* be handled by gpiolib, just as any casual
input gpio. Moreover, the "wake-up" ability should be activable/deactivable on
wish by userspace.
>> Instead figure out how to make the subsystems we have and the
>> device trees express what you want to do.
As I said above, I don't think it's the way to go. I have *no* subsystem to
address.
Devicetree can't help in the toggle to "activate" or "deactivate" the wakeup
upon this GPIO, can it ?
>>
>> In another thread I suggested that we add a GPIO "hogging"
>> mechanism to gpiolib, so that the gpio subsystem can by itself
>> "hog" (get) some GPIOs and set them up in certain modes.
>> This closely matches what the pin control subsystem will do
>> with some such things.
>>
>> What do you think about this idea?
I don't yet know. Let me think this more over. I'd like some literature if you
can provide (especially on LAKML).
> There's some merit to discussing the use of "GPIO hogging" for the
> purpose of solving interactions between the IRQ and GPIO subsystems
>
> However, the discussion above sounds like simply a list of GPIOs to
> initialize at boot for the sole purpose of GPIO initialization. I
> thought that had been discussed before and nak'd?
Now I have described a bit more the problem, I think this sentence would need to
be amended :)
Cheers.
--
Robert
next prev parent reply other threads:[~2013-05-16 19:39 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-09 12:59 GPIO sysfs : set a wake source Robert Jarzmik
2013-05-14 9:29 ` Linus Walleij
2013-05-14 16:08 ` Stephen Warren
2013-05-16 19:39 ` Robert Jarzmik [this message]
2013-05-16 19:49 ` Stephen Warren
2013-05-17 3:18 ` Robert Jarzmik
2013-05-17 6:24 ` Linus Walleij
2013-05-18 9:18 ` Robert Jarzmik
2013-05-20 18:25 ` Linus Walleij
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=87ip2ig1ez.fsf@free.fr \
--to=robert.jarzmik@free.fr \
--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).