@@ -197,6 +197,31 @@ struct exar8250 {
197
197
int line [];
198
198
};
199
199
200
+ static int generic_rs485_config (struct uart_port * port , struct ktermios * termios ,
201
+ struct serial_rs485 * rs485 )
202
+ {
203
+ bool is_rs485 = !!(rs485 -> flags & SER_RS485_ENABLED );
204
+ u8 __iomem * p = port -> membase ;
205
+ u8 value ;
206
+
207
+ value = readb (p + UART_EXAR_FCTR );
208
+ if (is_rs485 )
209
+ value |= UART_FCTR_EXAR_485 ;
210
+ else
211
+ value &= ~UART_FCTR_EXAR_485 ;
212
+
213
+ writeb (value , p + UART_EXAR_FCTR );
214
+
215
+ if (is_rs485 )
216
+ writeb (UART_EXAR_RS485_DLY (4 ), p + UART_MSR );
217
+
218
+ return 0 ;
219
+ }
220
+
221
+ static const struct serial_rs485 generic_rs485_supported = {
222
+ .flags = SER_RS485_ENABLED | SER_RS485_RTS_ON_SEND ,
223
+ };
224
+
200
225
static void exar_pm (struct uart_port * port , unsigned int state , unsigned int old )
201
226
{
202
227
/*
@@ -459,27 +484,6 @@ static void xr17v35x_unregister_gpio(struct uart_8250_port *port)
459
484
port -> port .private_data = NULL ;
460
485
}
461
486
462
- static int generic_rs485_config (struct uart_port * port , struct ktermios * termios ,
463
- struct serial_rs485 * rs485 )
464
- {
465
- bool is_rs485 = !!(rs485 -> flags & SER_RS485_ENABLED );
466
- u8 __iomem * p = port -> membase ;
467
- u8 value ;
468
-
469
- value = readb (p + UART_EXAR_FCTR );
470
- if (is_rs485 )
471
- value |= UART_FCTR_EXAR_485 ;
472
- else
473
- value &= ~UART_FCTR_EXAR_485 ;
474
-
475
- writeb (value , p + UART_EXAR_FCTR );
476
-
477
- if (is_rs485 )
478
- writeb (UART_EXAR_RS485_DLY (4 ), p + UART_MSR );
479
-
480
- return 0 ;
481
- }
482
-
483
487
static int sealevel_rs485_config (struct uart_port * port , struct ktermios * termios ,
484
488
struct serial_rs485 * rs485 )
485
489
{
@@ -518,10 +522,6 @@ static int sealevel_rs485_config(struct uart_port *port, struct ktermios *termio
518
522
return 0 ;
519
523
}
520
524
521
- static const struct serial_rs485 generic_rs485_supported = {
522
- .flags = SER_RS485_ENABLED | SER_RS485_RTS_ON_SEND ,
523
- };
524
-
525
525
static const struct exar8250_platform exar8250_default_platform = {
526
526
.register_gpio = xr17v35x_register_gpio ,
527
527
.unregister_gpio = xr17v35x_unregister_gpio ,
0 commit comments