From 1543e317f1da31b75942316931e8f491a8920811 Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Thu, 04 Jan 2024 10:08:02 +0000
Subject: [PATCH] disable FB

---
 kernel/drivers/tty/serial/8250/8250.h |   59 ++++++++++++++---------------------------------------------
 1 files changed, 14 insertions(+), 45 deletions(-)

diff --git a/kernel/drivers/tty/serial/8250/8250.h b/kernel/drivers/tty/serial/8250/8250.h
index 59ce698..97df058 100644
--- a/kernel/drivers/tty/serial/8250/8250.h
+++ b/kernel/drivers/tty/serial/8250/8250.h
@@ -156,49 +156,6 @@
 	up->dl_write(up, value);
 }
 
-static inline void serial8250_set_IER(struct uart_8250_port *up,
-				      unsigned char ier)
-{
-	struct uart_port *port = &up->port;
-	unsigned int flags;
-	bool is_console;
-
-	is_console = uart_console(port);
-
-	if (is_console)
-		console_atomic_lock(&flags);
-
-	serial_out(up, UART_IER, ier);
-
-	if (is_console)
-		console_atomic_unlock(flags);
-}
-
-static inline unsigned char serial8250_clear_IER(struct uart_8250_port *up)
-{
-	struct uart_port *port = &up->port;
-	unsigned int clearval = 0;
-	unsigned int prior;
-	unsigned int flags;
-	bool is_console;
-
-	is_console = uart_console(port);
-
-	if (up->capabilities & UART_CAP_UUE)
-		clearval = UART_IER_UUE;
-
-	if (is_console)
-		console_atomic_lock(&flags);
-
-	prior = serial_port_in(port, UART_IER);
-	serial_port_out(port, UART_IER, clearval);
-
-	if (is_console)
-		console_atomic_unlock(flags);
-
-	return prior;
-}
-
 static inline bool serial8250_set_THRI(struct uart_8250_port *up)
 {
 	if (up->ier & UART_IER_THRI)
@@ -207,7 +164,7 @@
 #if defined(CONFIG_ARCH_ROCKCHIP) && defined(CONFIG_NO_GKI)
 	up->ier |= UART_IER_PTIME;
 #endif
-	serial8250_set_IER(up, up->ier);
+	serial_out(up, UART_IER, up->ier);
 	return true;
 }
 
@@ -219,7 +176,7 @@
 #if defined(CONFIG_ARCH_ROCKCHIP) && defined(CONFIG_NO_GKI)
 	up->ier &= ~UART_IER_PTIME;
 #endif
-	serial8250_set_IER(up, up->ier);
+	serial_out(up, UART_IER, up->ier);
 	return true;
 }
 
@@ -385,6 +342,13 @@
 extern void serial8250_rx_dma_flush(struct uart_8250_port *);
 extern int serial8250_request_dma(struct uart_8250_port *);
 extern void serial8250_release_dma(struct uart_8250_port *);
+
+static inline bool serial8250_tx_dma_running(struct uart_8250_port *p)
+{
+	struct uart_8250_dma *dma = p->dma;
+
+	return dma && dma->tx_running;
+}
 #else
 static inline int serial8250_tx_dma(struct uart_8250_port *p)
 {
@@ -406,6 +370,11 @@
 	return -1;
 }
 static inline void serial8250_release_dma(struct uart_8250_port *p) { }
+
+static inline bool serial8250_tx_dma_running(struct uart_8250_port *p)
+{
+	return false;
+}
 #endif
 
 static inline int ns16550a_goto_highspeed(struct uart_8250_port *up)

--
Gitblit v1.6.2