tegra: i2c: Add function to find DVC bus
[oweals/u-boot.git] / drivers / serial / serial.c
index bce75489d2ecdf55442af084c1a7174ebee38104..0d6ad6283ace04ff723afafc1bb1908cc9d4d310 100644 (file)
@@ -22,8 +22,7 @@
  */
 
 #include <common.h>
-
-#ifdef CONFIG_SYS_NS16550_SERIAL
+#include <linux/compiler.h>
 
 #include <ns16550.h>
 #ifdef CONFIG_NS87308
@@ -110,10 +109,10 @@ static NS16550_t serial_ports[4] = {
        serial_puts_dev(port, s);}
 
 /* Serial device descriptor */
-#define INIT_ESERIAL_STRUCTURE(port,name,bus) {\
+#define INIT_ESERIAL_STRUCTURE(port, name) {\
        name,\
-       bus,\
        eserial##port##_init,\
+       NULL,\
        eserial##port##_setbrg,\
        eserial##port##_getc,\
        eserial##port##_tstc,\
@@ -317,16 +316,30 @@ serial_setbrg(void)
 
 DECLARE_ESERIAL_FUNCTIONS(1);
 struct serial_device eserial1_device =
-       INIT_ESERIAL_STRUCTURE(1,"eserial0","EUART1");
+       INIT_ESERIAL_STRUCTURE(1, "eserial0");
 DECLARE_ESERIAL_FUNCTIONS(2);
 struct serial_device eserial2_device =
-       INIT_ESERIAL_STRUCTURE(2,"eserial1","EUART2");
+       INIT_ESERIAL_STRUCTURE(2, "eserial1");
 DECLARE_ESERIAL_FUNCTIONS(3);
 struct serial_device eserial3_device =
-       INIT_ESERIAL_STRUCTURE(3,"eserial2","EUART3");
+       INIT_ESERIAL_STRUCTURE(3, "eserial2");
 DECLARE_ESERIAL_FUNCTIONS(4);
 struct serial_device eserial4_device =
-       INIT_ESERIAL_STRUCTURE(4,"eserial3","EUART4");
-#endif /* CONFIG_SERIAL_MULTI */
+       INIT_ESERIAL_STRUCTURE(4, "eserial3");
 
+__weak struct serial_device *default_serial_console(void)
+{
+#if CONFIG_CONS_INDEX == 1
+       return &eserial1_device;
+#elif CONFIG_CONS_INDEX == 2
+       return &eserial2_device;
+#elif CONFIG_CONS_INDEX == 3
+       return &eserial3_device;
+#elif CONFIG_CONS_INDEX == 4
+       return &eserial4_device;
+#else
+#error "Bad CONFIG_CONS_INDEX."
 #endif
+}
+
+#endif /* CONFIG_SERIAL_MULTI */