aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/s5pv210.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/tty/serial/s5pv210.c')
-rw-r--r--drivers/tty/serial/s5pv210.c60
1 files changed, 4 insertions, 56 deletions
diff --git a/drivers/tty/serial/s5pv210.c b/drivers/tty/serial/s5pv210.c
index 03b249e35bf1..173df5afb0fa 100644
--- a/drivers/tty/serial/s5pv210.c
+++ b/drivers/tty/serial/s5pv210.c
@@ -25,60 +25,6 @@
25#include <plat/regs-serial.h> 25#include <plat/regs-serial.h>
26#include "samsung.h" 26#include "samsung.h"
27 27
28static int s5pv210_serial_setsource(struct uart_port *port,
29 struct s3c24xx_uart_clksrc *clk)
30{
31 struct s3c24xx_uart_port *ourport;
32 struct s3c2410_uartcfg *cfg;
33 unsigned long ucon = rd_regl(port, S3C2410_UCON);
34
35 ourport = container_of(port, struct s3c24xx_uart_port, port);
36 cfg = ourport->cfg;
37
38 if (cfg->flags & NO_NEED_CHECK_CLKSRC)
39 return 0;
40
41 if (strcmp(clk->name, "pclk") == 0)
42 ucon &= ~S5PV210_UCON_CLKMASK;
43 else if (strcmp(clk->name, "uclk1") == 0)
44 ucon |= S5PV210_UCON_CLKMASK;
45 else {
46 printk(KERN_ERR "unknown clock source %s\n", clk->name);
47 return -EINVAL;
48 }
49
50 wr_regl(port, S3C2410_UCON, ucon);
51 return 0;
52}
53
54
55static int s5pv210_serial_getsource(struct uart_port *port,
56 struct s3c24xx_uart_clksrc *clk)
57{
58 struct s3c24xx_uart_port *ourport;
59 struct s3c2410_uartcfg *cfg;
60 u32 ucon = rd_regl(port, S3C2410_UCON);
61
62 ourport = container_of(port, struct s3c24xx_uart_port, port);
63 cfg = ourport->cfg;
64
65 clk->divisor = 1;
66
67 if (cfg->flags & NO_NEED_CHECK_CLKSRC)
68 return 0;
69
70 switch (ucon & S5PV210_UCON_CLKMASK) {
71 case S5PV210_UCON_PCLK:
72 clk->name = "pclk";
73 break;
74 case S5PV210_UCON_UCLK:
75 clk->name = "uclk1";
76 break;
77 }
78
79 return 0;
80}
81
82static int s5pv210_serial_resetport(struct uart_port *port, 28static int s5pv210_serial_resetport(struct uart_port *port,
83 struct s3c2410_uartcfg *cfg) 29 struct s3c2410_uartcfg *cfg)
84{ 30{
@@ -109,8 +55,10 @@ static int s5pv210_serial_resetport(struct uart_port *port,
109 .tx_fifofull = S5PV210_UFSTAT_TXFULL, \ 55 .tx_fifofull = S5PV210_UFSTAT_TXFULL, \
110 .tx_fifomask = S5PV210_UFSTAT_TXMASK, \ 56 .tx_fifomask = S5PV210_UFSTAT_TXMASK, \
111 .tx_fifoshift = S5PV210_UFSTAT_TXSHIFT, \ 57 .tx_fifoshift = S5PV210_UFSTAT_TXSHIFT, \
112 .get_clksrc = s5pv210_serial_getsource, \ 58 .def_clk_sel = S3C2410_UCON_CLKSEL0, \
113 .set_clksrc = s5pv210_serial_setsource, \ 59 .num_clks = 2, \
60 .clksel_mask = S5PV210_UCON_CLKMASK, \
61 .clksel_shift = S5PV210_UCON_CLKSHIFT, \
114 .reset_port = s5pv210_serial_resetport 62 .reset_port = s5pv210_serial_resetport
115 63
116static struct s3c24xx_uart_info s5p_port_fifo256 = { 64static struct s3c24xx_uart_info s5p_port_fifo256 = {