[PATCH 3/7] serial: ns16550: make it possible to get reg_write() from devtype

Antony Pavlov antonynpavlov at gmail.com
Sat Mar 22 07:29:53 EDT 2014


Signed-off-by: Antony Pavlov <antonynpavlov at gmail.com>
---
 drivers/serial/serial_ns16550.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/serial/serial_ns16550.c b/drivers/serial/serial_ns16550.c
index f1da44b..aa0992f 100644
--- a/drivers/serial/serial_ns16550.c
+++ b/drivers/serial/serial_ns16550.c
@@ -57,6 +57,8 @@ static inline struct ns16550_priv *to_ns16550_priv(struct console_device *cdev)
 
 struct ns16550_drvdata {
 	void (*init_port)(struct console_device *cdev);
+	void (*reg_write)(unsigned int val, unsigned long base,
+				    unsigned char reg_offset);
 	const char *linux_console_name;
 };
 
@@ -316,6 +318,9 @@ static int ns16550_probe(struct device_d *dev)
 	cdev->setbrg = ns16550_setbaudrate;
 	cdev->linux_console_name = devtype->linux_console_name;
 
+	if (devtype->reg_write)
+		priv->plat.reg_write = devtype->reg_write;
+
 	devtype->init_port(cdev);
 
 	return console_register(cdev);
-- 
1.9.0




More information about the barebox mailing list