summaryrefslogtreecommitdiffstats
path: root/drivers/serial/serial-uclass.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/serial/serial-uclass.c')
-rw-r--r--drivers/serial/serial-uclass.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c
index 3ded62732d..51ae1763fb 100644
--- a/drivers/serial/serial-uclass.c
+++ b/drivers/serial/serial-uclass.c
@@ -294,6 +294,20 @@ void serial_setbrg(void)
ops->setbrg(gd->cur_serial_dev, gd->baudrate);
}
+int serial_getconfig(uint *config)
+{
+ struct dm_serial_ops *ops;
+
+ if (!gd->cur_serial_dev)
+ return 0;
+
+ ops = serial_get_ops(gd->cur_serial_dev);
+ if (ops->getconfig)
+ return ops->getconfig(gd->cur_serial_dev, config);
+
+ return 0;
+}
+
int serial_setconfig(uint config)
{
struct dm_serial_ops *ops;
@@ -419,6 +433,8 @@ static int serial_post_probe(struct udevice *dev)
ops->pending += gd->reloc_off;
if (ops->clear)
ops->clear += gd->reloc_off;
+ if (ops->getconfig)
+ ops->getconfig += gd->reloc_off;
if (ops->setconfig)
ops->setconfig += gd->reloc_off;
#if CONFIG_POST & CONFIG_SYS_POST_UART