aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/serial_txx9.c
diff options
context:
space:
mode:
authorAtsushi Nemoto <anemo@mba.ocn.ne.jp>2007-02-10 04:45:05 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-11 13:51:27 -0500
commit138c5d258cf06c278f5d7fe0a806e50fe413a08f (patch)
tree86bd8700b12519a4dc4efc33ccddd0a1c743fd67 /drivers/serial/serial_txx9.c
parentc376222960ae91d5ffb9197ee36771aaed1d9f90 (diff)
[PATCH] serial: serial_txx9 driver update
Update the serial_txx9 driver. * Configurable manumum port number. (SERIAL_TXX9_NR_UARTS) * Remove some code which is unneeded if CONFIG_PM=n. * Use PCI_DEVICE() for pci device id table and make it const. * Do not include <asm/irq.h> Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/serial/serial_txx9.c')
-rw-r--r--drivers/serial/serial_txx9.c23
1 files changed, 11 insertions, 12 deletions
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
63static char *serial_version = "1.06"; 63static char *serial_version = "1.07";
64static char *serial_name = "TX39/49 Serial driver"; 64static 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
1012static DEFINE_MUTEX(serial_txx9_mutex); 1009static 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
1121static int pciserial_txx9_suspend_one(struct pci_dev *dev, pm_message_t state) 1119static 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
1146static struct pci_device_id serial_txx9_pci_tbl[] = { 1145static 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