aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-07-26 02:09:27 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-07-26 02:09:27 -0400
commitd5ef642355bdd9b383ff5c18cbc6102a06eecbaf (patch)
treefcf78d33c1790c6c24efbfd0c3695f7874f053d7 /drivers/tty/serial
parentf549953c15deab4c54708b39af86d4edecc6cddc (diff)
parentdef90f4239f094f3846c108c1c41a4cd55c33e8e (diff)
Merge branch 'tty-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6
* 'tty-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6: (26 commits) amba pl011: workaround for uart registers lockup n_gsm: fix the wrong FCS handling pch_uart: add missing comment about OKI ML7223 pch_uart: Add MSI support tty: fix "IRQ45: nobody cared" PTI feature to allow user to name and mark masterchannel request. 0 for o PTI Makefile bug. tty: serial: samsung.c remove legacy PM code. SERIAL: SC26xx: Fix link error. serial: mrst_max3110: initialize waitqueue earlier mrst_max3110: Change max missing message priority. tty: s5pv210: Add delay loop on fifo reset function for UART tty/serial: Fix XSCALE serial ports, e.g. ce4100 serial: bfin_5xx: fix off-by-one with resource size drivers/tty: use printk_ratelimited() instead of printk_ratelimit() tty: n_gsm: Added refcount usage to gsm_mux and gsm_dlci structs tty: n_gsm: Add raw-ip support tty: n_gsm: expose gsmtty device nodes at ldisc open time pch_phub: Fix register miss-setting issue serial: 8250, increase PASS_LIMIT ...
Diffstat (limited to 'drivers/tty/serial')
-rw-r--r--drivers/tty/serial/8250.c4
-rw-r--r--drivers/tty/serial/8250_pci.c183
-rw-r--r--drivers/tty/serial/Kconfig2
-rw-r--r--drivers/tty/serial/pch_uart.c11
-rw-r--r--drivers/tty/serial/s5pv210.c4
-rw-r--r--drivers/tty/serial/samsung.c27
6 files changed, 211 insertions, 20 deletions
diff --git a/drivers/tty/serial/8250.c b/drivers/tty/serial/8250.c
index b4129f53fb1b..f2dfec82faf8 100644
--- a/drivers/tty/serial/8250.c
+++ b/drivers/tty/serial/8250.c
@@ -81,7 +81,7 @@ static unsigned int skip_txen_test; /* force skip of txen test at init time */
81#define DEBUG_INTR(fmt...) do { } while (0) 81#define DEBUG_INTR(fmt...) do { } while (0)
82#endif 82#endif
83 83
84#define PASS_LIMIT 256 84#define PASS_LIMIT 512
85 85
86#define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE) 86#define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE)
87 87
@@ -1107,7 +1107,7 @@ static void autoconfig_16550a(struct uart_8250_port *up)
1107 */ 1107 */
1108 DEBUG_AUTOCONF("Xscale "); 1108 DEBUG_AUTOCONF("Xscale ");
1109 up->port.type = PORT_XSCALE; 1109 up->port.type = PORT_XSCALE;
1110 up->capabilities |= UART_CAP_UUE; 1110 up->capabilities |= UART_CAP_UUE | UART_CAP_RTOIE;
1111 return; 1111 return;
1112 } 1112 }
1113 } else { 1113 } else {
diff --git a/drivers/tty/serial/8250_pci.c b/drivers/tty/serial/8250_pci.c
index cf35e0dc5085..6b887d90a205 100644
--- a/drivers/tty/serial/8250_pci.c
+++ b/drivers/tty/serial/8250_pci.c
@@ -39,6 +39,7 @@ struct pci_serial_quirk {
39 u32 device; 39 u32 device;
40 u32 subvendor; 40 u32 subvendor;
41 u32 subdevice; 41 u32 subdevice;
42 int (*probe)(struct pci_dev *dev);
42 int (*init)(struct pci_dev *dev); 43 int (*init)(struct pci_dev *dev);
43 int (*setup)(struct serial_private *, 44 int (*setup)(struct serial_private *,
44 const struct pciserial_board *, 45 const struct pciserial_board *,
@@ -56,6 +57,9 @@ struct serial_private {
56 int line[0]; 57 int line[0];
57}; 58};
58 59
60static int pci_default_setup(struct serial_private*,
61 const struct pciserial_board*, struct uart_port*, int);
62
59static void moan_device(const char *str, struct pci_dev *dev) 63static void moan_device(const char *str, struct pci_dev *dev)
60{ 64{
61 printk(KERN_WARNING 65 printk(KERN_WARNING
@@ -571,6 +575,28 @@ static const struct timedia_struct {
571 { 8, timedia_eight_port } 575 { 8, timedia_eight_port }
572}; 576};
573 577
578/*
579 * There are nearly 70 different Timedia/SUNIX PCI serial devices. Instead of
580 * listing them individually, this driver merely grabs them all with
581 * PCI_ANY_ID. Some of these devices, however, also feature a parallel port,
582 * and should be left free to be claimed by parport_serial instead.
583 */
584static int pci_timedia_probe(struct pci_dev *dev)
585{
586 /*
587 * Check the third digit of the subdevice ID
588 * (0,2,3,5,6: serial only -- 7,8,9: serial + parallel)
589 */
590 if ((dev->subsystem_device & 0x00f0) >= 0x70) {
591 dev_info(&dev->dev,
592 "ignoring Timedia subdevice %04x for parport_serial\n",
593 dev->subsystem_device);
594 return -ENODEV;
595 }
596
597 return 0;
598}
599
574static int pci_timedia_init(struct pci_dev *dev) 600static int pci_timedia_init(struct pci_dev *dev)
575{ 601{
576 const unsigned short *ids; 602 const unsigned short *ids;
@@ -752,6 +778,62 @@ pci_ni8430_setup(struct serial_private *priv,
752 return setup_port(priv, port, bar, offset, board->reg_shift); 778 return setup_port(priv, port, bar, offset, board->reg_shift);
753} 779}
754 780
781static int pci_netmos_9900_setup(struct serial_private *priv,
782 const struct pciserial_board *board,
783 struct uart_port *port, int idx)
784{
785 unsigned int bar;
786
787 if ((priv->dev->subsystem_device & 0xff00) == 0x3000) {
788 /* netmos apparently orders BARs by datasheet layout, so serial
789 * ports get BARs 0 and 3 (or 1 and 4 for memmapped)
790 */
791 bar = 3 * idx;
792
793 return setup_port(priv, port, bar, 0, board->reg_shift);
794 } else {
795 return pci_default_setup(priv, board, port, idx);
796 }
797}
798
799/* the 99xx series comes with a range of device IDs and a variety
800 * of capabilities:
801 *
802 * 9900 has varying capabilities and can cascade to sub-controllers
803 * (cascading should be purely internal)
804 * 9904 is hardwired with 4 serial ports
805 * 9912 and 9922 are hardwired with 2 serial ports
806 */
807static int pci_netmos_9900_numports(struct pci_dev *dev)
808{
809 unsigned int c = dev->class;
810 unsigned int pi;
811 unsigned short sub_serports;
812
813 pi = (c & 0xff);
814
815 if (pi == 2) {
816 return 1;
817 } else if ((pi == 0) &&
818 (dev->device == PCI_DEVICE_ID_NETMOS_9900)) {
819 /* two possibilities: 0x30ps encodes number of parallel and
820 * serial ports, or 0x1000 indicates *something*. This is not
821 * immediately obvious, since the 2s1p+4s configuration seems
822 * to offer all functionality on functions 0..2, while still
823 * advertising the same function 3 as the 4s+2s1p config.
824 */
825 sub_serports = dev->subsystem_device & 0xf;
826 if (sub_serports > 0) {
827 return sub_serports;
828 } else {
829 printk(KERN_NOTICE "NetMos/Mostech serial driver ignoring port on ambiguous config.\n");
830 return 0;
831 }
832 }
833
834 moan_device("unknown NetMos/Mostech program interface", dev);
835 return 0;
836}
755 837
756static int pci_netmos_init(struct pci_dev *dev) 838static int pci_netmos_init(struct pci_dev *dev)
757{ 839{
@@ -761,12 +843,28 @@ static int pci_netmos_init(struct pci_dev *dev)
761 if ((dev->device == PCI_DEVICE_ID_NETMOS_9901) || 843 if ((dev->device == PCI_DEVICE_ID_NETMOS_9901) ||
762 (dev->device == PCI_DEVICE_ID_NETMOS_9865)) 844 (dev->device == PCI_DEVICE_ID_NETMOS_9865))
763 return 0; 845 return 0;
846
764 if (dev->subsystem_vendor == PCI_VENDOR_ID_IBM && 847 if (dev->subsystem_vendor == PCI_VENDOR_ID_IBM &&
765 dev->subsystem_device == 0x0299) 848 dev->subsystem_device == 0x0299)
766 return 0; 849 return 0;
767 850
851 switch (dev->device) { /* FALLTHROUGH on all */
852 case PCI_DEVICE_ID_NETMOS_9904:
853 case PCI_DEVICE_ID_NETMOS_9912:
854 case PCI_DEVICE_ID_NETMOS_9922:
855 case PCI_DEVICE_ID_NETMOS_9900:
856 num_serial = pci_netmos_9900_numports(dev);
857 break;
858
859 default:
860 if (num_serial == 0 ) {
861 moan_device("unknown NetMos/Mostech device", dev);
862 }
863 }
864
768 if (num_serial == 0) 865 if (num_serial == 0)
769 return -ENODEV; 866 return -ENODEV;
867
770 return num_serial; 868 return num_serial;
771} 869}
772 870
@@ -1396,6 +1494,7 @@ static struct pci_serial_quirk pci_serial_quirks[] __refdata = {
1396 .device = PCI_DEVICE_ID_TIMEDIA_1889, 1494 .device = PCI_DEVICE_ID_TIMEDIA_1889,
1397 .subvendor = PCI_VENDOR_ID_TIMEDIA, 1495 .subvendor = PCI_VENDOR_ID_TIMEDIA,
1398 .subdevice = PCI_ANY_ID, 1496 .subdevice = PCI_ANY_ID,
1497 .probe = pci_timedia_probe,
1399 .init = pci_timedia_init, 1498 .init = pci_timedia_init,
1400 .setup = pci_timedia_setup, 1499 .setup = pci_timedia_setup,
1401 }, 1500 },
@@ -1426,7 +1525,7 @@ static struct pci_serial_quirk pci_serial_quirks[] __refdata = {
1426 .subvendor = PCI_ANY_ID, 1525 .subvendor = PCI_ANY_ID,
1427 .subdevice = PCI_ANY_ID, 1526 .subdevice = PCI_ANY_ID,
1428 .init = pci_netmos_init, 1527 .init = pci_netmos_init,
1429 .setup = pci_default_setup, 1528 .setup = pci_netmos_9900_setup,
1430 }, 1529 },
1431 /* 1530 /*
1432 * For Oxford Semiconductor Tornado based devices 1531 * For Oxford Semiconductor Tornado based devices
@@ -1703,6 +1802,7 @@ enum pci_board_num_t {
1703 pbn_ADDIDATA_PCIe_8_3906250, 1802 pbn_ADDIDATA_PCIe_8_3906250,
1704 pbn_ce4100_1_115200, 1803 pbn_ce4100_1_115200,
1705 pbn_omegapci, 1804 pbn_omegapci,
1805 pbn_NETMOS9900_2s_115200,
1706}; 1806};
1707 1807
1708/* 1808/*
@@ -2404,6 +2504,11 @@ static struct pciserial_board pci_boards[] __devinitdata = {
2404 .base_baud = 115200, 2504 .base_baud = 115200,
2405 .uart_offset = 0x200, 2505 .uart_offset = 0x200,
2406 }, 2506 },
2507 [pbn_NETMOS9900_2s_115200] = {
2508 .flags = FL_BASE0,
2509 .num_ports = 2,
2510 .base_baud = 115200,
2511 },
2407}; 2512};
2408 2513
2409static const struct pci_device_id softmodem_blacklist[] = { 2514static const struct pci_device_id softmodem_blacklist[] = {
@@ -2640,11 +2745,19 @@ EXPORT_SYMBOL_GPL(pciserial_resume_ports);
2640static int __devinit 2745static int __devinit
2641pciserial_init_one(struct pci_dev *dev, const struct pci_device_id *ent) 2746pciserial_init_one(struct pci_dev *dev, const struct pci_device_id *ent)
2642{ 2747{
2748 struct pci_serial_quirk *quirk;
2643 struct serial_private *priv; 2749 struct serial_private *priv;
2644 const struct pciserial_board *board; 2750 const struct pciserial_board *board;
2645 struct pciserial_board tmp; 2751 struct pciserial_board tmp;
2646 int rc; 2752 int rc;
2647 2753
2754 quirk = find_quirk(dev);
2755 if (quirk->probe) {
2756 rc = quirk->probe(dev);
2757 if (rc)
2758 return rc;
2759 }
2760
2648 if (ent->driver_data >= ARRAY_SIZE(pci_boards)) { 2761 if (ent->driver_data >= ARRAY_SIZE(pci_boards)) {
2649 printk(KERN_ERR "pci_init_one: invalid driver_data: %ld\n", 2762 printk(KERN_ERR "pci_init_one: invalid driver_data: %ld\n",
2650 ent->driver_data); 2763 ent->driver_data);
@@ -2654,6 +2767,7 @@ pciserial_init_one(struct pci_dev *dev, const struct pci_device_id *ent)
2654 board = &pci_boards[ent->driver_data]; 2767 board = &pci_boards[ent->driver_data];
2655 2768
2656 rc = pci_enable_device(dev); 2769 rc = pci_enable_device(dev);
2770 pci_save_state(dev);
2657 if (rc) 2771 if (rc)
2658 return rc; 2772 return rc;
2659 2773
@@ -3885,6 +3999,27 @@ static struct pci_device_id serial_pci_tbl[] = {
3885 0xA000, 0x1000, 3999 0xA000, 0x1000,
3886 0, 0, pbn_b0_1_115200 }, 4000 0, 0, pbn_b0_1_115200 },
3887 4001
4002 /* the 9901 is a rebranded 9912 */
4003 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9912,
4004 0xA000, 0x1000,
4005 0, 0, pbn_b0_1_115200 },
4006
4007 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9922,
4008 0xA000, 0x1000,
4009 0, 0, pbn_b0_1_115200 },
4010
4011 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9904,
4012 0xA000, 0x1000,
4013 0, 0, pbn_b0_1_115200 },
4014
4015 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9900,
4016 0xA000, 0x1000,
4017 0, 0, pbn_b0_1_115200 },
4018
4019 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9900,
4020 0xA000, 0x3002,
4021 0, 0, pbn_NETMOS9900_2s_115200 },
4022
3888 /* 4023 /*
3889 * Best Connectivity PCI Multi I/O cards 4024 * Best Connectivity PCI Multi I/O cards
3890 */ 4025 */
@@ -3927,6 +4062,51 @@ static struct pci_device_id serial_pci_tbl[] = {
3927 { 0, } 4062 { 0, }
3928}; 4063};
3929 4064
4065static pci_ers_result_t serial8250_io_error_detected(struct pci_dev *dev,
4066 pci_channel_state_t state)
4067{
4068 struct serial_private *priv = pci_get_drvdata(dev);
4069
4070 if (state == pci_channel_io_perm_failure)
4071 return PCI_ERS_RESULT_DISCONNECT;
4072
4073 if (priv)
4074 pciserial_suspend_ports(priv);
4075
4076 pci_disable_device(dev);
4077
4078 return PCI_ERS_RESULT_NEED_RESET;
4079}
4080
4081static pci_ers_result_t serial8250_io_slot_reset(struct pci_dev *dev)
4082{
4083 int rc;
4084
4085 rc = pci_enable_device(dev);
4086
4087 if (rc)
4088 return PCI_ERS_RESULT_DISCONNECT;
4089
4090 pci_restore_state(dev);
4091 pci_save_state(dev);
4092
4093 return PCI_ERS_RESULT_RECOVERED;
4094}
4095
4096static void serial8250_io_resume(struct pci_dev *dev)
4097{
4098 struct serial_private *priv = pci_get_drvdata(dev);
4099
4100 if (priv)
4101 pciserial_resume_ports(priv);
4102}
4103
4104static struct pci_error_handlers serial8250_err_handler = {
4105 .error_detected = serial8250_io_error_detected,
4106 .slot_reset = serial8250_io_slot_reset,
4107 .resume = serial8250_io_resume,
4108};
4109
3930static struct pci_driver serial_pci_driver = { 4110static struct pci_driver serial_pci_driver = {
3931 .name = "serial", 4111 .name = "serial",
3932 .probe = pciserial_init_one, 4112 .probe = pciserial_init_one,
@@ -3936,6 +4116,7 @@ static struct pci_driver serial_pci_driver = {
3936 .resume = pciserial_resume_one, 4116 .resume = pciserial_resume_one,
3937#endif 4117#endif
3938 .id_table = serial_pci_tbl, 4118 .id_table = serial_pci_tbl,
4119 .err_handler = &serial8250_err_handler,
3939}; 4120};
3940 4121
3941static int __init serial8250_pci_init(void) 4122static int __init serial8250_pci_init(void)
diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 8f41e1123461..cb40b82daf36 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -1404,7 +1404,7 @@ config SERIAL_SC26XX
1404 1404
1405config SERIAL_SC26XX_CONSOLE 1405config SERIAL_SC26XX_CONSOLE
1406 bool "Console on SC2681/SC2692 serial port" 1406 bool "Console on SC2681/SC2692 serial port"
1407 depends on SERIAL_SC26XX 1407 depends on SERIAL_SC26XX=y
1408 select SERIAL_CORE_CONSOLE 1408 select SERIAL_CORE_CONSOLE
1409 help 1409 help
1410 Support for Console on SC2681/SC2692 serial ports. 1410 Support for Console on SC2681/SC2692 serial ports.
diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c
index 465210930890..846dfcd3ce0d 100644
--- a/drivers/tty/serial/pch_uart.c
+++ b/drivers/tty/serial/pch_uart.c
@@ -14,6 +14,7 @@
14 *along with this program; if not, write to the Free Software 14 *along with this program; if not, write to the Free Software
15 *Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. 15 *Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
16 */ 16 */
17#include <linux/kernel.h>
17#include <linux/serial_reg.h> 18#include <linux/serial_reg.h>
18#include <linux/slab.h> 19#include <linux/slab.h>
19#include <linux/module.h> 20#include <linux/module.h>
@@ -44,6 +45,7 @@ enum {
44/* Set the max number of UART port 45/* Set the max number of UART port
45 * Intel EG20T PCH: 4 port 46 * Intel EG20T PCH: 4 port
46 * OKI SEMICONDUCTOR ML7213 IOH: 3 port 47 * OKI SEMICONDUCTOR ML7213 IOH: 3 port
48 * OKI SEMICONDUCTOR ML7223 IOH: 2 port
47*/ 49*/
48#define PCH_UART_NR 4 50#define PCH_UART_NR 4
49 51
@@ -137,8 +139,6 @@ enum {
137#define PCH_UART_DLL 0x00 139#define PCH_UART_DLL 0x00
138#define PCH_UART_DLM 0x01 140#define PCH_UART_DLM 0x01
139 141
140#define DIV_ROUND(a, b) (((a) + ((b)/2)) / (b))
141
142#define PCH_UART_IID_RLS (PCH_UART_IIR_REI) 142#define PCH_UART_IID_RLS (PCH_UART_IIR_REI)
143#define PCH_UART_IID_RDR (PCH_UART_IIR_RRI) 143#define PCH_UART_IID_RDR (PCH_UART_IIR_RRI)
144#define PCH_UART_IID_RDR_TO (PCH_UART_IIR_RRI | PCH_UART_IIR_TOI) 144#define PCH_UART_IID_RDR_TO (PCH_UART_IIR_RRI | PCH_UART_IIR_TOI)
@@ -316,7 +316,7 @@ static int pch_uart_hal_set_line(struct eg20t_port *priv, int baud,
316 unsigned int dll, dlm, lcr; 316 unsigned int dll, dlm, lcr;
317 int div; 317 int div;
318 318
319 div = DIV_ROUND(priv->base_baud / 16, baud); 319 div = DIV_ROUND_CLOSEST(priv->base_baud / 16, baud);
320 if (div < 0 || USHRT_MAX <= div) { 320 if (div < 0 || USHRT_MAX <= div) {
321 dev_err(priv->port.dev, "Invalid Baud(div=0x%x)\n", div); 321 dev_err(priv->port.dev, "Invalid Baud(div=0x%x)\n", div);
322 return -EINVAL; 322 return -EINVAL;
@@ -1429,6 +1429,8 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev,
1429 goto init_port_hal_free; 1429 goto init_port_hal_free;
1430 } 1430 }
1431 1431
1432 pci_enable_msi(pdev);
1433
1432 iobase = pci_resource_start(pdev, 0); 1434 iobase = pci_resource_start(pdev, 0);
1433 mapbase = pci_resource_start(pdev, 1); 1435 mapbase = pci_resource_start(pdev, 1);
1434 priv->mapbase = mapbase; 1436 priv->mapbase = mapbase;
@@ -1485,6 +1487,8 @@ static void pch_uart_pci_remove(struct pci_dev *pdev)
1485 struct eg20t_port *priv; 1487 struct eg20t_port *priv;
1486 1488
1487 priv = (struct eg20t_port *)pci_get_drvdata(pdev); 1489 priv = (struct eg20t_port *)pci_get_drvdata(pdev);
1490
1491 pci_disable_msi(pdev);
1488 pch_uart_exit_port(priv); 1492 pch_uart_exit_port(priv);
1489 pci_disable_device(pdev); 1493 pci_disable_device(pdev);
1490 kfree(priv); 1494 kfree(priv);
@@ -1568,6 +1572,7 @@ static int __devinit pch_uart_pci_probe(struct pci_dev *pdev,
1568 return ret; 1572 return ret;
1569 1573
1570probe_disable_device: 1574probe_disable_device:
1575 pci_disable_msi(pdev);
1571 pci_disable_device(pdev); 1576 pci_disable_device(pdev);
1572probe_error: 1577probe_error:
1573 return ret; 1578 return ret;
diff --git a/drivers/tty/serial/s5pv210.c b/drivers/tty/serial/s5pv210.c
index 8dd160c96e87..8b0b888a1b76 100644
--- a/drivers/tty/serial/s5pv210.c
+++ b/drivers/tty/serial/s5pv210.c
@@ -18,6 +18,7 @@
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/serial_core.h> 19#include <linux/serial_core.h>
20#include <linux/serial.h> 20#include <linux/serial.h>
21#include <linux/delay.h>
21 22
22#include <asm/irq.h> 23#include <asm/irq.h>
23#include <mach/hardware.h> 24#include <mach/hardware.h>
@@ -83,6 +84,9 @@ static int s5pv210_serial_resetport(struct uart_port *port,
83 wr_regl(port, S3C2410_UFCON, cfg->ufcon | S3C2410_UFCON_RESETBOTH); 84 wr_regl(port, S3C2410_UFCON, cfg->ufcon | S3C2410_UFCON_RESETBOTH);
84 wr_regl(port, S3C2410_UFCON, cfg->ufcon); 85 wr_regl(port, S3C2410_UFCON, cfg->ufcon);
85 86
87 /* It is need to delay When reset FIFO register */
88 udelay(1);
89
86 return 0; 90 return 0;
87} 91}
88 92
diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
index 7ead42104c67..afc629423152 100644
--- a/drivers/tty/serial/samsung.c
+++ b/drivers/tty/serial/samsung.c
@@ -1194,12 +1194,10 @@ int __devexit s3c24xx_serial_remove(struct platform_device *dev)
1194EXPORT_SYMBOL_GPL(s3c24xx_serial_remove); 1194EXPORT_SYMBOL_GPL(s3c24xx_serial_remove);
1195 1195
1196/* UART power management code */ 1196/* UART power management code */
1197 1197#ifdef CONFIG_PM_SLEEP
1198#ifdef CONFIG_PM 1198static int s3c24xx_serial_suspend(struct device *dev)
1199
1200static int s3c24xx_serial_suspend(struct platform_device *dev, pm_message_t state)
1201{ 1199{
1202 struct uart_port *port = s3c24xx_dev_to_port(&dev->dev); 1200 struct uart_port *port = s3c24xx_dev_to_port(dev);
1203 1201
1204 if (port) 1202 if (port)
1205 uart_suspend_port(&s3c24xx_uart_drv, port); 1203 uart_suspend_port(&s3c24xx_uart_drv, port);
@@ -1207,9 +1205,9 @@ static int s3c24xx_serial_suspend(struct platform_device *dev, pm_message_t stat
1207 return 0; 1205 return 0;
1208} 1206}
1209 1207
1210static int s3c24xx_serial_resume(struct platform_device *dev) 1208static int s3c24xx_serial_resume(struct device *dev)
1211{ 1209{
1212 struct uart_port *port = s3c24xx_dev_to_port(&dev->dev); 1210 struct uart_port *port = s3c24xx_dev_to_port(dev);
1213 struct s3c24xx_uart_port *ourport = to_ourport(port); 1211 struct s3c24xx_uart_port *ourport = to_ourport(port);
1214 1212
1215 if (port) { 1213 if (port) {
@@ -1222,17 +1220,20 @@ static int s3c24xx_serial_resume(struct platform_device *dev)
1222 1220
1223 return 0; 1221 return 0;
1224} 1222}
1225#endif 1223
1224static const struct dev_pm_ops s3c24xx_serial_pm_ops = {
1225 .suspend = s3c24xx_serial_suspend,
1226 .resume = s3c24xx_serial_resume,
1227};
1228#else /* !CONFIG_PM_SLEEP */
1229#define s3c24xx_serial_pm_ops NULL
1230#endif /* CONFIG_PM_SLEEP */
1226 1231
1227int s3c24xx_serial_init(struct platform_driver *drv, 1232int s3c24xx_serial_init(struct platform_driver *drv,
1228 struct s3c24xx_uart_info *info) 1233 struct s3c24xx_uart_info *info)
1229{ 1234{
1230 dbg("s3c24xx_serial_init(%p,%p)\n", drv, info); 1235 dbg("s3c24xx_serial_init(%p,%p)\n", drv, info);
1231 1236 drv->driver.pm = &s3c24xx_serial_pm_ops;
1232#ifdef CONFIG_PM
1233 drv->suspend = s3c24xx_serial_suspend;
1234 drv->resume = s3c24xx_serial_resume;
1235#endif
1236 1237
1237 return platform_driver_register(drv); 1238 return platform_driver_register(drv);
1238} 1239}