94 lines
3.9 KiB
Diff
94 lines
3.9 KiB
Diff
|
this reverts drivers/tty/serial/8250/8250_mtk.c back to the v5.17 version
|
||
|
as otherwise it breaks bluetooth on mt8183 kukui devices
|
||
|
|
||
|
diff --git a/drivers/tty/serial/8250/8250_mtk.c b/drivers/tty/serial/8250/8250_mtk.c
|
||
|
index 54051ec7b499..fb65dc601b23 100644
|
||
|
--- a/drivers/tty/serial/8250/8250_mtk.c
|
||
|
+++ b/drivers/tty/serial/8250/8250_mtk.c
|
||
|
@@ -37,7 +37,6 @@
|
||
|
#define MTK_UART_IER_RTSI 0x40 /* Enable RTS Modem status interrupt */
|
||
|
#define MTK_UART_IER_CTSI 0x80 /* Enable CTS Modem status interrupt */
|
||
|
|
||
|
-#define MTK_UART_EFR 38 /* I/O: Extended Features Register */
|
||
|
#define MTK_UART_EFR_EN 0x10 /* Enable enhancement feature */
|
||
|
#define MTK_UART_EFR_RTS 0x40 /* Enable hardware rx flow control */
|
||
|
#define MTK_UART_EFR_CTS 0x80 /* Enable hardware tx flow control */
|
||
|
@@ -54,9 +53,6 @@
|
||
|
#define MTK_UART_TX_TRIGGER 1
|
||
|
#define MTK_UART_RX_TRIGGER MTK_UART_RX_SIZE
|
||
|
|
||
|
-#define MTK_UART_XON1 40 /* I/O: Xon character 1 */
|
||
|
-#define MTK_UART_XOFF1 42 /* I/O: Xoff character 1 */
|
||
|
-
|
||
|
#ifdef CONFIG_SERIAL_8250_DMA
|
||
|
enum dma_rx_status {
|
||
|
DMA_RX_START = 0,
|
||
|
@@ -173,7 +169,7 @@ static void mtk8250_dma_enable(struct uart_8250_port *up)
|
||
|
MTK_UART_DMA_EN_RX | MTK_UART_DMA_EN_TX);
|
||
|
|
||
|
serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
|
||
|
- serial_out(up, MTK_UART_EFR, UART_EFR_ECB);
|
||
|
+ serial_out(up, UART_EFR, UART_EFR_ECB);
|
||
|
serial_out(up, UART_LCR, lcr);
|
||
|
|
||
|
if (dmaengine_slave_config(dma->rxchan, &dma->rxconf) != 0)
|
||
|
@@ -236,7 +232,7 @@ static void mtk8250_set_flow_ctrl(struct uart_8250_port *up, int mode)
|
||
|
int lcr = serial_in(up, UART_LCR);
|
||
|
|
||
|
serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
|
||
|
- serial_out(up, MTK_UART_EFR, UART_EFR_ECB);
|
||
|
+ serial_out(up, UART_EFR, UART_EFR_ECB);
|
||
|
serial_out(up, UART_LCR, lcr);
|
||
|
lcr = serial_in(up, UART_LCR);
|
||
|
|
||
|
@@ -245,7 +241,7 @@ static void mtk8250_set_flow_ctrl(struct uart_8250_port *up, int mode)
|
||
|
serial_out(up, MTK_UART_ESCAPE_DAT, MTK_UART_ESCAPE_CHAR);
|
||
|
serial_out(up, MTK_UART_ESCAPE_EN, 0x00);
|
||
|
serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
|
||
|
- serial_out(up, MTK_UART_EFR, serial_in(up, MTK_UART_EFR) &
|
||
|
+ serial_out(up, UART_EFR, serial_in(up, UART_EFR) &
|
||
|
(~(MTK_UART_EFR_HW_FC | MTK_UART_EFR_SW_FC_MASK)));
|
||
|
serial_out(up, UART_LCR, lcr);
|
||
|
mtk8250_disable_intrs(up, MTK_UART_IER_XOFFI |
|
||
|
@@ -259,8 +255,8 @@ static void mtk8250_set_flow_ctrl(struct uart_8250_port *up, int mode)
|
||
|
serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
|
||
|
|
||
|
/*enable hw flow control*/
|
||
|
- serial_out(up, MTK_UART_EFR, MTK_UART_EFR_HW_FC |
|
||
|
- (serial_in(up, MTK_UART_EFR) &
|
||
|
+ serial_out(up, UART_EFR, MTK_UART_EFR_HW_FC |
|
||
|
+ (serial_in(up, UART_EFR) &
|
||
|
(~(MTK_UART_EFR_HW_FC | MTK_UART_EFR_SW_FC_MASK))));
|
||
|
|
||
|
serial_out(up, UART_LCR, lcr);
|
||
|
@@ -274,12 +270,12 @@ static void mtk8250_set_flow_ctrl(struct uart_8250_port *up, int mode)
|
||
|
serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
|
||
|
|
||
|
/*enable sw flow control */
|
||
|
- serial_out(up, MTK_UART_EFR, MTK_UART_EFR_XON1_XOFF1 |
|
||
|
- (serial_in(up, MTK_UART_EFR) &
|
||
|
+ serial_out(up, UART_EFR, MTK_UART_EFR_XON1_XOFF1 |
|
||
|
+ (serial_in(up, UART_EFR) &
|
||
|
(~(MTK_UART_EFR_HW_FC | MTK_UART_EFR_SW_FC_MASK))));
|
||
|
|
||
|
- serial_out(up, MTK_UART_XON1, START_CHAR(port->state->port.tty));
|
||
|
- serial_out(up, MTK_UART_XOFF1, STOP_CHAR(port->state->port.tty));
|
||
|
+ serial_out(up, UART_XON1, START_CHAR(port->state->port.tty));
|
||
|
+ serial_out(up, UART_XOFF1, STOP_CHAR(port->state->port.tty));
|
||
|
serial_out(up, UART_LCR, lcr);
|
||
|
mtk8250_disable_intrs(up, MTK_UART_IER_CTSI|MTK_UART_IER_RTSI);
|
||
|
mtk8250_enable_intrs(up, MTK_UART_IER_XOFFI);
|
||
|
@@ -293,10 +289,10 @@ static void
|
||
|
mtk8250_set_termios(struct uart_port *port, struct ktermios *termios,
|
||
|
struct ktermios *old)
|
||
|
{
|
||
|
- static const unsigned short fraction_L_mapping[] = {
|
||
|
+ unsigned short fraction_L_mapping[] = {
|
||
|
0, 1, 0x5, 0x15, 0x55, 0x57, 0x57, 0x77, 0x7F, 0xFF, 0xFF
|
||
|
};
|
||
|
- static const unsigned short fraction_M_mapping[] = {
|
||
|
+ unsigned short fraction_M_mapping[] = {
|
||
|
0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 3
|
||
|
};
|
||
|
struct uart_8250_port *up = up_to_u8250p(port);
|