drivers: gpio: rv32m1: configure pin mux as GPIO

Set the PCR[MUX] field to kPORT_MuxAsGpio as part of configuring a GPIO
pin. This removes the need to explicitly call pinmux_pin_set() in board
code.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
This commit is contained in:
Henrik Brix Andersen 2022-05-01 22:32:33 +02:00 committed by David Leach
parent a1181dbd16
commit 9ba953d13a
1 changed files with 4 additions and 0 deletions

View File

@ -126,6 +126,10 @@ static int gpio_rv32m1_configure(const struct device *dev,
return -ENOTSUP;
}
/* Set PCR mux to GPIO for the pin we are configuring */
mask |= PORT_PCR_MUX_MASK;
pcr |= PORT_PCR_MUX(kPORT_MuxAsGpio);
/* Now do the PORT module. Figure out the pullup/pulldown
* configuration, but don't write it to the PCR register yet.
*/