All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Y Vo <yvo@apm.com>
Cc: linux-input@vger.kernel.org,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>, Phong Vo <pvo@apm.com>,
	Toan Le <toanle@apm.com>, Loc Ho <lho@apm.com>,
	Feng Kan <fkan@apm.com>, patches <patches@apm.com>
Subject: Re: [PATCH v0] gpio_keys: fix gpio key driver to proper support GIC interrupt
Date: Thu, 11 Jun 2015 01:08:09 +0200	[thread overview]
Message-ID: <1529330.QWrJO7eUSt@wuerfel> (raw)
In-Reply-To: <CAL4ahLeMm_Qvk0BWxOYTc973_4=TPjZStgTNe5uJL53FBhMRvg@mail.gmail.com>

On Monday 08 June 2015 09:48:29 Y Vo wrote:
> On Fri, Jun 5, 2015 at 7:50 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> > On Thursday 04 June 2015 14:25:12 Y Vo wrote:
> >> GIC is designed to support two of trigger mechanisms - active level
> >> high or edge rising. But in the gpio_keys driver, it tries to use both
> >> edge rising and edge falling trigger. This patch fixes the gpio_keys
> >> driver to request only the edge rising event when failed to configure the
> >> interrupt.
> >>
> >> Signed-off-by: Y Vo <yvo@apm.com>
> >
> > I think you want to use an 'interrupts' property instead of a 'gpios'
> > property (or possibly both), so you can pass the right polarity.
> 
>         gpio-keys {
>                 compatible = "gpio-keys";
>                 apm_ctrl_name = "Power Button";
>                 btn2 {
>                         label = "EXT_INT2";
>                         gpios = <&sbgpio 13 0x0>;
>                         linux,code = <116>;
>                         linux,input-type = <0x1>;     /* EV_KEY */
>                 };
>         };
> 
>          sbgpio: sbgpio@17001000{
>                         compatible = "apm,xgene-gpio-sb";
>                         reg = <0x0 0x17001000 0x0 0x400>;
>                         #gpio-cells = <2>;
>                         gpio-controller;
>                         interrupts =    <0x0 0x28 0x1>,
>                                         <0x0 0x29 0x1>,
>                                         <0x0 0x2a 0x1>,
>                                         <0x0 0x2b 0x1>,
>                                         <0x0 0x2c 0x1>,
>                                         <0x0 0x2d 0x1>;
>                 };
> I can change the polarity of interrupt in the sbgpio node, but the
> issue here is the gpio_key driver always set interrupt type to
> (irqflags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING). And the GIC
> driver only support edge rising or level high. So that's our issue.

No, please do as I wrote, and use an interrupts property in the gpio-keys
node.

	Arnd

WARNING: multiple messages have this Message-ID (diff)
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v0] gpio_keys: fix gpio key driver to proper support GIC interrupt
Date: Thu, 11 Jun 2015 01:08:09 +0200	[thread overview]
Message-ID: <1529330.QWrJO7eUSt@wuerfel> (raw)
In-Reply-To: <CAL4ahLeMm_Qvk0BWxOYTc973_4=TPjZStgTNe5uJL53FBhMRvg@mail.gmail.com>

On Monday 08 June 2015 09:48:29 Y Vo wrote:
> On Fri, Jun 5, 2015 at 7:50 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> > On Thursday 04 June 2015 14:25:12 Y Vo wrote:
> >> GIC is designed to support two of trigger mechanisms - active level
> >> high or edge rising. But in the gpio_keys driver, it tries to use both
> >> edge rising and edge falling trigger. This patch fixes the gpio_keys
> >> driver to request only the edge rising event when failed to configure the
> >> interrupt.
> >>
> >> Signed-off-by: Y Vo <yvo@apm.com>
> >
> > I think you want to use an 'interrupts' property instead of a 'gpios'
> > property (or possibly both), so you can pass the right polarity.
> 
>         gpio-keys {
>                 compatible = "gpio-keys";
>                 apm_ctrl_name = "Power Button";
>                 btn2 {
>                         label = "EXT_INT2";
>                         gpios = <&sbgpio 13 0x0>;
>                         linux,code = <116>;
>                         linux,input-type = <0x1>;     /* EV_KEY */
>                 };
>         };
> 
>          sbgpio: sbgpio at 17001000{
>                         compatible = "apm,xgene-gpio-sb";
>                         reg = <0x0 0x17001000 0x0 0x400>;
>                         #gpio-cells = <2>;
>                         gpio-controller;
>                         interrupts =    <0x0 0x28 0x1>,
>                                         <0x0 0x29 0x1>,
>                                         <0x0 0x2a 0x1>,
>                                         <0x0 0x2b 0x1>,
>                                         <0x0 0x2c 0x1>,
>                                         <0x0 0x2d 0x1>;
>                 };
> I can change the polarity of interrupt in the sbgpio node, but the
> issue here is the gpio_key driver always set interrupt type to
> (irqflags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING). And the GIC
> driver only support edge rising or level high. So that's our issue.

No, please do as I wrote, and use an interrupts property in the gpio-keys
node.

	Arnd

  reply	other threads:[~2015-06-10 23:08 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-04  7:25 [PATCH v0] gpio_keys: fix gpio key driver to proper support GIC interrupt Y Vo
2015-06-04  7:25 ` Y Vo
     [not found] ` <1433402712-21399-1-git-send-email-yvo-qTEPVZfXA3Y@public.gmane.org>
2015-06-04 17:23   ` Dmitry Torokhov
2015-06-04 17:23     ` Dmitry Torokhov
2015-06-05  3:37     ` Feng Kan
2015-06-05  3:37       ` Feng Kan
2015-06-05  4:36       ` Dmitry Torokhov
2015-06-05  4:36         ` Dmitry Torokhov
2015-06-08  6:30   ` Uwe Kleine-König
2015-06-08  6:30     ` Uwe Kleine-König
2015-06-05 12:50 ` Arnd Bergmann
2015-06-05 12:50   ` Arnd Bergmann
2015-06-08  2:48   ` Y Vo
2015-06-08  2:48     ` Y Vo
2015-06-10 23:08     ` Arnd Bergmann [this message]
2015-06-10 23:08       ` Arnd Bergmann

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=1529330.QWrJO7eUSt@wuerfel \
    --to=arnd@arndb.de \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=fkan@apm.com \
    --cc=lho@apm.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=patches@apm.com \
    --cc=pvo@apm.com \
    --cc=toanle@apm.com \
    --cc=yvo@apm.com \
    /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.