]> git.sur5r.net Git - u-boot/blobdiff - drivers/serial/lpc32xx_hsuart.c
Merge branch 'master' of git://git.denx.de/u-boot-sunxi
[u-boot] / drivers / serial / lpc32xx_hsuart.c
index 536fd466ed0a2cf92f7b192cfa273bb1a871d3a5..c8926a8945ac6c84e81ff651a18ed0b2eb8566ef 100644 (file)
@@ -1,20 +1,7 @@
 /*
  * Copyright (C) 2011 Vladimir Zapolskiy <vz@mleia.com>
  *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -51,6 +38,9 @@ static int lpc32xx_serial_getc(void)
 
 static void lpc32xx_serial_putc(const char c)
 {
+       if (c == '\n')
+               serial_putc('\r');
+
        writel(c, &hsuart->tx);
 
        /* Wait for character to be sent */
@@ -77,20 +67,13 @@ static int lpc32xx_serial_init(void)
        return 0;
 }
 
-static void lpc32xx_serial_puts(const char *s)
-{
-       while (*s)
-               serial_putc(*s++);
-}
-
-#ifdef CONFIG_SERIAL_MULTI
 static struct serial_device lpc32xx_serial_drv = {
        .name   = "lpc32xx_serial",
        .start  = lpc32xx_serial_init,
        .stop   = NULL,
        .setbrg = lpc32xx_serial_setbrg,
        .putc   = lpc32xx_serial_putc,
-       .puts   = lpc32xx_serial_puts,
+       .puts   = default_serial_puts,
        .getc   = lpc32xx_serial_getc,
        .tstc   = lpc32xx_serial_tstc,
 };
@@ -104,34 +87,3 @@ __weak struct serial_device *default_serial_console(void)
 {
        return &lpc32xx_serial_drv;
 }
-#else
-int serial_init(void)
-{
-       return lpc32xx_serial_init();
-}
-
-void serial_setbrg(void)
-{
-       lpc32xx_serial_setbrg();
-}
-
-void serial_putc(const char c)
-{
-       lpc32xx_serial_putc(c);
-}
-
-void serial_puts(const char *s)
-{
-       lpc32xx_serial_puts(s);
-}
-
-int serial_getc(void)
-{
-       return lpc32xx_serial_getc();
-}
-
-int serial_tstc(void)
-{
-       return lpc32xx_serial_tstc();
-}
-#endif