Thread (22 messages) 22 messages, 4 authors, 2019-01-22

Re: [PATCH v6 04/15] spmi: pmic-arb: convert to v2 irq interfaces to support hierarchical IRQ chips

From: Marc Zyngier <hidden>
Date: 2019-01-20 11:30:52
Also in: linux-arm-msm, linux-gpio, lkml

On Sat, 19 Jan 2019 20:42:41 +0000,
Brian Masney [off-list ref] wrote:
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 <redacted>
---
The broken device tree bindings are corrected in this patch series and
additional validation to the type field is added later in the series.

Changes since v5:
- Properly set handler to edge or level when the IRQ is mapped.

Changes since v4:
- None

Changes since v3:
- None

Changes since v2:
- Don't move pmic_gpio_of_match block. Use device_get_match_data instead
  of of_match_device.
- Correct build warning on arm64: warning: cast from pointer to integer
  of different size

 drivers/spmi/spmi-pmic-arb.c | 67 +++++++++++++++++++++++++-----------
 1 file changed, 47 insertions(+), 20 deletions(-)
Reviewed-by: Marc Zyngier <redacted>

Thanks,

	M.

-- 
Jazz is not dead, it just smell funny.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help