drivers/rpmsg_port_uart: switch the uart IO to GPIO when peer poweroff

Use the TIOCVHANGUP to notify the driver to switch the uart io
to gpio mode to avoid the current leak caused by the uart io because
peer core may already poweroff so the io can be in high voltage
state.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
This commit is contained in:
Bowen Wang 2025-02-13 15:59:28 +08:00 • committed by GUIDINGLI
parent 579cf47299
commit ee02d0c769

View file

@ -400,6 +400,7 @@ static int rpmsg_port_uart_rx_thread(int argc, FAR char *argv[])
rpmsgdbg("Received poweroff command\n");
rpmsg_port_drop_packets(&rpuart->port, RPMSG_PORT_DROP_TXQ);
rpmsg_port_unregister(&rpuart->port);
DEBUGVERIFY(file_ioctl(&rpuart->file, TIOCVHANGUP, 0) >= 0);
rpuart->connected = false;
continue;
}