diff options
Diffstat (limited to 'drivers/serial/serial-uclass.c')
-rw-r--r-- | drivers/serial/serial-uclass.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c index 4121a37aa8..ffdcae0931 100644 --- a/drivers/serial/serial-uclass.c +++ b/drivers/serial/serial-uclass.c @@ -290,6 +290,20 @@ void serial_setbrg(void) ops->setbrg(gd->cur_serial_dev, gd->baudrate); } +int serial_setconfig(uint config) +{ + struct dm_serial_ops *ops; + + if (!gd->cur_serial_dev) + return 0; + + ops = serial_get_ops(gd->cur_serial_dev); + if (ops->setconfig) + return ops->setconfig(gd->cur_serial_dev, config); + + return 0; +} + void serial_stdio_init(void) { } @@ -401,6 +415,8 @@ static int serial_post_probe(struct udevice *dev) ops->pending += gd->reloc_off; if (ops->clear) ops->clear += gd->reloc_off; + if (ops->setconfig) + ops->setconfig += gd->reloc_off; #if CONFIG_POST & CONFIG_SYS_POST_UART if (ops->loop) ops->loop += gd->reloc_off |