From: Anton Tikhomirov <av.tikhomirov@samsung.com>
To: 'Vivek Gautam' <gautam.vivek@samsung.com>, linux-usb@vger.kernel.org
Cc: linux-samsung-soc@vger.kernel.org, linux-omap@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
gregkh@linuxfoundation.org, balbi@ti.com, kgene.kim@samsung.com,
mark.rutland@arm.com, pawel.moll@arm.com, robh+dt@kernel.org,
kishon@ti.com
Subject: RE: [PATCH v2 3/4] phy: exynos5-usbdrd: Add facility for VBUS-BOOST-5V supply
Date: Mon, 13 Oct 2014 14:06:39 +0900 [thread overview]
Message-ID: <00f301cfe6a3$78e90ab0$6abb2010$%tikhomirov@samsung.com> (raw)
In-Reply-To: <1412677176-3850-4-git-send-email-gautam.vivek@samsung.com>
Hi Vivek,
> Some Exynos SoCs have a separate regulator controlling a
I guess you meant the Exynos based *boards* instead of SoCs,
since Exynos SoCs don't have any boost regulators.
> Boost 5V supply which goes as input for VBUS regulator.
> So adding a control for the same in driver, to enable
> vbus supply on the port.
>
> Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
> ---
> drivers/phy/phy-exynos5-usbdrd.c | 30 ++++++++++++++++++++++++++++--
> 1 file changed, 28 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/phy/phy-exynos5-usbdrd.c b/drivers/phy/phy-
> exynos5-usbdrd.c
> index 013ee84..57e8a0a 100644
> --- a/drivers/phy/phy-exynos5-usbdrd.c
> +++ b/drivers/phy/phy-exynos5-usbdrd.c
> @@ -176,6 +176,7 @@ struct exynos5_usbdrd_phy {
> u32 extrefclk;
> struct clk *ref_clk;
> struct regulator *vbus;
> + struct regulator *vbus_boost;
> };
>
> static inline
> @@ -455,11 +456,20 @@ static int exynos5_usbdrd_phy_power_on(struct phy
> *phy)
> clk_prepare_enable(phy_drd->ref_clk);
>
> /* Enable VBUS supply */
> + if (phy_drd->vbus_boost) {
> + ret = regulator_enable(phy_drd->vbus_boost);
> + if (ret) {
> + dev_err(phy_drd->dev,
> + "Failed to enable VBUS boost supply\n");
> + goto fail_vbus;
> + }
> + }
> +
> if (phy_drd->vbus) {
> ret = regulator_enable(phy_drd->vbus);
> if (ret) {
> dev_err(phy_drd->dev, "Failed to enable VBUS
> supply\n");
> - goto fail_vbus;
> + goto fail_vbus_boost;
> }
> }
>
> @@ -468,6 +478,10 @@ static int exynos5_usbdrd_phy_power_on(struct phy
> *phy)
>
> return 0;
>
> +fail_vbus_boost:
> + if (phy_drd->vbus_boost)
> + regulator_disable(phy_drd->vbus_boost);
> +
> fail_vbus:
> clk_disable_unprepare(phy_drd->ref_clk);
> clk_disable_unprepare(phy_drd->pipeclk);
> @@ -489,6 +503,8 @@ static int exynos5_usbdrd_phy_power_off(struct phy
> *phy)
> /* Disable VBUS supply */
> if (phy_drd->vbus)
> regulator_disable(phy_drd->vbus);
> + if (phy_drd->vbus_boost)
> + regulator_disable(phy_drd->vbus_boost);
>
> clk_disable_unprepare(phy_drd->ref_clk);
> clk_disable_unprepare(phy_drd->pipeclk);
> @@ -644,7 +660,7 @@ static int exynos5_usbdrd_phy_probe(struct
> platform_device *pdev)
> break;
> }
>
> - /* Get Vbus regulator */
> + /* Get Vbus regulators */
> phy_drd->vbus = devm_regulator_get(dev, "vbus");
> if (IS_ERR(phy_drd->vbus)) {
> ret = PTR_ERR(phy_drd->vbus);
> @@ -655,6 +671,16 @@ static int exynos5_usbdrd_phy_probe(struct
> platform_device *pdev)
> phy_drd->vbus = NULL;
> }
>
> + phy_drd->vbus_boost = devm_regulator_get(dev, "vbus-boost");
> + if (IS_ERR(phy_drd->vbus_boost)) {
> + ret = PTR_ERR(phy_drd->vbus_boost);
> + if (ret == -EPROBE_DEFER)
> + return ret;
> +
> + dev_warn(dev, "Failed to get VBUS boost supply
> regulator\n");
> + phy_drd->vbus_boost = NULL;
> + }
> +
> dev_vdbg(dev, "Creating usbdrd_phy phy\n");
>
> for (i = 0; i < EXYNOS5_DRDPHYS_NUM; i++) {
> --
> 1.7.10.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2014-10-13 5:06 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-07 10:19 [PATCH v2 0/4] usb: dwc3/phy-exynos5-usbdrd: Extend support to Exynos7 Vivek Gautam
2014-10-07 10:19 ` [PATCH v2 1/4] dwc3: exynos: Add support for SCLK present on Exynos7 Vivek Gautam
2014-10-07 14:11 ` Felipe Balbi
2014-10-08 3:01 ` Vivek Gautam
2014-10-13 4:54 ` Anton Tikhomirov
2014-10-13 22:44 ` Felipe Balbi
2014-10-14 4:55 ` Vivek Gautam
2014-10-15 14:50 ` Felipe Balbi
[not found] ` <00f101cfe6a1$d772c5a0$865850e0$%tikhomirov-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-10-13 22:51 ` Tomasz Figa
2014-10-14 1:26 ` Anton Tikhomirov
2014-10-14 4:53 ` Vivek Gautam
[not found] ` <1412677176-3850-1-git-send-email-gautam.vivek-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-10-07 10:19 ` [PATCH v2 2/4] phy: exynos5-usbdrd: Add pipe-clk and utmi-clk support Vivek Gautam
2014-10-13 5:02 ` Anton Tikhomirov
2014-10-22 11:53 ` Kishon Vijay Abraham I
2014-10-07 10:19 ` [PATCH v2 3/4] phy: exynos5-usbdrd: Add facility for VBUS-BOOST-5V supply Vivek Gautam
2014-10-13 5:06 ` Anton Tikhomirov [this message]
2014-10-13 5:11 ` Vivek Gautam
2014-10-07 10:19 ` [PATCH v2 4/4] phy: exynos7-usbdrd: Update dependency for ARCH_EXYNOS 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='00f301cfe6a3$78e90ab0$6abb2010$%tikhomirov@samsung.com' \
--to=av.tikhomirov@samsung.com \
--cc=balbi@ti.com \
--cc=devicetree@vger.kernel.org \
--cc=gautam.vivek@samsung.com \
--cc=gregkh@linuxfoundation.org \
--cc=kgene.kim@samsung.com \
--cc=kishon@ti.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=pawel.moll@arm.com \
--cc=robh+dt@kernel.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;
as well as URLs for NNTP newsgroup(s).