linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Zhi Li <lznuaa@gmail.com>
Cc: "Frank.Li@freescale.com" <Frank.Li@freescale.com>,
	Shawn Guo <shawn.guo@linaro.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	linux-input@vger.kernel.org, Robin Gong <b38343@freescale.com>
Subject: Re: [PATCH 2/3] input: keyboad: imx: add snvs power key driver
Date: Tue, 12 May 2015 14:21:26 -0700	[thread overview]
Message-ID: <20150512212126.GG20725@dtor-ws> (raw)
In-Reply-To: <CAHrpEqQpyO=Fzu206xPUwQE+cvk7rpTd0r0A_bL-V1UWgT7+XA@mail.gmail.com>

On Tue, May 12, 2015 at 03:37:41PM -0500, Zhi Li wrote:
> >> +             ret = devm_request_irq(&pdev->dev, pdata->irq,
> >> +                                     imx_snvs_pwrkey_interrupt,
> >> +                                     IRQF_TRIGGER_HIGH | IRQF_NO_SUSPEND, pdev->name, pdev);
> >
> > Why IRQF_NO_SUSPEND? Also should we not get trigger type from OF data?
> >
> wake up by PWRON key in freeze mode

enable_irq_wake() should adjust the handler as needed, the driver should
request flags that are needed for it's own operations.

> 
> Do you have any example to get trigger type from OF data?

You can retrieve the flags via irqd_get_trigger_type() for example, but
you do not need to do that, because OF code will set up interrupt
properly (based on DTS) when creating the corresponsing platform device
(see of_irq_parse_and_map). so you just need to do:

	ret = devm_request_irq(&pdev->dev, pdata->irq,
			       imx_snvs_pwrkey_interrupt,
			       0, pdev->name, pdev);

Thanks.

-- 
Dmitry

  reply	other threads:[~2015-05-12 21:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-12 16:50 [PATCH 1/3] document: devicetree: input: imx: i.mx snvs power device tree bindings Frank.Li
2015-05-12 16:50 ` [PATCH 2/3] input: keyboad: imx: add snvs power key driver Frank.Li
2015-05-12 18:43   ` Dmitry Torokhov
2015-05-12 20:37     ` Zhi Li
2015-05-12 21:21       ` Dmitry Torokhov [this message]
2015-05-13 14:35     ` Zhi Li
2015-05-12 16:50 ` [PATCH 3/3] arm: dts: imx6sx: enable snvs power key Frank.Li

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=20150512212126.GG20725@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=Frank.Li@freescale.com \
    --cc=b38343@freescale.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-input@vger.kernel.org \
    --cc=lznuaa@gmail.com \
    --cc=shawn.guo@linaro.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).