Linux USB
 help / color / mirror / Atom feed
From: Sean Anderson <sean.anderson@seco.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org
Cc: Robert Jarzmik <robert.jarzmik@free.fr>,
	Felipe Balbi <balbi@kernel.org>,
	linux-kernel@vger.kernel.org,
	Sean Anderson <sean.anderson@seco.com>
Subject: [PATCH 4/4] usb: phy: generic: Disable vbus on removal
Date: Fri, 14 Jan 2022 12:09:41 -0500	[thread overview]
Message-ID: <20220114170941.800068-5-sean.anderson@seco.com> (raw)
In-Reply-To: <20220114170941.800068-1-sean.anderson@seco.com>

If we enabled vbus, we need to balance that with a disable.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
---

 drivers/usb/phy/phy-generic.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/usb/phy/phy-generic.c b/drivers/usb/phy/phy-generic.c
index 2c2553bc9b54..9fc3312d614a 100644
--- a/drivers/usb/phy/phy-generic.c
+++ b/drivers/usb/phy/phy-generic.c
@@ -328,6 +328,9 @@ static int usb_phy_generic_remove(struct platform_device *pdev)
 
 	usb_remove_phy(&nop->phy);
 
+	if (nop->vbus_draw && nop->vbus_draw_enabled)
+		regulator_disable(nop->vbus_draw);
+
 	return 0;
 }
 
-- 
2.25.1


  parent reply	other threads:[~2022-01-14 17:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-14 17:09 [PATCH 0/4] usb: phy: generic: Support enabling/disabling VBUS Sean Anderson
2022-01-14 17:09 ` [PATCH 1/4] dt-bindings: usb: usb-nop-xceiv: Repurpose vbus-regulator Sean Anderson
2022-01-15 17:22   ` Rob Herring
2022-01-14 17:09 ` [PATCH 2/4] usb: phy: generic: Get the vbus supply Sean Anderson
2022-01-14 17:09 ` [PATCH 3/4] usb: phy: generic: Implement otg->set_vbus Sean Anderson
2022-01-14 17:09 ` Sean Anderson [this message]
2022-04-05 14:51 ` [PATCH 0/4] usb: phy: generic: Support enabling/disabling VBUS Sean Anderson
2022-04-05 15:02   ` Greg Kroah-Hartman
2022-04-05 15:06     ` Sean Anderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220114170941.800068-5-sean.anderson@seco.com \
    --to=sean.anderson@seco.com \
    --cc=balbi@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=robert.jarzmik@free.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox