aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/s3c2410.c
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2005-12-06 17:31:30 -0500
committerLen Brown <len.brown@intel.com>2005-12-06 17:31:30 -0500
commit3d5271f9883cba7b54762bc4fe027d4172f06db7 (patch)
treeab8a881a14478598a0c8bda0d26c62cdccfffd6d /drivers/serial/s3c2410.c
parent378b2556f4e09fa6f87ff0cb5c4395ff28257d02 (diff)
parent9115a6c787596e687df03010d97fccc5e0762506 (diff)
Pull release into acpica branch
Diffstat (limited to 'drivers/serial/s3c2410.c')
-rw-r--r--drivers/serial/s3c2410.c75
1 files changed, 39 insertions, 36 deletions
diff --git a/drivers/serial/s3c2410.c b/drivers/serial/s3c2410.c
index c361c6fb0809..47681c4654e4 100644
--- a/drivers/serial/s3c2410.c
+++ b/drivers/serial/s3c2410.c
@@ -63,7 +63,7 @@
63 63
64#include <linux/module.h> 64#include <linux/module.h>
65#include <linux/ioport.h> 65#include <linux/ioport.h>
66#include <linux/device.h> 66#include <linux/platform_device.h>
67#include <linux/init.h> 67#include <linux/init.h>
68#include <linux/sysrq.h> 68#include <linux/sysrq.h>
69#include <linux/console.h> 69#include <linux/console.h>
@@ -82,8 +82,6 @@
82#include <asm/arch/regs-serial.h> 82#include <asm/arch/regs-serial.h>
83#include <asm/arch/regs-gpio.h> 83#include <asm/arch/regs-gpio.h>
84 84
85#include <asm/mach-types.h>
86
87/* structures */ 85/* structures */
88 86
89struct s3c24xx_uart_info { 87struct s3c24xx_uart_info {
@@ -753,8 +751,8 @@ static void s3c24xx_serial_set_termios(struct uart_port *port,
753{ 751{
754 struct s3c2410_uartcfg *cfg = s3c24xx_port_to_cfg(port); 752 struct s3c2410_uartcfg *cfg = s3c24xx_port_to_cfg(port);
755 struct s3c24xx_uart_port *ourport = to_ourport(port); 753 struct s3c24xx_uart_port *ourport = to_ourport(port);
756 struct s3c24xx_uart_clksrc *clksrc; 754 struct s3c24xx_uart_clksrc *clksrc = NULL;
757 struct clk *clk; 755 struct clk *clk = NULL;
758 unsigned long flags; 756 unsigned long flags;
759 unsigned int baud, quot; 757 unsigned int baud, quot;
760 unsigned int ulcon; 758 unsigned int ulcon;
@@ -1094,14 +1092,13 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport,
1094 1092
1095static int probe_index = 0; 1093static int probe_index = 0;
1096 1094
1097int s3c24xx_serial_probe(struct device *_dev, 1095static int s3c24xx_serial_probe(struct platform_device *dev,
1098 struct s3c24xx_uart_info *info) 1096 struct s3c24xx_uart_info *info)
1099{ 1097{
1100 struct s3c24xx_uart_port *ourport; 1098 struct s3c24xx_uart_port *ourport;
1101 struct platform_device *dev = to_platform_device(_dev);
1102 int ret; 1099 int ret;
1103 1100
1104 dbg("s3c24xx_serial_probe(%p, %p) %d\n", _dev, info, probe_index); 1101 dbg("s3c24xx_serial_probe(%p, %p) %d\n", dev, info, probe_index);
1105 1102
1106 ourport = &s3c24xx_serial_ports[probe_index]; 1103 ourport = &s3c24xx_serial_ports[probe_index];
1107 probe_index++; 1104 probe_index++;
@@ -1114,7 +1111,7 @@ int s3c24xx_serial_probe(struct device *_dev,
1114 1111
1115 dbg("%s: adding port\n", __FUNCTION__); 1112 dbg("%s: adding port\n", __FUNCTION__);
1116 uart_add_one_port(&s3c24xx_uart_drv, &ourport->port); 1113 uart_add_one_port(&s3c24xx_uart_drv, &ourport->port);
1117 dev_set_drvdata(_dev, &ourport->port); 1114 platform_set_drvdata(dev, &ourport->port);
1118 1115
1119 return 0; 1116 return 0;
1120 1117
@@ -1122,9 +1119,9 @@ int s3c24xx_serial_probe(struct device *_dev,
1122 return ret; 1119 return ret;
1123} 1120}
1124 1121
1125int s3c24xx_serial_remove(struct device *_dev) 1122static int s3c24xx_serial_remove(struct platform_device *dev)
1126{ 1123{
1127 struct uart_port *port = s3c24xx_dev_to_port(_dev); 1124 struct uart_port *port = s3c24xx_dev_to_port(&dev->dev);
1128 1125
1129 if (port) 1126 if (port)
1130 uart_remove_one_port(&s3c24xx_uart_drv, port); 1127 uart_remove_one_port(&s3c24xx_uart_drv, port);
@@ -1136,22 +1133,22 @@ int s3c24xx_serial_remove(struct device *_dev)
1136 1133
1137#ifdef CONFIG_PM 1134#ifdef CONFIG_PM
1138 1135
1139int s3c24xx_serial_suspend(struct device *dev, pm_message_t state, u32 level) 1136static int s3c24xx_serial_suspend(struct platform_device *dev, pm_message_t state)
1140{ 1137{
1141 struct uart_port *port = s3c24xx_dev_to_port(dev); 1138 struct uart_port *port = s3c24xx_dev_to_port(&dev->dev);
1142 1139
1143 if (port && level == SUSPEND_DISABLE) 1140 if (port)
1144 uart_suspend_port(&s3c24xx_uart_drv, port); 1141 uart_suspend_port(&s3c24xx_uart_drv, port);
1145 1142
1146 return 0; 1143 return 0;
1147} 1144}
1148 1145
1149int s3c24xx_serial_resume(struct device *dev, u32 level) 1146static int s3c24xx_serial_resume(struct platform_device *dev)
1150{ 1147{
1151 struct uart_port *port = s3c24xx_dev_to_port(dev); 1148 struct uart_port *port = s3c24xx_dev_to_port(&dev->dev);
1152 struct s3c24xx_uart_port *ourport = to_ourport(port); 1149 struct s3c24xx_uart_port *ourport = to_ourport(port);
1153 1150
1154 if (port && level == RESUME_ENABLE) { 1151 if (port) {
1155 clk_enable(ourport->clk); 1152 clk_enable(ourport->clk);
1156 s3c24xx_serial_resetport(port, s3c24xx_port_to_cfg(port)); 1153 s3c24xx_serial_resetport(port, s3c24xx_port_to_cfg(port));
1157 clk_disable(ourport->clk); 1154 clk_disable(ourport->clk);
@@ -1167,11 +1164,11 @@ int s3c24xx_serial_resume(struct device *dev, u32 level)
1167#define s3c24xx_serial_resume NULL 1164#define s3c24xx_serial_resume NULL
1168#endif 1165#endif
1169 1166
1170int s3c24xx_serial_init(struct device_driver *drv, 1167static int s3c24xx_serial_init(struct platform_driver *drv,
1171 struct s3c24xx_uart_info *info) 1168 struct s3c24xx_uart_info *info)
1172{ 1169{
1173 dbg("s3c24xx_serial_init(%p,%p)\n", drv, info); 1170 dbg("s3c24xx_serial_init(%p,%p)\n", drv, info);
1174 return driver_register(drv); 1171 return platform_driver_register(drv);
1175} 1172}
1176 1173
1177 1174
@@ -1230,18 +1227,20 @@ static struct s3c24xx_uart_info s3c2400_uart_inf = {
1230 .reset_port = s3c2400_serial_resetport, 1227 .reset_port = s3c2400_serial_resetport,
1231}; 1228};
1232 1229
1233static int s3c2400_serial_probe(struct device *dev) 1230static int s3c2400_serial_probe(struct platform_device *dev)
1234{ 1231{
1235 return s3c24xx_serial_probe(dev, &s3c2400_uart_inf); 1232 return s3c24xx_serial_probe(dev, &s3c2400_uart_inf);
1236} 1233}
1237 1234
1238static struct device_driver s3c2400_serial_drv = { 1235static struct platform_driver s3c2400_serial_drv = {
1239 .name = "s3c2400-uart",
1240 .bus = &platform_bus_type,
1241 .probe = s3c2400_serial_probe, 1236 .probe = s3c2400_serial_probe,
1242 .remove = s3c24xx_serial_remove, 1237 .remove = s3c24xx_serial_remove,
1243 .suspend = s3c24xx_serial_suspend, 1238 .suspend = s3c24xx_serial_suspend,
1244 .resume = s3c24xx_serial_resume, 1239 .resume = s3c24xx_serial_resume,
1240 .driver = {
1241 .name = "s3c2400-uart",
1242 .owner = THIS_MODULE,
1243 },
1245}; 1244};
1246 1245
1247static inline int s3c2400_serial_init(void) 1246static inline int s3c2400_serial_init(void)
@@ -1251,7 +1250,7 @@ static inline int s3c2400_serial_init(void)
1251 1250
1252static inline void s3c2400_serial_exit(void) 1251static inline void s3c2400_serial_exit(void)
1253{ 1252{
1254 driver_unregister(&s3c2400_serial_drv); 1253 platform_driver_unregister(&s3c2400_serial_drv);
1255} 1254}
1256 1255
1257#define s3c2400_uart_inf_at &s3c2400_uart_inf 1256#define s3c2400_uart_inf_at &s3c2400_uart_inf
@@ -1333,18 +1332,20 @@ static struct s3c24xx_uart_info s3c2410_uart_inf = {
1333 1332
1334/* device management */ 1333/* device management */
1335 1334
1336static int s3c2410_serial_probe(struct device *dev) 1335static int s3c2410_serial_probe(struct platform_device *dev)
1337{ 1336{
1338 return s3c24xx_serial_probe(dev, &s3c2410_uart_inf); 1337 return s3c24xx_serial_probe(dev, &s3c2410_uart_inf);
1339} 1338}
1340 1339
1341static struct device_driver s3c2410_serial_drv = { 1340static struct platform_driver s3c2410_serial_drv = {
1342 .name = "s3c2410-uart",
1343 .bus = &platform_bus_type,
1344 .probe = s3c2410_serial_probe, 1341 .probe = s3c2410_serial_probe,
1345 .remove = s3c24xx_serial_remove, 1342 .remove = s3c24xx_serial_remove,
1346 .suspend = s3c24xx_serial_suspend, 1343 .suspend = s3c24xx_serial_suspend,
1347 .resume = s3c24xx_serial_resume, 1344 .resume = s3c24xx_serial_resume,
1345 .driver = {
1346 .name = "s3c2410-uart",
1347 .owner = THIS_MODULE,
1348 },
1348}; 1349};
1349 1350
1350static inline int s3c2410_serial_init(void) 1351static inline int s3c2410_serial_init(void)
@@ -1354,7 +1355,7 @@ static inline int s3c2410_serial_init(void)
1354 1355
1355static inline void s3c2410_serial_exit(void) 1356static inline void s3c2410_serial_exit(void)
1356{ 1357{
1357 driver_unregister(&s3c2410_serial_drv); 1358 platform_driver_unregister(&s3c2410_serial_drv);
1358} 1359}
1359 1360
1360#define s3c2410_uart_inf_at &s3c2410_uart_inf 1361#define s3c2410_uart_inf_at &s3c2410_uart_inf
@@ -1493,19 +1494,21 @@ static struct s3c24xx_uart_info s3c2440_uart_inf = {
1493 1494
1494/* device management */ 1495/* device management */
1495 1496
1496static int s3c2440_serial_probe(struct device *dev) 1497static int s3c2440_serial_probe(struct platform_device *dev)
1497{ 1498{
1498 dbg("s3c2440_serial_probe: dev=%p\n", dev); 1499 dbg("s3c2440_serial_probe: dev=%p\n", dev);
1499 return s3c24xx_serial_probe(dev, &s3c2440_uart_inf); 1500 return s3c24xx_serial_probe(dev, &s3c2440_uart_inf);
1500} 1501}
1501 1502
1502static struct device_driver s3c2440_serial_drv = { 1503static struct platform_driver s3c2440_serial_drv = {
1503 .name = "s3c2440-uart",
1504 .bus = &platform_bus_type,
1505 .probe = s3c2440_serial_probe, 1504 .probe = s3c2440_serial_probe,
1506 .remove = s3c24xx_serial_remove, 1505 .remove = s3c24xx_serial_remove,
1507 .suspend = s3c24xx_serial_suspend, 1506 .suspend = s3c24xx_serial_suspend,
1508 .resume = s3c24xx_serial_resume, 1507 .resume = s3c24xx_serial_resume,
1508 .driver = {
1509 .name = "s3c2440-uart",
1510 .owner = THIS_MODULE,
1511 },
1509}; 1512};
1510 1513
1511 1514
@@ -1516,7 +1519,7 @@ static inline int s3c2440_serial_init(void)
1516 1519
1517static inline void s3c2440_serial_exit(void) 1520static inline void s3c2440_serial_exit(void)
1518{ 1521{
1519 driver_unregister(&s3c2440_serial_drv); 1522 platform_driver_unregister(&s3c2440_serial_drv);
1520} 1523}
1521 1524
1522#define s3c2440_uart_inf_at &s3c2440_uart_inf 1525#define s3c2440_uart_inf_at &s3c2440_uart_inf