Skip to content

Commit d81e50f

Browse files
peterhurleygregkh
authored andcommitted
serial: 8250: Move ns16550a_goto_hispeed() to local header
Prepare for 8250_core.c file split; move shared inline function to local header file. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 5db496b commit d81e50f

File tree

2 files changed

+17
-18
lines changed

2 files changed

+17
-18
lines changed

drivers/tty/serial/8250/8250.h

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ struct uart_8250_dma {
2121

2222
/* Filter function */
2323
dma_filter_fn fn;
24-
2524
/* Parameter to the filter function */
2625
void *rx_param;
2726
void *tx_param;
@@ -198,3 +197,20 @@ static inline int serial8250_request_dma(struct uart_8250_port *p)
198197
}
199198
static inline void serial8250_release_dma(struct uart_8250_port *p) { }
200199
#endif
200+
201+
static inline int ns16550a_goto_highspeed(struct uart_8250_port *up)
202+
{
203+
unsigned char status;
204+
205+
status = serial_in(up, 0x04); /* EXCR2 */
206+
#define PRESL(x) ((x) & 0x30)
207+
if (PRESL(status) == 0x10) {
208+
/* already in high speed mode */
209+
return 0;
210+
} else {
211+
status &= ~0xB0; /* Disable LOCK, mask out PRESL[01] */
212+
status |= 0x10; /* 1.625 divisor for baud_base --> 921600 */
213+
serial_out(up, 0x04, status);
214+
}
215+
return 1;
216+
}

drivers/tty/serial/8250/8250_core.c

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -903,23 +903,6 @@ static int broken_efr(struct uart_8250_port *up)
903903
return 0;
904904
}
905905

906-
static inline int ns16550a_goto_highspeed(struct uart_8250_port *up)
907-
{
908-
unsigned char status;
909-
910-
status = serial_in(up, 0x04); /* EXCR2 */
911-
#define PRESL(x) ((x) & 0x30)
912-
if (PRESL(status) == 0x10) {
913-
/* already in high speed mode */
914-
return 0;
915-
} else {
916-
status &= ~0xB0; /* Disable LOCK, mask out PRESL[01] */
917-
status |= 0x10; /* 1.625 divisor for baud_base --> 921600 */
918-
serial_out(up, 0x04, status);
919-
}
920-
return 1;
921-
}
922-
923906
/*
924907
* We know that the chip has FIFOs. Does it have an EFR? The
925908
* EFR is located in the same register position as the IIR and

0 commit comments

Comments
 (0)