Skip to content

Commit 12fa630

Browse files
andrei-edward-popacarlescufi
authored andcommitted
drivers: serial: rpi_pico: added reset support for UART devices
added reset controller for Raspberry Pi Pico UART devices Signed-off-by: Andrei-Edward Popa <[email protected]>
1 parent 66ec2ba commit 12fa630

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

drivers/serial/Kconfig.rpi_pico

+1
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ config UART_RPI_PICO
1010
select SERIAL_HAS_DRIVER
1111
select PICOSDK_USE_UART
1212
select SERIAL_SUPPORT_INTERRUPT
13+
depends on RESET

drivers/serial/uart_rpi_pico.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77

88
#include <drivers/uart.h>
9+
#include <drivers/reset.h>
910
#include <drivers/pinctrl.h>
1011

1112
/* pico-sdk includes */
@@ -17,6 +18,7 @@ struct uart_rpi_config {
1718
uart_inst_t *const uart_dev;
1819
uart_hw_t *const uart_regs;
1920
const struct pinctrl_dev_config *pcfg;
21+
const struct reset_dt_spec reset;
2022
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
2123
uart_irq_config_func_t irq_config_func;
2224
#endif /* CONFIG_UART_INTERRUPT_DRIVEN */
@@ -70,7 +72,7 @@ static int uart_rpi_init(const struct device *dev)
7072

7173
/*
7274
* uart_init() may be replaced by register based API once rpi-pico platform
73-
* has a clock controller driver and a reset controller driver
75+
* has a clock controller driver
7476
*/
7577
baudrate = uart_init(uart_inst, data->baudrate);
7678
/* Check if baudrate adjustment returned by 'uart_init' function is a positive value */
@@ -302,6 +304,7 @@ static const struct uart_driver_api uart_rpi_driver_api = {
302304
.uart_dev = uart##idx, \
303305
.uart_regs = (uart_hw_t *)uart##idx, \
304306
.pcfg = PINCTRL_DT_INST_DEV_CONFIG_GET(idx), \
307+
.reset = RESET_DT_SPEC_INST_GET(idx), \
305308
RPI_UART_IRQ_CONFIG_INIT(idx), \
306309
}; \
307310
\

0 commit comments

Comments
 (0)