[PATCH] Force set console baudrate

Alexey Galakhov agalakhov at gmail.com
Tue Jul 9 11:22:10 EDT 2013


Most serial drivers require setbrg() to be called at least once. Call them
just after the device has been added.

Signed-off-by: Alexey Galakhov <agalakhov at gmail.com>
---
 common/console.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/common/console.c b/common/console.c
index a0a06f6..abf5322 100644
--- a/common/console.c
+++ b/common/console.c
@@ -147,6 +147,7 @@ int console_register(struct console_device *newcdev)
 		newcdev->baudrate = CONFIG_BAUDRATE;
 		dev_add_param_int(dev, "baudrate", console_baudrate_set,
 			NULL, &newcdev->baudrate, "%u", newcdev);
+		newcdev->setbrg(newcdev, newcdev->baudrate);
 	}
 
 	dev_add_param(dev, "active", console_std_set, NULL, 0);
-- 
1.7.10.4




More information about the barebox mailing list