From a6094343b1f83b0f1f411dfc7dbac751d3ce5223 Mon Sep 17 00:00:00 2001 From: Roger Quadros Date: Tue, 12 Mar 2013 13:24:22 +0200 Subject: [PATCH] --- yaml --- r: 364527 b: refs/heads/master c: 58f735fe4778d34d9d1e37bcdd59325d66a8793e h: refs/heads/master i: 364525: 1cc26714640da5ce853f702033f18720ac279505 364523: 8c274cedb4dff325156dc6e9debdedfb567f2b99 364519: d6bc68fa71e5ed26afb5b17e242417230438f9d4 364511: c67b125c0a52a7311137df768d7247c56c3e8acf v: v3 --- [refs] | 2 +- trunk/drivers/usb/otg/nop-usb-xceiv.c | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index ead9479a9a0e..3682f3ff764c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 2319fb88e16e56c64d4f3ab50af69ed6dadbc7b5 +refs/heads/master: 58f735fe4778d34d9d1e37bcdd59325d66a8793e diff --git a/trunk/drivers/usb/otg/nop-usb-xceiv.c b/trunk/drivers/usb/otg/nop-usb-xceiv.c index 17c174f18da7..fbdcfef7169b 100644 --- a/trunk/drivers/usb/otg/nop-usb-xceiv.c +++ b/trunk/drivers/usb/otg/nop-usb-xceiv.c @@ -33,11 +33,13 @@ #include #include #include +#include struct nop_usb_xceiv { struct usb_phy phy; struct device *dev; struct clk *clk; + struct regulator *vcc; }; static struct platform_device *pd; @@ -70,6 +72,11 @@ static int nop_init(struct usb_phy *phy) { struct nop_usb_xceiv *nop = dev_get_drvdata(phy->dev); + if (!IS_ERR(nop->vcc)) { + if (regulator_enable(nop->vcc)) + dev_err(phy->dev, "Failed to enable power\n"); + } + if (!IS_ERR(nop->clk)) clk_enable(nop->clk); @@ -82,6 +89,11 @@ static void nop_shutdown(struct usb_phy *phy) if (!IS_ERR(nop->clk)) clk_disable(nop->clk); + + if (!IS_ERR(nop->vcc)) { + if (regulator_disable(nop->vcc)) + dev_err(phy->dev, "Failed to disable power\n"); + } } static int nop_set_peripheral(struct usb_otg *otg, struct usb_gadget *gadget) @@ -154,6 +166,12 @@ static int nop_usb_xceiv_probe(struct platform_device *pdev) } } + nop->vcc = devm_regulator_get(&pdev->dev, "vcc"); + if (IS_ERR(nop->vcc)) { + dev_dbg(&pdev->dev, "Error getting vcc regulator: %ld\n", + PTR_ERR(nop->vcc)); + } + nop->dev = &pdev->dev; nop->phy.dev = nop->dev; nop->phy.label = "nop-xceiv";