Re: [PATCH v3] Input: gpio_keys: Add level trigger support for GPIO keys

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Feb 28, 2018 at 1:44 PM, Baolin Wang <baolin.wang@xxxxxxxxxx> wrote:
> On some platforms (such as Spreadtrum platform), the GPIO keys can only
> be triggered by level type. So this patch introduces one property to
> indicate if the GPIO trigger type is level trigger or edge trigger.
>
> Signed-off-by: Baolin Wang <baolin.wang@xxxxxxxxxx>
> ---
> Changes since v2:
>  - Use 'interrupt' property to indicate the irq type.
>
> Changes since v1:
>  - Diable the GPIO irq until reversing the GPIO level type.

I've looked at your patch in more detail now, and given it a bit more thought.

I wonder if you could move that logic into your gpiochip/irqchip driver instead.
It seems that what you do in the gpio-keys driver is to emulate edge triggered
behavior on a level triggered irqchip.

If you put the same logic into the gpio driver, you could simply make it
pretend to support an edge trigger on both edges and call into the interrupt
handler whenever the state changes.

        Arnd
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux