1
0
Fork 0

MLK-23765 usb: phy: mxs: increase the TVDPSRC_ON value

The default 40ms is the minimum value according to BC 1.2 spec,
it works not well for Type-C port when connected with DCP charger.
Like this ticket described, the DCP charger will be recognized as
SDP. After increasing TVDPSRC_ON value to 240ms, the Type-C port could
work well with DCP charger.

imx8dxl mek, imx7ulp evk and imx8qxp mek are tested.

Reviewed-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
5.4-rM2-2.2.x-imx-squashed
Peter Chen 2020-06-10 19:01:54 +08:00
parent f45a6bb1d4
commit 1a418446c3
No known key found for this signature in database
GPG Key ID: 4859298150D671BB
1 changed files with 9 additions and 0 deletions

View File

@ -139,6 +139,7 @@
#define DCD_CONTROL 0x800
#define DCD_CLOCK (DCD_CONTROL + 0x4)
#define DCD_STATUS (DCD_CONTROL + 0x8)
#define DCD_TIMER1 (DCD_CONTROL + 0x14)
#define DCD_CONTROL_SR BIT(25)
#define DCD_CONTROL_START BIT(24)
@ -161,6 +162,9 @@
#define DCD_CDP_PORT BIT(17)
#define DCD_DCP_PORT (BIT(16) | BIT(17))
#define DCD_TVDPSRC_ON_MASK GENMASK(9, 0)
#define DCD_TVDPSRC_ON_VALUE 0xf0 /* 240ms */
#define to_mxs_phy(p) container_of((p), struct mxs_phy, phy)
/* Do disconnection between PHY and controller without vbus */
@ -888,6 +892,11 @@ static int mxs_phy_dcd_start(struct mxs_phy *mxs_phy)
writel(((mxs_phy->clk_rate / 1000000) << 2) | DCD_CLOCK_MHZ,
base + DCD_CLOCK);
value = readl(base + DCD_TIMER1);
value &= ~DCD_TVDPSRC_ON_MASK;
value |= DCD_TVDPSRC_ON_VALUE;
writel(value, base + DCD_TIMER1);
value = readl(base + DCD_CONTROL);
value &= ~DCD_CONTROL_IE;
writel(value | DCD_CONTROL_BC12, base + DCD_CONTROL);