spmi: pmic-arb: convert to v2 irq interfaces to support hierarchical IRQ chips
authorBrian Masney <masneyb@onstation.org>
Sat, 19 Jan 2019 20:42:41 +0000 (15:42 -0500)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 24 Jan 2019 14:32:52 +0000 (15:32 +0100)
commit12a9eeaebba34f4f0abe1548ecb460414e285c49
tree298833e6d572f9a81155610cf341c926cc8bcc94
parentcfacef373505dce8735c562a147d14611db259b9
spmi: pmic-arb: convert to v2 irq interfaces to support hierarchical IRQ chips

Convert the spmi-pmic-arb IRQ code to use the version 2 IRQ interface
in order to support hierarchical IRQ chips. This is necessary so that
spmi-gpio can be setup as a hierarchical IRQ chip with pmic-arb as the
parent. IRQ chips in device tree should be usable from the start without
the consumer having to make an additional call to gpio[d]_to_irq() to
get the proper IRQ on the parent.

The old qpnpint_irq_domain_map function would hardcode the handler as
handle_level_irq, however qpnpint_irq_set_type would later override the
handler. Properly set the handler when the IRQ is mapped. This new code
doesn't return an error for IRQ_TYPE_NONE and preserves the existing
behavior of using handle_level_irq since there are some broken device
tree bindings that need to be corrected first.

Driver was tested on a LG Nexus 5 (hammerhead) phone.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Reviewed-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/spmi/spmi-pmic-arb.c