All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kishon Vijay Abraham I <kishon@ti.com>
To: Vivek Gautam <gautam.vivek@samsung.com>,
	linux-usb@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	linux-doc@vger.kernel.org
Cc: k.debski@samsung.com, kgene.kim@samsung.com,
	gregkh@linuxfoundation.org, t.figa@samsung.com,
	jg1.han@samsung.com, balbi@ti.com, sylvester.nawrocki@gmail.com
Subject: Re: [PATCH] phy: exynos5-usbdrd: Add facility to toggle vbus gpio on/off
Date: Thu, 10 Apr 2014 14:39:13 +0530	[thread overview]
Message-ID: <53465FB9.7070002@ti.com> (raw)
In-Reply-To: <1397044485-26483-1-git-send-email-gautam.vivek@samsung.com>

Hi.

On Wednesday 09 April 2014 05:24 PM, Vivek Gautam wrote:
> Adding support to enable/disable VBUS hooked to a gpio
> to enable vbus supply on the port.
> 
> Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
> ---
> 
> Based on 'phy-exynos5-usbdrd' patches:
> [PATCH V4 0/5] Add Exynos5 USB 3.0 phy driver based on generic PHY framework
> http://www.spinics.net/lists/linux-usb/msg105507.html
> 
>  drivers/phy/phy-exynos5-usbdrd.c |   18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> diff --git a/drivers/phy/phy-exynos5-usbdrd.c b/drivers/phy/phy-exynos5-usbdrd.c
> index ff54a7c..5ca7485 100644
> --- a/drivers/phy/phy-exynos5-usbdrd.c
> +++ b/drivers/phy/phy-exynos5-usbdrd.c
> @@ -18,6 +18,7 @@
>  #include <linux/module.h>
>  #include <linux/of.h>
>  #include <linux/of_address.h>
> +#include <linux/of_gpio.h>
>  #include <linux/phy/phy.h>
>  #include <linux/platform_device.h>
>  #include <linux/mutex.h>
> @@ -176,6 +177,7 @@ struct exynos5_usbdrd_phy {
>  	struct clk *ref_clk;
>  	unsigned long ref_rate;
>  	unsigned int refclk_reg;
> +	int gpio;
>  };
>  
>  #define to_usbdrd_phy(inst) \
> @@ -460,6 +462,9 @@ static int exynos5_usbdrd_phy_power_on(struct phy *phy)
>  	if (!IS_ERR(phy_drd->usb30_sclk))
>  		clk_prepare_enable(phy_drd->usb30_sclk);
>  
> +	/* Toggle VBUS gpio - on */
> +	gpio_set_value(phy_drd->gpio, 1);
> +
>  	/* Power-on PHY*/
>  	inst->phy_cfg->phy_isol(inst, 0);
>  
> @@ -476,6 +481,9 @@ static int exynos5_usbdrd_phy_power_off(struct phy *phy)
>  	/* Power-off the PHY */
>  	inst->phy_cfg->phy_isol(inst, 1);
>  
> +	/* Toggle VBUS gpio - off */
> +	gpio_set_value(phy_drd->gpio, 0);
> +
>  	if (!IS_ERR(phy_drd->usb30_sclk))
>  		clk_disable_unprepare(phy_drd->usb30_sclk);
>  
> @@ -585,6 +593,16 @@ static int exynos5_usbdrd_phy_probe(struct platform_device *pdev)
>  
>  	phy_drd->drv_data = drv_data;
>  
> +	/* Get required GPIO for vbus */
> +	phy_drd->gpio = of_get_named_gpio(dev->of_node,
> +					  "samsung,vbus-gpio", 0);

Is this dt property documented somewhere?
> +	if (!gpio_is_valid(phy_drd->gpio))
> +		dev_dbg(dev, "no usbdrd-phy vbus gpio defined\n");

No return here? Can the PHY be functional even without the VBUS?

Thanks
Kishon

WARNING: multiple messages have this Message-ID (diff)
From: kishon@ti.com (Kishon Vijay Abraham I)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] phy: exynos5-usbdrd: Add facility to toggle vbus gpio on/off
Date: Thu, 10 Apr 2014 14:39:13 +0530	[thread overview]
Message-ID: <53465FB9.7070002@ti.com> (raw)
In-Reply-To: <1397044485-26483-1-git-send-email-gautam.vivek@samsung.com>

Hi.

