1
0
Fork 0

tty: serial: imx: add modem device reset

Add modem device reset for Bluetooth device.
The device reset is optional.

Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
5.4-rM2-2.2.x-imx-squashed
Fugang Duan 2019-05-16 13:52:57 +08:00 committed by Dong Aisheng
parent 926ebffe56
commit 8ee7d8348e
1 changed files with 9 additions and 0 deletions

View File

@ -26,6 +26,7 @@
#include <linux/delay.h>
#include <linux/pinctrl/consumer.h>
#include <linux/rational.h>
#include <linux/reset.h>
#include <linux/slab.h>
#include <linux/of.h>
#include <linux/of_device.h>
@ -1326,11 +1327,19 @@ static void imx_uart_disable_dma(struct imx_port *sport)
static int imx_uart_startup(struct uart_port *port)
{
struct imx_port *sport = (struct imx_port *)port;
struct tty_port *tty_port = &sport->port.state->port;
int retval, i;
unsigned long flags;
int dma_is_inited = 0;
u32 ucr1, ucr2, ucr4;
/* some modem may need reset */
if (!tty_port_suspended(tty_port)) {
retval = device_reset(sport->port.dev);
if (retval && retval != -ENOENT)
return retval;
}
retval = clk_prepare_enable(sport->clk_per);
if (retval)
return retval;