Skip to content
Commit 1aeef303 authored by Liu Gang's avatar Liu Gang Committed by Linus Walleij
Browse files

powerpc/gpio: Fix the wrong GPIO input data on MPC8572/MPC8536



For MPC8572/MPC8536, the status of GPIOs defined as output
cannot be determined by reading GPDAT register, so the code
use shadow data register instead. But the code may give the
wrong status of GPIOs defined as input under some scenarios:

1. If some pins were configured as inputs and were asserted
high before booting the kernel, the shadow data has been
initialized with those pin values.
2. Some pins have been configured as output first and have
been set to the high value, then reconfigured as input.

The above cases will make the shadow data for those input
pins to be set to high. Then reading the pin status will
always return high even if the actual pin status is low.

The code should eliminate the effects of the shadow data to
the input pins, and the status of those pins should be
read directly from GPDAT.

Cc: stable@vger.kernel.org
Acked-by: default avatarScott Wood <scottwood@freescale.com>
Acked-by: default avatarAnatolij Gustschin <agust@denx.de>
Signed-off-by: default avatarLiu Gang <Gang.Liu@freescale.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 35c5d7fd
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