All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Norris <briannorris@chromium.org>
To: JeffyChen <jeffy.chen@rock-chips.com>
Cc: linux-kernel@vger.kernel.org, briannorris@google.com,
	dtor@google.com, dianders@google.com,
	Enric Balletbo i Serra <enric.balletbo@collabora.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Joseph Lo <josephl@nvidia.com>, stephen lu <lumotuwe@gmail.com>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Kate Stewart <kstewart@linuxfoundation.org>,
	linux-input@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Philippe Ombredanne <pombredanne@nexb.com>,
	Arvind Yadav <arvind.yadav.cs@gmail.com>
Subject: Re: [PATCH v2 1/3] Input: gpio-keys - add support for wakeup event action
Date: Thu, 1 Mar 2018 18:32:30 -0800	[thread overview]
Message-ID: <20180302023229.GA164361@rodete-desktop-imager.corp.google.com> (raw)
In-Reply-To: <5A8FE726.6080903@rock-chips.com>

Hi,

On Fri, Feb 23, 2018 at 06:04:22PM +0800, Jeffy Chen wrote:
> On 02/13/2018 06:13 AM, Brian Norris wrote:
> > > >
> > > >  	if (bdata->gpiod) {
> > > >+		int active_low = gpiod_is_active_low(bdata->gpiod);
> > > >+
> > > >  		if (button->debounce_interval) {
> > > >  			error = gpiod_set_debounce(bdata->gpiod,
> > > >  					button->debounce_interval * 1000);
> > > >@@ -568,6 +572,16 @@ static int gpio_keys_setup_key(struct platform_device *pdev,
> > > >  		isr = gpio_keys_gpio_isr;
> > > >  		irqflags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING;
> > > >
> > > >+		switch (button->wakeup_event_action) {
> > > >+		case EV_ACT_ASSERTED:
> > > >+			bdata->wakeup_trigger_type = active_low ?
> > > >+				IRQF_TRIGGER_FALLING : IRQF_TRIGGER_RISING;
> > > >+			break;
> > > >+		case EV_ACT_DEASSERTED:
> > > >+			bdata->wakeup_trigger_type = active_low ?
> > > >+				IRQF_TRIGGER_RISING : IRQF_TRIGGER_FALLING;
> > > >+			break;
> > What about EV_ACT_ANY? And default case? I think for ANY, we're OK
> > letting suspend/resume not reconfigure the trigger type, but maybe a
> > comment here to note that?
> right, will add comment in the next version.
> > 
> > > >+		}
> > > >  	} else {
> > What about the 'else' case? Shouldn't we try to handle that?
> i think the else case is for irq key, which would generate down and up
> events in one irq, so it would use the same trigger type for all these 3
> cases.

Not necessarily. It uses whatever trigger was provided in
platform/DT/etc. data. You could retrieve that with
irq_get_trigger_type() and try to interpret that. Or you could just
outlaw using that combination (e.g., in the binding documentation).

Brian

> i'll add comment in the next version too.
> > 
> > Brian
> > 
> 
> 

  reply	other threads:[~2018-03-02  2:32 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-10 11:09 [PATCH v2 0/3] gpio-keys: Add support for specifying wakeup event action Jeffy Chen
2018-02-10 11:09 ` Jeffy Chen
2018-02-10 11:09 ` Jeffy Chen
2018-02-10 11:09 ` [PATCH v2 1/3] Input: gpio-keys - add support for " Jeffy Chen
2018-02-12 22:13   ` Brian Norris
2018-02-13 10:40     ` Enric Balletbo i Serra
2018-02-13 18:25       ` Brian Norris
2018-02-13 22:25         ` Enric Balletbo Serra
2018-02-23 10:15           ` JeffyChen
2018-02-23 10:04     ` JeffyChen
2018-03-02  2:32       ` Brian Norris [this message]
2018-03-02  3:57         ` JeffyChen
2018-02-10 11:09 ` [PATCH v2 2/3] Input: gpio-keys - allow setting wakeup event action in DT Jeffy Chen
2018-03-01 21:26   ` Rob Herring
2018-02-10 11:09 ` [PATCH v2 3/3] arm64: dts: rockchip: Avoid wakeup when inserting the pen Jeffy Chen
2018-02-10 11:09   ` Jeffy Chen
2018-02-10 11:09   ` Jeffy Chen
2018-02-14 13:39 ` [PATCH v2 0/3] gpio-keys: Add support for specifying wakeup event action Heiko Stübner
2018-02-14 13:39   ` Heiko Stübner
2018-02-14 13:39   ` Heiko Stübner
2018-02-23  9:43   ` JeffyChen
2018-02-23  9:43     ` JeffyChen
2018-02-23  9:43     ` JeffyChen

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=20180302023229.GA164361@rodete-desktop-imager.corp.google.com \
    --to=briannorris@chromium.org \
    --cc=arvind.yadav.cs@gmail.com \
    --cc=briannorris@google.com \
    --cc=dianders@google.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=dtor@google.com \
    --cc=enric.balletbo@collabora.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jeffy.chen@rock-chips.com \
    --cc=josephl@nvidia.com \
    --cc=kstewart@linuxfoundation.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lumotuwe@gmail.com \
    --cc=pombredanne@nexb.com \
    --cc=tglx@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.