Commit 64962724 authored by Amelie Delaunay's avatar Amelie Delaunay Committed by Vinod Koul

phy: stm32: ensure phy are no more active when removing the driver

To ensure a good balancing of regulators, and allow PLL disabling when the
driver is removed, call stm32_usbphyc_phy_exit on each ports to set phys
inactive and disable PLL.
Signed-off-by: default avatarAmelie Delaunay <amelie.delaunay@foss.st.com>
Link: https://lore.kernel.org/r/20210105090525.23164-6-amelie.delaunay@foss.st.comSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 56bf858e
...@@ -470,6 +470,12 @@ static int stm32_usbphyc_probe(struct platform_device *pdev) ...@@ -470,6 +470,12 @@ static int stm32_usbphyc_probe(struct platform_device *pdev)
static int stm32_usbphyc_remove(struct platform_device *pdev) static int stm32_usbphyc_remove(struct platform_device *pdev)
{ {
struct stm32_usbphyc *usbphyc = dev_get_drvdata(&pdev->dev); struct stm32_usbphyc *usbphyc = dev_get_drvdata(&pdev->dev);
int port;
/* Ensure PHYs are not active, to allow PLL disabling */
for (port = 0; port < usbphyc->nphys; port++)
if (usbphyc->phys[port]->active)
stm32_usbphyc_phy_exit(usbphyc->phys[port]->phy);
clk_disable_unprepare(usbphyc->clk); clk_disable_unprepare(usbphyc->clk);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment