From 9ba953d13a9ba5f51e63e69b60c27f8af0d43429 Mon Sep 17 00:00:00 2001 From: Henrik Brix Andersen Date: Sun, 1 May 2022 22:32:33 +0200 Subject: [PATCH] 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 --- drivers/gpio/gpio_rv32m1.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpio/gpio_rv32m1.c b/drivers/gpio/gpio_rv32m1.c index ce01594b23f..12397296e25 100644 --- a/drivers/gpio/gpio_rv32m1.c +++ b/drivers/gpio/gpio_rv32m1.c @@ -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. */