From: Amelie DELAUNAY <amelie.delaunay@st.com>
To: Felipe Balbi <felipe.balbi@linux.intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Tony Prisk <linux@prisktech.co.nz>,
Alan Stern <stern@rowland.harvard.edu>,
Roger Quadros <rogerq@ti.com>
Cc: "linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v2] usb: host: ehci-platform: add support for optional external vbus supply
Date: Tue, 20 Feb 2018 13:48:18 +0000 [thread overview]
Message-ID: <a34d376e-45c2-0791-7c69-d6647170aff9@st.com> (raw)
In-Reply-To: <87h8qbq0em.fsf@linux.intel.com>
Hi,
On 02/20/2018 02:02 PM, Felipe Balbi wrote:
>
> Hi,
>
> Amelie Delaunay <amelie.delaunay@st.com> writes:
>> On some boards, especially when vbus supply requires large current,
>> and the charge pump on the PHY isn't enough, an external vbus power switch
>> may be used.
>> Add support for this optional external vbus supply in ehci-platform.
>>
>> Signed-off-by: Amelie Delaunay <amelie.delaunay@st.com>
>>
>> ---
>> Changes in v2:
>> * Address Roger Quadros comments: move regulator_enable/disable from
>> ehci_platform_power_on/off to ehci_platform_port_power.
>> ---
>> Documentation/devicetree/bindings/usb/usb-ehci.txt | 1 +
>> drivers/usb/host/ehci-platform.c | 31 ++++++++++++++++++++++
>> 2 files changed, 32 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/usb/usb-ehci.txt b/Documentation/devicetree/bindings/usb/usb-ehci.txt
>> index 3efde12..fc480cd 100644
>> --- a/Documentation/devicetree/bindings/usb/usb-ehci.txt
>> +++ b/Documentation/devicetree/bindings/usb/usb-ehci.txt
>> @@ -19,6 +19,7 @@ Optional properties:
>> - phys : phandle + phy specifier pair
>> - phy-names : "usb"
>> - resets : phandle + reset specifier pair
>> + - vbus-supply : phandle of regulator supplying vbus
>>
>> Example (Sequoia 440EPx):
>> ehci@e0000300 {
>> diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-platform.c
>> index b065a96..05be100 100644
>> --- a/drivers/usb/host/ehci-platform.c
>> +++ b/drivers/usb/host/ehci-platform.c
>> @@ -29,6 +29,7 @@
>> #include <linux/of.h>
>> #include <linux/phy/phy.h>
>> #include <linux/platform_device.h>
>> +#include <linux/regulator/consumer.h>
>> #include <linux/reset.h>
>> #include <linux/usb.h>
>> #include <linux/usb/hcd.h>
>> @@ -46,6 +47,7 @@ struct ehci_platform_priv {
>> struct reset_control *rsts;
>> struct phy **phys;
>> int num_phys;
>> + struct regulator *vbus_supply;
>> bool reset_on_resume;
>> };
>>
>> @@ -76,6 +78,25 @@ static int ehci_platform_reset(struct usb_hcd *hcd)
>> return 0;
>> }
>>
>> +static int ehci_platform_port_power(struct usb_hcd *hcd, int portnum,
>> + bool enable)
>> +{
>> + struct ehci_platform_priv *priv = hcd_to_ehci_priv(hcd);
>> + int ret = 0;
>> +
>> + if (priv->vbus_supply) {
>
> you can reduce indentation here:
>
> if (!priv->vbus_supply)
> return 0;
>
You're right, thanks! I will fix it in upcoming v3, waiting for other
additional comments.
Amelie
next prev parent reply other threads:[~2018-02-20 13:48 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-20 12:58 Amelie Delaunay
2018-02-20 13:02 ` Felipe Balbi
2018-02-20 13:48 ` Amelie DELAUNAY [this message]
2018-02-20 14:00 ` Roger Quadros
2018-02-20 14:46 ` Amelie DELAUNAY
2018-02-20 16:33 ` Roger Quadros
2018-02-20 18:10 ` Alan Stern
2018-02-22 10:17 ` Amelie DELAUNAY
2018-02-22 18:27 ` Alan Stern
2018-02-23 10:46 ` Amelie DELAUNAY
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=a34d376e-45c2-0791-7c69-d6647170aff9@st.com \
--to=amelie.delaunay@st.com \
--cc=devicetree@vger.kernel.org \
--cc=felipe.balbi@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=linux@prisktech.co.nz \
--cc=mark.rutland@arm.com \
--cc=robh+dt@kernel.org \
--cc=rogerq@ti.com \
--cc=stern@rowland.harvard.edu \
/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®