mfd: axp20x: Allow AXP 806 chips without interrupt lines
authorAndre Przywara <andre.przywara@arm.com>
Wed, 19 May 2021 10:41:37 +0000 (11:41 +0100)
committerLee Jones <lee.jones@linaro.org>
Wed, 2 Jun 2021 09:50:02 +0000 (10:50 +0100)
commit3efc465f91107a4c20eaeb386a90360262f1663f
tree0124131482df3be9e569ee33f26ec91af8ee2983
parent3b0850440a06c54856fbb7afb6a366910462fa0a
mfd: axp20x: Allow AXP 806 chips without interrupt lines

Currently the AXP chip requires to have its IRQ line connected to some
interrupt controller, and will fail probing when this is not the case.

On a new Allwinner SoC (H616) there is no NMI pin anymore, and at
least one board does not connect the AXP's IRQ pin to anything else,
so the interrupt functionality of the AXP chip is simply not available.

Check whether the interrupt line number returned by the platform code is
valid, before trying to register the irqchip. If not, we skip this
registration, to avoid the driver to bail out completely.
Also we need to skip the power key functionality, as this relies on
a valid IRQ as well.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/axp20x.c