tty: serial: msm: Only configure MND registers on hw that has it
authorStephen Boyd <sboyd@codeaurora.org>
Thu, 12 May 2016 01:02:27 +0000 (18:02 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 25 Jun 2016 17:23:54 +0000 (10:23 -0700)
The registers that msm_serial_set_mnd_regs() writes only exist on
the non-uartdm hardware, so let's return early here if this
function is called on uartdm hardware. This also prevents us from
messing up the uartclk variable if the uartclk rate happens to be
19.2 or 4.8 MHz.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Acked-by: Andy Gross <andy.gross@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/msm_serial.c

index 28b8ac423de11e90ce5460e5d590bdfa942c1278..a051dc5def24134e5e1f05aa44c4e1a10d935f1e 100644 (file)
@@ -232,6 +232,15 @@ static void msm_serial_set_mnd_regs_tcxoby4(struct uart_port *port)
 
 static void msm_serial_set_mnd_regs(struct uart_port *port)
 {
+       struct msm_port *msm_port = UART_TO_MSM(port);
+
+       /*
+        * These registers don't exist so we change the clk input rate
+        * on uartdm hardware instead
+        */
+       if (msm_port->is_uartdm)
+               return;
+
        if (port->uartclk == 19200000)
                msm_serial_set_mnd_regs_tcxo(port);
        else if (port->uartclk == 4800000)