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: Add support for configuring PHY in HS Series B mode

Add separate tables_hs_b instance to allow the PHY driver to configure the
PHY in HS Series B mode. The individual SoC configs need to supply the
serdes register setting in tables_hs_b and the UFS driver can request the
Series B mode by calling phy_set_mode() with mode set to PHY_MODE_UFS_HS_B.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Tested-by: Andrew Halaney <ahalaney@redhat.com> # Qdrive3/sa8540p-ride
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Link: https://lore.kernel.org/r/20230114071009.88102-5-manivannan.sadhasivam@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Manivannan Sadhasivam and committed by
Vinod Koul
69d2f980 c9a7b0dd

+15
+15
drivers/phy/qualcomm/phy-qcom-qmp-ufs.c
··· 552 552 553 553 /* Main init sequence for PHY blocks - serdes, tx, rx, pcs */ 554 554 const struct qmp_phy_cfg_tbls tbls; 555 + /* Additional sequence for HS Series B */ 556 + const struct qmp_phy_cfg_tbls tbls_hs_b; 555 557 556 558 /* clock ids to be requested */ 557 559 const char * const *clk_list; ··· 587 585 struct reset_control *ufs_reset; 588 586 589 587 struct phy *phy; 588 + u32 mode; 590 589 }; 591 590 592 591 static inline void qphy_setbits(void __iomem *base, u32 offset, u32 val) ··· 851 848 static void qmp_ufs_init_registers(struct qmp_ufs *qmp, const struct qmp_phy_cfg *cfg) 852 849 { 853 850 qmp_ufs_serdes_init(qmp, &cfg->tbls); 851 + if (qmp->mode == PHY_MODE_UFS_HS_B) 852 + qmp_ufs_serdes_init(qmp, &cfg->tbls_hs_b); 854 853 qmp_ufs_lanes_init(qmp, &cfg->tbls); 855 854 qmp_ufs_pcs_init(qmp, &cfg->tbls); 856 855 } ··· 1023 1018 return qmp_ufs_exit(phy); 1024 1019 } 1025 1020 1021 + static int qmp_ufs_set_mode(struct phy *phy, enum phy_mode mode, int submode) 1022 + { 1023 + struct qmp_ufs *qmp = phy_get_drvdata(phy); 1024 + 1025 + qmp->mode = mode; 1026 + 1027 + return 0; 1028 + } 1029 + 1026 1030 static const struct phy_ops qcom_qmp_ufs_phy_ops = { 1027 1031 .power_on = qmp_ufs_enable, 1028 1032 .power_off = qmp_ufs_disable, 1033 + .set_mode = qmp_ufs_set_mode, 1029 1034 .owner = THIS_MODULE, 1030 1035 }; 1031 1036