HomeFreeBSD

arm64: rockchip: rk_gpio: Improve mode switching

Description

arm64: rockchip: rk_gpio: Improve mode switching

Changing mode on a pin (input/output/pullup/pulldown) is a bit slow.
Improve this by caching what we can.
We need to check if the pin is in gpio mode, do that the first time
that we have a request for this pin and cache the result. We can't do
that at attach as we are a child of rk_pinctrl and it didn't finished
its attach then.
Cache also the flags specific to the pinctrl (pullup or pulldown) if the
pin is in input mode.
Cache the registers that deals with input/output mode and output value. Also
remove some register reads when we change the direction of a pin or when we
change the output value since the bit changed in the registers only affect output
pins.

Details

Provenance
manuAuthored on Sep 22 2021, 2:55 PM
Parents
rGabc7a4a0c1b0: Simplify setting a non-4k PAGE_SIZE on arm64
Branches
Unknown
Tags
Unknown