Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

phy: qcom-qmp-ufs: drop multi-PHY support

Each UFS QMP PHY device provides just a single UFS PHY. Drop support
for handling multiple child PHYs.

Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Tested-by: Bjorn Andersson <bjorn.andersson@linaro.org> # UFS, PCIe and USB on SC8180X
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20220607213203.2819885-26-dmitry.baryshkov@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Dmitry Baryshkov and committed by
Vinod Koul
1da7115e 1239fd71

+3 -30
+3 -30
drivers/phy/qualcomm/phy-qcom-qmp-ufs.c
··· 669 669 * @vregs: regulator supplies bulk data 670 670 * 671 671 * @phys: array of per-lane phy descriptors 672 - * @phy_mutex: mutex lock for PHY common block initialization 673 - * @init_count: phy common block initialization count 674 672 * @ufs_reset: optional UFS PHY reset handle 675 673 */ 676 674 struct qcom_qmp { ··· 678 680 struct regulator_bulk_data *vregs; 679 681 680 682 struct qmp_phy **phys; 681 - 682 - struct mutex phy_mutex; 683 - int init_count; 684 683 685 684 struct reset_control *ufs_reset; 686 685 }; ··· 926 931 void __iomem *pcs = qphy->pcs; 927 932 int ret; 928 933 929 - mutex_lock(&qmp->phy_mutex); 930 - if (qmp->init_count++) { 931 - mutex_unlock(&qmp->phy_mutex); 932 - return 0; 933 - } 934 - 935 934 /* turn on regulator supplies */ 936 935 ret = regulator_bulk_enable(cfg->num_vregs, qmp->vregs); 937 936 if (ret) { 938 937 dev_err(qmp->dev, "failed to enable regulators, err=%d\n", ret); 939 - goto err_unlock; 938 + return ret; 940 939 } 941 940 942 941 ret = clk_bulk_prepare_enable(cfg->num_clks, qmp->clks); ··· 945 956 qphy_setbits(pcs, QPHY_POWER_DOWN_CONTROL, 946 957 cfg->pwrdn_ctrl); 947 958 948 - mutex_unlock(&qmp->phy_mutex); 949 - 950 959 return 0; 951 960 952 961 err_disable_regulators: 953 962 regulator_bulk_disable(cfg->num_vregs, qmp->vregs); 954 - err_unlock: 955 - mutex_unlock(&qmp->phy_mutex); 956 963 957 964 return ret; 958 965 } ··· 958 973 struct qcom_qmp *qmp = qphy->qmp; 959 974 const struct qmp_phy_cfg *cfg = qphy->cfg; 960 975 961 - mutex_lock(&qmp->phy_mutex); 962 - if (--qmp->init_count) { 963 - mutex_unlock(&qmp->phy_mutex); 964 - return 0; 965 - } 966 - 967 976 reset_control_assert(qmp->ufs_reset); 968 977 969 978 clk_bulk_disable_unprepare(cfg->num_clks, qmp->clks); 970 979 971 980 regulator_bulk_disable(cfg->num_vregs, qmp->vregs); 972 - 973 - mutex_unlock(&qmp->phy_mutex); 974 981 975 982 return 0; 976 983 } ··· 1299 1322 struct phy_provider *phy_provider; 1300 1323 void __iomem *serdes; 1301 1324 const struct qmp_phy_cfg *cfg = NULL; 1302 - int num, id, expected_phys; 1325 + int num, id; 1303 1326 int ret; 1304 1327 1305 1328 qmp = devm_kzalloc(dev, sizeof(*qmp), GFP_KERNEL); ··· 1319 1342 if (IS_ERR(serdes)) 1320 1343 return PTR_ERR(serdes); 1321 1344 1322 - expected_phys = cfg->nlanes; 1323 - 1324 - mutex_init(&qmp->phy_mutex); 1325 - 1326 1345 ret = qcom_qmp_phy_ufs_clk_init(dev, cfg); 1327 1346 if (ret) 1328 1347 return ret; ··· 1333 1360 1334 1361 num = of_get_available_child_count(dev->of_node); 1335 1362 /* do we have a rogue child node ? */ 1336 - if (num > expected_phys) 1363 + if (num > 1) 1337 1364 return -EINVAL; 1338 1365 1339 1366 qmp->phys = devm_kcalloc(dev, num, sizeof(*qmp->phys), GFP_KERNEL);