All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrice CHOTARD <patrice.chotard@st.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] usb: ehci-generic: Add vbus-supply regulator support
Date: Thu, 9 Aug 2018 12:54:39 +0000	[thread overview]
Message-ID: <54a27ee6-8603-abb1-8296-a26a021c4fd5@st.com> (raw)
In-Reply-To: <c030d548-c7dd-a7e8-5116-505043918d3c@denx.de>



On 08/09/2018 02:27 PM, Marek Vasut wrote:
> On 08/09/2018 02:25 PM, Patrice CHOTARD wrote:
>> Hi Marek
>>
>> On 08/09/2018 10:02 AM, Marek Vasut wrote:
>>> On 08/09/2018 09:14 AM, Patrice Chotard wrote:
>>>> Add vbus-supply regulator support.
>>>> On some board vbus is not controlled by the phy but by
>>>> an external regulator.
>>>>
>>>> Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
>>>> ---
>>>>
>>>> Changes in v2:
>>>>         - Add test on device_get_supply_regulator() call
>>>>
>>>>    drivers/usb/host/ehci-generic.c | 39 ++++++++++++++++++++++++++++++++++++++-
>>>>    1 file changed, 38 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/usb/host/ehci-generic.c b/drivers/usb/host/ehci-generic.c
>>>> index 5a56f66cfaa6..ad926d05ac3e 100644
>>>> --- a/drivers/usb/host/ehci-generic.c
>>>> +++ b/drivers/usb/host/ehci-generic.c
>>>> @@ -11,6 +11,7 @@
>>>>    #include <asm/io.h>
>>>>    #include <dm.h>
>>>>    #include "ehci.h"
>>>> +#include <power/regulator.h>
>>>>    
>>>>    /*
>>>>     * Even though here we don't explicitly use "struct ehci_ctrl"
>>>> @@ -22,6 +23,9 @@ struct generic_ehci {
>>>>    	struct clk *clocks;
>>>>    	struct reset_ctl *resets;
>>>>    	struct phy phy;
>>>> +#ifdef CONFIG_DM_REGULATOR
>>>> +	struct udevice *vbus_supply;
>>>> +#endif
>>>>    	int clock_count;
>>>>    	int reset_count;
>>>>    };
>>>> @@ -145,10 +149,27 @@ static int ehci_usb_probe(struct udevice *dev)
>>>>    		}
>>>>    	}
>>>>    
>>>> -	err = ehci_setup_phy(dev, 0);
>>>> +#ifdef CONFIG_DM_REGULATOR
>>>> +	err = device_get_supply_regulator(dev, "vbus-supply",
>>>> +					  &priv->vbus_supply);
>>>>    	if (err)
>>>>    		goto reset_err;
>>> What if there is no regulator, what does this return , probably a
>>> negative return value ?
>>
>> Argh yes, good catch, i will update the test.
> 
> Wait a few days before resending v3 so people can review the patches ...
> 

oups the v3 is gone ... :-(

      reply	other threads:[~2018-08-09 12:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-09  7:14 [U-Boot] [PATCH v2] usb: ehci-generic: Add vbus-supply regulator support Patrice Chotard
2018-08-09  8:02 ` Marek Vasut
2018-08-09 12:25   ` Patrice CHOTARD
2018-08-09 12:27     ` Marek Vasut
2018-08-09 12:54       ` Patrice CHOTARD [this message]

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=54a27ee6-8603-abb1-8296-a26a021c4fd5@st.com \
    --to=patrice.chotard@st.com \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.