diff options
Diffstat (limited to 'drivers/serial')
-rw-r--r-- | drivers/serial/Kconfig | 5 | ||||
-rw-r--r-- | drivers/serial/serial_txx9.c | 23 |
2 files changed, 16 insertions, 12 deletions
diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig index 2978c09860ee..5cc6b91f8408 100644 --- a/drivers/serial/Kconfig +++ b/drivers/serial/Kconfig | |||
@@ -916,6 +916,11 @@ config SERIAL_TXX9 | |||
916 | config HAS_TXX9_SERIAL | 916 | config HAS_TXX9_SERIAL |
917 | bool | 917 | bool |
918 | 918 | ||
919 | config SERIAL_TXX9_NR_UARTS | ||
920 | int "Maximum number of TMPTX39XX/49XX SIO ports" | ||
921 | depends on SERIAL_TXX9 | ||
922 | default "6" | ||
923 | |||
919 | config SERIAL_TXX9_CONSOLE | 924 | config SERIAL_TXX9_CONSOLE |
920 | bool "TMPTX39XX/49XX SIO Console support" | 925 | bool "TMPTX39XX/49XX SIO Console support" |
921 | depends on SERIAL_TXX9=y | 926 | depends on SERIAL_TXX9=y |
diff --git a/drivers/serial/serial_txx9.c b/drivers/serial/serial_txx9.c index 7186a82c4759..f4440d329310 100644 --- a/drivers/serial/serial_txx9.c +++ b/drivers/serial/serial_txx9.c | |||
@@ -37,6 +37,7 @@ | |||
37 | * 1.06 Do not insert a char caused previous overrun. | 37 | * 1.06 Do not insert a char caused previous overrun. |
38 | * Fix some spin_locks. | 38 | * Fix some spin_locks. |
39 | * Do not call uart_add_one_port for absent ports. | 39 | * Do not call uart_add_one_port for absent ports. |
40 | * 1.07 Use CONFIG_SERIAL_TXX9_NR_UARTS. Cleanup. | ||
40 | */ | 41 | */ |
41 | 42 | ||
42 | #if defined(CONFIG_SERIAL_TXX9_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) | 43 | #if defined(CONFIG_SERIAL_TXX9_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) |
@@ -58,9 +59,8 @@ | |||
58 | #include <linux/mutex.h> | 59 | #include <linux/mutex.h> |
59 | 60 | ||
60 | #include <asm/io.h> | 61 | #include <asm/io.h> |
61 | #include <asm/irq.h> | ||
62 | 62 | ||
63 | static char *serial_version = "1.06"; | 63 | static char *serial_version = "1.07"; |
64 | static char *serial_name = "TX39/49 Serial driver"; | 64 | static char *serial_name = "TX39/49 Serial driver"; |
65 | 65 | ||
66 | #define PASS_LIMIT 256 | 66 | #define PASS_LIMIT 256 |
@@ -88,12 +88,7 @@ static char *serial_name = "TX39/49 Serial driver"; | |||
88 | /* | 88 | /* |
89 | * Number of serial ports | 89 | * Number of serial ports |
90 | */ | 90 | */ |
91 | #ifdef ENABLE_SERIAL_TXX9_PCI | 91 | #define UART_NR CONFIG_SERIAL_TXX9_NR_UARTS |
92 | #define NR_PCI_BOARDS 4 | ||
93 | #define UART_NR (4 + NR_PCI_BOARDS) | ||
94 | #else | ||
95 | #define UART_NR 4 | ||
96 | #endif | ||
97 | 92 | ||
98 | #define HIGH_BITS_OFFSET ((sizeof(long)-sizeof(int))*8) | 93 | #define HIGH_BITS_OFFSET ((sizeof(long)-sizeof(int))*8) |
99 | 94 | ||
@@ -987,6 +982,7 @@ int __init early_serial_txx9_setup(struct uart_port *port) | |||
987 | } | 982 | } |
988 | 983 | ||
989 | #ifdef ENABLE_SERIAL_TXX9_PCI | 984 | #ifdef ENABLE_SERIAL_TXX9_PCI |
985 | #ifdef CONFIG_PM | ||
990 | /** | 986 | /** |
991 | * serial_txx9_suspend_port - suspend one serial port | 987 | * serial_txx9_suspend_port - suspend one serial port |
992 | * @line: serial line number | 988 | * @line: serial line number |
@@ -1008,6 +1004,7 @@ static void serial_txx9_resume_port(int line) | |||
1008 | { | 1004 | { |
1009 | uart_resume_port(&serial_txx9_reg, &serial_txx9_ports[line].port); | 1005 | uart_resume_port(&serial_txx9_reg, &serial_txx9_ports[line].port); |
1010 | } | 1006 | } |
1007 | #endif | ||
1011 | 1008 | ||
1012 | static DEFINE_MUTEX(serial_txx9_mutex); | 1009 | static DEFINE_MUTEX(serial_txx9_mutex); |
1013 | 1010 | ||
@@ -1118,6 +1115,7 @@ static void __devexit pciserial_txx9_remove_one(struct pci_dev *dev) | |||
1118 | } | 1115 | } |
1119 | } | 1116 | } |
1120 | 1117 | ||
1118 | #ifdef CONFIG_PM | ||
1121 | static int pciserial_txx9_suspend_one(struct pci_dev *dev, pm_message_t state) | 1119 | static int pciserial_txx9_suspend_one(struct pci_dev *dev, pm_message_t state) |
1122 | { | 1120 | { |
1123 | int line = (int)(long)pci_get_drvdata(dev); | 1121 | int line = (int)(long)pci_get_drvdata(dev); |
@@ -1142,11 +1140,10 @@ static int pciserial_txx9_resume_one(struct pci_dev *dev) | |||
1142 | } | 1140 | } |
1143 | return 0; | 1141 | return 0; |
1144 | } | 1142 | } |
1143 | #endif | ||
1145 | 1144 | ||
1146 | static struct pci_device_id serial_txx9_pci_tbl[] = { | 1145 | static const struct pci_device_id serial_txx9_pci_tbl[] = { |
1147 | { PCI_VENDOR_ID_TOSHIBA_2, PCI_DEVICE_ID_TOSHIBA_TC86C001_MISC, | 1146 | { PCI_DEVICE(PCI_VENDOR_ID_TOSHIBA_2, PCI_DEVICE_ID_TOSHIBA_TC86C001_MISC) }, |
1148 | PCI_ANY_ID, PCI_ANY_ID, | ||
1149 | 0, 0, 0 }, | ||
1150 | { 0, } | 1147 | { 0, } |
1151 | }; | 1148 | }; |
1152 | 1149 | ||
@@ -1154,8 +1151,10 @@ static struct pci_driver serial_txx9_pci_driver = { | |||
1154 | .name = "serial_txx9", | 1151 | .name = "serial_txx9", |
1155 | .probe = pciserial_txx9_init_one, | 1152 | .probe = pciserial_txx9_init_one, |
1156 | .remove = __devexit_p(pciserial_txx9_remove_one), | 1153 | .remove = __devexit_p(pciserial_txx9_remove_one), |
1154 | #ifdef CONFIG_PM | ||
1157 | .suspend = pciserial_txx9_suspend_one, | 1155 | .suspend = pciserial_txx9_suspend_one, |
1158 | .resume = pciserial_txx9_resume_one, | 1156 | .resume = pciserial_txx9_resume_one, |
1157 | #endif | ||
1159 | .id_table = serial_txx9_pci_tbl, | 1158 | .id_table = serial_txx9_pci_tbl, |
1160 | }; | 1159 | }; |
1161 | 1160 | ||