Loading Documentation/devicetree/bindings/usb/msm-phy.txt +3 −2 Original line number Diff line number Diff line Loading @@ -149,7 +149,7 @@ Required properties: - clocks: a list of phandles to the PHY clocks. Use as per Documentation/devicetree/bindings/clock/clock-bindings.txt - clock-names: Names of the clocks in 1-1 correspondence with the "clocks" property. Required clocks are "ref_clk", "cfg_ahb_clk" and "phy_reset". property. Required clocks are "ref_clk_src", "ref_clk", "cfg_ahb_clk" and "phy_reset". - phy_type: Should be one of "ulpi" or "utmi". ChipIdea core uses "ulpi" mode. Optional properties: Loading Loading @@ -181,7 +181,8 @@ Example: qcom,tune2-efuse-num-bits = <3>; clocks = <&clock_rpm clk_ln_bb_clk>, <&clock_gcc clk_gcc_rx2_usb1_clkref_clk>, <&clock_gcc clk_gcc_usb_phy_cfg_ahb2phy_clk>, <&clock_gcc clk_gcc_qusb2_phy_reset>; clock-names = "ref_clk", "cfg_ahb_clk", "phy_reset"; clock-names = "ref_clk_src", "ref_clk", "cfg_ahb_clk", "phy_reset"; }; arch/arm/boot/dts/qcom/msm8996.dtsi +10 −5 Original line number Diff line number Diff line Loading @@ -2137,11 +2137,13 @@ 0x14 0x9C>; phy_type= "utmi"; clocks = <&clock_gcc clk_gcc_rx1_usb2_clkref_clk>, clocks = <&clock_gcc clk_ln_bb_clk>, <&clock_gcc clk_gcc_rx1_usb2_clkref_clk>, <&clock_gcc clk_gcc_usb_phy_cfg_ahb2phy_clk>, <&clock_gcc clk_gcc_qusb2phy_prim_reset>; clock-names = "ref_clk", "cfg_ahb_clk", "phy_reset"; clock-names = "ref_clk_src", "ref_clk", "cfg_ahb_clk", "phy_reset"; }; qusb_phy1: qusb@7412000 { Loading @@ -2168,11 +2170,13 @@ 0x14 0x9C>; phy_type = "utmi"; clocks = <&clock_gcc clk_gcc_rx2_usb2_clkref_clk>, clocks = <&clock_gcc clk_ln_bb_clk>, <&clock_gcc clk_gcc_rx2_usb2_clkref_clk>, <&clock_gcc clk_gcc_usb_phy_cfg_ahb2phy_clk>, <&clock_gcc clk_gcc_qusb2phy_sec_reset>; clock-names = "ref_clk", "cfg_ahb_clk", "phy_reset"; clock-names = "ref_clk_src", "ref_clk", "cfg_ahb_clk", "phy_reset"; }; ssphy: ssphy@7410000 { Loading @@ -2193,10 +2197,11 @@ <&clock_gcc clk_gcc_usb_phy_cfg_ahb2phy_clk>, <&clock_gcc clk_gcc_usb3_phy_reset>, <&clock_gcc clk_gcc_usb3phy_phy_reset>, <&clock_gcc clk_ln_bb_clk>, <&clock_gcc clk_gcc_usb3_clkref_clk>; clock-names = "aux_clk", "pipe_clk", "cfg_ahb_clk", "phy_reset", "phy_phy_reset", "ref_clk"; "phy_phy_reset", "ref_clk_src", "ref_clk"; }; usb_nop_phy: usb_nop_phy { Loading drivers/usb/phy/phy-msm-qusb.c +12 −0 Original line number Diff line number Diff line Loading @@ -89,6 +89,7 @@ struct qusb_phy { void __iomem *qscratch_base; void __iomem *tune2_efuse_reg; struct clk *ref_clk_src; struct clk *ref_clk; struct clk *cfg_ahb_clk; struct clk *phy_reset; Loading Loading @@ -309,6 +310,7 @@ static int qusb_phy_init(struct usb_phy *phy) return ret; if (!qphy->clocks_enabled) { clk_prepare_enable(qphy->ref_clk_src); clk_prepare_enable(qphy->ref_clk); clk_prepare_enable(qphy->cfg_ahb_clk); qphy->clocks_enabled = true; Loading Loading @@ -392,6 +394,7 @@ static void qusb_phy_shutdown(struct usb_phy *phy) /* clocks need to be on to access register */ if (!qphy->clocks_enabled) { clk_prepare_enable(qphy->ref_clk_src); clk_prepare_enable(qphy->ref_clk); clk_prepare_enable(qphy->cfg_ahb_clk); qphy->clocks_enabled = true; Loading @@ -404,6 +407,7 @@ static void qusb_phy_shutdown(struct usb_phy *phy) clk_disable_unprepare(qphy->cfg_ahb_clk); clk_disable_unprepare(qphy->ref_clk); clk_disable_unprepare(qphy->ref_clk_src); qphy->clocks_enabled = false; } Loading Loading @@ -461,6 +465,7 @@ static int qusb_phy_set_suspend(struct usb_phy *phy, int suspend) clk_disable_unprepare(qphy->cfg_ahb_clk); clk_disable_unprepare(qphy->ref_clk); clk_disable_unprepare(qphy->ref_clk_src); } else { /* Disconnect case */ /* Disable all interrupts */ writel_relaxed(0x00, Loading @@ -479,6 +484,7 @@ static int qusb_phy_set_suspend(struct usb_phy *phy, int suspend) qphy->base + QUSB2PHY_PORT_UTMI_CTRL2); clk_disable_unprepare(qphy->cfg_ahb_clk); clk_disable_unprepare(qphy->ref_clk); clk_disable_unprepare(qphy->ref_clk_src); qusb_phy_enable_power(qphy, false); } qphy->suspended = true; Loading @@ -486,6 +492,7 @@ static int qusb_phy_set_suspend(struct usb_phy *phy, int suspend) /* Bus suspend case */ if (qphy->cable_connected || (qphy->phy.flags & PHY_HOST_MODE)) { clk_prepare_enable(qphy->ref_clk_src); clk_prepare_enable(qphy->ref_clk); clk_prepare_enable(qphy->cfg_ahb_clk); /* Clear all interrupts on resume */ Loading @@ -493,6 +500,7 @@ static int qusb_phy_set_suspend(struct usb_phy *phy, int suspend) qphy->base + QUSB2PHY_PORT_INTR_CTRL); } else { qusb_phy_enable_power(qphy, true); clk_prepare_enable(qphy->ref_clk_src); clk_prepare_enable(qphy->ref_clk); clk_prepare_enable(qphy->cfg_ahb_clk); } Loading Loading @@ -612,6 +620,9 @@ static int qusb_phy_probe(struct platform_device *pdev) } } qphy->ref_clk_src = devm_clk_get(dev, "ref_clk_src"); if (IS_ERR(qphy->ref_clk_src)) return PTR_ERR(qphy->ref_clk_src); qphy->ref_clk = devm_clk_get(dev, "ref_clk"); if (IS_ERR(qphy->ref_clk)) return PTR_ERR(qphy->ref_clk); Loading Loading @@ -716,6 +727,7 @@ static int qusb_phy_remove(struct platform_device *pdev) if (qphy->clocks_enabled) { clk_disable_unprepare(qphy->cfg_ahb_clk); clk_disable_unprepare(qphy->ref_clk); clk_disable_unprepare(qphy->ref_clk_src); qphy->clocks_enabled = false; } Loading drivers/usb/phy/phy-msm-ssusb-qmp.c +8 −0 Original line number Diff line number Diff line Loading @@ -337,6 +337,7 @@ struct msm_ssphy_qmp { struct regulator *vdd; struct regulator *vdda18; int vdd_levels[3]; /* none, low, high */ struct clk *ref_clk_src; struct clk *ref_clk; struct clk *aux_clk; struct clk *cfg_ahb_clk; Loading Loading @@ -1000,6 +1001,9 @@ static int msm_ssphy_qmp_probe(struct platform_device *pdev) goto disable_ss_vdd; } phy->ref_clk_src = devm_clk_get(dev, "ref_clk_src"); if (!IS_ERR(phy->ref_clk_src)) clk_prepare_enable(phy->ref_clk_src); phy->ref_clk = devm_clk_get(dev, "ref_clk"); if (!IS_ERR(phy->ref_clk)) clk_prepare_enable(phy->ref_clk); Loading Loading @@ -1038,6 +1042,8 @@ static int msm_ssphy_qmp_probe(struct platform_device *pdev) disable_ss_ldo: if (!IS_ERR(phy->ref_clk)) clk_disable_unprepare(phy->ref_clk); if (!IS_ERR(phy->ref_clk_src)) clk_disable_unprepare(phy->ref_clk_src); msm_ssusb_qmp_ldo_enable(phy, 0); disable_ss_vdd: regulator_disable(phy->vdd); Loading @@ -1057,6 +1063,8 @@ static int msm_ssphy_qmp_remove(struct platform_device *pdev) usb_remove_phy(&phy->phy); if (!IS_ERR(phy->ref_clk)) clk_disable_unprepare(phy->ref_clk); if (!IS_ERR(phy->ref_clk_src)) clk_disable_unprepare(phy->ref_clk_src); msm_ssusb_qmp_ldo_enable(phy, 0); regulator_disable(phy->vdd); msm_ssusb_qmp_config_vdd(phy, 0); Loading Loading
Documentation/devicetree/bindings/usb/msm-phy.txt +3 −2 Original line number Diff line number Diff line Loading @@ -149,7 +149,7 @@ Required properties: - clocks: a list of phandles to the PHY clocks. Use as per Documentation/devicetree/bindings/clock/clock-bindings.txt - clock-names: Names of the clocks in 1-1 correspondence with the "clocks" property. Required clocks are "ref_clk", "cfg_ahb_clk" and "phy_reset". property. Required clocks are "ref_clk_src", "ref_clk", "cfg_ahb_clk" and "phy_reset". - phy_type: Should be one of "ulpi" or "utmi". ChipIdea core uses "ulpi" mode. Optional properties: Loading Loading @@ -181,7 +181,8 @@ Example: qcom,tune2-efuse-num-bits = <3>; clocks = <&clock_rpm clk_ln_bb_clk>, <&clock_gcc clk_gcc_rx2_usb1_clkref_clk>, <&clock_gcc clk_gcc_usb_phy_cfg_ahb2phy_clk>, <&clock_gcc clk_gcc_qusb2_phy_reset>; clock-names = "ref_clk", "cfg_ahb_clk", "phy_reset"; clock-names = "ref_clk_src", "ref_clk", "cfg_ahb_clk", "phy_reset"; };
arch/arm/boot/dts/qcom/msm8996.dtsi +10 −5 Original line number Diff line number Diff line Loading @@ -2137,11 +2137,13 @@ 0x14 0x9C>; phy_type= "utmi"; clocks = <&clock_gcc clk_gcc_rx1_usb2_clkref_clk>, clocks = <&clock_gcc clk_ln_bb_clk>, <&clock_gcc clk_gcc_rx1_usb2_clkref_clk>, <&clock_gcc clk_gcc_usb_phy_cfg_ahb2phy_clk>, <&clock_gcc clk_gcc_qusb2phy_prim_reset>; clock-names = "ref_clk", "cfg_ahb_clk", "phy_reset"; clock-names = "ref_clk_src", "ref_clk", "cfg_ahb_clk", "phy_reset"; }; qusb_phy1: qusb@7412000 { Loading @@ -2168,11 +2170,13 @@ 0x14 0x9C>; phy_type = "utmi"; clocks = <&clock_gcc clk_gcc_rx2_usb2_clkref_clk>, clocks = <&clock_gcc clk_ln_bb_clk>, <&clock_gcc clk_gcc_rx2_usb2_clkref_clk>, <&clock_gcc clk_gcc_usb_phy_cfg_ahb2phy_clk>, <&clock_gcc clk_gcc_qusb2phy_sec_reset>; clock-names = "ref_clk", "cfg_ahb_clk", "phy_reset"; clock-names = "ref_clk_src", "ref_clk", "cfg_ahb_clk", "phy_reset"; }; ssphy: ssphy@7410000 { Loading @@ -2193,10 +2197,11 @@ <&clock_gcc clk_gcc_usb_phy_cfg_ahb2phy_clk>, <&clock_gcc clk_gcc_usb3_phy_reset>, <&clock_gcc clk_gcc_usb3phy_phy_reset>, <&clock_gcc clk_ln_bb_clk>, <&clock_gcc clk_gcc_usb3_clkref_clk>; clock-names = "aux_clk", "pipe_clk", "cfg_ahb_clk", "phy_reset", "phy_phy_reset", "ref_clk"; "phy_phy_reset", "ref_clk_src", "ref_clk"; }; usb_nop_phy: usb_nop_phy { Loading
drivers/usb/phy/phy-msm-qusb.c +12 −0 Original line number Diff line number Diff line Loading @@ -89,6 +89,7 @@ struct qusb_phy { void __iomem *qscratch_base; void __iomem *tune2_efuse_reg; struct clk *ref_clk_src; struct clk *ref_clk; struct clk *cfg_ahb_clk; struct clk *phy_reset; Loading Loading @@ -309,6 +310,7 @@ static int qusb_phy_init(struct usb_phy *phy) return ret; if (!qphy->clocks_enabled) { clk_prepare_enable(qphy->ref_clk_src); clk_prepare_enable(qphy->ref_clk); clk_prepare_enable(qphy->cfg_ahb_clk); qphy->clocks_enabled = true; Loading Loading @@ -392,6 +394,7 @@ static void qusb_phy_shutdown(struct usb_phy *phy) /* clocks need to be on to access register */ if (!qphy->clocks_enabled) { clk_prepare_enable(qphy->ref_clk_src); clk_prepare_enable(qphy->ref_clk); clk_prepare_enable(qphy->cfg_ahb_clk); qphy->clocks_enabled = true; Loading @@ -404,6 +407,7 @@ static void qusb_phy_shutdown(struct usb_phy *phy) clk_disable_unprepare(qphy->cfg_ahb_clk); clk_disable_unprepare(qphy->ref_clk); clk_disable_unprepare(qphy->ref_clk_src); qphy->clocks_enabled = false; } Loading Loading @@ -461,6 +465,7 @@ static int qusb_phy_set_suspend(struct usb_phy *phy, int suspend) clk_disable_unprepare(qphy->cfg_ahb_clk); clk_disable_unprepare(qphy->ref_clk); clk_disable_unprepare(qphy->ref_clk_src); } else { /* Disconnect case */ /* Disable all interrupts */ writel_relaxed(0x00, Loading @@ -479,6 +484,7 @@ static int qusb_phy_set_suspend(struct usb_phy *phy, int suspend) qphy->base + QUSB2PHY_PORT_UTMI_CTRL2); clk_disable_unprepare(qphy->cfg_ahb_clk); clk_disable_unprepare(qphy->ref_clk); clk_disable_unprepare(qphy->ref_clk_src); qusb_phy_enable_power(qphy, false); } qphy->suspended = true; Loading @@ -486,6 +492,7 @@ static int qusb_phy_set_suspend(struct usb_phy *phy, int suspend) /* Bus suspend case */ if (qphy->cable_connected || (qphy->phy.flags & PHY_HOST_MODE)) { clk_prepare_enable(qphy->ref_clk_src); clk_prepare_enable(qphy->ref_clk); clk_prepare_enable(qphy->cfg_ahb_clk); /* Clear all interrupts on resume */ Loading @@ -493,6 +500,7 @@ static int qusb_phy_set_suspend(struct usb_phy *phy, int suspend) qphy->base + QUSB2PHY_PORT_INTR_CTRL); } else { qusb_phy_enable_power(qphy, true); clk_prepare_enable(qphy->ref_clk_src); clk_prepare_enable(qphy->ref_clk); clk_prepare_enable(qphy->cfg_ahb_clk); } Loading Loading @@ -612,6 +620,9 @@ static int qusb_phy_probe(struct platform_device *pdev) } } qphy->ref_clk_src = devm_clk_get(dev, "ref_clk_src"); if (IS_ERR(qphy->ref_clk_src)) return PTR_ERR(qphy->ref_clk_src); qphy->ref_clk = devm_clk_get(dev, "ref_clk"); if (IS_ERR(qphy->ref_clk)) return PTR_ERR(qphy->ref_clk); Loading Loading @@ -716,6 +727,7 @@ static int qusb_phy_remove(struct platform_device *pdev) if (qphy->clocks_enabled) { clk_disable_unprepare(qphy->cfg_ahb_clk); clk_disable_unprepare(qphy->ref_clk); clk_disable_unprepare(qphy->ref_clk_src); qphy->clocks_enabled = false; } Loading
drivers/usb/phy/phy-msm-ssusb-qmp.c +8 −0 Original line number Diff line number Diff line Loading @@ -337,6 +337,7 @@ struct msm_ssphy_qmp { struct regulator *vdd; struct regulator *vdda18; int vdd_levels[3]; /* none, low, high */ struct clk *ref_clk_src; struct clk *ref_clk; struct clk *aux_clk; struct clk *cfg_ahb_clk; Loading Loading @@ -1000,6 +1001,9 @@ static int msm_ssphy_qmp_probe(struct platform_device *pdev) goto disable_ss_vdd; } phy->ref_clk_src = devm_clk_get(dev, "ref_clk_src"); if (!IS_ERR(phy->ref_clk_src)) clk_prepare_enable(phy->ref_clk_src); phy->ref_clk = devm_clk_get(dev, "ref_clk"); if (!IS_ERR(phy->ref_clk)) clk_prepare_enable(phy->ref_clk); Loading Loading @@ -1038,6 +1042,8 @@ static int msm_ssphy_qmp_probe(struct platform_device *pdev) disable_ss_ldo: if (!IS_ERR(phy->ref_clk)) clk_disable_unprepare(phy->ref_clk); if (!IS_ERR(phy->ref_clk_src)) clk_disable_unprepare(phy->ref_clk_src); msm_ssusb_qmp_ldo_enable(phy, 0); disable_ss_vdd: regulator_disable(phy->vdd); Loading @@ -1057,6 +1063,8 @@ static int msm_ssphy_qmp_remove(struct platform_device *pdev) usb_remove_phy(&phy->phy); if (!IS_ERR(phy->ref_clk)) clk_disable_unprepare(phy->ref_clk); if (!IS_ERR(phy->ref_clk_src)) clk_disable_unprepare(phy->ref_clk_src); msm_ssusb_qmp_ldo_enable(phy, 0); regulator_disable(phy->vdd); msm_ssusb_qmp_config_vdd(phy, 0); Loading