aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/samsung.c
diff options
context:
space:
mode:
authorThomas Abraham <thomas.abraham@linaro.org>2011-10-24 05:48:21 -0400
committerKukjin Kim <kgene.kim@samsung.com>2011-12-22 20:06:59 -0500
commit0dfb3b41be4ca3c9d1688f6c2d00bfa178356494 (patch)
treec0ea3c6ef69c90156016d8e9ec51cfa3c46226f9 /drivers/tty/serial/samsung.c
parent0cfb26e1fb9d7afe9c79a40a257808eafb2aff34 (diff)
serial: samsung: merge all SoC specific port reset functions
The port reset function in each of the platform specific extension performs the same operations and hence all the reset port functions can be merged into one and moved into the common samsung uart driver. The SoC specific port reset functions are removed from SoC extensions. Cc: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'drivers/tty/serial/samsung.c')
-rw-r--r--drivers/tty/serial/samsung.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
index dc5a4edbc450..78aea1a49ad8 100644
--- a/drivers/tty/serial/samsung.c
+++ b/drivers/tty/serial/samsung.c
@@ -965,16 +965,29 @@ static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS
965 965
966/* s3c24xx_serial_resetport 966/* s3c24xx_serial_resetport
967 * 967 *
968 * wrapper to call the specific reset for this port (reset the fifos 968 * reset the fifos and other the settings.
969 * and the settings)
970*/ 969*/
971 970
972static inline int s3c24xx_serial_resetport(struct uart_port *port, 971static void s3c24xx_serial_resetport(struct uart_port *port,
973 struct s3c2410_uartcfg *cfg) 972 struct s3c2410_uartcfg *cfg)
974{ 973{
975 struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); 974 struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port);
975 unsigned long ucon = rd_regl(port, S3C2410_UCON);
976 unsigned int ucon_mask;
976 977
977 return (info->reset_port)(port, cfg); 978 ucon_mask = info->clksel_mask;
979 if (info->type == PORT_S3C2440)
980 ucon_mask |= S3C2440_UCON0_DIVMASK;
981
982 ucon &= ucon_mask;
983 wr_regl(port, S3C2410_UCON, ucon | cfg->ucon);
984
985 /* reset both fifos */
986 wr_regl(port, S3C2410_UFCON, cfg->ufcon | S3C2410_UFCON_RESETBOTH);
987 wr_regl(port, S3C2410_UFCON, cfg->ufcon);
988
989 /* some delay is required after fifo reset */
990 udelay(1);
978} 991}
979 992
980 993