提交 54e9e087 编写于 作者: H Holger Brunck 提交者: David S. Miller

net/wan/fsl_ucc_hdlc: call qe_setbrg only for loopback mode

We can't assume that we are always in loopback mode if rx and tx clock
have the same clock source. If we want to use HDLC busmode we also have
the same clock source but we are not in loopback mode. So move the
setting of the baudrate generator after the check for property for the
loopback mode.
Signed-off-by: NHolger Brunck <holger.brunck@keymile.com>
Cc: Zhao Qiang <qiang.zhao@nxp.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 5b8aad93
......@@ -113,6 +113,9 @@ static int uhdlc_init(struct ucc_hdlc_private *priv)
/* Loopback mode */
if (priv->loopback) {
dev_info(priv->dev, "Loopback Mode\n");
/* use the same clock when work in loopback */
qe_setbrg(ut_info->uf_info.rx_clock, 20000000, 1);
gumr = ioread32be(&priv->uf_regs->gumr);
gumr |= (UCC_FAST_GUMR_LOOPBACK | UCC_FAST_GUMR_CDS |
UCC_FAST_GUMR_TCI);
......@@ -1021,10 +1024,6 @@ static int ucc_hdlc_probe(struct platform_device *pdev)
return -EINVAL;
}
/* use the same clock when work in loopback */
if (ut_info->uf_info.rx_clock == ut_info->uf_info.tx_clock)
qe_setbrg(ut_info->uf_info.rx_clock, 20000000, 1);
ret = of_address_to_resource(np, 0, &res);
if (ret)
return -EINVAL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册