2013/11/28 Hauke Mehrtens <hauke@xxxxxxxxxx>: > 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@xxxxxxxxx> >> --- >> 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.