@@ -150,16 +150,6 @@ static void serial_out(struct uart_sunsu_port *up, int offset, int value)
150
150
}
151
151
}
152
152
153
- /*
154
- * We used to support using pause I/O for certain machines. We
155
- * haven't supported this for a while, but just in case it's badly
156
- * needed for certain old 386 machines, I've left these #define's
157
- * in....
158
- */
159
- #define serial_inp (up , offset ) serial_in(up, offset)
160
- #define serial_outp (up , offset , value ) serial_out(up, offset, value)
161
-
162
-
163
153
/*
164
154
* For the 16C950
165
155
*/
@@ -193,12 +183,12 @@ static int __enable_rsa(struct uart_sunsu_port *up)
193
183
unsigned char mode ;
194
184
int result ;
195
185
196
- mode = serial_inp (up , UART_RSA_MSR );
186
+ mode = serial_in (up , UART_RSA_MSR );
197
187
result = mode & UART_RSA_MSR_FIFO ;
198
188
199
189
if (!result ) {
200
- serial_outp (up , UART_RSA_MSR , mode | UART_RSA_MSR_FIFO );
201
- mode = serial_inp (up , UART_RSA_MSR );
190
+ serial_out (up , UART_RSA_MSR , mode | UART_RSA_MSR_FIFO );
191
+ mode = serial_in (up , UART_RSA_MSR );
202
192
result = mode & UART_RSA_MSR_FIFO ;
203
193
}
204
194
@@ -217,7 +207,7 @@ static void enable_rsa(struct uart_sunsu_port *up)
217
207
uart_port_unlock_irq (& up -> port );
218
208
}
219
209
if (up -> port .uartclk == SERIAL_RSA_BAUD_BASE * 16 )
220
- serial_outp (up , UART_RSA_FRR , 0 );
210
+ serial_out (up , UART_RSA_FRR , 0 );
221
211
}
222
212
}
223
213
@@ -236,12 +226,12 @@ static void disable_rsa(struct uart_sunsu_port *up)
236
226
up -> port .uartclk == SERIAL_RSA_BAUD_BASE * 16 ) {
237
227
uart_port_lock_irq (& up -> port );
238
228
239
- mode = serial_inp (up , UART_RSA_MSR );
229
+ mode = serial_in (up , UART_RSA_MSR );
240
230
result = !(mode & UART_RSA_MSR_FIFO );
241
231
242
232
if (!result ) {
243
- serial_outp (up , UART_RSA_MSR , mode & ~UART_RSA_MSR_FIFO );
244
- mode = serial_inp (up , UART_RSA_MSR );
233
+ serial_out (up , UART_RSA_MSR , mode & ~UART_RSA_MSR_FIFO );
234
+ mode = serial_in (up , UART_RSA_MSR );
245
235
result = !(mode & UART_RSA_MSR_FIFO );
246
236
}
247
237
@@ -326,7 +316,7 @@ receive_chars(struct uart_sunsu_port *up, unsigned char *status)
326
316
int saw_console_brk = 0 ;
327
317
328
318
do {
329
- ch = serial_inp (up , UART_RX );
319
+ ch = serial_in (up , UART_RX );
330
320
flag = TTY_NORMAL ;
331
321
up -> port .icount .rx ++ ;
332
322
@@ -387,7 +377,7 @@ receive_chars(struct uart_sunsu_port *up, unsigned char *status)
387
377
*/
388
378
tty_insert_flip_char (port , 0 , TTY_OVERRUN );
389
379
ignore_char :
390
- * status = serial_inp (up , UART_LSR );
380
+ * status = serial_in (up , UART_LSR );
391
381
} while ((* status & UART_LSR_DR ) && (max_count -- > 0 ));
392
382
393
383
if (saw_console_brk )
@@ -401,7 +391,7 @@ static void transmit_chars(struct uart_sunsu_port *up)
401
391
int count ;
402
392
403
393
if (up -> port .x_char ) {
404
- serial_outp (up , UART_TX , up -> port .x_char );
394
+ serial_out (up , UART_TX , up -> port .x_char );
405
395
up -> port .icount .tx ++ ;
406
396
up -> port .x_char = 0 ;
407
397
return ;
@@ -460,7 +450,7 @@ static irqreturn_t sunsu_serial_interrupt(int irq, void *dev_id)
460
450
uart_port_lock_irqsave (& up -> port , & flags );
461
451
462
452
do {
463
- status = serial_inp (up , UART_LSR );
453
+ status = serial_in (up , UART_LSR );
464
454
if (status & UART_LSR_DR )
465
455
receive_chars (up , & status );
466
456
check_modem_status (up );
@@ -498,7 +488,7 @@ static void sunsu_change_mouse_baud(struct uart_sunsu_port *up)
498
488
static void receive_kbd_ms_chars (struct uart_sunsu_port * up , int is_break )
499
489
{
500
490
do {
501
- unsigned char ch = serial_inp (up , UART_RX );
491
+ unsigned char ch = serial_in (up , UART_RX );
502
492
503
493
/* Stop-A is handled by drivers/char/keyboard.c now. */
504
494
if (up -> su_type == SU_PORT_KBD ) {
@@ -530,7 +520,7 @@ static irqreturn_t sunsu_kbd_ms_interrupt(int irq, void *dev_id)
530
520
struct uart_sunsu_port * up = dev_id ;
531
521
532
522
if (!(serial_in (up , UART_IIR ) & UART_IIR_NO_INT )) {
533
- unsigned char status = serial_inp (up , UART_LSR );
523
+ unsigned char status = serial_in (up , UART_LSR );
534
524
535
525
if ((status & UART_LSR_DR ) || (status & UART_LSR_BI ))
536
526
receive_kbd_ms_chars (up , (status & UART_LSR_BI ) != 0 );
@@ -619,14 +609,14 @@ static int sunsu_startup(struct uart_port *port)
619
609
if (up -> port .type == PORT_16C950 ) {
620
610
/* Wake up and initialize UART */
621
611
up -> acr = 0 ;
622
- serial_outp (up , UART_LCR , 0xBF );
623
- serial_outp (up , UART_EFR , UART_EFR_ECB );
624
- serial_outp (up , UART_IER , 0 );
625
- serial_outp (up , UART_LCR , 0 );
612
+ serial_out (up , UART_LCR , 0xBF );
613
+ serial_out (up , UART_EFR , UART_EFR_ECB );
614
+ serial_out (up , UART_IER , 0 );
615
+ serial_out (up , UART_LCR , 0 );
626
616
serial_icr_write (up , UART_CSR , 0 ); /* Reset the UART */
627
- serial_outp (up , UART_LCR , 0xBF );
628
- serial_outp (up , UART_EFR , UART_EFR_ECB );
629
- serial_outp (up , UART_LCR , 0 );
617
+ serial_out (up , UART_LCR , 0xBF );
618
+ serial_out (up , UART_EFR , UART_EFR_ECB );
619
+ serial_out (up , UART_LCR , 0 );
630
620
}
631
621
632
622
#ifdef CONFIG_SERIAL_8250_RSA
@@ -642,27 +632,27 @@ static int sunsu_startup(struct uart_port *port)
642
632
* (they will be reenabled in set_termios())
643
633
*/
644
634
if (uart_config [up -> port .type ].flags & UART_CLEAR_FIFO ) {
645
- serial_outp (up , UART_FCR , UART_FCR_ENABLE_FIFO );
646
- serial_outp (up , UART_FCR , UART_FCR_ENABLE_FIFO |
635
+ serial_out (up , UART_FCR , UART_FCR_ENABLE_FIFO );
636
+ serial_out (up , UART_FCR , UART_FCR_ENABLE_FIFO |
647
637
UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT );
648
- serial_outp (up , UART_FCR , 0 );
638
+ serial_out (up , UART_FCR , 0 );
649
639
}
650
640
651
641
/*
652
642
* Clear the interrupt registers.
653
643
*/
654
- (void ) serial_inp (up , UART_LSR );
655
- (void ) serial_inp (up , UART_RX );
656
- (void ) serial_inp (up , UART_IIR );
657
- (void ) serial_inp (up , UART_MSR );
644
+ (void ) serial_in (up , UART_LSR );
645
+ (void ) serial_in (up , UART_RX );
646
+ (void ) serial_in (up , UART_IIR );
647
+ (void ) serial_in (up , UART_MSR );
658
648
659
649
/*
660
650
* At this point, there's no way the LSR could still be 0xff;
661
651
* if it is, then bail out, because there's likely no UART
662
652
* here.
663
653
*/
664
654
if (!(up -> port .flags & UPF_BUGGY_UART ) &&
665
- (serial_inp (up , UART_LSR ) == 0xff )) {
655
+ (serial_in (up , UART_LSR ) == 0xff )) {
666
656
printk ("ttyS%d: LSR safety check engaged!\n" , up -> port .line );
667
657
return - ENODEV ;
668
658
}
@@ -682,7 +672,7 @@ static int sunsu_startup(struct uart_port *port)
682
672
/*
683
673
* Now, initialize the UART
684
674
*/
685
- serial_outp (up , UART_LCR , UART_LCR_WLEN8 );
675
+ serial_out (up , UART_LCR , UART_LCR_WLEN8 );
686
676
687
677
uart_port_lock_irqsave (& up -> port , & flags );
688
678
@@ -697,7 +687,7 @@ static int sunsu_startup(struct uart_port *port)
697
687
* anyway, so we don't enable them here.
698
688
*/
699
689
up -> ier = UART_IER_RLSI | UART_IER_RDI ;
700
- serial_outp (up , UART_IER , up -> ier );
690
+ serial_out (up , UART_IER , up -> ier );
701
691
702
692
if (up -> port .flags & UPF_FOURPORT ) {
703
693
unsigned int icp ;
@@ -712,10 +702,10 @@ static int sunsu_startup(struct uart_port *port)
712
702
/*
713
703
* And clear the interrupt registers again for luck.
714
704
*/
715
- (void ) serial_inp (up , UART_LSR );
716
- (void ) serial_inp (up , UART_RX );
717
- (void ) serial_inp (up , UART_IIR );
718
- (void ) serial_inp (up , UART_MSR );
705
+ (void ) serial_in (up , UART_LSR );
706
+ (void ) serial_in (up , UART_RX );
707
+ (void ) serial_in (up , UART_IIR );
708
+ (void ) serial_in (up , UART_MSR );
719
709
720
710
return 0 ;
721
711
}
@@ -730,7 +720,7 @@ static void sunsu_shutdown(struct uart_port *port)
730
720
* Disable interrupts from this port
731
721
*/
732
722
up -> ier = 0 ;
733
- serial_outp (up , UART_IER , 0 );
723
+ serial_out (up , UART_IER , 0 );
734
724
735
725
uart_port_lock_irqsave (& up -> port , & flags );
736
726
if (up -> port .flags & UPF_FOURPORT ) {
@@ -746,11 +736,11 @@ static void sunsu_shutdown(struct uart_port *port)
746
736
/*
747
737
* Disable break condition and FIFOs
748
738
*/
749
- serial_out (up , UART_LCR , serial_inp (up , UART_LCR ) & ~UART_LCR_SBC );
750
- serial_outp (up , UART_FCR , UART_FCR_ENABLE_FIFO |
739
+ serial_out (up , UART_LCR , serial_in (up , UART_LCR ) & ~UART_LCR_SBC );
740
+ serial_out (up , UART_FCR , UART_FCR_ENABLE_FIFO |
751
741
UART_FCR_CLEAR_RCVR |
752
742
UART_FCR_CLEAR_XMIT );
753
- serial_outp (up , UART_FCR , 0 );
743
+ serial_out (up , UART_FCR , 0 );
754
744
755
745
#ifdef CONFIG_SERIAL_8250_RSA
756
746
/*
@@ -872,22 +862,22 @@ sunsu_change_speed(struct uart_port *port, unsigned int cflag,
872
862
serial_out (up , UART_IER , up -> ier );
873
863
874
864
if (uart_config [up -> port .type ].flags & UART_STARTECH ) {
875
- serial_outp (up , UART_LCR , 0xBF );
876
- serial_outp (up , UART_EFR , cflag & CRTSCTS ? UART_EFR_CTS :0 );
865
+ serial_out (up , UART_LCR , 0xBF );
866
+ serial_out (up , UART_EFR , cflag & CRTSCTS ? UART_EFR_CTS :0 );
877
867
}
878
- serial_outp (up , UART_LCR , cval | UART_LCR_DLAB );/* set DLAB */
879
- serial_outp (up , UART_DLL , quot & 0xff ); /* LS of divisor */
880
- serial_outp (up , UART_DLM , quot >> 8 ); /* MS of divisor */
868
+ serial_out (up , UART_LCR , cval | UART_LCR_DLAB );/* set DLAB */
869
+ serial_out (up , UART_DLL , quot & 0xff ); /* LS of divisor */
870
+ serial_out (up , UART_DLM , quot >> 8 ); /* MS of divisor */
881
871
if (up -> port .type == PORT_16750 )
882
- serial_outp (up , UART_FCR , fcr ); /* set fcr */
883
- serial_outp (up , UART_LCR , cval ); /* reset DLAB */
872
+ serial_out (up , UART_FCR , fcr ); /* set fcr */
873
+ serial_out (up , UART_LCR , cval ); /* reset DLAB */
884
874
up -> lcr = cval ; /* Save LCR */
885
875
if (up -> port .type != PORT_16750 ) {
886
876
if (fcr & UART_FCR_ENABLE_FIFO ) {
887
877
/* emulated UARTs (Lucent Venus 167x) need two steps */
888
- serial_outp (up , UART_FCR , UART_FCR_ENABLE_FIFO );
878
+ serial_out (up , UART_FCR , UART_FCR_ENABLE_FIFO );
889
879
}
890
- serial_outp (up , UART_FCR , fcr ); /* set fcr */
880
+ serial_out (up , UART_FCR , fcr ); /* set fcr */
891
881
}
892
882
893
883
up -> cflag = cflag ;
@@ -1051,18 +1041,18 @@ static void sunsu_autoconfig(struct uart_sunsu_port *up)
1051
1041
* 0x80 is a non-existent port; which should be safe since
1052
1042
* include/asm/io.h also makes this assumption.
1053
1043
*/
1054
- scratch = serial_inp (up , UART_IER );
1055
- serial_outp (up , UART_IER , 0 );
1044
+ scratch = serial_in (up , UART_IER );
1045
+ serial_out (up , UART_IER , 0 );
1056
1046
#ifdef __i386__
1057
1047
outb (0xff , 0x080 );
1058
1048
#endif
1059
- scratch2 = serial_inp (up , UART_IER );
1060
- serial_outp (up , UART_IER , 0x0f );
1049
+ scratch2 = serial_in (up , UART_IER );
1050
+ serial_out (up , UART_IER , 0x0f );
1061
1051
#ifdef __i386__
1062
1052
outb (0 , 0x080 );
1063
1053
#endif
1064
- scratch3 = serial_inp (up , UART_IER );
1065
- serial_outp (up , UART_IER , scratch );
1054
+ scratch3 = serial_in (up , UART_IER );
1055
+ serial_out (up , UART_IER , scratch );
1066
1056
if (scratch2 != 0 || scratch3 != 0x0F )
1067
1057
goto out ; /* We failed; there's nothing here */
1068
1058
}
@@ -1080,16 +1070,16 @@ static void sunsu_autoconfig(struct uart_sunsu_port *up)
1080
1070
* that conflicts with COM 1-4 --- we hope!
1081
1071
*/
1082
1072
if (!(up -> port .flags & UPF_SKIP_TEST )) {
1083
- serial_outp (up , UART_MCR , UART_MCR_LOOP | 0x0A );
1084
- status1 = serial_inp (up , UART_MSR ) & 0xF0 ;
1085
- serial_outp (up , UART_MCR , save_mcr );
1073
+ serial_out (up , UART_MCR , UART_MCR_LOOP | 0x0A );
1074
+ status1 = serial_in (up , UART_MSR ) & 0xF0 ;
1075
+ serial_out (up , UART_MCR , save_mcr );
1086
1076
if (status1 != 0x90 )
1087
1077
goto out ; /* We failed loopback test */
1088
1078
}
1089
- serial_outp (up , UART_LCR , 0xBF ); /* set up for StarTech test */
1090
- serial_outp (up , UART_EFR , 0 ); /* EFR is the same as FCR */
1091
- serial_outp (up , UART_LCR , 0 );
1092
- serial_outp (up , UART_FCR , UART_FCR_ENABLE_FIFO );
1079
+ serial_out (up , UART_LCR , 0xBF ); /* set up for StarTech test */
1080
+ serial_out (up , UART_EFR , 0 ); /* EFR is the same as FCR */
1081
+ serial_out (up , UART_LCR , 0 );
1082
+ serial_out (up , UART_FCR , UART_FCR_ENABLE_FIFO );
1093
1083
scratch = serial_in (up , UART_IIR ) >> 6 ;
1094
1084
switch (scratch ) {
1095
1085
case 0 :
@@ -1107,19 +1097,19 @@ static void sunsu_autoconfig(struct uart_sunsu_port *up)
1107
1097
}
1108
1098
if (up -> port .type == PORT_16550A ) {
1109
1099
/* Check for Startech UART's */
1110
- serial_outp (up , UART_LCR , UART_LCR_DLAB );
1100
+ serial_out (up , UART_LCR , UART_LCR_DLAB );
1111
1101
if (serial_in (up , UART_EFR ) == 0 ) {
1112
1102
up -> port .type = PORT_16650 ;
1113
1103
} else {
1114
- serial_outp (up , UART_LCR , 0xBF );
1104
+ serial_out (up , UART_LCR , 0xBF );
1115
1105
if (serial_in (up , UART_EFR ) == 0 )
1116
1106
up -> port .type = PORT_16650V2 ;
1117
1107
}
1118
1108
}
1119
1109
if (up -> port .type == PORT_16550A ) {
1120
1110
/* Check for TI 16750 */
1121
- serial_outp (up , UART_LCR , save_lcr | UART_LCR_DLAB );
1122
- serial_outp (up , UART_FCR ,
1111
+ serial_out (up , UART_LCR , save_lcr | UART_LCR_DLAB );
1112
+ serial_out (up , UART_FCR ,
1123
1113
UART_FCR_ENABLE_FIFO | UART_FCR7_64BYTE );
1124
1114
scratch = serial_in (up , UART_IIR ) >> 5 ;
1125
1115
if (scratch == 7 ) {
@@ -1129,24 +1119,24 @@ static void sunsu_autoconfig(struct uart_sunsu_port *up)
1129
1119
* mode if the UART_FCR7_64BYTE bit was set
1130
1120
* while UART_LCR_DLAB was latched.
1131
1121
*/
1132
- serial_outp (up , UART_FCR , UART_FCR_ENABLE_FIFO );
1133
- serial_outp (up , UART_LCR , 0 );
1134
- serial_outp (up , UART_FCR ,
1122
+ serial_out (up , UART_FCR , UART_FCR_ENABLE_FIFO );
1123
+ serial_out (up , UART_LCR , 0 );
1124
+ serial_out (up , UART_FCR ,
1135
1125
UART_FCR_ENABLE_FIFO | UART_FCR7_64BYTE );
1136
1126
scratch = serial_in (up , UART_IIR ) >> 5 ;
1137
1127
if (scratch == 6 )
1138
1128
up -> port .type = PORT_16750 ;
1139
1129
}
1140
- serial_outp (up , UART_FCR , UART_FCR_ENABLE_FIFO );
1130
+ serial_out (up , UART_FCR , UART_FCR_ENABLE_FIFO );
1141
1131
}
1142
- serial_outp (up , UART_LCR , save_lcr );
1132
+ serial_out (up , UART_LCR , save_lcr );
1143
1133
if (up -> port .type == PORT_16450 ) {
1144
1134
scratch = serial_in (up , UART_SCR );
1145
- serial_outp (up , UART_SCR , 0xa5 );
1135
+ serial_out (up , UART_SCR , 0xa5 );
1146
1136
status1 = serial_in (up , UART_SCR );
1147
- serial_outp (up , UART_SCR , 0x5a );
1137
+ serial_out (up , UART_SCR , 0x5a );
1148
1138
status2 = serial_in (up , UART_SCR );
1149
- serial_outp (up , UART_SCR , scratch );
1139
+ serial_out (up , UART_SCR , scratch );
1150
1140
1151
1141
if ((status1 != 0xa5 ) || (status2 != 0x5a ))
1152
1142
up -> port .type = PORT_8250 ;
@@ -1163,15 +1153,15 @@ static void sunsu_autoconfig(struct uart_sunsu_port *up)
1163
1153
*/
1164
1154
#ifdef CONFIG_SERIAL_8250_RSA
1165
1155
if (up -> port .type == PORT_RSA )
1166
- serial_outp (up , UART_RSA_FRR , 0 );
1156
+ serial_out (up , UART_RSA_FRR , 0 );
1167
1157
#endif
1168
- serial_outp (up , UART_MCR , save_mcr );
1169
- serial_outp (up , UART_FCR , (UART_FCR_ENABLE_FIFO |
1158
+ serial_out (up , UART_MCR , save_mcr );
1159
+ serial_out (up , UART_FCR , (UART_FCR_ENABLE_FIFO |
1170
1160
UART_FCR_CLEAR_RCVR |
1171
1161
UART_FCR_CLEAR_XMIT ));
1172
- serial_outp (up , UART_FCR , 0 );
1162
+ serial_out (up , UART_FCR , 0 );
1173
1163
(void )serial_in (up , UART_RX );
1174
- serial_outp (up , UART_IER , 0 );
1164
+ serial_out (up , UART_IER , 0 );
1175
1165
1176
1166
out :
1177
1167
uart_port_unlock_irqrestore (& up -> port , flags );
0 commit comments