diff options
author | Abhijeet Dharmapurikar <adharmap@codeaurora.org> | 2010-05-20 18:20:23 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-06-04 16:37:16 -0400 |
commit | 18c79d76ece432a48c985ea404800f8ee154ada2 (patch) | |
tree | 864f598be56999e4437e01a413d1c72beb78d75e /drivers/serial/msm_serial.c | |
parent | ad8456361fa19068cf49b50a4f98e41b73c08e76 (diff) |
msm_serial: fix serial on trout
Set the mnd counter based on uartclk. This fixes a problem
on 7x30 where the uartclk is 19.2Mhz rather than the usual
4.8Mhz.
Trout incorrectly reports uartclk to be running at 19.2Mhz
It is actually running at 4.8Mhz. For trout force mnd
counter values as if uartclk was fed by tcxo/4.
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
[dwalker@codeaurora.org: inlined, moved into header, added comments.]
Signed-off-by: Daniel Walker <dwalker@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/serial/msm_serial.c')
-rw-r--r-- | drivers/serial/msm_serial.c | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/drivers/serial/msm_serial.c b/drivers/serial/msm_serial.c index ecdc0facf7ee..f8c816e7725d 100644 --- a/drivers/serial/msm_serial.c +++ b/drivers/serial/msm_serial.c | |||
@@ -41,19 +41,6 @@ struct msm_port { | |||
41 | unsigned int imr; | 41 | unsigned int imr; |
42 | }; | 42 | }; |
43 | 43 | ||
44 | #define UART_TO_MSM(uart_port) ((struct msm_port *) uart_port) | ||
45 | |||
46 | static inline void msm_write(struct uart_port *port, unsigned int val, | ||
47 | unsigned int off) | ||
48 | { | ||
49 | __raw_writel(val, port->membase + off); | ||
50 | } | ||
51 | |||
52 | static inline unsigned int msm_read(struct uart_port *port, unsigned int off) | ||
53 | { | ||
54 | return __raw_readl(port->membase + off); | ||
55 | } | ||
56 | |||
57 | static void msm_stop_tx(struct uart_port *port) | 44 | static void msm_stop_tx(struct uart_port *port) |
58 | { | 45 | { |
59 | struct msm_port *msm_port = UART_TO_MSM(port); | 46 | struct msm_port *msm_port = UART_TO_MSM(port); |
@@ -320,11 +307,7 @@ static void msm_init_clock(struct uart_port *port) | |||
320 | struct msm_port *msm_port = UART_TO_MSM(port); | 307 | struct msm_port *msm_port = UART_TO_MSM(port); |
321 | 308 | ||
322 | clk_enable(msm_port->clk); | 309 | clk_enable(msm_port->clk); |
323 | 310 | msm_serial_set_mnd_regs(port); | |
324 | msm_write(port, 0xC0, UART_MREG); | ||
325 | msm_write(port, 0xB2, UART_NREG); | ||
326 | msm_write(port, 0x7D, UART_DREG); | ||
327 | msm_write(port, 0x1C, UART_MNDREG); | ||
328 | } | 311 | } |
329 | 312 | ||
330 | static int msm_startup(struct uart_port *port) | 313 | static int msm_startup(struct uart_port *port) |
@@ -706,6 +689,8 @@ static int __init msm_serial_probe(struct platform_device *pdev) | |||
706 | if (unlikely(IS_ERR(msm_port->clk))) | 689 | if (unlikely(IS_ERR(msm_port->clk))) |
707 | return PTR_ERR(msm_port->clk); | 690 | return PTR_ERR(msm_port->clk); |
708 | port->uartclk = clk_get_rate(msm_port->clk); | 691 | port->uartclk = clk_get_rate(msm_port->clk); |
692 | printk(KERN_INFO "uartclk = %d\n", port->uartclk); | ||
693 | |||
709 | 694 | ||
710 | resource = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 695 | resource = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
711 | if (unlikely(!resource)) | 696 | if (unlikely(!resource)) |