From 667a4a62b3a0d7406fb7ccece7b0e86b79aa2f70 Mon Sep 17 00:00:00 2001 From: Mayank Rana Date: Fri, 27 Mar 2020 14:44:24 -0700 Subject: [PATCH] usb: phy: Keep regulators on in probe if EUD is enabled EUD may be enable in boot loader and to keep EUD session alive across kernel boot till USB phy driver is initialized based on cable status, keep regulators on from USB high speed phy driver's probe. Regulators shall get turn off while handling USB cable disconnect routine for both boot up with and without USB cable case. Change-Id: Ic6ac92be11a91c18ec89c39f17d7c445dee98263 Signed-off-by: Mayank Rana --- drivers/usb/phy/phy-msm-snps-hs.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/usb/phy/phy-msm-snps-hs.c b/drivers/usb/phy/phy-msm-snps-hs.c index 9f6b7fdc4832..121669dfe89b 100644 --- a/drivers/usb/phy/phy-msm-snps-hs.c +++ b/drivers/usb/phy/phy-msm-snps-hs.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. */ #include @@ -799,6 +799,13 @@ static int msm_hsphy_probe(struct platform_device *pdev) msm_hsphy_create_debugfs(phy); + /* + * EUD may be enable in boot loader and to keep EUD session alive across + * kernel boot till USB phy driver is initialized based on cable status, + * keep LDOs on here. + */ + if (phy->eud_enable_reg && readl_relaxed(phy->eud_enable_reg)) + msm_hsphy_enable_power(phy, true); return 0; err_ret: