diff options
author | Hans de Goede <hdegoede@redhat.com> | 2015-03-09 00:13:57 +0300 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2015-03-18 12:56:46 +0300 |
commit | ef6d24cc7f5b2b5c4184eddb039e2add6231a122 (patch) | |
tree | e32481835c8e61ef2dc01c7e1ea797c9c8206c00 /drivers/pinctrl/sunxi/pinctrl-sunxi.h | |
parent | bd8733738c5af6114dd15d340b3f8713e9b624c2 (diff) | |
download | linux-ef6d24cc7f5b2b5c4184eddb039e2add6231a122.tar.xz |
pinctrl: sun4i: GPIOs configured as irq must be set to input before reading
On sun4i-a10, when GPIOs are configured as external interrupt the value for
them in the data register does not seem to get updated, so set their mux to
input (and restore afterwards) when reading the pin.
Missed edges seem to be buffered, so this does not introduce a race
condition.
I've also tested this on sun5i-a13 and sun7i-a20 and those do not seem to
be affected, the input value representation in the data register does seem
to correctly get updated to the actual pin value while in irq mode there.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/sunxi/pinctrl-sunxi.h')
-rw-r--r-- | drivers/pinctrl/sunxi/pinctrl-sunxi.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.h b/drivers/pinctrl/sunxi/pinctrl-sunxi.h index 5a51523a3459..e248e81a0f9e 100644 --- a/drivers/pinctrl/sunxi/pinctrl-sunxi.h +++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.h @@ -77,6 +77,9 @@ #define IRQ_LEVEL_LOW 0x03 #define IRQ_EDGE_BOTH 0x04 +#define SUN4I_FUNC_INPUT 0 +#define SUN4I_FUNC_IRQ 6 + struct sunxi_desc_function { const char *name; u8 muxval; @@ -94,6 +97,7 @@ struct sunxi_pinctrl_desc { int npins; unsigned pin_base; unsigned irq_banks; + bool irq_read_needs_mux; }; struct sunxi_pinctrl_function { |