gpio: mpc8xxx: don't modify gpdat when setting gpio as input
authorRasmus Villemoes <rasmus.villemoes@prevas.dk>
Tue, 28 Jan 2020 12:04:33 +0000 (12:04 +0000)
committerTom Rini <trini@konsulko.com>
Tue, 31 Mar 2020 14:06:52 +0000 (10:06 -0400)
commit1d7ad9fa051e5b3057bccb6384ab62e4f9c206b2
treee3da9dc2fa48eda040b20999cabb2fe3b74d365e
parent71a3e5c51c96fe4011ef2cea8490e523786de863
gpio: mpc8xxx: don't modify gpdat when setting gpio as input

Since some chips don't support reading back the value of output gpios
from the gpdat register, we should not do a RMW cycle (i.e., the
clrbits_be32) on the gpdat register when setting a gpio as input, as
that might accidentally change the value of some other (still
configured as output) gpio.

The extra indirection through mpc8xxx_gpio_set_in() does not help
readability, so just fold the gpdir update into
mpc8xxx_gpio_direction_input().

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
drivers/gpio/mpc8xxx_gpio.c