Commit e44f1f4c authored by Srinivas Kandagatla's avatar Srinivas Kandagatla Committed by Felipe Balbi

usb: phy: msm: Make phy_reset clk and reset line optional.

This patch makes the phy reset clk and reset line optional as this clk
is not available on boards like IFC6410 with APQ8064.
Signed-off-by: default avatarSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent e176475d
...@@ -279,11 +279,11 @@ static int msm_otg_link_clk_reset(struct msm_otg *motg, bool assert) ...@@ -279,11 +279,11 @@ static int msm_otg_link_clk_reset(struct msm_otg *motg, bool assert)
static int msm_otg_phy_clk_reset(struct msm_otg *motg) static int msm_otg_phy_clk_reset(struct msm_otg *motg)
{ {
int ret; int ret = 0;
if (motg->pdata->phy_clk_reset) if (motg->pdata->phy_clk_reset && motg->phy_reset_clk)
ret = motg->pdata->phy_clk_reset(motg->phy_reset_clk); ret = motg->pdata->phy_clk_reset(motg->phy_reset_clk);
else else if (motg->phy_rst)
ret = reset_control_reset(motg->phy_rst); ret = reset_control_reset(motg->phy_rst);
if (ret) if (ret)
...@@ -1464,7 +1464,7 @@ static int msm_otg_read_dt(struct platform_device *pdev, struct msm_otg *motg) ...@@ -1464,7 +1464,7 @@ static int msm_otg_read_dt(struct platform_device *pdev, struct msm_otg *motg)
motg->phy_rst = devm_reset_control_get(&pdev->dev, "phy"); motg->phy_rst = devm_reset_control_get(&pdev->dev, "phy");
if (IS_ERR(motg->phy_rst)) if (IS_ERR(motg->phy_rst))
return PTR_ERR(motg->phy_rst); motg->phy_rst = NULL;
pdata->mode = of_usb_get_dr_mode(node); pdata->mode = of_usb_get_dr_mode(node);
if (pdata->mode == USB_DR_MODE_UNKNOWN) if (pdata->mode == USB_DR_MODE_UNKNOWN)
...@@ -1556,7 +1556,7 @@ static int msm_otg_probe(struct platform_device *pdev) ...@@ -1556,7 +1556,7 @@ static int msm_otg_probe(struct platform_device *pdev)
np ? "phy" : "usb_phy_clk"); np ? "phy" : "usb_phy_clk");
if (IS_ERR(motg->phy_reset_clk)) { if (IS_ERR(motg->phy_reset_clk)) {
dev_err(&pdev->dev, "failed to get usb_phy_clk\n"); dev_err(&pdev->dev, "failed to get usb_phy_clk\n");
return PTR_ERR(motg->phy_reset_clk); motg->phy_reset_clk = NULL;
} }
motg->clk = devm_clk_get(&pdev->dev, np ? "core" : "usb_hs_clk"); motg->clk = devm_clk_get(&pdev->dev, np ? "core" : "usb_hs_clk");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment