hc
2024-11-01 7e970c18f85f99acc678d90128b6e01dce1bf273
kernel/drivers/tty/serial/st-asc.c
....@@ -908,6 +908,29 @@
908908 spin_unlock_irqrestore(&port->lock, flags);
909909 }
910910
911
+#ifdef CONFIG_RAW_PRINTK
912
+
913
+static void asc_console_write_raw(struct console *co,
914
+ const char *s, unsigned int count)
915
+{
916
+ struct uart_port *port = &asc_ports[co->index].port;
917
+ unsigned long timeout = 1000000;
918
+ u32 intenable;
919
+
920
+ intenable = asc_in(port, ASC_INTEN);
921
+ asc_out(port, ASC_INTEN, 0);
922
+ (void)asc_in(port, ASC_INTEN); /* Defeat bus write posting */
923
+
924
+ uart_console_write(port, s, count, asc_console_putchar);
925
+
926
+ while (timeout-- && !asc_txfifo_is_empty(port))
927
+ cpu_relax(); /* wait shorter */
928
+
929
+ asc_out(port, ASC_INTEN, intenable);
930
+}
931
+
932
+#endif
933
+
911934 static int asc_console_setup(struct console *co, char *options)
912935 {
913936 struct asc_port *ascport;
....@@ -940,6 +963,9 @@
940963 .name = ASC_SERIAL_NAME,
941964 .device = uart_console_device,
942965 .write = asc_console_write,
966
+#ifdef CONFIG_RAW_PRINTK
967
+ .write_raw = asc_console_write_raw,
968
+#endif
943969 .setup = asc_console_setup,
944970 .flags = CON_PRINTBUFFER,
945971 .index = -1,