serial: samsung: merge all SoC specific port reset functions
[pandora-kernel.git] / drivers / tty / serial / s3c2440.c
1 /*
2  * Driver for Samsung S3C2440 and S3C2442 SoC onboard UARTs.
3  *
4  * Ben Dooks, Copyright (c) 2003-2008 Simtec Electronics
5  *      http://armlinux.simtec.co.uk/
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License version 2 as
9  * published by the Free Software Foundation.
10 */
11
12 #include <linux/module.h>
13 #include <linux/ioport.h>
14 #include <linux/io.h>
15 #include <linux/platform_device.h>
16 #include <linux/init.h>
17 #include <linux/serial_core.h>
18 #include <linux/serial.h>
19
20 #include <asm/irq.h>
21 #include <mach/hardware.h>
22
23 #include <plat/regs-serial.h>
24 #include <mach/regs-gpio.h>
25
26 #include "samsung.h"
27
28 static struct s3c24xx_uart_info s3c2440_uart_inf = {
29         .name           = "Samsung S3C2440 UART",
30         .type           = PORT_S3C2440,
31         .fifosize       = 64,
32         .rx_fifomask    = S3C2440_UFSTAT_RXMASK,
33         .rx_fifoshift   = S3C2440_UFSTAT_RXSHIFT,
34         .rx_fifofull    = S3C2440_UFSTAT_RXFULL,
35         .tx_fifofull    = S3C2440_UFSTAT_TXFULL,
36         .tx_fifomask    = S3C2440_UFSTAT_TXMASK,
37         .tx_fifoshift   = S3C2440_UFSTAT_TXSHIFT,
38         .def_clk_sel    = S3C2410_UCON_CLKSEL2,
39         .num_clks       = 4,
40         .clksel_mask    = S3C2440_UCON_CLKMASK,
41         .clksel_shift   = S3C2440_UCON_CLKSHIFT,
42 };
43
44 /* device management */
45
46 static int s3c2440_serial_probe(struct platform_device *dev)
47 {
48         dbg("s3c2440_serial_probe: dev=%p\n", dev);
49         return s3c24xx_serial_probe(dev, &s3c2440_uart_inf);
50 }
51
52 static struct platform_driver s3c2440_serial_driver = {
53         .probe          = s3c2440_serial_probe,
54         .remove         = __devexit_p(s3c24xx_serial_remove),
55         .driver         = {
56                 .name   = "s3c2440-uart",
57                 .owner  = THIS_MODULE,
58         },
59 };
60
61 static int __init s3c2440_serial_init(void)
62 {
63         return s3c24xx_serial_init(&s3c2440_serial_driver, &s3c2440_uart_inf);
64 }
65
66 static void __exit s3c2440_serial_exit(void)
67 {
68         platform_driver_unregister(&s3c2440_serial_driver);
69 }
70
71 module_init(s3c2440_serial_init);
72 module_exit(s3c2440_serial_exit);
73
74 MODULE_DESCRIPTION("Samsung S3C2440,S3C2442 SoC Serial port driver");
75 MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>");
76 MODULE_LICENSE("GPL v2");
77 MODULE_ALIAS("platform:s3c2440-uart");