Skip to content

Commit 73faaa6

Browse files
committed
Merge tag 'phy-for-5.7-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy into char-misc-linus
phy: for 5.7 -rc *) Update MAINTAINER to include Vinod Koul as co-maintainer of PHY *) Fix Kconfig dependencies in seen with PHY_TEGRA_XUSB *) Re-add "qcom,sdm845-qusb2-phy" compatible in phy-qcom-qusb2.c to make it work with existing dtbs *) Move clock enable from ->poweron() to ->init() in Qualcomm usb-hs-28nm driver to initialize HW in ->init() Signed-off-by: Kishon Vijay Abraham I <[email protected]> * tag 'phy-for-5.7-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy: phy: qualcomm: usb-hs-28nm: Prepare clocks in init MAINTAINERS: Add Vinod Koul as Generic PHY co-maintainer phy: qcom-qusb2: Re add "qcom,sdm845-qusb2-phy" compat string phy: tegra: Select USB_COMMON for usb_get_maximum_speed()
2 parents 5409e0c + 820eeb9 commit 73faaa6

File tree

3 files changed

+30
-12
lines changed

3 files changed

+30
-12
lines changed

MAINTAINERS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7119,9 +7119,10 @@ F: include/uapi/asm-generic/
71197119

71207120
GENERIC PHY FRAMEWORK
71217121
M: Kishon Vijay Abraham I <[email protected]>
7122+
M: Vinod Koul <[email protected]>
71227123
71237124
S: Supported
7124-
T: git git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy.git
7125+
T: git git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy.git
71257126
F: Documentation/devicetree/bindings/phy/
71267127
F: drivers/phy/
71277128
F: include/linux/phy/

drivers/phy/qualcomm/phy-qcom-qusb2.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -815,6 +815,13 @@ static const struct of_device_id qusb2_phy_of_match_table[] = {
815815
}, {
816816
.compatible = "qcom,msm8998-qusb2-phy",
817817
.data = &msm8998_phy_cfg,
818+
}, {
819+
/*
820+
* Deprecated. Only here to support legacy device
821+
* trees that didn't include "qcom,qusb2-v2-phy"
822+
*/
823+
.compatible = "qcom,sdm845-qusb2-phy",
824+
.data = &qusb2_v2_phy_cfg,
818825
}, {
819826
.compatible = "qcom,qusb2-v2-phy",
820827
.data = &qusb2_v2_phy_cfg,

drivers/phy/qualcomm/phy-qcom-usb-hs-28nm.c

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -160,18 +160,11 @@ static int qcom_snps_hsphy_power_on(struct phy *phy)
160160
ret = regulator_bulk_enable(VREG_NUM, priv->vregs);
161161
if (ret)
162162
return ret;
163-
ret = clk_bulk_prepare_enable(priv->num_clks, priv->clks);
164-
if (ret)
165-
goto err_disable_regulator;
163+
166164
qcom_snps_hsphy_disable_hv_interrupts(priv);
167165
qcom_snps_hsphy_exit_retention(priv);
168166

169167
return 0;
170-
171-
err_disable_regulator:
172-
regulator_bulk_disable(VREG_NUM, priv->vregs);
173-
174-
return ret;
175168
}
176169

177170
static int qcom_snps_hsphy_power_off(struct phy *phy)
@@ -180,7 +173,6 @@ static int qcom_snps_hsphy_power_off(struct phy *phy)
180173

181174
qcom_snps_hsphy_enter_retention(priv);
182175
qcom_snps_hsphy_enable_hv_interrupts(priv);
183-
clk_bulk_disable_unprepare(priv->num_clks, priv->clks);
184176
regulator_bulk_disable(VREG_NUM, priv->vregs);
185177

186178
return 0;
@@ -266,21 +258,39 @@ static int qcom_snps_hsphy_init(struct phy *phy)
266258
struct hsphy_priv *priv = phy_get_drvdata(phy);
267259
int ret;
268260

269-
ret = qcom_snps_hsphy_reset(priv);
261+
ret = clk_bulk_prepare_enable(priv->num_clks, priv->clks);
270262
if (ret)
271263
return ret;
272264

265+
ret = qcom_snps_hsphy_reset(priv);
266+
if (ret)
267+
goto disable_clocks;
268+
273269
qcom_snps_hsphy_init_sequence(priv);
274270

275271
ret = qcom_snps_hsphy_por_reset(priv);
276272
if (ret)
277-
return ret;
273+
goto disable_clocks;
274+
275+
return 0;
276+
277+
disable_clocks:
278+
clk_bulk_disable_unprepare(priv->num_clks, priv->clks);
279+
return ret;
280+
}
281+
282+
static int qcom_snps_hsphy_exit(struct phy *phy)
283+
{
284+
struct hsphy_priv *priv = phy_get_drvdata(phy);
285+
286+
clk_bulk_disable_unprepare(priv->num_clks, priv->clks);
278287

279288
return 0;
280289
}
281290

282291
static const struct phy_ops qcom_snps_hsphy_ops = {
283292
.init = qcom_snps_hsphy_init,
293+
.exit = qcom_snps_hsphy_exit,
284294
.power_on = qcom_snps_hsphy_power_on,
285295
.power_off = qcom_snps_hsphy_power_off,
286296
.set_mode = qcom_snps_hsphy_set_mode,

0 commit comments

Comments
 (0)