pinctrl: uniphier: set input-enable before pin-muxing
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Tue, 20 Oct 2015 08:25:09 +0000 (17:25 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Dec 2015 19:34:32 +0000 (14:34 -0500)
commit717991ddefe125a0f68f10b44bd7178e2208fdfd
tree3c3e474a24c3b28369a76c47181cbdc6d400574f
parentea9130ac6927fc4fe26cab6aa25d9e4172c38cd5
pinctrl: uniphier: set input-enable before pin-muxing

commit bac7f4c1bf5e7c6ccd5bb71edc015b26c77f7460 upstream.

While IECTRL is disabled, input signals are pulled-down internally.
If pin-muxing is set up first, glitch signals (Low to High transition)
might be input to hardware blocks.

Bad case scenario:
[1] The hardware block is already running before pinctrl is handled.
   (the reset is de-asserted by default or by a firmware, for example)
[2] The pin-muxing is set up.  The input signals to hardware block
    are pulled-down by the chip-internal biasing.
[3] The pins are input-enabled.  The signals from the board reach the
    hardware block.

Actually, one invalid character is input to the UART blocks for such
SoCs as PH1-LD4, PH1-sLD8, where UART devices start to run at the
power on reset.

To avoid such problems, pins should be input-enabled before muxing.

Fixes: 6e9088920258 ("pinctrl: UniPhier: add UniPhier pinctrl core support")
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reported-by: Dai Okamura <okamura.dai@socionext.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/pinctrl/uniphier/pinctrl-uniphier-core.c