Commit 847547dd authored by Linus Walleij's avatar Linus Walleij Committed by Greg Kroah-Hartman

ARM: dts: MSM8064 remove flags from SPMI/MPP IRQs

commit ca88696e upstream.

The Qualcomm PMIC GPIO and MPP lines are problematic: the
are fetched from the main MFD driver with platform_get_irq()
which means that at this point they will all be assigned the
flags set up for the interrupts in the device tree.

That is problematic since these are flagged as rising edge
and an this point the interrupt descriptor is assigned a
rising edge, while the only thing the GPIO/MPP drivers really
do is issue irq_get_irqchip_state() on the line to read it
out and to provide a .to_irq() helper for *other* IRQ
consumers.

If another device tree node tries to flag the same IRQ
for use as something else than rising edge, the kernel
irqdomain core will protest like this:

  type mismatch, failed to map hwirq-NN for <FOO>!

Which is what happens when the device tree defines two
contradictory flags for the same interrupt line.

To work around this and alleviate the problem, assign 0
as flag for the interrupts taken by the PM GPIO and MPP
drivers. This will lead to the flag being unset, and a
second consumer requesting rising, falling, both or level
interrupts will be respected. This is what the qcom-pm*.dtsi
files already do.

Switched to using the symbolic name IRQ_TYPE_NONE so that
we get this more readable.

Fixes: bce36046 ("ARM: dts: apq8064: add pm8921 mpp support")
Fixes: 874443fe ("ARM: dts: apq8064: Add pm8921 mfd and its gpio node")
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Björn Andersson <bjorn.andersson@linaro.org>
Cc: Ivan T. Ivanov <ivan.ivanov@linaro.org>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Andy Gross <andy.gross@linaro.org>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarAndy Gross <andy.gross@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7d19a914
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <dt-bindings/reset/qcom,gcc-msm8960.h> #include <dt-bindings/reset/qcom,gcc-msm8960.h>
#include <dt-bindings/clock/qcom,mmcc-msm8960.h> #include <dt-bindings/clock/qcom,mmcc-msm8960.h>
#include <dt-bindings/soc/qcom,gsbi.h> #include <dt-bindings/soc/qcom,gsbi.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/interrupt-controller/arm-gic.h> #include <dt-bindings/interrupt-controller/arm-gic.h>
/ { / {
model = "Qualcomm APQ8064"; model = "Qualcomm APQ8064";
...@@ -354,22 +355,50 @@ pm8921_gpio: gpio@150 { ...@@ -354,22 +355,50 @@ pm8921_gpio: gpio@150 {
compatible = "qcom,pm8921-gpio"; compatible = "qcom,pm8921-gpio";
reg = <0x150>; reg = <0x150>;
interrupts = <192 1>, <193 1>, <194 1>, interrupts = <192 IRQ_TYPE_NONE>,
<195 1>, <196 1>, <197 1>, <193 IRQ_TYPE_NONE>,
<198 1>, <199 1>, <200 1>, <194 IRQ_TYPE_NONE>,
<201 1>, <202 1>, <203 1>, <195 IRQ_TYPE_NONE>,
<204 1>, <205 1>, <206 1>, <196 IRQ_TYPE_NONE>,
<207 1>, <208 1>, <209 1>, <197 IRQ_TYPE_NONE>,
<210 1>, <211 1>, <212 1>, <198 IRQ_TYPE_NONE>,
<213 1>, <214 1>, <215 1>, <199 IRQ_TYPE_NONE>,
<216 1>, <217 1>, <218 1>, <200 IRQ_TYPE_NONE>,
<219 1>, <220 1>, <221 1>, <201 IRQ_TYPE_NONE>,
<222 1>, <223 1>, <224 1>, <202 IRQ_TYPE_NONE>,
<225 1>, <226 1>, <227 1>, <203 IRQ_TYPE_NONE>,
<228 1>, <229 1>, <230 1>, <204 IRQ_TYPE_NONE>,
<231 1>, <232 1>, <233 1>, <205 IRQ_TYPE_NONE>,
<234 1>, <235 1>; <206 IRQ_TYPE_NONE>,
<207 IRQ_TYPE_NONE>,
<208 IRQ_TYPE_NONE>,
<209 IRQ_TYPE_NONE>,
<210 IRQ_TYPE_NONE>,
<211 IRQ_TYPE_NONE>,
<212 IRQ_TYPE_NONE>,
<213 IRQ_TYPE_NONE>,
<214 IRQ_TYPE_NONE>,
<215 IRQ_TYPE_NONE>,
<216 IRQ_TYPE_NONE>,
<217 IRQ_TYPE_NONE>,
<218 IRQ_TYPE_NONE>,
<219 IRQ_TYPE_NONE>,
<220 IRQ_TYPE_NONE>,
<221 IRQ_TYPE_NONE>,
<222 IRQ_TYPE_NONE>,
<223 IRQ_TYPE_NONE>,
<224 IRQ_TYPE_NONE>,
<225 IRQ_TYPE_NONE>,
<226 IRQ_TYPE_NONE>,
<227 IRQ_TYPE_NONE>,
<228 IRQ_TYPE_NONE>,
<229 IRQ_TYPE_NONE>,
<230 IRQ_TYPE_NONE>,
<231 IRQ_TYPE_NONE>,
<232 IRQ_TYPE_NONE>,
<233 IRQ_TYPE_NONE>,
<234 IRQ_TYPE_NONE>,
<235 IRQ_TYPE_NONE>;
gpio-controller; gpio-controller;
#gpio-cells = <2>; #gpio-cells = <2>;
...@@ -381,9 +410,18 @@ pm8921_mpps: mpps@50 { ...@@ -381,9 +410,18 @@ pm8921_mpps: mpps@50 {
gpio-controller; gpio-controller;
#gpio-cells = <2>; #gpio-cells = <2>;
interrupts = interrupts =
<128 1>, <129 1>, <130 1>, <131 1>, <128 IRQ_TYPE_NONE>,
<132 1>, <133 1>, <134 1>, <135 1>, <129 IRQ_TYPE_NONE>,
<136 1>, <137 1>, <138 1>, <139 1>; <130 IRQ_TYPE_NONE>,
<131 IRQ_TYPE_NONE>,
<132 IRQ_TYPE_NONE>,
<133 IRQ_TYPE_NONE>,
<134 IRQ_TYPE_NONE>,
<135 IRQ_TYPE_NONE>,
<136 IRQ_TYPE_NONE>,
<137 IRQ_TYPE_NONE>,
<138 IRQ_TYPE_NONE>,
<139 IRQ_TYPE_NONE>;
}; };
rtc@11d { rtc@11d {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment