linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Miao <eric.y.miao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Stanislav Brabec <utx-ZsETY1VsSgLrBKCeMvbIDA@public.gmane.org>
Cc: Andrew Morton <akpm-3NddpPZAyC0@public.gmane.org>,
	thommycheck-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	dbaryshkov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	dtor-JGs/UdohzUI@public.gmane.org,
	arminlitzel-S0/GAf8tV78@public.gmane.org,
	kernel list
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Cyril Hrubis <metan-+ZI9xUNit7I@public.gmane.org>,
	Dirk-ngtJ1GK09nrbFfAX06+HdQ@public.gmane.org,
	"Rafael J. Wysocki" <rjw-KKrjLPT3xs0@public.gmane.org>,
	lenz-hcNo3dDEHLuVc3sceRu5cw@public.gmane.org,
	Vojtech Pavlik <vojtech-AlSwsSmVLrQ@public.gmane.org>,
	rpurdie-Fm38FmjxZ/leoWH0uzbU5w@public.gmane.org,
	linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	zaurus-devel-cunTk1MwBs/k6gDgw6ADrEB+6BGkLq7r@public.gmane.org,
	linux-arm-kernel
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>
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 18:20:13 +0800	[thread overview]
Message-ID: <f17812d71001260220v5d03b0e1u1e3bc229827c37c8@mail.gmail.com> (raw)
In-Reply-To: <1264500824.4480.79.camel-VKpoJ9vcIcXrBKCeMvbIDA@public.gmane.org>

2010/1/26 Stanislav Brabec <utx@penguin.cz>:
> Eric Miao wrota:
>
>> I prefer 2) - the ugly and hardcoded setup in spitz_pm.c should really
>> be removed. That's why the gpio_set_wake() and keypad_set_wake()
>> are introduced.
>
> I am unsure, whether gpio_keys driver is interested in the way, how wake
> happens. I guess that is interested only in the fact, that wake
> happened.
>
> 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.

> I talked to Vojtěch Pavlík and he told that 1 is correct: Follow
> include/linux/interrupt.h. Setting edge/level wake mode should be done
> in the platform file. The driver could use just irq_set_wake() and don't
> care about details. And irq_set_wake() should do something useful even
> for PKWR capable GPIO.
>

I don't mind if IRQF_TRIGGER_ will always be correct regarding the
wakeup edge/level settings in MFP, but honestly - I don't think so.

>> keypad_set_wake() is really specifically introduced for use by pxa27x_keypad
>> and no generic GPIO stuffs. So it's really annoying a GPIO will use
>> the PKWR as a wakeup GPIO, I'd recommend one still get this hard coded
>> into the platform file, with combination of WAKEUP_ON_LEVEL_HIGH (which
>> is specifically designed for keypad GPIOs) and keypad_set_wake().
>
> Well, keypad_set_wake() seems to be possibly broken for GPIO 38. Imagine
> a device, that has a small keypad, but GPIO 38 has a different purpose
> that requires an edge triggered wakeup (PWER). I think that
> keypad_set_wake() reprograms it to PKWR.

Unless someone specifies that by

GPIO38_GPIO | WAKEUP_ON_LEVEL_HIGH,

keypad_set_wake() will never try to enable the bit in PKWR.

>
> The problem affects gpio_keys: It is a driver implementing "one key per
> gpio". It now handles On/Off and lid switches on Zaurus. Lid switches
> are on "normal" GPIOs, On/Off switch is wired to PKWR capable GPIO.
>

Ain't On/Off switch one of the matrix key? And so SPITZ_GPIO_KEY_INT
could be used to handle that?

>> The spitz, however, is doing a good job on this though it's using a GPIO
>> emulated matrix keypad, that there is a separate SPITZ_GPIO_KEY_INT,
>> which triggers whenever there is any key press on this matrix (I don't
>> know how that's designed in HW, but it seems to do that job), and
>> which can be setup as a GPIO wakeup.
>
> SPITZ_GPIO_KEY_INT happens if AC adapter is connected or key is pressed.
> Surprisingly, the key press logic is part of NAND flash controller CPLD.
> SPITZ_GPIO_KEY_INT==0 - it makes possible to wake Zaurus even from deep
> sleep by any key press. It would be impossible only with PKWR.
>
> I guess that this and implementation of keypad_set_wake() is a reason,
> why most devices suspend and resume correctly even if the irq_set_wake()
> refuses to configure wake and the warning is only visible symptom.

_______________________________________________
Zaurus-devel mailing list
Zaurus-devel@lists.linuxtogo.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/zaurus-devel

  parent reply	other threads:[~2010-01-26 10:20 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 [this message]
     [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
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=f17812d71001260220v5d03b0e1u1e3bc229827c37c8@mail.gmail.com \
    --to=eric.y.miao-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=Dirk-ngtJ1GK09nrbFfAX06+HdQ@public.gmane.org \
    --cc=akpm-3NddpPZAyC0@public.gmane.org \
    --cc=arminlitzel-S0/GAf8tV78@public.gmane.org \
    --cc=dbaryshkov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=dtor-JGs/UdohzUI@public.gmane.org \
    --cc=lenz-hcNo3dDEHLuVc3sceRu5cw@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=metan-+ZI9xUNit7I@public.gmane.org \
    --cc=rjw-KKrjLPT3xs0@public.gmane.org \
    --cc=rpurdie-Fm38FmjxZ/leoWH0uzbU5w@public.gmane.org \
    --cc=thommycheck-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=utx-ZsETY1VsSgLrBKCeMvbIDA@public.gmane.org \
    --cc=vojtech-AlSwsSmVLrQ@public.gmane.org \
    --cc=zaurus-devel-cunTk1MwBs/k6gDgw6ADrEB+6BGkLq7r@public.gmane.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).