On Wednesday 09 April 2014 05:24 PM, Vivek Gautam wrote:
> Adding support to enable/disable VBUS hooked to a gpio
> to enable vbus supply on the port.
> 
> Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
> ---
> 
> Based on 'phy-exynos5-usbdrd' patches:
> [PATCH V4 0/5] Add Exynos5 USB 3.0 phy driver based on generic PHY framework
> http://www.spinics.net/lists/linux-usb/msg105507.html
> 
>  drivers/phy/phy-exynos5-usbdrd.c |   18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> diff --git a/drivers/phy/phy-exynos5-usbdrd.c b/drivers/phy/phy-exynos5-usbdrd.c
> index ff54a7c..5ca7485 100644
> --- a/drivers/phy/phy-exynos5-usbdrd.c
> +++ b/drivers/phy/phy-exynos5-usbdrd.c
> @@ -18,6 +18,7 @@
>  #include <linux/module.h>
>  #include <linux/of.h>
>  #include <linux/of_address.h>
> +#include <linux/of_gpio.h>
>  #include <linux/phy/phy.h>
>  #include <linux/platform_device.h>
>  #include <linux/mutex.h>
> @@ -176,6 +177,7 @@ struct exynos5_usbdrd_phy {
>  	struct clk *ref_clk;
>  	unsigned long ref_rate;
>  	unsigned int refclk_reg;
> +	int gpio;
>  };
>  
>  #define to_usbdrd_phy(inst) \
> @@ -460,6 +462,9 @@ static int exynos5_usbdrd_phy_power_on(struct phy *phy)
>  	if (!IS_ERR(phy_drd->usb30_sclk))
>  		clk_prepare_enable(phy_drd->usb30_sclk);
>  
> +	/* Toggle VBUS gpio - on */
> +	gpio_set_value(phy_drd->gpio, 1);
> +
>  	/* Power-on PHY*/
>  	inst->phy_cfg->phy_isol(inst, 0);
>  
> @@ -476,6 +481,9 @@ static int exynos5_usbdrd_phy_power_off(struct phy *phy)
>  	/* Power-off the PHY */
>  	inst->phy_cfg->phy_isol(inst, 1);
>  
> +	/* Toggle VBUS gpio - off */
> +	gpio_set_value(phy_drd->gpio, 0);
> +
>  	if (!IS_ERR(phy_drd->usb30_sclk))
>  		clk_disable_unprepare(phy_drd->usb30_sclk);
>  
> @@ -585,6 +593,16 @@ static int exynos5_usbdrd_phy_probe(struct platform_device *pdev)
>  
>  	phy_drd->drv_data = drv_data;
>  
> +	/* Get required GPIO for vbus */
> +	phy_drd->gpio = of_get_named_gpio(dev->of_node,
> +					  "samsung,vbus-gpio", 0);

Is this dt property documented somewhere?
> +	if (!gpio_is_valid(phy_drd->gpio))
> +		dev_dbg(dev, "no usbdrd-phy vbus gpio defined\n");

No return here? Can the PHY be functional even without the VBUS?

Thanks
Kishon

WARNING: multiple messages have this Message-ID (diff)
From: Kishon Vijay Abraham I <kishon@ti.com>
To: Vivek Gautam <gautam.vivek@samsung.com>,
	<linux-usb@vger.kernel.org>, <linux-samsung-soc@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<linux-doc@vger.kernel.org>
Cc: <gregkh@linuxfoundation.org>, <balbi@ti.com>,
	<kgene.kim@samsung.com>, <t.figa@samsung.com>,
	<k.debski@samsung.com>, <jg1.han@samsung.com>,
	<sylvester.nawrocki@gmail.com>
Subject: Re: [PATCH] phy: exynos5-usbdrd: Add facility to toggle vbus gpio on/off
Date: Thu, 10 Apr 2014 14:39:13 +0530	[thread overview]
Message-ID: <53465FB9.7070002@ti.com> (raw)
In-Reply-To: <1397044485-26483-1-git-send-email-gautam.vivek@samsung.com>

Hi.

