forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-02-19 1c055e55a242a33e574e48be530e06770a210dcd
kernel/drivers/tty/tty_baudrate.c
....@@ -8,6 +8,7 @@
88 #include <linux/termios.h>
99 #include <linux/tty.h>
1010 #include <linux/export.h>
11
+#include "tty.h"
1112
1213
1314 /*
....@@ -17,32 +18,28 @@
1718 * include/asm/termbits.h file.
1819 */
1920 static const speed_t baud_table[] = {
20
- 0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800,
21
- 9600, 19200, 38400, 57600, 115200, 230400, 460800,
21
+ 0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400,
22
+ 4800, 9600, 19200, 38400, 57600, 115200, 230400, 460800,
2223 #ifdef __sparc__
23
- 76800, 153600, 307200, 614400, 921600
24
+ 76800, 153600, 307200, 614400, 921600, 500000, 576000,
25
+ 1000000, 1152000, 1500000, 2000000
2426 #else
2527 500000, 576000, 921600, 1000000, 1152000, 1500000, 2000000,
2628 2500000, 3000000, 3500000, 4000000
2729 #endif
2830 };
2931
30
-#ifndef __sparc__
3132 static const tcflag_t baud_bits[] = {
32
- B0, B50, B75, B110, B134, B150, B200, B300, B600,
33
- B1200, B1800, B2400, B4800, B9600, B19200, B38400,
34
- B57600, B115200, B230400, B460800, B500000, B576000,
35
- B921600, B1000000, B1152000, B1500000, B2000000, B2500000,
36
- B3000000, B3500000, B4000000
37
-};
33
+ B0, B50, B75, B110, B134, B150, B200, B300, B600, B1200, B1800, B2400,
34
+ B4800, B9600, B19200, B38400, B57600, B115200, B230400, B460800,
35
+#ifdef __sparc__
36
+ B76800, B153600, B307200, B614400, B921600, B500000, B576000,
37
+ B1000000, B1152000, B1500000, B2000000
3838 #else
39
-static const tcflag_t baud_bits[] = {
40
- B0, B50, B75, B110, B134, B150, B200, B300, B600,
41
- B1200, B1800, B2400, B4800, B9600, B19200, B38400,
42
- B57600, B115200, B230400, B460800, B76800, B153600,
43
- B307200, B614400, B921600
44
-};
39
+ B500000, B576000, B921600, B1000000, B1152000, B1500000, B2000000,
40
+ B2500000, B3000000, B3500000, B4000000
4541 #endif
42
+};
4643
4744 static int n_baud_table = ARRAY_SIZE(baud_table);
4845
....@@ -123,8 +120,8 @@
123120 /**
124121 * tty_termios_encode_baud_rate
125122 * @termios: ktermios structure holding user requested state
126
- * @ispeed: input speed
127
- * @ospeed: output speed
123
+ * @ibaud: input speed
124
+ * @obaud: output speed
128125 *
129126 * Encode the speeds set into the passed termios structure. This is
130127 * used as a library helper for drivers so that they can report back
....@@ -227,7 +224,7 @@
227224 /**
228225 * tty_encode_baud_rate - set baud rate of the tty
229226 * @ibaud: input baud rate
230
- * @obad: output baud rate
227
+ * @obaud: output baud rate
231228 *
232229 * Update the current termios data for the tty with the new speed
233230 * settings. The caller must hold the termios_rwsem for the tty in