mirror of https://lore.kernel.org/lkml/
 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>,
	Linus Walleij <linus.walleij@linaro.org>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	Mike Looijmans <mike.looijmans@topic.nl>,
	Jules Maselbas <jmaselbas@kalray.eu>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 2/4] usb: phy: generic: Get the vbus supply
Date: Mon, 29 Jan 2024 11:18:19 -0500	[thread overview]
Message-ID: <39a17b10-c66a-432e-b4ed-012374dcbe20@seco.com> (raw)
In-Reply-To: <20240123225111.1629405-3-sean.anderson@seco.com>

On 1/23/24 17:51, Sean Anderson wrote:
> While support for working with a vbus was added, the regulator was never
> actually gotten (despite what was documented). Fix this by actually
> getting the supply from the device tree.
> 
> Fixes: 7acc9973e3c4 ("usb: phy: generic: add vbus support")
> Signed-off-by: Sean Anderson <sean.anderson@seco.com>
> ---
> 
> (no changes since v1)
> 
>  drivers/usb/phy/phy-generic.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/usb/phy/phy-generic.c b/drivers/usb/phy/phy-generic.c
> index 9ab50f26db60..16494030209e 100644
> --- a/drivers/usb/phy/phy-generic.c
> +++ b/drivers/usb/phy/phy-generic.c
> @@ -274,6 +274,13 @@ int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_generic *nop)
>  		return dev_err_probe(dev, PTR_ERR(nop->vbus_draw),
>  				     "could not get vbus regulator\n");
>  
> +	nop->vbus_draw = devm_regulator_get_exclusive(dev, "vbus");
> +	if (PTR_ERR(nop->vbus_draw) == -ENODEV)
> +		nop->vbus_draw = NULL;
> +	if (IS_ERR(nop->vbus_draw))
> +		return dev_err_probe(dev, PTR_ERR(nop->vbus_draw),
> +				     "could not get vbus regulator\n");
> +
>  	nop->dev		= dev;
>  	nop->phy.dev		= nop->dev;
>  	nop->phy.label		= "nop-xceiv";

OK, so as it turns out, this patch (and only this one) got applied as
03e607cbb293 ("usb: phy: generic: Get the vbus supply"). Which of course
messes with the premise of this series that no one was using the vbus
supply (so we can repurpose it), by adding the possibility that someone
was using the vbus supply. However, the only in-tree user is in
arch/arm/boot/dts/armada-388-helios4.dts, which was added before this
patch (so presumably they don't care).

At the very least, this patch should get dropped (and hopefully no one
complains about the next patch).

--Sean

  reply	other threads:[~2024-01-29 16:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-23 22:51 [PATCH v3 0/4] usb: phy: generic: Support enabling/disabling VBUS Sean Anderson
2024-01-23 22:51 ` [PATCH v3 1/4] dt-bindings: usb: usb-nop-xceiv: Repurpose vbus-regulator Sean Anderson
2024-01-23 22:51 ` [PATCH v3 2/4] usb: phy: generic: Get the vbus supply Sean Anderson
2024-01-29 16:18   ` Sean Anderson [this message]
2024-01-23 22:51 ` [PATCH v3 3/4] usb: phy: generic: Implement otg->set_vbus Sean Anderson
2024-01-23 22:51 ` [PATCH v3 4/4] usb: phy: generic: Disable vbus on removal 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=39a17b10-c66a-432e-b4ed-012374dcbe20@seco.com \
    --to=sean.anderson@seco.com \
    --cc=balbi@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jmaselbas@kalray.eu \
    --cc=jonathanh@nvidia.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mike.looijmans@topic.nl \
    --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

all inboxes | Powered by JetHome®