diff options
Diffstat (limited to 'drivers/phy/qualcomm/phy-qcom-m31.c')
-rw-r--r-- | drivers/phy/qualcomm/phy-qcom-m31.c | 59 |
1 files changed, 55 insertions, 4 deletions
diff --git a/drivers/phy/qualcomm/phy-qcom-m31.c b/drivers/phy/qualcomm/phy-qcom-m31.c index 5cb7e79b99..c259057919 100644 --- a/drivers/phy/qualcomm/phy-qcom-m31.c +++ b/drivers/phy/qualcomm/phy-qcom-m31.c @@ -82,6 +82,50 @@ struct m31_priv_data { unsigned int nregs; }; +static const struct m31_phy_regs m31_ipq5018_regs[] = { + { + .off = USB_PHY_CFG0, + .val = UTMI_PHY_OVERRIDE_EN + }, + { + .off = USB_PHY_UTMI_CTRL5, + .val = POR_EN, + .delay = 15 + }, + { + .off = USB_PHY_FSEL_SEL, + .val = FREQ_SEL + }, + { + .off = USB_PHY_HS_PHY_CTRL_COMMON0, + .val = COMMONONN | FSEL | RETENABLEN + }, + { + .off = USB_PHY_REFCLK_CTRL, + .val = CLKCORE + }, + { + .off = USB_PHY_UTMI_CTRL5, + .val = POR_EN + }, + { + .off = USB_PHY_HS_PHY_CTRL2, + .val = USB2_SUSPEND_N_SEL | USB2_SUSPEND_N | USB2_UTMI_CLK_EN + }, + { + .off = USB_PHY_UTMI_CTRL5, + .val = 0x0 + }, + { + .off = USB_PHY_HS_PHY_CTRL2, + .val = USB2_SUSPEND_N | USB2_UTMI_CLK_EN + }, + { + .off = USB_PHY_CFG0, + .val = 0x0 + }, +}; + static struct m31_phy_regs m31_ipq5332_regs[] = { { USB_PHY_CFG0, @@ -241,7 +285,7 @@ static int m31usb_phy_probe(struct platform_device *pdev) qphy->clk = devm_clk_get(dev, NULL); if (IS_ERR(qphy->clk)) return dev_err_probe(dev, PTR_ERR(qphy->clk), - "failed to get clk\n"); + "failed to get clk\n"); data = of_device_get_match_data(dev); qphy->regs = data->regs; @@ -251,12 +295,12 @@ static int m31usb_phy_probe(struct platform_device *pdev) qphy->phy = devm_phy_create(dev, NULL, &m31usb_phy_gen_ops); if (IS_ERR(qphy->phy)) return dev_err_probe(dev, PTR_ERR(qphy->phy), - "failed to create phy\n"); + "failed to create phy\n"); qphy->vreg = devm_regulator_get(dev, "vdda-phy"); if (IS_ERR(qphy->vreg)) - return dev_err_probe(dev, PTR_ERR(qphy->vreg), - "failed to get vreg\n"); + return dev_err_probe(dev, PTR_ERR(qphy->phy), + "failed to get vreg\n"); phy_set_drvdata(qphy->phy, qphy); @@ -267,6 +311,12 @@ static int m31usb_phy_probe(struct platform_device *pdev) return PTR_ERR_OR_ZERO(phy_provider); } +static const struct m31_priv_data m31_ipq5018_data = { + .ulpi_mode = false, + .regs = m31_ipq5018_regs, + .nregs = ARRAY_SIZE(m31_ipq5018_regs), +}; + static const struct m31_priv_data m31_ipq5332_data = { .ulpi_mode = false, .regs = m31_ipq5332_regs, @@ -274,6 +324,7 @@ static const struct m31_priv_data m31_ipq5332_data = { }; static const struct of_device_id m31usb_phy_id_table[] = { + { .compatible = "qcom,ipq5018-usb-hsphy", .data = &m31_ipq5018_data }, { .compatible = "qcom,ipq5332-usb-hsphy", .data = &m31_ipq5332_data }, { }, }; |