summaryrefslogtreecommitdiffstats
path: root/drivers/serial/serial_ns16550.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2013-07-22 21:23:54 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2013-07-23 08:28:30 +0200
commitffd44fc14c26048fecb8bc4ae616770d6b3eb8ec (patch)
treee1133934a2ef4d7f448fa31bb7a7a3e77983c2f9 /drivers/serial/serial_ns16550.c
parentcdd1de46ff81bdcfc323953156c1b4573a36cb1f (diff)
downloadbarebox-ffd44fc14c26048fecb8bc4ae616770d6b3eb8ec.tar.gz
barebox-ffd44fc14c26048fecb8bc4ae616770d6b3eb8ec.tar.xz
serial: ns16550: reorder functions to avoid forward declaration
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/serial/serial_ns16550.c')
-rw-r--r--drivers/serial/serial_ns16550.c59
1 files changed, 28 insertions, 31 deletions
diff --git a/drivers/serial/serial_ns16550.c b/drivers/serial/serial_ns16550.c
index b7913aa3ce..b792ba546e 100644
--- a/drivers/serial/serial_ns16550.c
+++ b/drivers/serial/serial_ns16550.c
@@ -42,9 +42,6 @@
#include "serial_ns16550.h"
#include <ns16550.h>
-/*********** Private Functions **********************************/
-static int ns16550_setbaudrate(struct console_device *cdev, int baud_rate);
-
/**
* @brief read register
*
@@ -129,6 +126,34 @@ static inline unsigned int ns16550_calc_divisor(struct console_device *cdev,
}
/**
+ * @brief Set the baudrate for the uart port
+ *
+ * @param[in] cdev console device
+ * @param[in] baud_rate baud rate to set
+ *
+ * @return 0-implied to support the baudrate
+ */
+static int ns16550_setbaudrate(struct console_device *cdev, int baud_rate)
+{
+ unsigned int baud_divisor = ns16550_calc_divisor(cdev, baud_rate);
+ struct NS16550_plat *plat = (struct NS16550_plat *)
+ cdev->dev->platform_data;
+
+ ns16550_write(cdev, LCR_BKSE, lcr);
+ ns16550_write(cdev, baud_divisor & 0xff, dll);
+ ns16550_write(cdev, (baud_divisor >> 8) & 0xff, dlm);
+ ns16550_write(cdev, LCRVAL, lcr);
+ ns16550_write(cdev, MCRVAL, mcr);
+
+ if (plat->flags & NS16650_FLAG_DISABLE_FIFO)
+ ns16550_write(cdev, FCRVAL & ~FCR_FIFO_EN, fcr);
+ else
+ ns16550_write(cdev, FCRVAL, fcr);
+
+ return 0;
+}
+
+/**
* @brief Initialize the device
*
* @param[in] cdev pointer to console device
@@ -192,34 +217,6 @@ static int ns16550_tstc(struct console_device *cdev)
}
/**
- * @brief Set the baudrate for the uart port
- *
- * @param[in] cdev console device
- * @param[in] baud_rate baud rate to set
- *
- * @return 0-implied to support the baudrate
- */
-static int ns16550_setbaudrate(struct console_device *cdev, int baud_rate)
-{
- unsigned int baud_divisor = ns16550_calc_divisor(cdev, baud_rate);
- struct NS16550_plat *plat = (struct NS16550_plat *)
- cdev->dev->platform_data;
-
- ns16550_write(cdev, LCR_BKSE, lcr);
- ns16550_write(cdev, baud_divisor & 0xff, dll);
- ns16550_write(cdev, (baud_divisor >> 8) & 0xff, dlm);
- ns16550_write(cdev, LCRVAL, lcr);
- ns16550_write(cdev, MCRVAL, mcr);
-
- if (plat->flags & NS16650_FLAG_DISABLE_FIFO)
- ns16550_write(cdev, FCRVAL & ~FCR_FIFO_EN, fcr);
- else
- ns16550_write(cdev, FCRVAL, fcr);
-
- return 0;
-}
-
-/**
* @brief Probe entry point -called on the first match for device
*
* @param[in] dev matched device