On Wednesday 09 April 2014 05:24 PM, Vivek Gautam wrote:
> Adding support to enable/disable VBUS hooked to a gpio
> to enable vbus supply on the port.
> 
> Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
> ---
> 
> Based on 'phy-exynos5-usbdrd' patches:
> [PATCH V4 0/5] Add Exynos5 USB 3.0 phy driver based on generic PHY framework
> http://www.spinics.net/lists/linux-usb/msg105507.html
> 
>  drivers/phy/phy-exynos5-usbdrd.c |   18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> diff --git a/drivers/phy/phy-exynos5-usbdrd.c b/drivers/phy/phy-exynos5-usbdrd.c
> index ff54a7c..5ca7485 100644
> --- a/drivers/phy/phy-exynos5-usbdrd.c
> +++ b/drivers/phy/phy-exynos5-usbdrd.c
> @@ -18,6 +18,7 @@
>  #include <linux/module.h>
>  #include <linux/of.h>
>  #include <linux/of_address.h>
> +#include <linux/of_gpio.h>
>  #include <linux/phy/phy.h>
>  #include <linux/platform_device.h>
>  #include <linux/mutex.h>
> @@ -176,6 +177,7 @@ struct exynos5_usbdrd_phy {
>  	struct clk *ref_clk;
>  	unsigned long ref_rate;
>  	unsigned int refclk_reg;
> +	int gpio;
>  };
>  
>  #define to_usbdrd_phy(inst) \
> @@ -460,6 +462,9 @@ static int exynos5_usbdrd_phy_power_on(struct phy *phy)
>  	if (!IS_ERR(phy_drd->usb30_sclk))
>  		clk_prepare_enable(phy_drd->usb30_sclk);
>  
> +	/* Toggle VBUS gpio - on */
> +	gpio_set_value(phy_drd->gpio, 1);
> +
>  	/* Power-on PHY*/
>  	inst->phy_cfg->phy_isol(inst, 0);
>  
> @@ -476,6 +481,9 @@ static int exynos5_usbdrd_phy_power_off(struct phy *phy)
>  	/* Power-off the PHY */
>  	inst->phy_cfg->phy_isol(inst, 1);
>  
> +	/* Toggle VBUS gpio - off */
> +	gpio_set_value(phy_drd->gpio, 0);
> +
>  	if (!IS_ERR(phy_drd->usb30_sclk))
>  		clk_disable_unprepare(phy_drd->usb30_sclk);
>  
> @@ -585,6 +593,16 @@ static int exynos5_usbdrd_phy_probe(struct platform_device *pdev)
>  
>  	phy_drd->drv_data = drv_data;
>  
> +	/* Get required GPIO for vbus */
> +	phy_drd->gpio = of_get_named_gpio(dev->of_node,
> +					  "samsung,vbus-gpio", 0);

Is this dt property documented somewhere?
> +	if (!gpio_is_valid(phy_drd->gpio))
> +		dev_dbg(dev, "no usbdrd-phy vbus gpio defined\n");

No return here? Can the PHY be functional even without the VBUS?

Thanks
Kishon

  parent reply	other threads:[~2014-04-10  9:09 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-09 11:54 [PATCH] phy: exynos5-usbdrd: Add facility to toggle vbus gpio on/off Vivek Gautam
2014-04-09 11:54 ` Vivek Gautam
2014-04-09 12:11 ` Sylwester Nawrocki
2014-04-09 12:11   ` Sylwester Nawrocki
2014-04-09 12:24   ` Vivek Gautam
2014-04-09 12:24     ` Vivek Gautam
2014-04-09 12:38     ` Tomasz Figa
2014-04-09 12:38       ` Tomasz Figa
2014-04-10 11:07       ` Vivek Gautam
2014-04-10 11:07         ` Vivek Gautam
2014-04-09 13:08     ` Sylwester Nawrocki
2014-04-09 13:08       ` Sylwester Nawrocki
2014-04-10  9:09 ` Kishon Vijay Abraham I [this message]
2014-04-10  9:09   ` Kishon Vijay Abraham I
2014-04-10  9:09   ` Kishon Vijay Abraham I
2014-04-10 10:32   ` Vivek Gautam
2014-04-10 10:32     ` Vivek Gautam
2014-04-12  3:37 ` Felipe Balbi
2014-04-12  3:37   ` Felipe Balbi
2014-04-12  3:37   ` Felipe Balbi
2014-04-14  8:05   ` Vivek Gautam
2014-04-14  8:05     ` Vivek Gautam

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=53465FB9.7070002@ti.com \
    --to=kishon@ti.com \
    --cc=balbi@ti.com \
    --cc=devicetree@vger.kernel.org \
    --cc=gautam.vivek@samsung.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jg1.han@samsung.com \
    --cc=k.debski@samsung.com \
    --cc=kgene.kim@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=sylvester.nawrocki@gmail.com \
    --cc=t.figa@samsung.com \
    /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.