lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 5 Feb 2013 11:22:47 +0200
From:	Felipe Balbi <balbi@...com>
To:	Roger Quadros <rogerq@...com>
CC:	<tony@...mide.com>, <linux@....linux.org.uk>,
	<sameo@...ux.intel.com>, <balbi@...com>,
	<stern@...land.harvard.edu>, <gregkh@...uxfoundation.org>,
	<eballetbo@...il.com>, <javier@...hile0.org>,
	<sshtylyov@...sta.com>, <linux-usb@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>,
	<linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH v2 05/30] usb: phy: nop: Handle RESET for the PHY

On Mon, Jan 28, 2013 at 01:30:06PM +0200, Roger Quadros wrote:
> We expect the RESET line to be modeled as a regulator with supply
> name "reset". The regulator should be modeled such that enabling
> the regulator brings the PHY device out of RESET and disabling the
> regulator holds the device in RESET.
> 
> They PHY will be held in RESET in .shutdown() and brought out of
> RESET in .init().
> 
> Signed-off-by: Roger Quadros <rogerq@...com>

Acked-by: Felipe Balbi <balbi@...com>

> ---
>  drivers/usb/otg/nop-usb-xceiv.c |   19 +++++++++++++++++++
>  1 files changed, 19 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/usb/otg/nop-usb-xceiv.c b/drivers/usb/otg/nop-usb-xceiv.c
> index 0a9628c..3060ed0 100644
> --- a/drivers/usb/otg/nop-usb-xceiv.c
> +++ b/drivers/usb/otg/nop-usb-xceiv.c
> @@ -40,6 +40,7 @@ struct nop_usb_xceiv {
>  	struct device		*dev;
>  	struct clk		*clk;
>  	struct regulator	*vcc;
> +	struct regulator	*reset;
>  };
>  
>  static struct platform_device *pd;
> @@ -80,6 +81,12 @@ static int nop_init(struct usb_phy *phy)
>  	if (!IS_ERR(nop->clk))
>  		clk_enable(nop->clk);
>  
> +	if (!IS_ERR(nop->reset)) {
> +		/* De-assert RESET */
> +		if (regulator_enable(nop->reset))
> +			dev_err(phy->dev, "Failed to de-assert reset\n");
> +	}
> +
>  	return 0;
>  }
>  
> @@ -87,6 +94,12 @@ static void nop_shutdown(struct usb_phy *phy)
>  {
>  	struct nop_usb_xceiv *nop = dev_get_drvdata(phy->dev);
>  
> +	if (!IS_ERR(nop->reset)) {
> +		/* Assert RESET */
> +		if (regulator_disable(nop->reset))
> +			dev_err(phy->dev, "Failed to assert reset\n");
> +	}
> +
>  	if (!IS_ERR(nop->clk))
>  		clk_disable(nop->clk);
>  
> @@ -171,6 +184,12 @@ static int nop_usb_xceiv_probe(struct platform_device *pdev)
>  					PTR_ERR(nop->vcc));
>  	}
>  
> +	nop->reset = devm_regulator_get(&pdev->dev, "reset");
> +	if (IS_ERR(nop->reset)) {
> +		dev_dbg(&pdev->dev, "Error getting reset regulator: %ld\n",
> +					PTR_ERR(nop->reset));
> +	}
> +
>  	nop->dev		= &pdev->dev;
>  	nop->phy.dev		= nop->dev;
>  	nop->phy.label		= "nop-xceiv";
> -- 
> 1.7.4.1
> 

-- 
balbi

Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