diff options
author | Simon Shields <simon@lineageos.org> | 2018-08-07 19:06:43 +1000 |
---|---|---|
committer | Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> | 2020-03-28 01:15:31 +0100 |
commit | ad414fcb7b10036f8b59da672fb21b508a9a1fdf (patch) | |
tree | bc9c05da17a1dfb93fd3ad59c60a2542c28acbd6 /board | |
parent | 3869751c6ca01365d5c72e0061d34248804e8824 (diff) | |
download | u-boot-midas-ad414fcb7b10036f8b59da672fb21b508a9a1fdf.tar.gz u-boot-midas-ad414fcb7b10036f8b59da672fb21b508a9a1fdf.tar.bz2 u-boot-midas-ad414fcb7b10036f8b59da672fb21b508a9a1fdf.zip |
midas: fix USB after SW reset
make sure that all the USB regulators are toggled on/off
when activating/deactivating the PHY
Diffstat (limited to 'board')
-rw-r--r-- | board/samsung/midas/midas.c | 45 |
1 files changed, 40 insertions, 5 deletions
diff --git a/board/samsung/midas/midas.c b/board/samsung/midas/midas.c index dcc40b0fc4..b0a4771d74 100644 --- a/board/samsung/midas/midas.c +++ b/board/samsung/midas/midas.c @@ -188,7 +188,7 @@ static int midas_phy_control(int on) { int ret; int type; - struct udevice *vuotg; + struct udevice *vuotg, *vhsic10, *vhsic18; struct udevice *safeout; struct udevice *extcon; struct udevice *pmic; @@ -199,6 +199,18 @@ static int midas_phy_control(int on) return -1; } + ret = regulator_get_by_platname("VHSIC_1.0V", &vhsic10); + if (ret) { + pr_err("Failed to get VHSIC_1.0V: %d\n", ret); + return -1; + } + + ret = regulator_get_by_platname("VHSIC_1.8V", &vhsic18); + if (ret) { + pr_err("Failed to get VHSIC_1.8V: %d\n", ret); + return -1; + } + ret = regulator_get_by_platname("ESAFEOUT1", &safeout); if (ret) { pr_err("Failed to get ESAFEOUT1: %d\n", ret); @@ -236,7 +248,19 @@ static int midas_phy_control(int on) } if (on) { - ret = regulator_set_mode(vuotg, OPMODE_ON); + ret = regulator_set_enable(vhsic10, true); + if (ret) { + pr_err("Failed to enable VHSIC_1.0V: %d\n", ret); + return -1; + } + + ret = regulator_set_enable(vhsic18, true); + if (ret) { + pr_err("Failed to enable VHSIC_1.8V: %d\n", ret); + return -1; + } + + ret = regulator_set_enable(vuotg, true); if (ret) { pr_err("Failed to set VUOTG_3.0V to ON: %d\n", ret); return -1; @@ -256,9 +280,21 @@ static int midas_phy_control(int on) return -1; } } else { - ret = regulator_set_mode(vuotg, OPMODE_LPM); + ret = regulator_set_enable(vuotg, false); + if (ret) { + pr_err("Failed to disable VUOTG_3.0V: %d\n", ret); + return -1; + } + + ret = regulator_set_enable(vhsic18, false); + if (ret) { + pr_err("Failed to disable VHSIC_1.8V: %d\n", ret); + return -1; + } + + ret = regulator_set_enable(vhsic10, false); if (ret) { - pr_err("Failed to set VUOTG_3.0V to LPM: %d\n", ret); + pr_err("Failed to disable VHSIC_1.0V: %d\n", ret); return -1; } @@ -272,7 +308,6 @@ static int midas_phy_control(int on) } - return 0; } |