linux-mips
[Top] [All Lists]

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

To: Hauke Mehrtens <hauke@hauke-m.de>
Subject: Re: [PATCH] MIPS: BCM47XX: Prepare support for GPIO buttons
From: Rafał Miłecki <zajec5@gmail.com>
Date: Thu, 28 Nov 2013 13:45:16 +0100
Cc: "linux-mips@linux-mips.org" <linux-mips@linux-mips.org>, Ralf Baechle <ralf@linux-mips.org>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; 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: <5297353B.1000007@hauke-m.de>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1385634758-22723-1-git-send-email-zajec5@gmail.com> <5297353B.1000007@hauke-m.de>
Sender: linux-mips-bounce@linux-mips.org
2013/11/28 Hauke Mehrtens <hauke@hauke-m.de>:
> 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 <zajec5@gmail.com>
>> ---
>> 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
release.

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>