public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>
To: Roger Quadros <rogerq-l0cyMroinI0@public.gmane.org>
Cc: kishon-l0cyMroinI0@public.gmane.org,
	balbi-l0cyMroinI0@public.gmane.org,
	tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org,
	nm-l0cyMroinI0@public.gmane.org,
	t-kristo-l0cyMroinI0@public.gmane.org,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 1/3] phy: omap-usb2: Manage PHY 3.3V supply regulator
Date: Mon, 30 Jun 2014 12:09:39 -0500	[thread overview]
Message-ID: <20140630170939.GE31442@saruman.home> (raw)
In-Reply-To: <1404126038-19974-2-git-send-email-rogerq-l0cyMroinI0@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 2527 bytes --]

Hi,

On Mon, Jun 30, 2014 at 02:00:36PM +0300, Roger Quadros wrote:
> On some SoCs e.g. J6 the 3.3V supply to the USB2 PHY can be
> powered down when the PHY is not in use. Add regulator
> management code to control this power line.
> 
> Signed-off-by: Roger Quadros <rogerq-l0cyMroinI0@public.gmane.org>

Reviewed-by: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>

> ---
>  drivers/phy/phy-omap-usb2.c  | 25 +++++++++++++++++++++++++
>  include/linux/phy/omap_usb.h |  1 +
>  2 files changed, 26 insertions(+)
> 
> diff --git a/drivers/phy/phy-omap-usb2.c b/drivers/phy/phy-omap-usb2.c
> index 7007c11..2afc79c 100644
> --- a/drivers/phy/phy-omap-usb2.c
> +++ b/drivers/phy/phy-omap-usb2.c
> @@ -30,6 +30,7 @@
>  #include <linux/phy/omap_control_phy.h>
>  #include <linux/phy/phy.h>
>  #include <linux/of_platform.h>
> +#include <linux/regulator/consumer.h>
>  
>  #define USB2PHY_DISCON_BYP_LATCH (1 << 31)
>  #define USB2PHY_ANA_CONFIG1 0x4c
> @@ -107,6 +108,14 @@ static int omap_usb_power_off(struct phy *x)
>  
>  	omap_control_phy_power(phy->control_dev, 0);
>  
> +	if (phy->pwr) {
> +		int ret;
> +
> +		ret = regulator_disable(phy->pwr);
> +		if (ret)
> +			return ret;
> +	}
> +
>  	return 0;
>  }
>  
> @@ -114,6 +123,14 @@ static int omap_usb_power_on(struct phy *x)
>  {
>  	struct omap_usb *phy = phy_get_drvdata(x);
>  
> +	if (phy->pwr) {
> +		int ret;
> +
> +		ret = regulator_enable(phy->pwr);
> +		if (ret)
> +			return ret;
> +	}
> +
>  	omap_control_phy_power(phy->control_dev, 1);
>  
>  	return 0;
> @@ -253,6 +270,14 @@ static int omap_usb2_probe(struct platform_device *pdev)
>  	phy->control_dev = &control_pdev->dev;
>  	omap_control_phy_power(phy->control_dev, 0);
>  
> +	/* phy-supply */
> +	phy->pwr = devm_regulator_get_optional(phy->dev, "phy");
> +	if (IS_ERR(phy->pwr)) {
> +		if (PTR_ERR(phy->pwr) == -EPROBE_DEFER)
> +			return -EPROBE_DEFER;
> +		phy->pwr = NULL;
> +	}
> +
>  	otg->set_host		= omap_usb_set_host;
>  	otg->set_peripheral	= omap_usb_set_peripheral;
>  	if (phy_data->flags & OMAP_USB2_HAS_SET_VBUS)
> diff --git a/include/linux/phy/omap_usb.h b/include/linux/phy/omap_usb.h
> index dc2c541..e2c46df 100644
> --- a/include/linux/phy/omap_usb.h
> +++ b/include/linux/phy/omap_usb.h
> @@ -40,6 +40,7 @@ struct omap_usb {
>  	struct clk		*wkupclk;
>  	struct clk		*optclk;
>  	u8			flags;
> +	struct regulator	*pwr;
>  };
>  
>  struct usb_phy_data {
> -- 
> 1.8.3.2
> 

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  parent reply	other threads:[~2014-06-30 17:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-30 11:00 [PATCH 0/3] PHY: ti-pipe3: Manage 3.3V PHY regulator Roger Quadros
     [not found] ` <1404126038-19974-1-git-send-email-rogerq-l0cyMroinI0@public.gmane.org>
2014-06-30 11:00   ` [PATCH 1/3] phy: omap-usb2: Manage PHY 3.3V supply regulator Roger Quadros
     [not found]     ` <1404126038-19974-2-git-send-email-rogerq-l0cyMroinI0@public.gmane.org>
2014-06-30 17:09       ` Felipe Balbi [this message]
2014-07-01  9:56       ` Kishon Vijay Abraham I
     [not found]         ` <53B285DC.8070102-l0cyMroinI0@public.gmane.org>
2014-07-01 10:13           ` Roger Quadros
2014-07-01 10:20             ` Kishon Vijay Abraham I
2014-07-01 10:25               ` Roger Quadros
     [not found]                 ` <53B28CB5.1070306-l0cyMroinI0@public.gmane.org>
2014-07-01 10:37                   ` Kishon Vijay Abraham I
2014-06-30 11:00   ` [PATCH 2/3] phy: omap-usb2: Add PHY regulator to DT binding documentation Roger Quadros
2014-06-30 11:00 ` [PATCH 3/3] ARM: dts: dra7-evm: Add regulator information to USB2 PHYs Roger Quadros
2014-07-09 11:56   ` Tony Lindgren

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=20140630170939.GE31442@saruman.home \
    --to=balbi-l0cymroini0@public.gmane.org \
    --cc=kishon-l0cyMroinI0@public.gmane.org \
    --cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=nm-l0cyMroinI0@public.gmane.org \
    --cc=rogerq-l0cyMroinI0@public.gmane.org \
    --cc=t-kristo-l0cyMroinI0@public.gmane.org \
    --cc=tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org \
    /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