struct device *dev;
struct clk *clk;
struct regulator *vcc;
+ struct regulator *reset;
};
static struct platform_device *pd;
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;
}
{
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);
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";