linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanislav Brabec <utx@penguin.cz>
To: Eric Miao <eric.y.miao@gmail.com>
Cc: Andrew Morton <akpm@osdl.org>,
	thommycheck@gmail.com, dbaryshkov@gmail.com, dtor@mail.ru,
	arminlitzel@web.de, linux-input@vger.kernel.org,
	kernel list <linux-kernel@vger.kernel.org>,
	Dirk@opfer-online.de, "Rafael J. Wysocki" <rjw@sisk.pl>,
	lenz@cs.wisc.edu, rpurdie@rpsys.net,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	Pavel Machek <pavel@ucw.cz>, Cyril Hrubis <metan@ucw.cz>,
	zaurus-devel@lists.linuxtogo.org, omegamoon@gmail.com,
	Vojtech Pavlik <vojtech@suse.cz>
Subject: Re: gpio_keys and how PXA27x sets gpio_set_wake() (was Re: sharp c-3000 aka spitz: fix warn_on introduced in 2.6.32-rc1)
Date: Tue, 26 Jan 2010 13:50:42 +0100	[thread overview]
Message-ID: <1264510242.25072.269.camel@hammer.suse.cz> (raw)
In-Reply-To: <f17812d71001260339h6184c82bj25ff13a168284c24@mail.gmail.com>

Eric Miao wrote:
> 2010/1/26 Stanislav Brabec <utx@penguin.cz>:
> > Eric Miao wrote:
> >> 2010/1/26 Stanislav Brabec <utx@penguin.cz>:
> >
> >> > Handling platform specific edge/level wake setup would only complicate
> >> > the code. (In fact, even the PXA270 platform code does not exist yet -
> >> > arch/arm/mach-pxa/mfp-pxa2xx.c:__mfp_config_gpio() is not capable to
> >> > configure Power Manager Keyboard Wake-Up Enable Register (PKWR).)
> >> That's why WAKEUP_ON_EDGE_* is introduced, no need for gpio-keys
> >> to know this.
> >
> > But WAKEUP_ON_EDGE_* is impossible for GPIO 95,
> > enable_irq_wake()/gpio_set_wake() returns EINVAL and disable_irq_wake()
> > complains on "Unbalanced IRQ 191".

> Now I see, but I don't know why disable_irq_wake() will complains about
> unbalance since it should really manage it well.

Because gpio_set_wake() returned EINVAL, set_irq_wake() assumed error
and did not increment wake_depth, the whole enable_irq_wake() was a big
NOP. disable_irq_wake() seen wake_depth being zero and complains.

> A quick dirty solution would be the platform to call keypad_set_wake()
> directly somewhere. Otherwise we have to let gpio_set_wake() to handle
> those keypad GPIOs and to live together with keypad_set_wake() happily,
> which is really difficult.

I was thinking about it as well (and even tested that it works):
gpio_set_wake():
if (d->keypad_gpio)
	return keypad_set_wake(on);

But keypad_set_wake() always sets all keypad GPIOs, not just a single
one. And there is GPIO 36, that can be configured in more ways.

gpio_set_wake() and only set wake, keeping the mode as it was before.
(Well, it's again impossible for GPIO 36 without storing this
information somewhere.)

But well, another idea:

Only matrix_keypad driver should be aware of level triggered wakeup. All
other drivers could follow *_irq_wake documentation and not care about
it. If edge triggered interrupt is available, it should be preferred
there, if not, level triggered wake should be used instead. Hardware
designers should know what they are doing.


-- 
Best Regards / S pozdravem,

Stanislav Brabec
software developer
---------------------------------------------------------------------
SUSE LINUX, s. r. o.                          e-mail: sbrabec@suse.cz
Lihovarská 1060/12           tel: +420 284 028 966, +49 911 740538747
190 00 Praha 9                                  fax: +420 284 028 951
Czech Republic                                    http://www.suse.cz/

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2010-01-26 12:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20100106071026.GD1382@ucw.cz>
     [not found] ` <f17812d71001052317h2bf25fady6bd729b35ef6db63@mail.gmail.com>
2010-01-07  6:52   ` sharp c-3000 aka spitz: fix warn_on introduced in 2.6.32-rc1 Pavel Machek
2010-01-07  7:33     ` Eric Miao
     [not found]       ` <f17812d71001062333y2e49fa21scf91718da9ae3091-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-01-23 19:41         ` Stanislav Brabec
2010-01-23 22:43           ` gpio_keys and how PXA27x sets gpio_set_wake() (was Re: sharp c-3000 aka spitz: fix warn_on introduced in 2.6.32-rc1) Stanislav Brabec
     [not found]             ` <1264286611.11766.49.camel-VKpoJ9vcIcXrBKCeMvbIDA@public.gmane.org>
2010-01-26  3:58               ` Eric Miao
2010-01-26 10:13                 ` Stanislav Brabec
     [not found]                   ` <1264500824.4480.79.camel-VKpoJ9vcIcXrBKCeMvbIDA@public.gmane.org>
2010-01-26 10:20                     ` Eric Miao
     [not found]                       ` <f17812d71001260220v5d03b0e1u1e3bc229827c37c8-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-01-26 10:44                         ` Stanislav Brabec
2010-01-26 11:23                           ` Dmitry Eremin-Solenikov
     [not found]                           ` <1264502668.4480.97.camel-VKpoJ9vcIcXrBKCeMvbIDA@public.gmane.org>
2010-01-26 11:39                             ` Eric Miao
2010-01-26 12:50                               ` Stanislav Brabec [this message]
2010-03-05  9:23       ` sharp c-3000 aka spitz: fix warn_on introduced in 2.6.32-rc1 Pavel Machek
2010-03-08  5:35         ` Eric Miao
2010-04-29 13:08           ` Pavel Machek

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=1264510242.25072.269.camel@hammer.suse.cz \
    --to=utx@penguin.cz \
    --cc=Dirk@opfer-online.de \
    --cc=akpm@osdl.org \
    --cc=arminlitzel@web.de \
    --cc=dbaryshkov@gmail.com \
    --cc=dtor@mail.ru \
    --cc=eric.y.miao@gmail.com \
    --cc=lenz@cs.wisc.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=metan@ucw.cz \
    --cc=omegamoon@gmail.com \
    --cc=pavel@ucw.cz \
    --cc=rjw@sisk.pl \
    --cc=rpurdie@rpsys.net \
    --cc=thommycheck@gmail.com \
    --cc=vojtech@suse.cz \
    --cc=zaurus-devel@lists.linuxtogo.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).