[Top] [All Lists]

Re: [PATCH] MIPS: BCM47XX: Prepare support for GPIO buttons

To: Hauke Mehrtens <>
Subject: Re: [PATCH] MIPS: BCM47XX: Prepare support for GPIO buttons
From: Rafał Miłecki <>
Date: Thu, 28 Nov 2013 13:45:16 +0100
Cc: "" <>, Ralf Baechle <>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=1C1rzR7b0Po5RVuB9WTocRiDXpz8dClHtL7FCMskSqk=; b=FmHCxy1LdJSE+SPPcUYqAmDv6+3zEF1b4B7A1sCrv58B9Zhlw0j4Tp8hiy1/4ZlFDk 1BLYpsxMRY+3T30shGwhWdMDFZXBwTW6Sjnv5RQ+AcSTgotrxu969U6DnxCpauf+TfbY h+U4vpgd8ILB5vRmZFbxsByqMDrFJUDmVWJGHUcwHCcuOvaXXn+9I38zDFf9k0Cvk7OW 1mwegRhOnvMx+qtyYEjxju153YCkZhCkXPBfyC+1K8G5LfntbhWxraJGpa+bqM1x25DG HZQnPes4iFZTJgVR+SgdHmCDqrUKF1lOh8RqEoVAuJWEKTg5ttaK3m0PyWLWMmANERsE L+Ew==
In-reply-to: <>
List-archive: <>
List-help: <>
List-id: linux-mips <>
List-owner: <>
List-post: <>
List-software: Ecartis version 1.0.0
List-subscribe: <>
List-unsubscribe: <>
Original-recipient: rfc822;
References: <> <>
2013/11/28 Hauke Mehrtens <>:
> On 11/28/2013 11:32 AM, Rafał Miłecki wrote:
>> So far this adds support for one Netgear model only, but it's designed
>> and ready to add many more device. We could hopefully import database
>> from OpenWrt.
>> Signed-off-by: Rafał Miłecki <>
>> ---
>> This should apply cleanly on top of (still not pushed):
>> MIPS: BCM47XX: Prepare support for LEDs
>> ---
> It would be nice if include/linux/gpio_keys.h is used for that, but I
> know the generic gpio system does not provide enough functionality to do
> so with this gpio controller.
> Have you tried to extend the gpio system to make this possible?

I tried that, but I hit few issues:

1) Different IRQ flags:
genirq: Flags mismatch irq 2. 00000080 (serial) vs. 00000083 (gpio_keys)
(that could be workarounded with some way of passing flags to the
serial of gpio_keys).

2) gpio_keys generic interrupt handler
It was only scheduling work that didn't start until releasing the
button. By then GPIO value was back to "normal" and keypress wasn't
detected at all.

3) interrupt polarity
(It's related to the 2nd). We need to adjust IRQ polarity to stop HW
from generating IRQs all the time and to get a next IRQ on button

Do you have any other ideas for above?

> As far as I read your comment your are getting an interrupt till you
> change the polarity?

Yes. But I change polarity immediately and as the result I get only 1
IRQ for key press and 1 IRQ for key release.
Works perfectly, as expected.

<Prev in Thread] Current Thread [Next in Thread>