Skip to content

Commit c0250fe

Browse files
Chunfeng Yunkishon
authored andcommitted
phy: phy-mt65xx-usb3: disable 100uA extraction from SS port to HS port
There will be a problem if SS port is diasbled and HS port extracts 100uA from SS port, so disable extract 100uA from SS port in the case, when disable it, PA0_RG_USB20_INTR_EN should be set, otherwise HS port only works on LS. Signed-off-by: Chunfeng Yun <[email protected]> Signed-off-by: Kishon Vijay Abraham I <[email protected]>
1 parent 8d6e195 commit c0250fe

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

drivers/phy/phy-mt65xx-usb3.c

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646

4747
#define U3P_USBPHYACR0 0x000
4848
#define PA0_RG_U2PLL_FORCE_ON BIT(15)
49+
#define PA0_RG_USB20_INTR_EN BIT(5)
4950

5051
#define U3P_USBPHYACR2 0x008
5152
#define PA2_RG_SIF_U2PLL_FORCE_EN BIT(18)
@@ -339,6 +340,15 @@ static void phy_instance_init(struct mt65xx_u3phy *u3phy,
339340
tmp &= ~P2C_RG_UART_EN;
340341
writel(tmp, com + U3P_U2PHYDTM1);
341342

343+
tmp = readl(com + U3P_USBPHYACR0);
344+
tmp |= PA0_RG_USB20_INTR_EN;
345+
writel(tmp, com + U3P_USBPHYACR0);
346+
347+
/* disable switch 100uA current to SSUSB */
348+
tmp = readl(com + U3P_USBPHYACR5);
349+
tmp &= ~PA5_RG_U2_HS_100U_U3_EN;
350+
writel(tmp, com + U3P_USBPHYACR5);
351+
342352
if (!index) {
343353
tmp = readl(com + U3P_U2PHYACR4);
344354
tmp &= ~P2C_U2_GPIO_CTR_MSK;
@@ -393,13 +403,6 @@ static void phy_instance_power_on(struct mt65xx_u3phy *u3phy,
393403
tmp |= PA6_RG_U2_OTG_VBUSCMP_EN;
394404
writel(tmp, com + U3P_USBPHYACR6);
395405

396-
if (!index) {
397-
/* switch 100uA current to SSUSB */
398-
tmp = readl(com + U3P_USBPHYACR5);
399-
tmp |= PA5_RG_U2_HS_100U_U3_EN;
400-
writel(tmp, com + U3P_USBPHYACR5);
401-
}
402-
403406
tmp = readl(com + U3P_U2PHYDTM1);
404407
tmp |= P2C_RG_VBUSVALID | P2C_RG_AVALID;
405408
tmp &= ~P2C_RG_SESSEND;
@@ -435,13 +438,6 @@ static void phy_instance_power_off(struct mt65xx_u3phy *u3phy,
435438
tmp &= ~PA6_RG_U2_OTG_VBUSCMP_EN;
436439
writel(tmp, com + U3P_USBPHYACR6);
437440

438-
if (!index) {
439-
/* switch 100uA current back to USB2.0 */
440-
tmp = readl(com + U3P_USBPHYACR5);
441-
tmp &= ~PA5_RG_U2_HS_100U_U3_EN;
442-
writel(tmp, com + U3P_USBPHYACR5);
443-
}
444-
445441
/* let suspendm=0, set utmi into analog power down */
446442
tmp = readl(com + U3P_U2PHYDTM0);
447443
tmp &= ~P2C_RG_SUSPENDM;

0 commit comments

Comments
 (0)