Thread (5 messages) 5 messages, 3 authors, 2018-03-01

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

From: Arnd Bergmann <arnd@arndb.de>
Date: 2018-03-01 14:29:41
Also in: linux-devicetree, lkml

On Thu, Mar 1, 2018 at 2:59 PM, Andy Shevchenko
[off-list ref] wrote:
On Thu, Mar 1, 2018 at 2:37 PM, Arnd Bergmann [off-list ref] wrote:
quoted
On Thu, Mar 1, 2018 at 1:09 PM, Andy Shevchenko
[off-list ref] wrote:
quoted
On Thu, Mar 1, 2018 at 9:36 AM, Baolin Wang [off-list ref] wrote:
quoted
On some platforms (such as Spreadtrum platform), the GPIO keys can only
be triggered by level type. So this patch introduces one trigger_type to
indicate if the button's interrupt type is level trigger or edge trigger.
quoted
                        button->irq =
                                irq_of_parse_and_map(to_of_node(child), 0);
AFAIU, 0 means NO_IRQ, thus,
quoted
+                       if (button->irq)
+                               button->trigger_type =
+                                       irq_get_trigger_type(button->irq);
irq_get_trigger_type(NO_IRQ) should return 0.

Therefore, if (button->irq) is redundant.
Did I miss anything?
"irq_of_parse_and_map(to_of_node(child), 0);" is the first interrupt. A
more common way to express the same thing in modern drivers is
'platform_get_irq(pdev, 0)'.
Yes, though I'm talking about _returned_ value.
Got it, yes you are right.

      Arnd
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help