[PATCH v3 05/10] litex serial: add setbrg callback

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Marek Czerski <m.czerski@xxxxxxxxxx>

setbrg callback (set baudrate) is needed by the loadx/loady commands.
Because litex serial has fixed baudrate the callback only checks if
the requested baudrate is the same as the CONFIG_BAUDRATE.
---
 drivers/serial/serial_litex.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/serial/serial_litex.c b/drivers/serial/serial_litex.c
index 8562a45ecc..9d35a6e44a 100644
--- a/drivers/serial/serial_litex.c
+++ b/drivers/serial/serial_litex.c
@@ -58,6 +58,13 @@ static int litex_serial_tstc(struct console_device *cdev)
 	return !litex_serial_readb(cdev, UART_RXEMPTY);
 }
 
+static int litex_setial_setbaudrate(struct console_device *cdev, int baudrate)
+{
+	if (baudrate != CONFIG_BAUDRATE)
+		return -EINVAL;
+	return 0;
+}
+
 static int litex_serial_probe(struct device_d *dev)
 {
 	struct resource *iores;
@@ -73,7 +80,7 @@ static int litex_serial_probe(struct device_d *dev)
 	cdev->tstc = &litex_serial_tstc;
 	cdev->putc = &litex_serial_putc;
 	cdev->getc = &litex_serial_getc;
-	cdev->setbrg = NULL;
+	cdev->setbrg = &litex_setial_setbaudrate;
 
 	console_register(cdev);
 
-- 
2.31.1


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux