phy: qcom-qmp: config and misc clean ups
Subsystems (2)
PATCH 3/17 phy: qcom-qmp-ufs: drop unused type from config
In reply to Johan HovoldThe configuration PHY type is no longer used since the QMP driver split so drop it from the configuration.
--- drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 8 -------- 1 file changed, 8 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-ufs.c +0 -8
@@ -535,8 +535,6 @@ struct qmp_phy;/* struct qmp_phy_cfg - per-PHY initialization config */ struct qmp_phy_cfg { -/* phy-type - PCIE/UFS/USB */ -unsigned int type;/* number of lanes provided by phy */ int nlanes;
@@ -668,7 +666,6 @@ static const char * const qmp_phy_vreg_l[] = { };static const struct qmp_phy_cfg msm8996_ufs_cfg = { - .type =PHY_TYPE_UFS , .nlanes =1 , .serdes_tbl = msm8996_ufs_serdes_tbl,
@@ -694,7 +691,6 @@ static const struct qmp_phy_cfg msm8996_ufs_cfg = { };static const struct qmp_phy_cfg sdm845_ufsphy_cfg = { - .type =PHY_TYPE_UFS , .nlanes =2 , .serdes_tbl = sdm845_ufsphy_serdes_tbl,
@@ -720,7 +716,6 @@ static const struct qmp_phy_cfg sdm845_ufsphy_cfg = { };static const struct qmp_phy_cfg sm6115_ufsphy_cfg = { - .type =PHY_TYPE_UFS , .nlanes =1 , .serdes_tbl = sm6115_ufsphy_serdes_tbl,
@@ -744,7 +739,6 @@ static const struct qmp_phy_cfg sm6115_ufsphy_cfg = { };static const struct qmp_phy_cfg sm8150_ufsphy_cfg = { - .type =PHY_TYPE_UFS , .nlanes =2 , .serdes_tbl = sm8150_ufsphy_serdes_tbl,
@@ -769,7 +763,6 @@ static const struct qmp_phy_cfg sm8150_ufsphy_cfg = { };static const struct qmp_phy_cfg sm8350_ufsphy_cfg = { - .type =PHY_TYPE_UFS , .nlanes =2 , .serdes_tbl = sm8350_ufsphy_serdes_tbl,
@@ -794,7 +787,6 @@ static const struct qmp_phy_cfg sm8350_ufsphy_cfg = { };static const struct qmp_phy_cfg sm8450_ufsphy_cfg = { - .type =PHY_TYPE_UFS , .nlanes =2 , .serdes_tbl = sm8350_ufsphy_serdes_tbl,
Signature · 1 line
2.35.1
PATCH 7/17 phy: qcom-qmp: drop unused forward declarations
In reply to Johan HovoldOnly the combo QMP driver needs a forward declaration of struct qmp_phy.
--- drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c | 2 -- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 2 -- drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 2 -- drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 2 -- 4 files changed, 8 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c +0 -2
@@ -184,8 +184,6 @@ static const struct qmp_phy_init_tbl msm8996_pcie_pcs_tbl[] = { QMP_PHY_INIT_CFG(QPHY_V2_PCS_TXDEEMPH_M3P5DB_V0, 0x0e), }; -struct qmp_phy ; -/* struct qmp_phy_cfg - per-PHY initialization config */ struct qmp_phy_cfg {/* number of lanes provided by phy */
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +0 -2
@@ -1300,8 +1300,6 @@ static const struct qmp_phy_init_tbl sm8450_qmp_gen4x2_pcie_pcs_misc_tbl[] = { QMP_PHY_INIT_CFG(QPHY_V5_20_PCS_PCIE_G4_PRE_GAIN, 0x2e), }; -struct qmp_phy ; -/* struct qmp_phy_cfg - per-PHY initialization config */ struct qmp_phy_cfg {/* number of lanes provided by phy */
drivers/phy/qualcomm/phy-qcom-qmp-ufs.c +0 -2
@@ -531,8 +531,6 @@ static const struct qmp_phy_init_tbl sm8350_ufsphy_pcs_tbl[] = { QMP_PHY_INIT_CFG(QPHY_V5_PCS_UFS_MULTI_LANE_CTRL1, 0x02), }; -struct qmp_phy ; -/* struct qmp_phy_cfg - per-PHY initialization config */ struct qmp_phy_cfg {/* number of lanes provided by phy */
drivers/phy/qualcomm/phy-qcom-qmp-usb.c +0 -2
@@ -1427,8 +1427,6 @@ static const struct qmp_phy_init_tbl sc8280xp_usb3_uniphy_pcs_tbl[] = { QMP_PHY_INIT_CFG(QPHY_V5_PCS_REFGEN_REQ_CONFIG1, 0x21), }; -struct qmp_phy ; -/* struct qmp_phy_cfg - per-PHY initialization config */ struct qmp_phy_cfg {/* number of lanes provided by phy */
Signature · 7 lines
2.35.1 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH 8/17 phy: qcom-qmp-pcie-msm8996: drop unused kernel doc
In reply to Johan HovoldDrop the removed mode field from the struct qmp_phy kernel doc.
--- drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c | 1 - 1 file changed, 1 deletion(-)
drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c +0 -1
@@ -238,7 +238,6 @@ struct qmp_phy_cfg {* @index: lane index * @qmp: QMP phy to which this lane belongs * @lane_rst: lane's reset controller -* @mode: current PHY mode */ struct qmp_phy {struct phy *phy;
Signature · 1 line
2.35.1
PATCH 5/17 phy: qcom-qmp-pcie: drop init and exit wrappers
In reply to Johan HovoldDrop the unnecessary PHY init and exit callback wrappers.
--- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 29 ++++-------------------- 1 file changed, 4 insertions(+), 25 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +4 -25
@@ -1877,8 +1877,9 @@ static int qmp_pcie_serdes_init(struct qmp_phy *qphy)return 0 ; } -static int qmp_pcie_com_init (struct qmp_phy *qphy) +static int qmp_pcie_init (struct phy *phy) { +struct qmp_phy *qphy =phy_get_drvdata (phy);struct qcom_qmp *qmp = qphy->qmp;const struct qmp_phy_cfg *cfg = qphy->cfg;void __iomem *pcs = qphy->pcs;
@@ -1925,8 +1926,9 @@ static int qmp_pcie_com_init(struct qmp_phy *qphy)return ret; } -static int qmp_pcie_com_exit (struct qmp_phy *qphy) +static int qmp_pcie_exit (struct phy *phy) { +struct qmp_phy *qphy =phy_get_drvdata (phy);struct qcom_qmp *qmp = qphy->qmp;const struct qmp_phy_cfg *cfg = qphy->cfg;
@@ -1939,20 +1941,6 @@ static int qmp_pcie_com_exit(struct qmp_phy *qphy)return 0 ; } -static int qmp_pcie_init (struct phy *phy) -{ -struct qmp_phy *qphy =phy_get_drvdata (phy); -struct qcom_qmp *qmp = qphy->qmp; -int ret; -dev_vdbg (qmp->dev,"Initializing QMP phy\n" ); - - ret =qmp_pcie_com_init (qphy); -if (ret) -return ret; - -return 0 ; -} -static int qmp_pcie_power_on (struct phy *phy) {struct qmp_phy *qphy =phy_get_drvdata (phy);
@@ -2060,15 +2048,6 @@ static int qmp_pcie_power_off(struct phy *phy)return 0 ; } -static int qmp_pcie_exit (struct phy *phy) -{ -struct qmp_phy *qphy =phy_get_drvdata (phy); - -qmp_pcie_com_exit (qphy); - -return 0 ; -} -static int qmp_pcie_enable (struct phy *phy) {int ret;
Signature · 1 line
2.35.1
PATCH 9/17 phy: qcom-qmp-pcie: drop unused mode field
In reply to Johan HovoldDrop the unused mode field from struct qmp_phy.
--- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 2 -- 1 file changed, 2 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +0 -2
@@ -1374,7 +1374,6 @@ struct qmp_phy_cfg {* @pipe_clk: pipe clock * @index: lane index * @qmp: QMP phy to which this lane belongs -* @mode: current PHY mode */ struct qmp_phy {struct phy *phy;
@@ -1389,7 +1388,6 @@ struct qmp_phy {struct clk *pipe_clk;unsigned int index;struct qcom_qmp *qmp; -enum phy_mode mode; };/**
Signature · 1 line
2.35.1
PATCH 6/17 phy: qcom-qmp-usb: drop init and exit wrappers
In reply to Johan HovoldDrop the unnecessary PHY init and exit callback wrappers.
--- drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 29 ++++--------------------- 1 file changed, 4 insertions(+), 25 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-usb.c +4 -25
@@ -2125,8 +2125,9 @@ static int qmp_usb_serdes_init(struct qmp_phy *qphy)return 0 ; } -static int qmp_usb_com_init (struct qmp_phy *qphy) +static int qmp_usb_init (struct phy *phy) { +struct qmp_phy *qphy =phy_get_drvdata (phy);struct qcom_qmp *qmp = qphy->qmp;const struct qmp_phy_cfg *cfg = qphy->cfg;void __iomem *pcs = qphy->pcs;
@@ -2197,8 +2198,9 @@ static int qmp_usb_com_init(struct qmp_phy *qphy)return ret; } -static int qmp_usb_com_exit (struct qmp_phy *qphy) +static int qmp_usb_exit (struct phy *phy) { +struct qmp_phy *qphy =phy_get_drvdata (phy);struct qcom_qmp *qmp = qphy->qmp;const struct qmp_phy_cfg *cfg = qphy->cfg;
@@ -2211,20 +2213,6 @@ static int qmp_usb_com_exit(struct qmp_phy *qphy)return 0 ; } -static int qmp_usb_init (struct phy *phy) -{ -struct qmp_phy *qphy =phy_get_drvdata (phy); -struct qcom_qmp *qmp = qphy->qmp; -int ret; -dev_vdbg (qmp->dev,"Initializing QMP phy\n" ); - - ret =qmp_usb_com_init (qphy); -if (ret) -return ret; - -return 0 ; -} -static int qmp_usb_power_on (struct phy *phy) {struct qmp_phy *qphy =phy_get_drvdata (phy);
@@ -2316,15 +2304,6 @@ static int qmp_usb_power_off(struct phy *phy)return 0 ; } -static int qmp_usb_exit (struct phy *phy) -{ -struct qmp_phy *qphy =phy_get_drvdata (phy); - -qmp_usb_com_exit (qphy); - -return 0 ; -} -static int qmp_usb_enable (struct phy *phy) {int ret;
Signature · 1 line
2.35.1
PATCH 2/17 phy: qcom-qmp-pcie-msm8996: drop unused type from config
In reply to Johan HovoldThe configuration PHY type is no longer used since the QMP driver split so drop it from the configuration.
--- drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c | 3 --- 1 file changed, 3 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c +0 -3
@@ -188,8 +188,6 @@ struct qmp_phy;/* struct qmp_phy_cfg - per-PHY initialization config */ struct qmp_phy_cfg { -/* phy-type - PCIE/UFS/USB */ -unsigned int type;/* number of lanes provided by phy */ int nlanes;
@@ -323,7 +321,6 @@ static const char * const qmp_phy_vreg_l[] = { };static const struct qmp_phy_cfg msm8996_pciephy_cfg = { - .type =PHY_TYPE_PCIE , .nlanes =3 , .serdes_tbl = msm8996_pcie_serdes_tbl,
Signature · 7 lines
2.35.1 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH 11/17 phy: qcom-qmp: drop unused index field
In reply to Johan HovoldOnly the MSM8996 PCIe QMP driver uses the index field so drop it from the other drivers.
--- drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 3 --- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 3 --- drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 3 --- drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 3 --- 4 files changed, 12 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-combo.c +0 -3
@@ -906,7 +906,6 @@ struct qmp_phy_combo_cfg {* @pcs_misc: iomapped memory space for lane's pcs_misc * @pcs_usb: iomapped memory space for lane's pcs_usb * @pipe_clk: pipe clock -* @index: lane index * @qmp: QMP phy to which this lane belongs * @mode: current PHY mode * @dp_aux_cfg: Display port aux config
@@ -925,7 +924,6 @@ struct qmp_phy {void __iomem *pcs_misc;void __iomem *pcs_usb;struct clk *pipe_clk; -unsigned int index;struct qcom_qmp *qmp;enum phy_mode mode;unsigned int dp_aux_cfg;
@@ -2779,7 +2777,6 @@ static int qmp_combo_create(struct device *dev, struct device_node *np, int id, } qphy->phy = generic_phy; - qphy->index = id; qphy->qmp = qmp; qmp->phys[id] = qphy;phy_set_drvdata (generic_phy, qphy);
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +0 -3
@@ -1371,7 +1371,6 @@ struct qmp_phy_cfg {* @rx2: iomapped memory space for second lane's rx (in dual lane PHYs) * @pcs_misc: iomapped memory space for lane's pcs_misc * @pipe_clk: pipe clock -* @index: lane index * @qmp: QMP phy to which this lane belongs */ struct qmp_phy {
@@ -1385,7 +1384,6 @@ struct qmp_phy {void __iomem *rx2;void __iomem *pcs_misc;struct clk *pipe_clk; -unsigned int index;struct qcom_qmp *qmp; };
@@ -2264,7 +2262,6 @@ static int qmp_pcie_create(struct device *dev, struct device_node *np, int id, } qphy->phy = generic_phy; - qphy->index = id; qphy->qmp = qmp; qmp->phys[id] = qphy;phy_set_drvdata (generic_phy, qphy);
drivers/phy/qualcomm/phy-qcom-qmp-ufs.c +0 -3
@@ -580,7 +580,6 @@ struct qmp_phy_cfg {* @tx2: iomapped memory space for second lane's tx (in dual lane PHYs) * @rx2: iomapped memory space for second lane's rx (in dual lane PHYs) * @pcs_misc: iomapped memory space for lane's pcs_misc -* @index: lane index * @qmp: QMP phy to which this lane belongs */ struct qmp_phy {
@@ -593,7 +592,6 @@ struct qmp_phy {void __iomem *tx2;void __iomem *rx2;void __iomem *pcs_misc; -unsigned int index;struct qcom_qmp *qmp; };
@@ -1149,7 +1147,6 @@ static int qmp_ufs_create(struct device *dev, struct device_node *np, int id, } qphy->phy = generic_phy; - qphy->index = id; qphy->qmp = qmp; qmp->phys[id] = qphy;phy_set_drvdata (generic_phy, qphy);
drivers/phy/qualcomm/phy-qcom-qmp-usb.c +0 -3
@@ -1491,7 +1491,6 @@ struct qmp_phy_cfg {* @pcs_misc: iomapped memory space for lane's pcs_misc * @pcs_usb: iomapped memory space for lane's pcs_usb * @pipe_clk: pipe clock -* @index: lane index * @qmp: QMP phy to which this lane belongs * @mode: current PHY mode */
@@ -1507,7 +1506,6 @@ struct qmp_phy {void __iomem *pcs_misc;void __iomem *pcs_usb;struct clk *pipe_clk; -unsigned int index;struct qcom_qmp *qmp;enum phy_mode mode; };
@@ -2648,7 +2646,6 @@ int qmp_usb_create(struct device *dev, struct device_node *np, int id, } qphy->phy = generic_phy; - qphy->index = id; qphy->qmp = qmp; qmp->phys[id] = qphy;phy_set_drvdata (generic_phy, qphy);
Signature · 7 lines
2.35.1 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
cover phy: qcom-qmp: config and misc clean ups
Here's the next and hopefully last set of QMP driver cleanups for a while.
These patches drops further configuration parameters that are unused or redundant since the QMP driver split.
This notably includes consolidating the lane configuration, which for legacy reasons was inconsistent.
Johan
Johan Hovold (17):
phy: qcom-qmp-pcie: drop unused type from config
phy: qcom-qmp-pcie-msm8996: drop unused type from config
phy: qcom-qmp-ufs: drop unused type from config
phy: qcom-qmp-usb: drop unused type from config
phy: qcom-qmp-pcie: drop init and exit wrappers
phy: qcom-qmp-usb: drop init and exit wrappers
phy: qcom-qmp: drop unused forward declarations
phy: qcom-qmp-pcie-msm8996: drop unused kernel doc
phy: qcom-qmp-pcie: drop unused mode field
phy: qcom-qmp-pcie: drop unused config field
phy: qcom-qmp: drop unused index field
phy: qcom-qmp-pcie: consolidate lane config
phy: qcom-qmp-pcie-msm8996: rename nlanes config
phy: qcom-qmp-combo: consolidate lane config
phy: qcom-qmp-ufs: consolidate lane config
phy: qcom-qmp-usb: consolidate lane config
phy: qcom-qmp-combo: drop redundant DP config flag
drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 104 +++++----------- .../phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c | 14 +-- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 90 ++++---------- drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 44 ++----- drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 112 ++++-------------- 5 files changed, 89 insertions(+), 275 deletions(-)
Signature · 7 lines
2.35.1 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH 10/17 phy: qcom-qmp-pcie: drop unused config field
Drop the unused mask_com_pcs_ready field from struct qmp_phy_cfg.
--- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 1 - 1 file changed, 1 deletion(-)
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +0 -1
@@ -1342,7 +1342,6 @@ struct qmp_phy_cfg {unsigned int start_ctrl;unsigned int pwrdn_ctrl; -unsigned int mask_com_pcs_ready;/* bit offset of PHYSTATUS in QPHY_PCS_STATUS register */ unsigned int phy_status;
Signature · 1 line
2.35.1
PATCH 13/17 phy: qcom-qmp-pcie-msm8996: rename nlanes config
In reply to Johan HovoldThe nlanes configuration parameter is really the number of PHYs provided by this QMP block on MSM8996. Rename it accordingly.
--- drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c +4 -4
@@ -186,8 +186,8 @@ static const struct qmp_phy_init_tbl msm8996_pcie_pcs_tbl[] = {/* struct qmp_phy_cfg - per-PHY initialization config */ struct qmp_phy_cfg { -/* number of lanes provided by phy */ -int nlanes; +/* number of PHYs provided by this block */ +int num_phys;/* Init sequence for PHY blocks - serdes, tx, rx, pcs */ const struct qmp_phy_init_tbl *serdes_tbl;
@@ -318,7 +318,7 @@ static const char * const qmp_phy_vreg_l[] = { };static const struct qmp_phy_cfg msm8996_pciephy_cfg = { - .nlanes =3 , + .num_phys =3 , .serdes_tbl = msm8996_pcie_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (msm8996_pcie_serdes_tbl),
@@ -861,7 +861,7 @@ static int qmp_pcie_msm8996_probe(struct platform_device *pdev)if (IS_ERR (serdes))return PTR_ERR (serdes); - expected_phys = cfg->nlanes; + expected_phys = cfg->num_phys;mutex_init (&qmp->phy_mutex);
Signature · 7 lines
2.35.1 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH 12/17 phy: qcom-qmp-pcie: consolidate lane config
In reply to Johan HovoldFor legacy reasons, there are two configuration parameters that describe the number of lanes a PHY has.
Replace them both with a new field simply named "lanes".
--- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 39 ++++++++++-------------- 1 file changed, 16 insertions(+), 23 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +16 -23
@@ -1302,8 +1302,7 @@ static const struct qmp_phy_init_tbl sm8450_qmp_gen4x2_pcie_pcs_misc_tbl[] = {/* struct qmp_phy_cfg - per-PHY initialization config */ struct qmp_phy_cfg { -/* number of lanes provided by phy */ -int nlanes; +int lanes;/* Init sequence for PHY blocks - serdes, tx, rx, pcs */ const struct qmp_phy_init_tbl *serdes_tbl;
@@ -1351,9 +1350,6 @@ struct qmp_phy_cfg {int pwrdn_delay_min;int pwrdn_delay_max; -/* true, if PHY has secondary tx/rx lanes to be configured */ -bool is_dual_lane_phy; -/* QMP PHY pipe clock interface rate */ unsigned long pipe_clock_rate; };
@@ -1461,7 +1457,7 @@ static const char * const sdm845_pciephy_reset_l[] = { };static const struct qmp_phy_cfg ipq8074_pciephy_cfg = { - .nlanes =1 , + .lanes =1 , .serdes_tbl = ipq8074_pcie_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (ipq8074_pcie_serdes_tbl),
@@ -1489,7 +1485,7 @@ static const struct qmp_phy_cfg ipq8074_pciephy_cfg = { };static const struct qmp_phy_cfg ipq8074_pciephy_gen3_cfg = { - .nlanes =1 , + .lanes =1 , .serdes_tbl = ipq8074_pcie_gen3_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (ipq8074_pcie_gen3_serdes_tbl),
@@ -1518,7 +1514,7 @@ static const struct qmp_phy_cfg ipq8074_pciephy_gen3_cfg = { };static const struct qmp_phy_cfg ipq6018_pciephy_cfg = { - .nlanes =1 , + .lanes =1 , .serdes_tbl = ipq6018_pcie_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (ipq6018_pcie_serdes_tbl),
@@ -1547,7 +1543,7 @@ static const struct qmp_phy_cfg ipq6018_pciephy_cfg = { };static const struct qmp_phy_cfg sdm845_qmp_pciephy_cfg = { - .nlanes =1 , + .lanes =1 , .serdes_tbl = sdm845_qmp_pcie_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sdm845_qmp_pcie_serdes_tbl),
@@ -1577,7 +1573,7 @@ static const struct qmp_phy_cfg sdm845_qmp_pciephy_cfg = { };static const struct qmp_phy_cfg sdm845_qhp_pciephy_cfg = { - .nlanes =1 , + .lanes =1 , .serdes_tbl = sdm845_qhp_pcie_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sdm845_qhp_pcie_serdes_tbl),
@@ -1605,7 +1601,7 @@ static const struct qmp_phy_cfg sdm845_qhp_pciephy_cfg = { };static const struct qmp_phy_cfg sm8250_qmp_gen3x1_pciephy_cfg = { - .nlanes =1 , + .lanes =1 , .serdes_tbl = sm8250_qmp_pcie_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sm8250_qmp_pcie_serdes_tbl),
@@ -1643,7 +1639,7 @@ static const struct qmp_phy_cfg sm8250_qmp_gen3x1_pciephy_cfg = { };static const struct qmp_phy_cfg sm8250_qmp_gen3x2_pciephy_cfg = { - .nlanes =2 , + .lanes =2 , .serdes_tbl = sm8250_qmp_pcie_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sm8250_qmp_pcie_serdes_tbl),
@@ -1675,14 +1671,13 @@ static const struct qmp_phy_cfg sm8250_qmp_gen3x2_pciephy_cfg = { .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, .phy_status = PHYSTATUS, - .is_dual_lane_phy = true, .has_pwrdn_delay = true, .pwrdn_delay_min = 995, /* us */ .pwrdn_delay_max = 1005, /* us */ };static const struct qmp_phy_cfg msm8998_pciephy_cfg = { - .nlanes =1 , + .lanes =1 , .serdes_tbl = msm8998_pcie_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (msm8998_pcie_serdes_tbl),
@@ -1706,7 +1701,7 @@ static const struct qmp_phy_cfg msm8998_pciephy_cfg = { };static const struct qmp_phy_cfg sc8180x_pciephy_cfg = { - .nlanes =1 , + .lanes =1 , .serdes_tbl = sc8180x_qmp_pcie_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sc8180x_qmp_pcie_serdes_tbl),
@@ -1735,7 +1730,7 @@ static const struct qmp_phy_cfg sc8180x_pciephy_cfg = { };static const struct qmp_phy_cfg sdx55_qmp_pciephy_cfg = { - .nlanes =2 , + .lanes =2 , .serdes_tbl = sdx55_qmp_pcie_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sdx55_qmp_pcie_serdes_tbl),
@@ -1759,14 +1754,13 @@ static const struct qmp_phy_cfg sdx55_qmp_pciephy_cfg = { .pwrdn_ctrl = SW_PWRDN, .phy_status = PHYSTATUS_4_20, - .is_dual_lane_phy = true, .has_pwrdn_delay = true, .pwrdn_delay_min = 995, /* us */ .pwrdn_delay_max = 1005, /* us */ };static const struct qmp_phy_cfg sm8450_qmp_gen3x1_pciephy_cfg = { - .nlanes =1 , + .lanes =1 , .serdes_tbl = sm8450_qmp_gen3x1_pcie_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sm8450_qmp_gen3x1_pcie_serdes_tbl),
@@ -1796,7 +1790,7 @@ static const struct qmp_phy_cfg sm8450_qmp_gen3x1_pciephy_cfg = { };static const struct qmp_phy_cfg sm8450_qmp_gen4x2_pciephy_cfg = { - .nlanes =2 , + .lanes =2 , .serdes_tbl = sm8450_qmp_gen4x2_pcie_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sm8450_qmp_gen4x2_pcie_serdes_tbl),
@@ -1820,7 +1814,6 @@ static const struct qmp_phy_cfg sm8450_qmp_gen4x2_pciephy_cfg = { .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, .phy_status = PHYSTATUS_4_20, - .is_dual_lane_phy = true, .has_pwrdn_delay = true, .pwrdn_delay_min = 995, /* us */ .pwrdn_delay_max = 1005, /* us */
@@ -1959,7 +1952,7 @@ static int qmp_pcie_power_on(struct phy *phy)qmp_pcie_configure_lane (tx, cfg->regs, cfg->tx_tbl, cfg->tx_tbl_num,1 );qmp_pcie_configure_lane (tx, cfg->regs, cfg->tx_tbl_sec, cfg->tx_tbl_num_sec,1 ); -if (cfg->is_dual_lane_phy) { +if (cfg->lanes >=2 ) {qmp_pcie_configure_lane (qphy->tx2, cfg->regs, cfg->tx_tbl, cfg->tx_tbl_num,2 ); qmp_pcie_configure_lane(qphy->tx2, cfg->regs, cfg->tx_tbl_sec,
@@ -1969,7 +1962,7 @@ static int qmp_pcie_power_on(struct phy *phy)qmp_pcie_configure_lane (rx, cfg->regs, cfg->rx_tbl, cfg->rx_tbl_num,1 );qmp_pcie_configure_lane (rx, cfg->regs, cfg->rx_tbl_sec, cfg->rx_tbl_num_sec,1 ); -if (cfg->is_dual_lane_phy) { +if (cfg->lanes >=2 ) {qmp_pcie_configure_lane (qphy->rx2, cfg->regs, cfg->rx_tbl, cfg->rx_tbl_num,2 ); qmp_pcie_configure_lane(qphy->rx2, cfg->regs, cfg->rx_tbl_sec,
@@ -2225,7 +2218,7 @@ static int qmp_pcie_create(struct device *dev, struct device_node *np, int id,if (IS_ERR (qphy->pcs))return PTR_ERR (qphy->pcs); -if (cfg->is_dual_lane_phy) { +if (cfg->lanes >=2 ) { qphy->tx2 =devm_of_iomap (dev, np,3 ,NULL );if (IS_ERR (qphy->tx2))return PTR_ERR (qphy->tx2);
Signature · 7 lines
2.35.1 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH 4/17 phy: qcom-qmp-usb: drop unused type from config
In reply to Johan HovoldThe configuration PHY type is no longer needed since the QMP driver split so drop it from the configuration and suspend callbacks.
--- drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 26 ------------------------- 1 file changed, 26 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-usb.c +0 -26
@@ -1431,8 +1431,6 @@ struct qmp_phy;/* struct qmp_phy_cfg - per-PHY initialization config */ struct qmp_phy_cfg { -/* phy-type - PCIE/UFS/USB */ -unsigned int type;/* number of lanes provided by phy */ int nlanes;
@@ -1609,7 +1607,6 @@ static const char * const qmp_phy_vreg_l[] = { };static const struct qmp_phy_cfg ipq8074_usb3phy_cfg = { - .type =PHY_TYPE_USB3 , .nlanes =1 , .serdes_tbl = ipq8074_usb3_serdes_tbl,
@@ -1634,7 +1631,6 @@ static const struct qmp_phy_cfg ipq8074_usb3phy_cfg = { };static const struct qmp_phy_cfg msm8996_usb3phy_cfg = { - .type =PHY_TYPE_USB3 , .nlanes =1 , .serdes_tbl = msm8996_usb3_serdes_tbl,
@@ -1659,7 +1655,6 @@ static const struct qmp_phy_cfg msm8996_usb3phy_cfg = { };static const struct qmp_phy_cfg qmp_v3_usb3phy_cfg = { - .type =PHY_TYPE_USB3 , .nlanes =1 , .serdes_tbl = qmp_v3_usb3_serdes_tbl,
@@ -1691,7 +1686,6 @@ static const struct qmp_phy_cfg qmp_v3_usb3phy_cfg = { };static const struct qmp_phy_cfg sc7180_usb3phy_cfg = { - .type =PHY_TYPE_USB3 , .nlanes =1 , .serdes_tbl = qmp_v3_usb3_serdes_tbl,
@@ -1723,7 +1717,6 @@ static const struct qmp_phy_cfg sc7180_usb3phy_cfg = { };static const struct qmp_phy_cfg sc8280xp_usb3_uniphy_cfg = { - .type =PHY_TYPE_USB3 , .nlanes =1 , .serdes_tbl = sc8280xp_usb3_uniphy_serdes_tbl,
@@ -1752,7 +1745,6 @@ static const struct qmp_phy_cfg sc8280xp_usb3_uniphy_cfg = { };static const struct qmp_phy_cfg qmp_v3_usb3_uniphy_cfg = { - .type =PHY_TYPE_USB3 , .nlanes =1 , .serdes_tbl = qmp_v3_usb3_uniphy_serdes_tbl,
@@ -1781,7 +1773,6 @@ static const struct qmp_phy_cfg qmp_v3_usb3_uniphy_cfg = { };static const struct qmp_phy_cfg msm8998_usb3phy_cfg = { - .type =PHY_TYPE_USB3 , .nlanes =1 , .serdes_tbl = msm8998_usb3_serdes_tbl,
@@ -1808,7 +1799,6 @@ static const struct qmp_phy_cfg msm8998_usb3phy_cfg = { };static const struct qmp_phy_cfg sm8150_usb3phy_cfg = { - .type =PHY_TYPE_USB3 , .nlanes =1 , .serdes_tbl = sm8150_usb3_serdes_tbl,
@@ -1844,7 +1834,6 @@ static const struct qmp_phy_cfg sm8150_usb3phy_cfg = { };static const struct qmp_phy_cfg sm8150_usb3_uniphy_cfg = { - .type =PHY_TYPE_USB3 , .nlanes =1 , .serdes_tbl = sm8150_usb3_uniphy_serdes_tbl,
@@ -1876,7 +1865,6 @@ static const struct qmp_phy_cfg sm8150_usb3_uniphy_cfg = { };static const struct qmp_phy_cfg sm8250_usb3phy_cfg = { - .type =PHY_TYPE_USB3 , .nlanes =1 , .serdes_tbl = sm8150_usb3_serdes_tbl,
@@ -1911,7 +1899,6 @@ static const struct qmp_phy_cfg sm8250_usb3phy_cfg = { };static const struct qmp_phy_cfg sm8250_usb3_uniphy_cfg = { - .type =PHY_TYPE_USB3 , .nlanes =1 , .serdes_tbl = sm8150_usb3_uniphy_serdes_tbl,
@@ -1943,7 +1930,6 @@ static const struct qmp_phy_cfg sm8250_usb3_uniphy_cfg = { };static const struct qmp_phy_cfg sdx55_usb3_uniphy_cfg = { - .type =PHY_TYPE_USB3 , .nlanes =1 , .serdes_tbl = sm8150_usb3_uniphy_serdes_tbl,
@@ -1975,7 +1961,6 @@ static const struct qmp_phy_cfg sdx55_usb3_uniphy_cfg = { };static const struct qmp_phy_cfg sdx65_usb3_uniphy_cfg = { - .type =PHY_TYPE_USB3 , .nlanes =1 , .serdes_tbl = sm8150_usb3_uniphy_serdes_tbl,
@@ -2007,7 +1992,6 @@ static const struct qmp_phy_cfg sdx65_usb3_uniphy_cfg = { };static const struct qmp_phy_cfg sm8350_usb3phy_cfg = { - .type =PHY_TYPE_USB3 , .nlanes =1 , .serdes_tbl = sm8150_usb3_serdes_tbl,
@@ -2042,7 +2026,6 @@ static const struct qmp_phy_cfg sm8350_usb3phy_cfg = { };static const struct qmp_phy_cfg sm8350_usb3_uniphy_cfg = { - .type =PHY_TYPE_USB3 , .nlanes =1 , .serdes_tbl = sm8150_usb3_uniphy_serdes_tbl,
@@ -2074,7 +2057,6 @@ static const struct qmp_phy_cfg sm8350_usb3_uniphy_cfg = { };static const struct qmp_phy_cfg qcm2290_usb3phy_cfg = { - .type =PHY_TYPE_USB3 , .nlanes =1 , .serdes_tbl = qcm2290_usb3_serdes_tbl,
@@ -2432,10 +2414,6 @@ static int __maybe_unused qmp_usb_runtime_suspend(struct device *dev)dev_vdbg (dev,"Suspending QMP phy, mode:%d\n" , qphy->mode); -/* Supported only for USB3 PHY and luckily USB3 is the first phy */ -if (cfg->type !=PHY_TYPE_USB3 ) -return 0 ; -if (!qphy->phy->init_count) {dev_vdbg (dev,"PHY not initialized, bailing out\n" );return 0 ;
@@ -2458,10 +2436,6 @@ static int __maybe_unused qmp_usb_runtime_resume(struct device *dev)dev_vdbg (dev,"Resuming QMP phy, mode:%d\n" , qphy->mode); -/* Supported only for USB3 PHY and luckily USB3 is the first phy */ -if (cfg->type !=PHY_TYPE_USB3 ) -return 0 ; -if (!qphy->phy->init_count) {dev_vdbg (dev,"PHY not initialized, bailing out\n" );return 0 ;
Signature · 1 line
2.35.1
PATCH 16/17 phy: qcom-qmp-usb: consolidate lane config
In reply to Johan HovoldFor legacy reasons, there are two configuration parameters that appear to describe the number of lanes a PHY has, even if "nlanes" was actually used for a different purpose.
Replace them both with a new field simply named "lanes".
--- drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 52 ++++++++++--------------- 1 file changed, 20 insertions(+), 32 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-usb.c +20 -32
@@ -1429,8 +1429,7 @@ static const struct qmp_phy_init_tbl sc8280xp_usb3_uniphy_pcs_tbl[] = {/* struct qmp_phy_cfg - per-PHY initialization config */ struct qmp_phy_cfg { -/* number of lanes provided by phy */ -int nlanes; +int lanes;/* Init sequence for PHY blocks - serdes, tx, rx, pcs */ const struct qmp_phy_init_tbl *serdes_tbl;
@@ -1470,8 +1469,6 @@ struct qmp_phy_cfg {/* true, if PHY has a separate DP_COM control block */ bool has_phy_dp_com_ctrl; -/* true, if PHY has secondary tx/rx lanes to be configured */ -bool is_dual_lane_phy;/* Offset from PCS to PCS_USB region */ unsigned int pcs_usb_offset;
@@ -1603,7 +1600,7 @@ static const char * const qmp_phy_vreg_l[] = { };static const struct qmp_phy_cfg ipq8074_usb3phy_cfg = { - .nlanes =1 , + .lanes =1 , .serdes_tbl = ipq8074_usb3_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (ipq8074_usb3_serdes_tbl),
@@ -1627,7 +1624,7 @@ static const struct qmp_phy_cfg ipq8074_usb3phy_cfg = { };static const struct qmp_phy_cfg msm8996_usb3phy_cfg = { - .nlanes =1 , + .lanes =1 , .serdes_tbl = msm8996_usb3_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (msm8996_usb3_serdes_tbl),
@@ -1651,7 +1648,7 @@ static const struct qmp_phy_cfg msm8996_usb3phy_cfg = { };static const struct qmp_phy_cfg qmp_v3_usb3phy_cfg = { - .nlanes =1 , + .lanes =2 , .serdes_tbl = qmp_v3_usb3_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (qmp_v3_usb3_serdes_tbl),
@@ -1678,11 +1675,10 @@ static const struct qmp_phy_cfg qmp_v3_usb3phy_cfg = { .pwrdn_delay_max = POWER_DOWN_DELAY_US_MAX, .has_phy_dp_com_ctrl = true, - .is_dual_lane_phy = true, };static const struct qmp_phy_cfg sc7180_usb3phy_cfg = { - .nlanes =1 , + .lanes =2 , .serdes_tbl = qmp_v3_usb3_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (qmp_v3_usb3_serdes_tbl),
@@ -1709,11 +1705,10 @@ static const struct qmp_phy_cfg sc7180_usb3phy_cfg = { .pwrdn_delay_max = POWER_DOWN_DELAY_US_MAX, .has_phy_dp_com_ctrl = true, - .is_dual_lane_phy = true, };static const struct qmp_phy_cfg sc8280xp_usb3_uniphy_cfg = { - .nlanes =1 , + .lanes =1 , .serdes_tbl = sc8280xp_usb3_uniphy_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sc8280xp_usb3_uniphy_serdes_tbl),
@@ -1741,7 +1736,7 @@ static const struct qmp_phy_cfg sc8280xp_usb3_uniphy_cfg = { };static const struct qmp_phy_cfg qmp_v3_usb3_uniphy_cfg = { - .nlanes =1 , + .lanes =1 , .serdes_tbl = qmp_v3_usb3_uniphy_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (qmp_v3_usb3_uniphy_serdes_tbl),
@@ -1769,7 +1764,7 @@ static const struct qmp_phy_cfg qmp_v3_usb3_uniphy_cfg = { };static const struct qmp_phy_cfg msm8998_usb3phy_cfg = { - .nlanes =1 , + .lanes =2 , .serdes_tbl = msm8998_usb3_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (msm8998_usb3_serdes_tbl),
@@ -1790,12 +1785,10 @@ static const struct qmp_phy_cfg msm8998_usb3phy_cfg = { .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN, .phy_status = PHYSTATUS, - - .is_dual_lane_phy = true, };static const struct qmp_phy_cfg sm8150_usb3phy_cfg = { - .nlanes =1 , + .lanes =2 , .serdes_tbl = sm8150_usb3_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sm8150_usb3_serdes_tbl),
@@ -1826,11 +1819,10 @@ static const struct qmp_phy_cfg sm8150_usb3phy_cfg = { .pwrdn_delay_max = POWER_DOWN_DELAY_US_MAX, .has_phy_dp_com_ctrl = true, - .is_dual_lane_phy = true, };static const struct qmp_phy_cfg sm8150_usb3_uniphy_cfg = { - .nlanes =1 , + .lanes =1 , .serdes_tbl = sm8150_usb3_uniphy_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sm8150_usb3_uniphy_serdes_tbl),
@@ -1861,7 +1853,7 @@ static const struct qmp_phy_cfg sm8150_usb3_uniphy_cfg = { };static const struct qmp_phy_cfg sm8250_usb3phy_cfg = { - .nlanes =1 , + .lanes =2 , .serdes_tbl = sm8150_usb3_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sm8150_usb3_serdes_tbl),
@@ -1891,11 +1883,10 @@ static const struct qmp_phy_cfg sm8250_usb3phy_cfg = { .pwrdn_delay_max = POWER_DOWN_DELAY_US_MAX, .has_phy_dp_com_ctrl = true, - .is_dual_lane_phy = true, };static const struct qmp_phy_cfg sm8250_usb3_uniphy_cfg = { - .nlanes =1 , + .lanes =1 , .serdes_tbl = sm8150_usb3_uniphy_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sm8150_usb3_uniphy_serdes_tbl),
@@ -1926,7 +1917,7 @@ static const struct qmp_phy_cfg sm8250_usb3_uniphy_cfg = { };static const struct qmp_phy_cfg sdx55_usb3_uniphy_cfg = { - .nlanes =1 , + .lanes =1 , .serdes_tbl = sm8150_usb3_uniphy_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sm8150_usb3_uniphy_serdes_tbl),
@@ -1957,7 +1948,7 @@ static const struct qmp_phy_cfg sdx55_usb3_uniphy_cfg = { };static const struct qmp_phy_cfg sdx65_usb3_uniphy_cfg = { - .nlanes =1 , + .lanes =1 , .serdes_tbl = sm8150_usb3_uniphy_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sm8150_usb3_uniphy_serdes_tbl),
@@ -1988,7 +1979,7 @@ static const struct qmp_phy_cfg sdx65_usb3_uniphy_cfg = { };static const struct qmp_phy_cfg sm8350_usb3phy_cfg = { - .nlanes =1 , + .lanes =2 , .serdes_tbl = sm8150_usb3_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sm8150_usb3_serdes_tbl),
@@ -2018,11 +2009,10 @@ static const struct qmp_phy_cfg sm8350_usb3phy_cfg = { .pwrdn_delay_max = POWER_DOWN_DELAY_US_MAX, .has_phy_dp_com_ctrl = true, - .is_dual_lane_phy = true, };static const struct qmp_phy_cfg sm8350_usb3_uniphy_cfg = { - .nlanes =1 , + .lanes =1 , .serdes_tbl = sm8150_usb3_uniphy_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sm8150_usb3_uniphy_serdes_tbl),
@@ -2053,7 +2043,7 @@ static const struct qmp_phy_cfg sm8350_usb3_uniphy_cfg = { };static const struct qmp_phy_cfg qcm2290_usb3phy_cfg = { - .nlanes =1 , + .lanes =2 , .serdes_tbl = qcm2290_usb3_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (qcm2290_usb3_serdes_tbl),
@@ -2074,8 +2064,6 @@ static const struct qmp_phy_cfg qcm2290_usb3phy_cfg = { .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN, .phy_status = PHYSTATUS, - - .is_dual_lane_phy = true, }; static void qmp_usb_configure_lane(void __iomem *base,
@@ -2232,14 +2220,14 @@ static int qmp_usb_power_on(struct phy *phy)/* Tx, Rx, and PCS configurations */ qmp_usb_configure_lane (tx, cfg->regs, cfg->tx_tbl, cfg->tx_tbl_num,1 ); -if (cfg->is_dual_lane_phy) { +if (cfg->lanes >=2 ) {qmp_usb_configure_lane (qphy->tx2, cfg->regs, cfg->tx_tbl, cfg->tx_tbl_num,2 ); }qmp_usb_configure_lane (rx, cfg->regs, cfg->rx_tbl, cfg->rx_tbl_num,1 ); -if (cfg->is_dual_lane_phy) { +if (cfg->lanes >=2 ) {qmp_usb_configure_lane (qphy->rx2, cfg->regs, cfg->rx_tbl, cfg->rx_tbl_num,2 ); }
@@ -2613,7 +2601,7 @@ int qmp_usb_create(struct device *dev, struct device_node *np, int id,if (cfg->pcs_usb_offset) qphy->pcs_usb = qphy->pcs + cfg->pcs_usb_offset; -if (cfg->is_dual_lane_phy) { +if (cfg->lanes >=2 ) { qphy->tx2 =devm_of_iomap (dev, np,3 ,NULL );if (IS_ERR (qphy->tx2))return PTR_ERR (qphy->tx2);
Signature · 1 line
2.35.1
PATCH 17/17 phy: qcom-qmp-combo: drop redundant DP config flag
In reply to Johan HovoldDrop the DP_COM control block flag from the configuration data, which is set for all combo PHYs and hence no longer needed since the QMP driver split.
--- drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 63 +++++++---------------- 1 file changed, 18 insertions(+), 45 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-combo.c +18 -45
@@ -876,9 +876,6 @@ struct qmp_phy_cfg {int pwrdn_delay_min;int pwrdn_delay_max; -/* true, if PHY has a separate DP_COM control block */ -bool has_phy_dp_com_ctrl; -/* Offset from PCS to PCS_USB region */ unsigned int pcs_usb_offset;
@@ -1051,8 +1048,6 @@ static const struct qmp_phy_cfg sc7180_usb3phy_cfg = { .has_pwrdn_delay = true, .pwrdn_delay_min = POWER_DOWN_DELAY_US_MIN, .pwrdn_delay_max = POWER_DOWN_DELAY_US_MAX, - - .has_phy_dp_com_ctrl = true, };static const struct qmp_phy_cfg sc7180_dpphy_cfg = {
@@ -1086,8 +1081,6 @@ static const struct qmp_phy_cfg sc7180_dpphy_cfg = { .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = qmp_v3_usb3phy_regs_layout, - .has_phy_dp_com_ctrl = true, - .dp_aux_init = qcom_qmp_v3_phy_dp_aux_init, .configure_dp_tx = qcom_qmp_v3_phy_configure_dp_tx, .configure_dp_phy = qcom_qmp_v3_phy_configure_dp_phy,
@@ -1126,8 +1119,6 @@ static const struct qmp_phy_cfg sdm845_usb3phy_cfg = { .has_pwrdn_delay = true, .pwrdn_delay_min = POWER_DOWN_DELAY_US_MIN, .pwrdn_delay_max = POWER_DOWN_DELAY_US_MAX, - - .has_phy_dp_com_ctrl = true, };static const struct qmp_phy_combo_cfg sdm845_usb3dpphy_cfg = {
@@ -1166,8 +1157,6 @@ static const struct qmp_phy_cfg sm8150_usb3phy_cfg = { .has_pwrdn_delay = true, .pwrdn_delay_min = POWER_DOWN_DELAY_US_MIN, .pwrdn_delay_max = POWER_DOWN_DELAY_US_MAX, - - .has_phy_dp_com_ctrl = true, };static const struct qmp_phy_cfg sc8180x_dpphy_cfg = {
@@ -1201,8 +1190,6 @@ static const struct qmp_phy_cfg sc8180x_dpphy_cfg = { .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = qmp_v3_usb3phy_regs_layout, - .has_phy_dp_com_ctrl = true, - .dp_aux_init = qcom_qmp_v4_phy_dp_aux_init, .configure_dp_tx = qcom_qmp_v4_phy_configure_dp_tx, .configure_dp_phy = qcom_qmp_v4_phy_configure_dp_phy,
@@ -1242,8 +1229,6 @@ static const struct qmp_phy_cfg sc8280xp_usb43dp_usb_cfg = { .has_pwrdn_delay = true, .pwrdn_delay_min = POWER_DOWN_DELAY_US_MIN, .pwrdn_delay_max = POWER_DOWN_DELAY_US_MAX, - - .has_phy_dp_com_ctrl = true, };static const struct qmp_phy_cfg sc8280xp_usb43dp_dp_cfg = {
@@ -1277,8 +1262,6 @@ static const struct qmp_phy_cfg sc8280xp_usb43dp_dp_cfg = { .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = qmp_v4_usb3phy_regs_layout, - .has_phy_dp_com_ctrl = true, - .dp_aux_init = qcom_qmp_v4_phy_dp_aux_init, .configure_dp_tx = qcom_qmp_v4_phy_configure_dp_tx, .configure_dp_phy = qcom_qmp_v5_phy_configure_dp_phy,
@@ -1320,8 +1303,6 @@ static const struct qmp_phy_cfg sm8250_usb3phy_cfg = { .has_pwrdn_delay = true, .pwrdn_delay_min = POWER_DOWN_DELAY_US_MIN, .pwrdn_delay_max = POWER_DOWN_DELAY_US_MAX, - - .has_phy_dp_com_ctrl = true, };static const struct qmp_phy_cfg sm8250_dpphy_cfg = {
@@ -1355,8 +1336,6 @@ static const struct qmp_phy_cfg sm8250_dpphy_cfg = { .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = qmp_v4_usb3phy_regs_layout, - .has_phy_dp_com_ctrl = true, - .dp_aux_init = qcom_qmp_v4_phy_dp_aux_init, .configure_dp_tx = qcom_qmp_v4_phy_configure_dp_tx, .configure_dp_phy = qcom_qmp_v4_phy_configure_dp_phy,
@@ -1995,28 +1974,25 @@ static int qmp_combo_com_init(struct qmp_phy *qphy)if (ret) goto err_assert_reset; -if (cfg->has_phy_dp_com_ctrl) { -qphy_setbits (dp_com,QPHY_V3_DP_COM_POWER_DOWN_CTRL , -SW_PWRDN ); -/* override hardware control for reset of qmp phy */ -qphy_setbits (dp_com,QPHY_V3_DP_COM_RESET_OVRD_CTRL , -SW_DPPHY_RESET_MUX |SW_DPPHY_RESET | -SW_USB3PHY_RESET_MUX |SW_USB3PHY_RESET ); +qphy_setbits (dp_com,QPHY_V3_DP_COM_POWER_DOWN_CTRL ,SW_PWRDN ); -/* Default type-c orientation, i.e CC1 */ -qphy_setbits (dp_com,QPHY_V3_DP_COM_TYPEC_CTRL ,0x02 ); +/* override hardware control for reset of qmp phy */ +qphy_setbits (dp_com,QPHY_V3_DP_COM_RESET_OVRD_CTRL , +SW_DPPHY_RESET_MUX |SW_DPPHY_RESET | +SW_USB3PHY_RESET_MUX |SW_USB3PHY_RESET ); -qphy_setbits (dp_com,QPHY_V3_DP_COM_PHY_MODE_CTRL , -USB3_MODE |DP_MODE ); +/* Default type-c orientation, i.e CC1 */ +qphy_setbits (dp_com,QPHY_V3_DP_COM_TYPEC_CTRL ,0x02 ); -/* bring both QMP USB and QMP DP PHYs PCS block out of reset */ -qphy_clrbits (dp_com,QPHY_V3_DP_COM_RESET_OVRD_CTRL , -SW_DPPHY_RESET_MUX |SW_DPPHY_RESET | -SW_USB3PHY_RESET_MUX |SW_USB3PHY_RESET ); +qphy_setbits (dp_com,QPHY_V3_DP_COM_PHY_MODE_CTRL ,USB3_MODE |DP_MODE ); -qphy_clrbits (dp_com,QPHY_V3_DP_COM_SWI_CTRL ,0x03 ); -qphy_clrbits (dp_com,QPHY_V3_DP_COM_SW_RESET ,SW_RESET ); - } +/* bring both QMP USB and QMP DP PHYs PCS block out of reset */ +qphy_clrbits (dp_com,QPHY_V3_DP_COM_RESET_OVRD_CTRL , +SW_DPPHY_RESET_MUX |SW_DPPHY_RESET | +SW_USB3PHY_RESET_MUX |SW_USB3PHY_RESET ); + +qphy_clrbits (dp_com,QPHY_V3_DP_COM_SWI_CTRL ,0x03 ); +qphy_clrbits (dp_com,QPHY_V3_DP_COM_SW_RESET ,SW_RESET );if (cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL ]) qphy_setbits(pcs,
@@ -2838,12 +2814,9 @@ static int qmp_combo_probe(struct platform_device *pdev)if (IS_ERR (serdes))return PTR_ERR (serdes); -/* per PHY dp_com; if PHY has dp_com control block */ -if (cfg->has_phy_dp_com_ctrl) { - qmp->dp_com =devm_platform_ioremap_resource (pdev,1 ); -if (IS_ERR (qmp->dp_com)) -return PTR_ERR (qmp->dp_com); - } + qmp->dp_com =devm_platform_ioremap_resource (pdev,1 ); +if (IS_ERR (qmp->dp_com)) +return PTR_ERR (qmp->dp_com);/* Only two serdes for combo PHY */ dp_serdes =devm_platform_ioremap_resource (pdev,2 );
Signature · 1 line
2.35.1
PATCH 1/17 phy: qcom-qmp-pcie: drop unused type from config
In reply to Johan HovoldThe configuration PHY type is no longer used since the QMP driver split so drop it from the configurations.
--- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 14 -------------- 1 file changed, 14 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +0 -14
@@ -1304,8 +1304,6 @@ struct qmp_phy;/* struct qmp_phy_cfg - per-PHY initialization config */ struct qmp_phy_cfg { -/* phy-type - PCIE/UFS/USB */ -unsigned int type;/* number of lanes provided by phy */ int nlanes;
@@ -1470,7 +1468,6 @@ static const char * const sdm845_pciephy_reset_l[] = { };static const struct qmp_phy_cfg ipq8074_pciephy_cfg = { - .type =PHY_TYPE_PCIE , .nlanes =1 , .serdes_tbl = ipq8074_pcie_serdes_tbl,
@@ -1499,7 +1496,6 @@ static const struct qmp_phy_cfg ipq8074_pciephy_cfg = { };static const struct qmp_phy_cfg ipq8074_pciephy_gen3_cfg = { - .type =PHY_TYPE_PCIE , .nlanes =1 , .serdes_tbl = ipq8074_pcie_gen3_serdes_tbl,
@@ -1529,7 +1525,6 @@ static const struct qmp_phy_cfg ipq8074_pciephy_gen3_cfg = { };static const struct qmp_phy_cfg ipq6018_pciephy_cfg = { - .type =PHY_TYPE_PCIE , .nlanes =1 , .serdes_tbl = ipq6018_pcie_serdes_tbl,
@@ -1559,7 +1554,6 @@ static const struct qmp_phy_cfg ipq6018_pciephy_cfg = { };static const struct qmp_phy_cfg sdm845_qmp_pciephy_cfg = { - .type =PHY_TYPE_PCIE , .nlanes =1 , .serdes_tbl = sdm845_qmp_pcie_serdes_tbl,
@@ -1590,7 +1584,6 @@ static const struct qmp_phy_cfg sdm845_qmp_pciephy_cfg = { };static const struct qmp_phy_cfg sdm845_qhp_pciephy_cfg = { - .type =PHY_TYPE_PCIE , .nlanes =1 , .serdes_tbl = sdm845_qhp_pcie_serdes_tbl,
@@ -1619,7 +1612,6 @@ static const struct qmp_phy_cfg sdm845_qhp_pciephy_cfg = { };static const struct qmp_phy_cfg sm8250_qmp_gen3x1_pciephy_cfg = { - .type =PHY_TYPE_PCIE , .nlanes =1 , .serdes_tbl = sm8250_qmp_pcie_serdes_tbl,
@@ -1658,7 +1650,6 @@ static const struct qmp_phy_cfg sm8250_qmp_gen3x1_pciephy_cfg = { };static const struct qmp_phy_cfg sm8250_qmp_gen3x2_pciephy_cfg = { - .type =PHY_TYPE_PCIE , .nlanes =2 , .serdes_tbl = sm8250_qmp_pcie_serdes_tbl,
@@ -1698,7 +1689,6 @@ static const struct qmp_phy_cfg sm8250_qmp_gen3x2_pciephy_cfg = { };static const struct qmp_phy_cfg msm8998_pciephy_cfg = { - .type =PHY_TYPE_PCIE , .nlanes =1 , .serdes_tbl = msm8998_pcie_serdes_tbl,
@@ -1723,7 +1713,6 @@ static const struct qmp_phy_cfg msm8998_pciephy_cfg = { };static const struct qmp_phy_cfg sc8180x_pciephy_cfg = { - .type =PHY_TYPE_PCIE , .nlanes =1 , .serdes_tbl = sc8180x_qmp_pcie_serdes_tbl,
@@ -1753,7 +1742,6 @@ static const struct qmp_phy_cfg sc8180x_pciephy_cfg = { };static const struct qmp_phy_cfg sdx55_qmp_pciephy_cfg = { - .type =PHY_TYPE_PCIE , .nlanes =2 , .serdes_tbl = sdx55_qmp_pcie_serdes_tbl,
@@ -1785,7 +1773,6 @@ static const struct qmp_phy_cfg sdx55_qmp_pciephy_cfg = { };static const struct qmp_phy_cfg sm8450_qmp_gen3x1_pciephy_cfg = { - .type =PHY_TYPE_PCIE , .nlanes =1 , .serdes_tbl = sm8450_qmp_gen3x1_pcie_serdes_tbl,
@@ -1816,7 +1803,6 @@ static const struct qmp_phy_cfg sm8450_qmp_gen3x1_pciephy_cfg = { };static const struct qmp_phy_cfg sm8450_qmp_gen4x2_pciephy_cfg = { - .type =PHY_TYPE_PCIE , .nlanes =2 , .serdes_tbl = sm8450_qmp_gen4x2_pcie_serdes_tbl,
Signature · 7 lines
2.35.1 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH 14/17 phy: qcom-qmp-combo: consolidate lane config
In reply to Johan HovoldFor legacy reasons, there are two configuration parameters that appear to describe the number of lanes a PHY has, even if "nlanes" was actually used for a different purpose.
Replace them both with a new field simply named "lanes".
--- drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 38 ++++++++--------------- 1 file changed, 13 insertions(+), 25 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-combo.c +13 -25
@@ -816,8 +816,7 @@ struct qmp_phy;struct qmp_phy_cfg {/* phy-type - PCIE/UFS/USB */ unsigned int type; -/* number of lanes provided by phy */ -int nlanes; +int lanes;/* Init sequence for PHY blocks - serdes, tx, rx, pcs */ const struct qmp_phy_init_tbl *serdes_tbl;
@@ -879,8 +878,6 @@ struct qmp_phy_cfg {/* true, if PHY has a separate DP_COM control block */ bool has_phy_dp_com_ctrl; -/* true, if PHY has secondary tx/rx lanes to be configured */ -bool is_dual_lane_phy;/* Offset from PCS to PCS_USB region */ unsigned int pcs_usb_offset;
@@ -1029,7 +1026,7 @@ static const char * const sc7180_usb3phy_reset_l[] = {static const struct qmp_phy_cfg sc7180_usb3phy_cfg = { .type =PHY_TYPE_USB3 , - .nlanes =1 , + .lanes =2 , .serdes_tbl = qmp_v3_usb3_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (qmp_v3_usb3_serdes_tbl),
@@ -1056,12 +1053,11 @@ static const struct qmp_phy_cfg sc7180_usb3phy_cfg = { .pwrdn_delay_max = POWER_DOWN_DELAY_US_MAX, .has_phy_dp_com_ctrl = true, - .is_dual_lane_phy = true, };static const struct qmp_phy_cfg sc7180_dpphy_cfg = { .type =PHY_TYPE_DP , - .nlanes =1 , + .lanes =2 , .serdes_tbl = qmp_v3_dp_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (qmp_v3_dp_serdes_tbl),
@@ -1091,7 +1087,6 @@ static const struct qmp_phy_cfg sc7180_dpphy_cfg = { .regs = qmp_v3_usb3phy_regs_layout, .has_phy_dp_com_ctrl = true, - .is_dual_lane_phy = true, .dp_aux_init = qcom_qmp_v3_phy_dp_aux_init, .configure_dp_tx = qcom_qmp_v3_phy_configure_dp_tx,
@@ -1106,7 +1101,7 @@ static const struct qmp_phy_combo_cfg sc7180_usb3dpphy_cfg = {static const struct qmp_phy_cfg sdm845_usb3phy_cfg = { .type =PHY_TYPE_USB3 , - .nlanes =1 , + .lanes =2 , .serdes_tbl = qmp_v3_usb3_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (qmp_v3_usb3_serdes_tbl),
@@ -1133,7 +1128,6 @@ static const struct qmp_phy_cfg sdm845_usb3phy_cfg = { .pwrdn_delay_max = POWER_DOWN_DELAY_US_MAX, .has_phy_dp_com_ctrl = true, - .is_dual_lane_phy = true, };static const struct qmp_phy_combo_cfg sdm845_usb3dpphy_cfg = {
@@ -1143,7 +1137,7 @@ static const struct qmp_phy_combo_cfg sdm845_usb3dpphy_cfg = {static const struct qmp_phy_cfg sm8150_usb3phy_cfg = { .type =PHY_TYPE_USB3 , - .nlanes =1 , + .lanes =2 , .serdes_tbl = sm8150_usb3_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sm8150_usb3_serdes_tbl),
@@ -1174,12 +1168,11 @@ static const struct qmp_phy_cfg sm8150_usb3phy_cfg = { .pwrdn_delay_max = POWER_DOWN_DELAY_US_MAX, .has_phy_dp_com_ctrl = true, - .is_dual_lane_phy = true, };static const struct qmp_phy_cfg sc8180x_dpphy_cfg = { .type =PHY_TYPE_DP , - .nlanes =1 , + .lanes =2 , .serdes_tbl = qmp_v4_dp_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (qmp_v4_dp_serdes_tbl),
@@ -1209,7 +1202,6 @@ static const struct qmp_phy_cfg sc8180x_dpphy_cfg = { .regs = qmp_v3_usb3phy_regs_layout, .has_phy_dp_com_ctrl = true, - .is_dual_lane_phy = true, .dp_aux_init = qcom_qmp_v4_phy_dp_aux_init, .configure_dp_tx = qcom_qmp_v4_phy_configure_dp_tx,
@@ -1224,7 +1216,7 @@ static const struct qmp_phy_combo_cfg sc8180x_usb3dpphy_cfg = {static const struct qmp_phy_cfg sc8280xp_usb43dp_usb_cfg = { .type =PHY_TYPE_USB3 , - .nlanes =1 , + .lanes =2 , .serdes_tbl = sc8280xp_usb43dp_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sc8280xp_usb43dp_serdes_tbl),
@@ -1252,12 +1244,11 @@ static const struct qmp_phy_cfg sc8280xp_usb43dp_usb_cfg = { .pwrdn_delay_max = POWER_DOWN_DELAY_US_MAX, .has_phy_dp_com_ctrl = true, - .is_dual_lane_phy = true, };static const struct qmp_phy_cfg sc8280xp_usb43dp_dp_cfg = { .type =PHY_TYPE_DP , - .nlanes =1 , + .lanes =2 , .serdes_tbl = qmp_v5_dp_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (qmp_v5_dp_serdes_tbl),
@@ -1287,7 +1278,6 @@ static const struct qmp_phy_cfg sc8280xp_usb43dp_dp_cfg = { .regs = qmp_v4_usb3phy_regs_layout, .has_phy_dp_com_ctrl = true, - .is_dual_lane_phy = true, .dp_aux_init = qcom_qmp_v4_phy_dp_aux_init, .configure_dp_tx = qcom_qmp_v4_phy_configure_dp_tx,
@@ -1302,7 +1292,7 @@ static const struct qmp_phy_combo_cfg sc8280xp_usb43dpphy_combo_cfg = {static const struct qmp_phy_cfg sm8250_usb3phy_cfg = { .type =PHY_TYPE_USB3 , - .nlanes =1 , + .lanes =2 , .serdes_tbl = sm8150_usb3_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sm8150_usb3_serdes_tbl),
@@ -1332,12 +1322,11 @@ static const struct qmp_phy_cfg sm8250_usb3phy_cfg = { .pwrdn_delay_max = POWER_DOWN_DELAY_US_MAX, .has_phy_dp_com_ctrl = true, - .is_dual_lane_phy = true, };static const struct qmp_phy_cfg sm8250_dpphy_cfg = { .type =PHY_TYPE_DP , - .nlanes =1 , + .lanes =2 , .serdes_tbl = qmp_v4_dp_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (qmp_v4_dp_serdes_tbl),
@@ -1367,7 +1356,6 @@ static const struct qmp_phy_cfg sm8250_dpphy_cfg = { .regs = qmp_v4_usb3phy_regs_layout, .has_phy_dp_com_ctrl = true, - .is_dual_lane_phy = true, .dp_aux_init = qcom_qmp_v4_phy_dp_aux_init, .configure_dp_tx = qcom_qmp_v4_phy_configure_dp_tx,
@@ -2117,7 +2105,7 @@ static int qmp_combo_power_on(struct phy *phy)/* Tx, Rx, and PCS configurations */ qmp_combo_configure_lane (tx, cfg->regs, cfg->tx_tbl, cfg->tx_tbl_num,1 ); -if (cfg->is_dual_lane_phy) { +if (cfg->lanes >=2 ) {qmp_combo_configure_lane (qphy->tx2, cfg->regs, cfg->tx_tbl, cfg->tx_tbl_num,2 ); }
@@ -2128,7 +2116,7 @@ static int qmp_combo_power_on(struct phy *phy)qmp_combo_configure_lane (rx, cfg->regs, cfg->rx_tbl, cfg->rx_tbl_num,1 ); -if (cfg->is_dual_lane_phy) { +if (cfg->lanes >=2 ) {qmp_combo_configure_lane (qphy->rx2, cfg->regs, cfg->rx_tbl, cfg->rx_tbl_num,2 ); }
@@ -2725,7 +2713,7 @@ static int qmp_combo_create(struct device *dev, struct device_node *np, int id,if (cfg->pcs_usb_offset) qphy->pcs_usb = qphy->pcs + cfg->pcs_usb_offset; -if (cfg->is_dual_lane_phy) { +if (cfg->lanes >=2 ) { qphy->tx2 =devm_of_iomap (dev, np,3 ,NULL );if (IS_ERR (qphy->tx2))return PTR_ERR (qphy->tx2);
Signature · 1 line
2.35.1
PATCH 15/17 phy: qcom-qmp-ufs: consolidate lane config
In reply to Johan HovoldFor legacy reasons, there are two configuration parameters that describe the number of lanes a PHY has.
Replace them both with a new field simply named "lanes".
--- drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 31 ++++++++----------------- 1 file changed, 10 insertions(+), 21 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-ufs.c +10 -21
@@ -533,8 +533,7 @@ static const struct qmp_phy_init_tbl sm8350_ufsphy_pcs_tbl[] = {/* struct qmp_phy_cfg - per-PHY initialization config */ struct qmp_phy_cfg { -/* number of lanes provided by phy */ -int nlanes; +int lanes;/* Init sequence for PHY blocks - serdes, tx, rx, pcs */ const struct qmp_phy_init_tbl *serdes_tbl;
@@ -561,9 +560,6 @@ struct qmp_phy_cfg {/* bit offset of PHYSTATUS in QPHY_PCS_STATUS register */ unsigned int phy_status; -/* true, if PHY has secondary tx/rx lanes to be configured */ -bool is_dual_lane_phy; -/* true, if PCS block has no separate SW_RESET register */ bool no_pcs_sw_reset; };
@@ -662,7 +658,7 @@ static const char * const qmp_phy_vreg_l[] = { };static const struct qmp_phy_cfg msm8996_ufs_cfg = { - .nlanes =1 , + .lanes =1 , .serdes_tbl = msm8996_ufs_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (msm8996_ufs_serdes_tbl),
@@ -687,7 +683,7 @@ static const struct qmp_phy_cfg msm8996_ufs_cfg = { };static const struct qmp_phy_cfg sdm845_ufsphy_cfg = { - .nlanes =2 , + .lanes =2 , .serdes_tbl = sdm845_ufsphy_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sdm845_ufsphy_serdes_tbl),
@@ -707,12 +703,11 @@ static const struct qmp_phy_cfg sdm845_ufsphy_cfg = { .pwrdn_ctrl = SW_PWRDN, .phy_status = PHYSTATUS, - .is_dual_lane_phy = true, .no_pcs_sw_reset = true, };static const struct qmp_phy_cfg sm6115_ufsphy_cfg = { - .nlanes =1 , + .lanes =1 , .serdes_tbl = sm6115_ufsphy_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sm6115_ufsphy_serdes_tbl),
@@ -735,7 +730,7 @@ static const struct qmp_phy_cfg sm6115_ufsphy_cfg = { };static const struct qmp_phy_cfg sm8150_ufsphy_cfg = { - .nlanes =2 , + .lanes =2 , .serdes_tbl = sm8150_ufsphy_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sm8150_ufsphy_serdes_tbl),
@@ -754,12 +749,10 @@ static const struct qmp_phy_cfg sm8150_ufsphy_cfg = { .start_ctrl = SERDES_START, .pwrdn_ctrl = SW_PWRDN, .phy_status = PHYSTATUS, - - .is_dual_lane_phy = true, };static const struct qmp_phy_cfg sm8350_ufsphy_cfg = { - .nlanes =2 , + .lanes =2 , .serdes_tbl = sm8350_ufsphy_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sm8350_ufsphy_serdes_tbl),
@@ -778,12 +771,10 @@ static const struct qmp_phy_cfg sm8350_ufsphy_cfg = { .start_ctrl = SERDES_START, .pwrdn_ctrl = SW_PWRDN, .phy_status = PHYSTATUS, - - .is_dual_lane_phy = true, };static const struct qmp_phy_cfg sm8450_ufsphy_cfg = { - .nlanes =2 , + .lanes =2 , .serdes_tbl = sm8350_ufsphy_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sm8350_ufsphy_serdes_tbl),
@@ -802,8 +793,6 @@ static const struct qmp_phy_cfg sm8450_ufsphy_cfg = { .start_ctrl = SERDES_START, .pwrdn_ctrl = SW_PWRDN, .phy_status = PHYSTATUS, - - .is_dual_lane_phy = true, }; static void qmp_ufs_configure_lane(void __iomem *base,
@@ -956,14 +945,14 @@ static int qmp_ufs_power_on(struct phy *phy)/* Tx, Rx, and PCS configurations */ qmp_ufs_configure_lane (tx, cfg->regs, cfg->tx_tbl, cfg->tx_tbl_num,1 ); -if (cfg->is_dual_lane_phy) { +if (cfg->lanes >=2 ) {qmp_ufs_configure_lane (qphy->tx2, cfg->regs, cfg->tx_tbl, cfg->tx_tbl_num,2 ); }qmp_ufs_configure_lane (rx, cfg->regs, cfg->rx_tbl, cfg->rx_tbl_num,1 ); -if (cfg->is_dual_lane_phy) { +if (cfg->lanes >=2 ) {qmp_ufs_configure_lane (qphy->rx2, cfg->regs, cfg->rx_tbl, cfg->rx_tbl_num,2 ); }
@@ -1122,7 +1111,7 @@ static int qmp_ufs_create(struct device *dev, struct device_node *np, int id,if (IS_ERR (qphy->pcs))return PTR_ERR (qphy->pcs); -if (cfg->is_dual_lane_phy) { +if (cfg->lanes >=2 ) { qphy->tx2 =devm_of_iomap (dev, np,3 ,NULL );if (IS_ERR (qphy->tx2))return PTR_ERR (qphy->tx2);
Signature · 1 line
2.35.1
Re: [PATCH 01/17] phy: qcom-qmp-pcie: drop unused type from config
In reply to Johan HovoldQuoted 110 lines · Johan Hovold
The configuration PHY type is no longer used since the QMP driver split so drop it from the configurations.
Signed-off-by Johan Hovold <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 14 -------------- 1 file changed, 14 deletions(-)drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +0
-13@@ -1304,8 +1304,6 @@ struct qmp_phy;/* struct qmp_phy_cfg - per-PHY initialization config */ struct qmp_phy_cfg { -/* phy-type - PCIE/UFS/USB */ -unsigned int type;/* number of lanes provided by phy */ int nlanes;@@ -1470,7 +1468,6 @@ static const char * const sdm845_pciephy_reset_l[] = { };static const struct qmp_phy_cfg ipq8074_pciephy_cfg = { - .type =PHY_TYPE_PCIE , .nlanes =1 , .serdes_tbl = ipq8074_pcie_serdes_tbl,@@ -1499,7 +1496,6 @@ static const struct qmp_phy_cfg ipq8074_pciephy_cfg = { };static const struct qmp_phy_cfg ipq8074_pciephy_gen3_cfg = { - .type =PHY_TYPE_PCIE , .nlanes =1 , .serdes_tbl = ipq8074_pcie_gen3_serdes_tbl,@@ -1529,7 +1525,6 @@ static const struct qmp_phy_cfg ipq8074_pciephy_gen3_cfg = { };static const struct qmp_phy_cfg ipq6018_pciephy_cfg = { - .type =PHY_TYPE_PCIE , .nlanes =1 , .serdes_tbl = ipq6018_pcie_serdes_tbl,@@ -1559,7 +1554,6 @@ static const struct qmp_phy_cfg ipq6018_pciephy_cfg = { };static const struct qmp_phy_cfg sdm845_qmp_pciephy_cfg = { - .type =PHY_TYPE_PCIE , .nlanes =1 , .serdes_tbl = sdm845_qmp_pcie_serdes_tbl,@@ -1590,7 +1584,6 @@ static const struct qmp_phy_cfg sdm845_qmp_pciephy_cfg = { };static const struct qmp_phy_cfg sdm845_qhp_pciephy_cfg = { - .type =PHY_TYPE_PCIE , .nlanes =1 , .serdes_tbl = sdm845_qhp_pcie_serdes_tbl,@@ -1619,7 +1612,6 @@ static const struct qmp_phy_cfg sdm845_qhp_pciephy_cfg = { };static const struct qmp_phy_cfg sm8250_qmp_gen3x1_pciephy_cfg = { - .type =PHY_TYPE_PCIE , .nlanes =1 , .serdes_tbl = sm8250_qmp_pcie_serdes_tbl,@@ -1658,7 +1650,6 @@ static const struct qmp_phy_cfg sm8250_qmp_gen3x1_pciephy_cfg = { };static const struct qmp_phy_cfg sm8250_qmp_gen3x2_pciephy_cfg = { - .type =PHY_TYPE_PCIE , .nlanes =2 , .serdes_tbl = sm8250_qmp_pcie_serdes_tbl,@@ -1698,7 +1689,6 @@ static const struct qmp_phy_cfg sm8250_qmp_gen3x2_pciephy_cfg = { };static const struct qmp_phy_cfg msm8998_pciephy_cfg = { - .type =PHY_TYPE_PCIE , .nlanes =1 , .serdes_tbl = msm8998_pcie_serdes_tbl,@@ -1723,7 +1713,6 @@ static const struct qmp_phy_cfg msm8998_pciephy_cfg = { };static const struct qmp_phy_cfg sc8180x_pciephy_cfg = { - .type =PHY_TYPE_PCIE , .nlanes =1 , .serdes_tbl = sc8180x_qmp_pcie_serdes_tbl,@@ -1753,7 +1742,6 @@ static const struct qmp_phy_cfg sc8180x_pciephy_cfg = { };static const struct qmp_phy_cfg sdx55_qmp_pciephy_cfg = { - .type =PHY_TYPE_PCIE , .nlanes =2 , .serdes_tbl = sdx55_qmp_pcie_serdes_tbl,@@ -1785,7 +1773,6 @@ static const struct qmp_phy_cfg sdx55_qmp_pciephy_cfg = { };static const struct qmp_phy_cfg sm8450_qmp_gen3x1_pciephy_cfg = { - .type =PHY_TYPE_PCIE , .nlanes =1 , .serdes_tbl = sm8450_qmp_gen3x1_pcie_serdes_tbl,
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c static const struct qmp_phy_cfg sm8450_qmp_gen3x1_pciephy_cfg = { · line 1808
Quoted 7 lines
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +0
-1@@ -1816,7 +1803,6 @@ static const struct qmp_phy_cfg sm8450_qmp_gen3x1_pciephy_cfg = { };static const struct qmp_phy_cfg sm8450_qmp_gen4x2_pciephy_cfg = { - .type =PHY_TYPE_PCIE , .nlanes =2 , .serdes_tbl = sm8450_qmp_gen4x2_pcie_serdes_tbl,
Signature · 3 lines
linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH 02/17] phy: qcom-qmp-pcie-msm8996: drop unused type from config
In reply to Johan HovoldQuoted 22 lines · Johan Hovold
The configuration PHY type is no longer used since the QMP driver split so drop it from the configuration.
Signed-off-by Johan Hovold <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c | 3 --- 1 file changed, 3 deletions(-)drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c +0
-2@@ -188,8 +188,6 @@ struct qmp_phy;/* struct qmp_phy_cfg - per-PHY initialization config */ struct qmp_phy_cfg { -/* phy-type - PCIE/UFS/USB */ -unsigned int type;/* number of lanes provided by phy */ int nlanes;
drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c static const char * const qmp_phy_vreg_l[] = { · line 326
Quoted 7 lines
drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c +0
-1@@ -323,7 +321,6 @@ static const char * const qmp_phy_vreg_l[] = { };static const struct qmp_phy_cfg msm8996_pciephy_cfg = { - .type =PHY_TYPE_PCIE , .nlanes =3 , .serdes_tbl = msm8996_pcie_serdes_tbl,
Signature · 3 lines
linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH 03/17] phy: qcom-qmp-ufs: drop unused type from config
In reply to Johan HovoldQuoted 62 lines · Johan Hovold
The configuration PHY type is no longer used since the QMP driver split so drop it from the configuration.
Signed-off-by Johan Hovold <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 8 -------- 1 file changed, 8 deletions(-)drivers/phy/qualcomm/phy-qcom-qmp-ufs.c +0
-7@@ -535,8 +535,6 @@ struct qmp_phy;/* struct qmp_phy_cfg - per-PHY initialization config */ struct qmp_phy_cfg { -/* phy-type - PCIE/UFS/USB */ -unsigned int type;/* number of lanes provided by phy */ int nlanes;@@ -668,7 +666,6 @@ static const char * const qmp_phy_vreg_l[] = { };static const struct qmp_phy_cfg msm8996_ufs_cfg = { - .type =PHY_TYPE_UFS , .nlanes =1 , .serdes_tbl = msm8996_ufs_serdes_tbl,@@ -694,7 +691,6 @@ static const struct qmp_phy_cfg msm8996_ufs_cfg = { };static const struct qmp_phy_cfg sdm845_ufsphy_cfg = { - .type =PHY_TYPE_UFS , .nlanes =2 , .serdes_tbl = sdm845_ufsphy_serdes_tbl,@@ -720,7 +716,6 @@ static const struct qmp_phy_cfg sdm845_ufsphy_cfg = { };static const struct qmp_phy_cfg sm6115_ufsphy_cfg = { - .type =PHY_TYPE_UFS , .nlanes =1 , .serdes_tbl = sm6115_ufsphy_serdes_tbl,@@ -744,7 +739,6 @@ static const struct qmp_phy_cfg sm6115_ufsphy_cfg = { };static const struct qmp_phy_cfg sm8150_ufsphy_cfg = { - .type =PHY_TYPE_UFS , .nlanes =2 , .serdes_tbl = sm8150_ufsphy_serdes_tbl,@@ -769,7 +763,6 @@ static const struct qmp_phy_cfg sm8150_ufsphy_cfg = { };static const struct qmp_phy_cfg sm8350_ufsphy_cfg = { - .type =PHY_TYPE_UFS , .nlanes =2 , .serdes_tbl = sm8350_ufsphy_serdes_tbl,
drivers/phy/qualcomm/phy-qcom-qmp-ufs.c static const struct qmp_phy_cfg sm8350_ufsphy_cfg = { · line 792
Quoted 7 lines
drivers/phy/qualcomm/phy-qcom-qmp-ufs.c +0
-1@@ -794,7 +787,6 @@ static const struct qmp_phy_cfg sm8350_ufsphy_cfg = { };static const struct qmp_phy_cfg sm8450_ufsphy_cfg = { - .type =PHY_TYPE_UFS , .nlanes =2 , .serdes_tbl = sm8350_ufsphy_serdes_tbl,
Re: [PATCH 04/17] phy: qcom-qmp-usb: drop unused type from config
In reply to Johan HovoldQuoted 161 lines · Johan Hovold
The configuration PHY type is no longer needed since the QMP driver split so drop it from the configuration and suspend callbacks.
Signed-off-by Johan Hovold <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 26 ------------------------- 1 file changed, 26 deletions(-)drivers/phy/qualcomm/phy-qcom-qmp-usb.c +0
-22@@ -1431,8 +1431,6 @@ struct qmp_phy;/* struct qmp_phy_cfg - per-PHY initialization config */ struct qmp_phy_cfg { -/* phy-type - PCIE/UFS/USB */ -unsigned int type;/* number of lanes provided by phy */ int nlanes;@@ -1609,7 +1607,6 @@ static const char * const qmp_phy_vreg_l[] = { };static const struct qmp_phy_cfg ipq8074_usb3phy_cfg = { - .type =PHY_TYPE_USB3 , .nlanes =1 , .serdes_tbl = ipq8074_usb3_serdes_tbl,@@ -1634,7 +1631,6 @@ static const struct qmp_phy_cfg ipq8074_usb3phy_cfg = { };static const struct qmp_phy_cfg msm8996_usb3phy_cfg = { - .type =PHY_TYPE_USB3 , .nlanes =1 , .serdes_tbl = msm8996_usb3_serdes_tbl,@@ -1659,7 +1655,6 @@ static const struct qmp_phy_cfg msm8996_usb3phy_cfg = { };static const struct qmp_phy_cfg qmp_v3_usb3phy_cfg = { - .type =PHY_TYPE_USB3 , .nlanes =1 , .serdes_tbl = qmp_v3_usb3_serdes_tbl,@@ -1691,7 +1686,6 @@ static const struct qmp_phy_cfg qmp_v3_usb3phy_cfg = { };static const struct qmp_phy_cfg sc7180_usb3phy_cfg = { - .type =PHY_TYPE_USB3 , .nlanes =1 , .serdes_tbl = qmp_v3_usb3_serdes_tbl,@@ -1723,7 +1717,6 @@ static const struct qmp_phy_cfg sc7180_usb3phy_cfg = { };static const struct qmp_phy_cfg sc8280xp_usb3_uniphy_cfg = { - .type =PHY_TYPE_USB3 , .nlanes =1 , .serdes_tbl = sc8280xp_usb3_uniphy_serdes_tbl,@@ -1752,7 +1745,6 @@ static const struct qmp_phy_cfg sc8280xp_usb3_uniphy_cfg = { };static const struct qmp_phy_cfg qmp_v3_usb3_uniphy_cfg = { - .type =PHY_TYPE_USB3 , .nlanes =1 , .serdes_tbl = qmp_v3_usb3_uniphy_serdes_tbl,@@ -1781,7 +1773,6 @@ static const struct qmp_phy_cfg qmp_v3_usb3_uniphy_cfg = { };static const struct qmp_phy_cfg msm8998_usb3phy_cfg = { - .type =PHY_TYPE_USB3 , .nlanes =1 , .serdes_tbl = msm8998_usb3_serdes_tbl,@@ -1808,7 +1799,6 @@ static const struct qmp_phy_cfg msm8998_usb3phy_cfg = { };static const struct qmp_phy_cfg sm8150_usb3phy_cfg = { - .type =PHY_TYPE_USB3 , .nlanes =1 , .serdes_tbl = sm8150_usb3_serdes_tbl,@@ -1844,7 +1834,6 @@ static const struct qmp_phy_cfg sm8150_usb3phy_cfg = { };static const struct qmp_phy_cfg sm8150_usb3_uniphy_cfg = { - .type =PHY_TYPE_USB3 , .nlanes =1 , .serdes_tbl = sm8150_usb3_uniphy_serdes_tbl,@@ -1876,7 +1865,6 @@ static const struct qmp_phy_cfg sm8150_usb3_uniphy_cfg = { };static const struct qmp_phy_cfg sm8250_usb3phy_cfg = { - .type =PHY_TYPE_USB3 , .nlanes =1 , .serdes_tbl = sm8150_usb3_serdes_tbl,@@ -1911,7 +1899,6 @@ static const struct qmp_phy_cfg sm8250_usb3phy_cfg = { };static const struct qmp_phy_cfg sm8250_usb3_uniphy_cfg = { - .type =PHY_TYPE_USB3 , .nlanes =1 , .serdes_tbl = sm8150_usb3_uniphy_serdes_tbl,@@ -1943,7 +1930,6 @@ static const struct qmp_phy_cfg sm8250_usb3_uniphy_cfg = { };static const struct qmp_phy_cfg sdx55_usb3_uniphy_cfg = { - .type =PHY_TYPE_USB3 , .nlanes =1 , .serdes_tbl = sm8150_usb3_uniphy_serdes_tbl,@@ -1975,7 +1961,6 @@ static const struct qmp_phy_cfg sdx55_usb3_uniphy_cfg = { };static const struct qmp_phy_cfg sdx65_usb3_uniphy_cfg = { - .type =PHY_TYPE_USB3 , .nlanes =1 , .serdes_tbl = sm8150_usb3_uniphy_serdes_tbl,@@ -2007,7 +1992,6 @@ static const struct qmp_phy_cfg sdx65_usb3_uniphy_cfg = { };static const struct qmp_phy_cfg sm8350_usb3phy_cfg = { - .type =PHY_TYPE_USB3 , .nlanes =1 , .serdes_tbl = sm8150_usb3_serdes_tbl,@@ -2042,7 +2026,6 @@ static const struct qmp_phy_cfg sm8350_usb3phy_cfg = { };static const struct qmp_phy_cfg sm8350_usb3_uniphy_cfg = { - .type =PHY_TYPE_USB3 , .nlanes =1 , .serdes_tbl = sm8150_usb3_uniphy_serdes_tbl,@@ -2074,7 +2057,6 @@ static const struct qmp_phy_cfg sm8350_usb3_uniphy_cfg = { };static const struct qmp_phy_cfg qcm2290_usb3phy_cfg = { - .type =PHY_TYPE_USB3 , .nlanes =1 , .serdes_tbl = qcm2290_usb3_serdes_tbl,@@ -2432,10 +2414,6 @@ static int __maybe_unused qmp_usb_runtime_suspend(struct device *dev)dev_vdbg (dev,"Suspending QMP phy, mode:%d\n" , qphy->mode); -/* Supported only for USB3 PHY and luckily USB3 is the first phy */ -if (cfg->type !=PHY_TYPE_USB3 ) -return 0 ; -if (!qphy->phy->init_count) {dev_vdbg (dev,"PHY not initialized, bailing out\n" );return 0 ;
drivers/phy/qualcomm/phy-qcom-qmp-usb.c static int __maybe_unused qmp_usb_runtime_resume(struct device *dev) · line 2441
Quoted 10 lines
drivers/phy/qualcomm/phy-qcom-qmp-usb.c +0
-4@@ -2458,10 +2436,6 @@ static int __maybe_unused qmp_usb_runtime_resume(struct device *dev)dev_vdbg (dev,"Resuming QMP phy, mode:%d\n" , qphy->mode); -/* Supported only for USB3 PHY and luckily USB3 is the first phy */ -if (cfg->type !=PHY_TYPE_USB3 ) -return 0 ; -if (!qphy->phy->init_count) {dev_vdbg (dev,"PHY not initialized, bailing out\n" );return 0 ;
Signature · 3 lines
linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH 05/17] phy: qcom-qmp-pcie: drop init and exit wrappers
In reply to Johan HovoldQuoted 60 lines · Johan Hovold
Drop the unnecessary PHY init and exit callback wrappers.
Signed-off-by Johan Hovold <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 29 ++++-------------------- 1 file changed, 4 insertions(+), 25 deletions(-)drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +4
-18@@ -1877,8 +1877,9 @@ static int qmp_pcie_serdes_init(struct qmp_phy *qphy)return 0 ; } -static int qmp_pcie_com_init (struct qmp_phy *qphy) +static int qmp_pcie_init (struct phy *phy) { +struct qmp_phy *qphy =phy_get_drvdata (phy);struct qcom_qmp *qmp = qphy->qmp;const struct qmp_phy_cfg *cfg = qphy->cfg;void __iomem *pcs = qphy->pcs;@@ -1925,8 +1926,9 @@ static int qmp_pcie_com_init(struct qmp_phy *qphy)return ret; } -static int qmp_pcie_com_exit (struct qmp_phy *qphy) +static int qmp_pcie_exit (struct phy *phy) { +struct qmp_phy *qphy =phy_get_drvdata (phy);struct qcom_qmp *qmp = qphy->qmp;const struct qmp_phy_cfg *cfg = qphy->cfg;@@ -1939,20 +1941,6 @@ static int qmp_pcie_com_exit(struct qmp_phy *qphy)return 0 ; } -static int qmp_pcie_init (struct phy *phy) -{ -struct qmp_phy *qphy =phy_get_drvdata (phy); -struct qcom_qmp *qmp = qphy->qmp; -int ret; -dev_vdbg (qmp->dev,"Initializing QMP phy\n" ); - - ret =qmp_pcie_com_init (qphy); -if (ret) -return ret; - -return 0 ; -} -static int qmp_pcie_power_on (struct phy *phy) {struct qmp_phy *qphy =phy_get_drvdata (phy);@@ -2060,15 +2048,6 @@ static int qmp_pcie_power_off(struct phy *phy)return 0 ; } -static int qmp_pcie_exit (struct phy *phy) -{
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c static int qmp_pcie_power_off(struct phy *phy) · line 2053
Quoted 10 lines
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +0
-7-struct qmp_phy *qphy =phy_get_drvdata (phy); - -qmp_pcie_com_exit (qphy); - -return 0 ; -} -static int qmp_pcie_enable (struct phy *phy) {int ret;
Signature · 3 lines
linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH 06/17] phy: qcom-qmp-usb: drop init and exit wrappers
In reply to Johan HovoldQuoted 60 lines · Johan Hovold
Drop the unnecessary PHY init and exit callback wrappers.
Signed-off-by Johan Hovold <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 29 ++++--------------------- 1 file changed, 4 insertions(+), 25 deletions(-)drivers/phy/qualcomm/phy-qcom-qmp-usb.c +4
-18@@ -2125,8 +2125,9 @@ static int qmp_usb_serdes_init(struct qmp_phy *qphy)return 0 ; } -static int qmp_usb_com_init (struct qmp_phy *qphy) +static int qmp_usb_init (struct phy *phy) { +struct qmp_phy *qphy =phy_get_drvdata (phy);struct qcom_qmp *qmp = qphy->qmp;const struct qmp_phy_cfg *cfg = qphy->cfg;void __iomem *pcs = qphy->pcs;@@ -2197,8 +2198,9 @@ static int qmp_usb_com_init(struct qmp_phy *qphy)return ret; } -static int qmp_usb_com_exit (struct qmp_phy *qphy) +static int qmp_usb_exit (struct phy *phy) { +struct qmp_phy *qphy =phy_get_drvdata (phy);struct qcom_qmp *qmp = qphy->qmp;const struct qmp_phy_cfg *cfg = qphy->cfg;@@ -2211,20 +2213,6 @@ static int qmp_usb_com_exit(struct qmp_phy *qphy)return 0 ; } -static int qmp_usb_init (struct phy *phy) -{ -struct qmp_phy *qphy =phy_get_drvdata (phy); -struct qcom_qmp *qmp = qphy->qmp; -int ret; -dev_vdbg (qmp->dev,"Initializing QMP phy\n" ); - - ret =qmp_usb_com_init (qphy); -if (ret) -return ret; - -return 0 ; -} -static int qmp_usb_power_on (struct phy *phy) {struct qmp_phy *qphy =phy_get_drvdata (phy);@@ -2316,15 +2304,6 @@ static int qmp_usb_power_off(struct phy *phy)return 0 ; } -static int qmp_usb_exit (struct phy *phy) -{
drivers/phy/qualcomm/phy-qcom-qmp-usb.c static int qmp_usb_power_off(struct phy *phy) · line 2309
Quoted 10 lines
drivers/phy/qualcomm/phy-qcom-qmp-usb.c +0
-7-struct qmp_phy *qphy =phy_get_drvdata (phy); - -qmp_usb_com_exit (qphy); - -return 0 ; -} -static int qmp_usb_enable (struct phy *phy) {int ret;
Signature · 3 lines
linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH 07/17] phy: qcom-qmp: drop unused forward declarations
In reply to Johan HovoldQuoted 54 lines · Johan Hovold
Only the combo QMP driver needs a forward declaration of struct
qmp_phy.Signed-off-by Johan Hovold <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c | 2 -- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 2 -- drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 2 -- drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 2 -- 4 files changed, 8 deletions(-)drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c +0
-2@@ -184,8 +184,6 @@ static const struct qmp_phy_init_tbl msm8996_pcie_pcs_tbl[] = { QMP_PHY_INIT_CFG(QPHY_V2_PCS_TXDEEMPH_M3P5DB_V0, 0x0e), }; -struct qmp_phy ; -/* struct qmp_phy_cfg - per-PHY initialization config */ struct qmp_phy_cfg {/* number of lanes provided by phy */ drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +0
-2@@ -1300,8 +1300,6 @@ static const struct qmp_phy_init_tbl sm8450_qmp_gen4x2_pcie_pcs_misc_tbl[] = { QMP_PHY_INIT_CFG(QPHY_V5_20_PCS_PCIE_G4_PRE_GAIN, 0x2e), }; -struct qmp_phy ; -/* struct qmp_phy_cfg - per-PHY initialization config */ struct qmp_phy_cfg {/* number of lanes provided by phy */ drivers/phy/qualcomm/phy-qcom-qmp-ufs.c +0
-2@@ -531,8 +531,6 @@ static const struct qmp_phy_init_tbl sm8350_ufsphy_pcs_tbl[] = { QMP_PHY_INIT_CFG(QPHY_V5_PCS_UFS_MULTI_LANE_CTRL1, 0x02), }; -struct qmp_phy ; -/* struct qmp_phy_cfg - per-PHY initialization config */ struct qmp_phy_cfg {/* number of lanes provided by phy */ drivers/phy/qualcomm/phy-qcom-qmp-usb.c +0
-0
drivers/phy/qualcomm/phy-qcom-qmp-usb.c static const struct qmp_phy_init_tbl sc8280xp_usb3_uniphy_pcs_tbl[] = { · line 1432
Quoted 8 lines
drivers/phy/qualcomm/phy-qcom-qmp-usb.c +0
-2@@ -1427,8 +1427,6 @@ static const struct qmp_phy_init_tbl sc8280xp_usb3_uniphy_pcs_tbl[] = { QMP_PHY_INIT_CFG(QPHY_V5_PCS_REFGEN_REQ_CONFIG1, 0x21), }; -struct qmp_phy ; -/* struct qmp_phy_cfg - per-PHY initialization config */ struct qmp_phy_cfg {/* number of lanes provided by phy */
Signature · 3 lines
linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH 08/17] phy: qcom-qmp-pcie-msm8996: drop unused kernel doc
In reply to Johan HovoldQuoted 12 lines · Johan Hovold
Drop the removed mode field from the struct
qmp_phykernel doc.Signed-off-by Johan Hovold <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c | 1 - 1 file changed, 1 deletion(-)drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c +0
-0
drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c struct qmp_phy_cfg { · line 243
Quoted 7 lines
drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c +0
-1@@ -238,7 +238,6 @@ struct qmp_phy_cfg {* @index: lane index * @qmp: QMP phy to which this lane belongs * @lane_rst: lane's reset controller -* @mode: current PHY mode */ struct qmp_phy {struct phy *phy;
Signature · 3 lines
linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH 09/17] phy: qcom-qmp-pcie: drop unused mode field
In reply to Johan HovoldQuoted 20 lines · Johan Hovold
Drop the unused mode field from struct
qmp_phy.Signed-off-by Johan Hovold <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 2 -- 1 file changed, 2 deletions(-)drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +0
-1@@ -1374,7 +1374,6 @@ struct qmp_phy_cfg {* @pipe_clk: pipe clock * @index: lane index * @qmp: QMP phy to which this lane belongs -* @mode: current PHY mode */ struct qmp_phy {struct phy *phy;
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c struct qmp_phy { · line 1393
Quoted 7 lines
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +0
-1@@ -1389,7 +1388,6 @@ struct qmp_phy {struct clk *pipe_clk;unsigned int index;struct qcom_qmp *qmp; -enum phy_mode mode; };/**
Signature · 3 lines
linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH 10/17] phy: qcom-qmp-pcie: drop unused config field
In reply to Johan HovoldQuoted 12 lines · Johan Hovold
Drop the unused
mask_com_pcs_readyfield from structqmp_phy_cfg.Signed-off-by Johan Hovold <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 1 - 1 file changed, 1 deletion(-)drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +0
-0
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c struct qmp_phy_cfg { · line 1347
Quoted 7 lines
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +0
-1@@ -1342,7 +1342,6 @@ struct qmp_phy_cfg {unsigned int start_ctrl;unsigned int pwrdn_ctrl; -unsigned int mask_com_pcs_ready;/* bit offset of PHYSTATUS in QPHY_PCS_STATUS register */ unsigned int phy_status;
Signature · 3 lines
linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH 11/17] phy: qcom-qmp: drop unused index field
In reply to Johan HovoldQuoted 116 lines · Johan Hovold
Only the MSM8996 PCIe QMP driver uses the index field so drop it from the other drivers.
Signed-off-by Johan Hovold <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 3 --- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 3 --- drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 3 --- drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 3 --- 4 files changed, 12 deletions(-)drivers/phy/qualcomm/phy-qcom-qmp-combo.c +0
-3@@ -906,7 +906,6 @@ struct qmp_phy_combo_cfg {* @pcs_misc: iomapped memory space for lane's pcs_misc * @pcs_usb: iomapped memory space for lane's pcs_usb * @pipe_clk: pipe clock -* @index: lane index * @qmp: QMP phy to which this lane belongs * @mode: current PHY mode * @dp_aux_cfg: Display port aux config @@ -925,7 +924,6 @@ struct qmp_phy {void __iomem *pcs_misc;void __iomem *pcs_usb;struct clk *pipe_clk; -unsigned int index;struct qcom_qmp *qmp;enum phy_mode mode;unsigned int dp_aux_cfg;@@ -2779,7 +2777,6 @@ static int qmp_combo_create(struct device *dev, struct device_node *np, int id, } qphy->phy = generic_phy; - qphy->index = id; qphy->qmp = qmp; qmp->phys[id] = qphy;phy_set_drvdata (generic_phy, qphy);drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +0
-3@@ -1371,7 +1371,6 @@ struct qmp_phy_cfg {* @rx2: iomapped memory space for second lane's rx (in dual lane PHYs) * @pcs_misc: iomapped memory space for lane's pcs_misc * @pipe_clk: pipe clock -* @index: lane index * @qmp: QMP phy to which this lane belongs */ struct qmp_phy {@@ -1385,7 +1384,6 @@ struct qmp_phy {void __iomem *rx2;void __iomem *pcs_misc;struct clk *pipe_clk; -unsigned int index;struct qcom_qmp *qmp; };@@ -2264,7 +2262,6 @@ static int qmp_pcie_create(struct device *dev, struct device_node *np, int id, } qphy->phy = generic_phy; - qphy->index = id; qphy->qmp = qmp; qmp->phys[id] = qphy;phy_set_drvdata (generic_phy, qphy);drivers/phy/qualcomm/phy-qcom-qmp-ufs.c +0
-3@@ -580,7 +580,6 @@ struct qmp_phy_cfg {* @tx2: iomapped memory space for second lane's tx (in dual lane PHYs) * @rx2: iomapped memory space for second lane's rx (in dual lane PHYs) * @pcs_misc: iomapped memory space for lane's pcs_misc -* @index: lane index * @qmp: QMP phy to which this lane belongs */ struct qmp_phy {@@ -593,7 +592,6 @@ struct qmp_phy {void __iomem *tx2;void __iomem *rx2;void __iomem *pcs_misc; -unsigned int index;struct qcom_qmp *qmp; };@@ -1149,7 +1147,6 @@ static int qmp_ufs_create(struct device *dev, struct device_node *np, int id, } qphy->phy = generic_phy; - qphy->index = id; qphy->qmp = qmp; qmp->phys[id] = qphy;phy_set_drvdata (generic_phy, qphy);drivers/phy/qualcomm/phy-qcom-qmp-usb.c +0
-2@@ -1491,7 +1491,6 @@ struct qmp_phy_cfg {* @pcs_misc: iomapped memory space for lane's pcs_misc * @pcs_usb: iomapped memory space for lane's pcs_usb * @pipe_clk: pipe clock -* @index: lane index * @qmp: QMP phy to which this lane belongs * @mode: current PHY mode */ @@ -1507,7 +1506,6 @@ struct qmp_phy {void __iomem *pcs_misc;void __iomem *pcs_usb;struct clk *pipe_clk; -unsigned int index;struct qcom_qmp *qmp;enum phy_mode mode; };
drivers/phy/qualcomm/phy-qcom-qmp-usb.c int qmp_usb_create(struct device *dev, struct device_node *np, int id, · line 2651
Quoted 7 lines
drivers/phy/qualcomm/phy-qcom-qmp-usb.c +0
-1@@ -2648,7 +2646,6 @@ int qmp_usb_create(struct device *dev, struct device_node *np, int id, } qphy->phy = generic_phy; - qphy->index = id; qphy->qmp = qmp; qmp->phys[id] = qphy;phy_set_drvdata (generic_phy, qphy);
Signature · 3 lines
linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH 12/17] phy: qcom-qmp-pcie: consolidate lane config
In reply to Johan HovoldQuoted 183 lines · Johan Hovold
For legacy reasons, there are two configuration parameters that describe the number of lanes a PHY has.
Replace them both with a new field simply named "lanes".
Signed-off-by Johan Hovold <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 39 ++++++++++-------------- 1 file changed, 16 insertions(+), 23 deletions(-)drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +15
-22@@ -1302,8 +1302,7 @@ static const struct qmp_phy_init_tbl sm8450_qmp_gen4x2_pcie_pcs_misc_tbl[] = {/* struct qmp_phy_cfg - per-PHY initialization config */ struct qmp_phy_cfg { -/* number of lanes provided by phy */ -int nlanes; +int lanes;/* Init sequence for PHY blocks - serdes, tx, rx, pcs */ const struct qmp_phy_init_tbl *serdes_tbl;@@ -1351,9 +1350,6 @@ struct qmp_phy_cfg {int pwrdn_delay_min;int pwrdn_delay_max; -/* true, if PHY has secondary tx/rx lanes to be configured */ -bool is_dual_lane_phy; -/* QMP PHY pipe clock interface rate */ unsigned long pipe_clock_rate; };@@ -1461,7 +1457,7 @@ static const char * const sdm845_pciephy_reset_l[] = { };static const struct qmp_phy_cfg ipq8074_pciephy_cfg = { - .nlanes =1 , + .lanes =1 , .serdes_tbl = ipq8074_pcie_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (ipq8074_pcie_serdes_tbl),@@ -1489,7 +1485,7 @@ static const struct qmp_phy_cfg ipq8074_pciephy_cfg = { };static const struct qmp_phy_cfg ipq8074_pciephy_gen3_cfg = { - .nlanes =1 , + .lanes =1 , .serdes_tbl = ipq8074_pcie_gen3_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (ipq8074_pcie_gen3_serdes_tbl),@@ -1518,7 +1514,7 @@ static const struct qmp_phy_cfg ipq8074_pciephy_gen3_cfg = { };static const struct qmp_phy_cfg ipq6018_pciephy_cfg = { - .nlanes =1 , + .lanes =1 , .serdes_tbl = ipq6018_pcie_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (ipq6018_pcie_serdes_tbl),@@ -1547,7 +1543,7 @@ static const struct qmp_phy_cfg ipq6018_pciephy_cfg = { };static const struct qmp_phy_cfg sdm845_qmp_pciephy_cfg = { - .nlanes =1 , + .lanes =1 , .serdes_tbl = sdm845_qmp_pcie_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sdm845_qmp_pcie_serdes_tbl),@@ -1577,7 +1573,7 @@ static const struct qmp_phy_cfg sdm845_qmp_pciephy_cfg = { };static const struct qmp_phy_cfg sdm845_qhp_pciephy_cfg = { - .nlanes =1 , + .lanes =1 , .serdes_tbl = sdm845_qhp_pcie_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sdm845_qhp_pcie_serdes_tbl),@@ -1605,7 +1601,7 @@ static const struct qmp_phy_cfg sdm845_qhp_pciephy_cfg = { };static const struct qmp_phy_cfg sm8250_qmp_gen3x1_pciephy_cfg = { - .nlanes =1 , + .lanes =1 , .serdes_tbl = sm8250_qmp_pcie_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sm8250_qmp_pcie_serdes_tbl),@@ -1643,7 +1639,7 @@ static const struct qmp_phy_cfg sm8250_qmp_gen3x1_pciephy_cfg = { };static const struct qmp_phy_cfg sm8250_qmp_gen3x2_pciephy_cfg = { - .nlanes =2 , + .lanes =2 , .serdes_tbl = sm8250_qmp_pcie_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sm8250_qmp_pcie_serdes_tbl),@@ -1675,14 +1671,13 @@ static const struct qmp_phy_cfg sm8250_qmp_gen3x2_pciephy_cfg = { .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, .phy_status = PHYSTATUS, - .is_dual_lane_phy = true, .has_pwrdn_delay = true, .pwrdn_delay_min = 995, /* us */ .pwrdn_delay_max = 1005, /* us */ };static const struct qmp_phy_cfg msm8998_pciephy_cfg = { - .nlanes =1 , + .lanes =1 , .serdes_tbl = msm8998_pcie_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (msm8998_pcie_serdes_tbl),@@ -1706,7 +1701,7 @@ static const struct qmp_phy_cfg msm8998_pciephy_cfg = { };static const struct qmp_phy_cfg sc8180x_pciephy_cfg = { - .nlanes =1 , + .lanes =1 , .serdes_tbl = sc8180x_qmp_pcie_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sc8180x_qmp_pcie_serdes_tbl),@@ -1735,7 +1730,7 @@ static const struct qmp_phy_cfg sc8180x_pciephy_cfg = { };static const struct qmp_phy_cfg sdx55_qmp_pciephy_cfg = { - .nlanes =2 , + .lanes =2 , .serdes_tbl = sdx55_qmp_pcie_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sdx55_qmp_pcie_serdes_tbl),@@ -1759,14 +1754,13 @@ static const struct qmp_phy_cfg sdx55_qmp_pciephy_cfg = { .pwrdn_ctrl = SW_PWRDN, .phy_status = PHYSTATUS_4_20, - .is_dual_lane_phy = true, .has_pwrdn_delay = true, .pwrdn_delay_min = 995, /* us */ .pwrdn_delay_max = 1005, /* us */ };static const struct qmp_phy_cfg sm8450_qmp_gen3x1_pciephy_cfg = { - .nlanes =1 , + .lanes =1 , .serdes_tbl = sm8450_qmp_gen3x1_pcie_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sm8450_qmp_gen3x1_pcie_serdes_tbl),@@ -1796,7 +1790,7 @@ static const struct qmp_phy_cfg sm8450_qmp_gen3x1_pciephy_cfg = { };static const struct qmp_phy_cfg sm8450_qmp_gen4x2_pciephy_cfg = { - .nlanes =2 , + .lanes =2 , .serdes_tbl = sm8450_qmp_gen4x2_pcie_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sm8450_qmp_gen4x2_pcie_serdes_tbl),@@ -1820,7 +1814,6 @@ static const struct qmp_phy_cfg sm8450_qmp_gen4x2_pciephy_cfg = { .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, .phy_status = PHYSTATUS_4_20, - .is_dual_lane_phy = true, .has_pwrdn_delay = true, .pwrdn_delay_min = 995, /* us */ .pwrdn_delay_max = 1005, /* us */@@ -1959,7 +1952,7 @@ static int qmp_pcie_power_on(struct phy *phy)qmp_pcie_configure_lane (tx, cfg->regs, cfg->tx_tbl, cfg->tx_tbl_num,1 );qmp_pcie_configure_lane (tx, cfg->regs, cfg->tx_tbl_sec, cfg->tx_tbl_num_sec,1 ); -if (cfg->is_dual_lane_phy) { +if (cfg->lanes >=2 ) {qmp_pcie_configure_lane (qphy->tx2, cfg->regs, cfg->tx_tbl, cfg->tx_tbl_num,2 ); qmp_pcie_configure_lane(qphy->tx2, cfg->regs, cfg->tx_tbl_sec,@@ -1969,7 +1962,7 @@ static int qmp_pcie_power_on(struct phy *phy)qmp_pcie_configure_lane (rx, cfg->regs, cfg->rx_tbl, cfg->rx_tbl_num,1 );qmp_pcie_configure_lane (rx, cfg->regs, cfg->rx_tbl_sec, cfg->rx_tbl_num_sec,1 ); -if (cfg->is_dual_lane_phy) { +if (cfg->lanes >=2 ) {qmp_pcie_configure_lane (qphy->rx2, cfg->regs, cfg->rx_tbl, cfg->rx_tbl_num,2 ); qmp_pcie_configure_lane(qphy->rx2, cfg->regs, cfg->rx_tbl_sec,
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c static int qmp_pcie_create(struct device *dev, struct device_node *np, int id, · line 2224
Quoted 8 lines
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +1
-1@@ -2225,7 +2218,7 @@ static int qmp_pcie_create(struct device *dev, struct device_node *np, int id,if (IS_ERR (qphy->pcs))return PTR_ERR (qphy->pcs); -if (cfg->is_dual_lane_phy) { +if (cfg->lanes >=2 ) { qphy->tx2 =devm_of_iomap (dev, np,3 ,NULL );if (IS_ERR (qphy->tx2))return PTR_ERR (qphy->tx2);
Signature · 3 lines
linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH 13/17] phy: qcom-qmp-pcie-msm8996: rename nlanes config
In reply to Johan HovoldQuoted 33 lines · Johan Hovold
The nlanes configuration parameter is really the number of PHYs provided by this QMP block on MSM8996. Rename it accordingly.
Signed-off-by Johan Hovold <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c +3
-3@@ -186,8 +186,8 @@ static const struct qmp_phy_init_tbl msm8996_pcie_pcs_tbl[] = {/* struct qmp_phy_cfg - per-PHY initialization config */ struct qmp_phy_cfg { -/* number of lanes provided by phy */ -int nlanes; +/* number of PHYs provided by this block */ +int num_phys;/* Init sequence for PHY blocks - serdes, tx, rx, pcs */ const struct qmp_phy_init_tbl *serdes_tbl;@@ -318,7 +318,7 @@ static const char * const qmp_phy_vreg_l[] = { };static const struct qmp_phy_cfg msm8996_pciephy_cfg = { - .nlanes =3 , + .num_phys =3 , .serdes_tbl = msm8996_pcie_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (msm8996_pcie_serdes_tbl),
drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c static int qmp_pcie_msm8996_probe(struct platform_device *pdev) · line 867
Quoted 8 lines
drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c +1
-1@@ -861,7 +861,7 @@ static int qmp_pcie_msm8996_probe(struct platform_device *pdev)if (IS_ERR (serdes))return PTR_ERR (serdes); - expected_phys = cfg->nlanes; + expected_phys = cfg->num_phys;mutex_init (&qmp->phy_mutex);
Signature · 3 lines
linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH 14/17] phy: qcom-qmp-combo: consolidate lane config
In reply to Johan HovoldQuoted 194 lines · Johan Hovold
For legacy reasons, there are two configuration parameters that appear to describe the number of lanes a PHY has, even if "nlanes" was actually used for a different purpose.
Replace them both with a new field simply named "lanes".
Signed-off-by Johan Hovold <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 38 ++++++++--------------- 1 file changed, 13 insertions(+), 25 deletions(-)drivers/phy/qualcomm/phy-qcom-qmp-combo.c +12
-24@@ -816,8 +816,7 @@ struct qmp_phy;struct qmp_phy_cfg {/* phy-type - PCIE/UFS/USB */ unsigned int type; -/* number of lanes provided by phy */ -int nlanes; +int lanes;/* Init sequence for PHY blocks - serdes, tx, rx, pcs */ const struct qmp_phy_init_tbl *serdes_tbl;@@ -879,8 +878,6 @@ struct qmp_phy_cfg {/* true, if PHY has a separate DP_COM control block */ bool has_phy_dp_com_ctrl; -/* true, if PHY has secondary tx/rx lanes to be configured */ -bool is_dual_lane_phy;/* Offset from PCS to PCS_USB region */ unsigned int pcs_usb_offset;@@ -1029,7 +1026,7 @@ static const char * const sc7180_usb3phy_reset_l[] = {static const struct qmp_phy_cfg sc7180_usb3phy_cfg = { .type =PHY_TYPE_USB3 , - .nlanes =1 , + .lanes =2 , .serdes_tbl = qmp_v3_usb3_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (qmp_v3_usb3_serdes_tbl),@@ -1056,12 +1053,11 @@ static const struct qmp_phy_cfg sc7180_usb3phy_cfg = { .pwrdn_delay_max = POWER_DOWN_DELAY_US_MAX, .has_phy_dp_com_ctrl = true, - .is_dual_lane_phy = true, };static const struct qmp_phy_cfg sc7180_dpphy_cfg = { .type =PHY_TYPE_DP , - .nlanes =1 , + .lanes =2 , .serdes_tbl = qmp_v3_dp_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (qmp_v3_dp_serdes_tbl),@@ -1091,7 +1087,6 @@ static const struct qmp_phy_cfg sc7180_dpphy_cfg = { .regs = qmp_v3_usb3phy_regs_layout, .has_phy_dp_com_ctrl = true, - .is_dual_lane_phy = true, .dp_aux_init = qcom_qmp_v3_phy_dp_aux_init, .configure_dp_tx = qcom_qmp_v3_phy_configure_dp_tx,@@ -1106,7 +1101,7 @@ static const struct qmp_phy_combo_cfg sc7180_usb3dpphy_cfg = {static const struct qmp_phy_cfg sdm845_usb3phy_cfg = { .type =PHY_TYPE_USB3 , - .nlanes =1 , + .lanes =2 , .serdes_tbl = qmp_v3_usb3_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (qmp_v3_usb3_serdes_tbl),@@ -1133,7 +1128,6 @@ static const struct qmp_phy_cfg sdm845_usb3phy_cfg = { .pwrdn_delay_max = POWER_DOWN_DELAY_US_MAX, .has_phy_dp_com_ctrl = true, - .is_dual_lane_phy = true, };static const struct qmp_phy_combo_cfg sdm845_usb3dpphy_cfg = {@@ -1143,7 +1137,7 @@ static const struct qmp_phy_combo_cfg sdm845_usb3dpphy_cfg = {static const struct qmp_phy_cfg sm8150_usb3phy_cfg = { .type =PHY_TYPE_USB3 , - .nlanes =1 , + .lanes =2 , .serdes_tbl = sm8150_usb3_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sm8150_usb3_serdes_tbl),@@ -1174,12 +1168,11 @@ static const struct qmp_phy_cfg sm8150_usb3phy_cfg = { .pwrdn_delay_max = POWER_DOWN_DELAY_US_MAX, .has_phy_dp_com_ctrl = true, - .is_dual_lane_phy = true, };static const struct qmp_phy_cfg sc8180x_dpphy_cfg = { .type =PHY_TYPE_DP , - .nlanes =1 , + .lanes =2 , .serdes_tbl = qmp_v4_dp_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (qmp_v4_dp_serdes_tbl),@@ -1209,7 +1202,6 @@ static const struct qmp_phy_cfg sc8180x_dpphy_cfg = { .regs = qmp_v3_usb3phy_regs_layout, .has_phy_dp_com_ctrl = true, - .is_dual_lane_phy = true, .dp_aux_init = qcom_qmp_v4_phy_dp_aux_init, .configure_dp_tx = qcom_qmp_v4_phy_configure_dp_tx,@@ -1224,7 +1216,7 @@ static const struct qmp_phy_combo_cfg sc8180x_usb3dpphy_cfg = {static const struct qmp_phy_cfg sc8280xp_usb43dp_usb_cfg = { .type =PHY_TYPE_USB3 , - .nlanes =1 , + .lanes =2 , .serdes_tbl = sc8280xp_usb43dp_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sc8280xp_usb43dp_serdes_tbl),@@ -1252,12 +1244,11 @@ static const struct qmp_phy_cfg sc8280xp_usb43dp_usb_cfg = { .pwrdn_delay_max = POWER_DOWN_DELAY_US_MAX, .has_phy_dp_com_ctrl = true, - .is_dual_lane_phy = true, };static const struct qmp_phy_cfg sc8280xp_usb43dp_dp_cfg = { .type =PHY_TYPE_DP , - .nlanes =1 , + .lanes =2 , .serdes_tbl = qmp_v5_dp_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (qmp_v5_dp_serdes_tbl),@@ -1287,7 +1278,6 @@ static const struct qmp_phy_cfg sc8280xp_usb43dp_dp_cfg = { .regs = qmp_v4_usb3phy_regs_layout, .has_phy_dp_com_ctrl = true, - .is_dual_lane_phy = true, .dp_aux_init = qcom_qmp_v4_phy_dp_aux_init, .configure_dp_tx = qcom_qmp_v4_phy_configure_dp_tx,@@ -1302,7 +1292,7 @@ static const struct qmp_phy_combo_cfg sc8280xp_usb43dpphy_combo_cfg = {static const struct qmp_phy_cfg sm8250_usb3phy_cfg = { .type =PHY_TYPE_USB3 , - .nlanes =1 , + .lanes =2 , .serdes_tbl = sm8150_usb3_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sm8150_usb3_serdes_tbl),@@ -1332,12 +1322,11 @@ static const struct qmp_phy_cfg sm8250_usb3phy_cfg = { .pwrdn_delay_max = POWER_DOWN_DELAY_US_MAX, .has_phy_dp_com_ctrl = true, - .is_dual_lane_phy = true, };static const struct qmp_phy_cfg sm8250_dpphy_cfg = { .type =PHY_TYPE_DP , - .nlanes =1 , + .lanes =2 , .serdes_tbl = qmp_v4_dp_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (qmp_v4_dp_serdes_tbl),@@ -1367,7 +1356,6 @@ static const struct qmp_phy_cfg sm8250_dpphy_cfg = { .regs = qmp_v4_usb3phy_regs_layout, .has_phy_dp_com_ctrl = true, - .is_dual_lane_phy = true, .dp_aux_init = qcom_qmp_v4_phy_dp_aux_init, .configure_dp_tx = qcom_qmp_v4_phy_configure_dp_tx,@@ -2117,7 +2105,7 @@ static int qmp_combo_power_on(struct phy *phy)/* Tx, Rx, and PCS configurations */ qmp_combo_configure_lane (tx, cfg->regs, cfg->tx_tbl, cfg->tx_tbl_num,1 ); -if (cfg->is_dual_lane_phy) { +if (cfg->lanes >=2 ) {qmp_combo_configure_lane (qphy->tx2, cfg->regs, cfg->tx_tbl, cfg->tx_tbl_num,2 ); }@@ -2128,7 +2116,7 @@ static int qmp_combo_power_on(struct phy *phy)qmp_combo_configure_lane (rx, cfg->regs, cfg->rx_tbl, cfg->rx_tbl_num,1 ); -if (cfg->is_dual_lane_phy) { +if (cfg->lanes >=2 ) {qmp_combo_configure_lane (qphy->rx2, cfg->regs, cfg->rx_tbl, cfg->rx_tbl_num,2 ); }
drivers/phy/qualcomm/phy-qcom-qmp-combo.c static int qmp_combo_create(struct device *dev, struct device_node *np, int id, · line 2719
Quoted 8 lines
drivers/phy/qualcomm/phy-qcom-qmp-combo.c +1
-1@@ -2725,7 +2713,7 @@ static int qmp_combo_create(struct device *dev, struct device_node *np, int id,if (cfg->pcs_usb_offset) qphy->pcs_usb = qphy->pcs + cfg->pcs_usb_offset; -if (cfg->is_dual_lane_phy) { +if (cfg->lanes >=2 ) { qphy->tx2 =devm_of_iomap (dev, np,3 ,NULL );if (IS_ERR (qphy->tx2))return PTR_ERR (qphy->tx2);
Signature · 3 lines
linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH 15/17] phy: qcom-qmp-ufs: consolidate lane config
In reply to Johan HovoldQuoted 130 lines · Johan Hovold
For legacy reasons, there are two configuration parameters that describe the number of lanes a PHY has.
Replace them both with a new field simply named "lanes".
Signed-off-by Johan Hovold <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 31 ++++++++----------------- 1 file changed, 10 insertions(+), 21 deletions(-)drivers/phy/qualcomm/phy-qcom-qmp-ufs.c +9
-20@@ -533,8 +533,7 @@ static const struct qmp_phy_init_tbl sm8350_ufsphy_pcs_tbl[] = {/* struct qmp_phy_cfg - per-PHY initialization config */ struct qmp_phy_cfg { -/* number of lanes provided by phy */ -int nlanes; +int lanes;/* Init sequence for PHY blocks - serdes, tx, rx, pcs */ const struct qmp_phy_init_tbl *serdes_tbl;@@ -561,9 +560,6 @@ struct qmp_phy_cfg {/* bit offset of PHYSTATUS in QPHY_PCS_STATUS register */ unsigned int phy_status; -/* true, if PHY has secondary tx/rx lanes to be configured */ -bool is_dual_lane_phy; -/* true, if PCS block has no separate SW_RESET register */ bool no_pcs_sw_reset; };@@ -662,7 +658,7 @@ static const char * const qmp_phy_vreg_l[] = { };static const struct qmp_phy_cfg msm8996_ufs_cfg = { - .nlanes =1 , + .lanes =1 , .serdes_tbl = msm8996_ufs_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (msm8996_ufs_serdes_tbl),@@ -687,7 +683,7 @@ static const struct qmp_phy_cfg msm8996_ufs_cfg = { };static const struct qmp_phy_cfg sdm845_ufsphy_cfg = { - .nlanes =2 , + .lanes =2 , .serdes_tbl = sdm845_ufsphy_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sdm845_ufsphy_serdes_tbl),@@ -707,12 +703,11 @@ static const struct qmp_phy_cfg sdm845_ufsphy_cfg = { .pwrdn_ctrl = SW_PWRDN, .phy_status = PHYSTATUS, - .is_dual_lane_phy = true, .no_pcs_sw_reset = true, };static const struct qmp_phy_cfg sm6115_ufsphy_cfg = { - .nlanes =1 , + .lanes =1 , .serdes_tbl = sm6115_ufsphy_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sm6115_ufsphy_serdes_tbl),@@ -735,7 +730,7 @@ static const struct qmp_phy_cfg sm6115_ufsphy_cfg = { };static const struct qmp_phy_cfg sm8150_ufsphy_cfg = { - .nlanes =2 , + .lanes =2 , .serdes_tbl = sm8150_ufsphy_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sm8150_ufsphy_serdes_tbl),@@ -754,12 +749,10 @@ static const struct qmp_phy_cfg sm8150_ufsphy_cfg = { .start_ctrl = SERDES_START, .pwrdn_ctrl = SW_PWRDN, .phy_status = PHYSTATUS, - - .is_dual_lane_phy = true, };static const struct qmp_phy_cfg sm8350_ufsphy_cfg = { - .nlanes =2 , + .lanes =2 , .serdes_tbl = sm8350_ufsphy_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sm8350_ufsphy_serdes_tbl),@@ -778,12 +771,10 @@ static const struct qmp_phy_cfg sm8350_ufsphy_cfg = { .start_ctrl = SERDES_START, .pwrdn_ctrl = SW_PWRDN, .phy_status = PHYSTATUS, - - .is_dual_lane_phy = true, };static const struct qmp_phy_cfg sm8450_ufsphy_cfg = { - .nlanes =2 , + .lanes =2 , .serdes_tbl = sm8350_ufsphy_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sm8350_ufsphy_serdes_tbl),@@ -802,8 +793,6 @@ static const struct qmp_phy_cfg sm8450_ufsphy_cfg = { .start_ctrl = SERDES_START, .pwrdn_ctrl = SW_PWRDN, .phy_status = PHYSTATUS, - - .is_dual_lane_phy = true, }; static void qmp_ufs_configure_lane(void __iomem *base,@@ -956,14 +945,14 @@ static int qmp_ufs_power_on(struct phy *phy)/* Tx, Rx, and PCS configurations */ qmp_ufs_configure_lane (tx, cfg->regs, cfg->tx_tbl, cfg->tx_tbl_num,1 ); -if (cfg->is_dual_lane_phy) { +if (cfg->lanes >=2 ) {qmp_ufs_configure_lane (qphy->tx2, cfg->regs, cfg->tx_tbl, cfg->tx_tbl_num,2 ); }qmp_ufs_configure_lane (rx, cfg->regs, cfg->rx_tbl, cfg->rx_tbl_num,1 ); -if (cfg->is_dual_lane_phy) { +if (cfg->lanes >=2 ) {qmp_ufs_configure_lane (qphy->rx2, cfg->regs, cfg->rx_tbl, cfg->rx_tbl_num,2 ); }
drivers/phy/qualcomm/phy-qcom-qmp-ufs.c static int qmp_ufs_create(struct device *dev, struct device_node *np, int id, · line 1117
Quoted 8 lines
drivers/phy/qualcomm/phy-qcom-qmp-ufs.c +1
-1@@ -1122,7 +1111,7 @@ static int qmp_ufs_create(struct device *dev, struct device_node *np, int id,if (IS_ERR (qphy->pcs))return PTR_ERR (qphy->pcs); -if (cfg->is_dual_lane_phy) { +if (cfg->lanes >=2 ) { qphy->tx2 =devm_of_iomap (dev, np,3 ,NULL );if (IS_ERR (qphy->tx2))return PTR_ERR (qphy->tx2);
Signature · 3 lines
linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH 16/17] phy: qcom-qmp-usb: consolidate lane config
In reply to Johan HovoldQuoted 230 lines · Johan Hovold
For legacy reasons, there are two configuration parameters that appear to describe the number of lanes a PHY has, even if "nlanes" was actually used for a different purpose.
Replace them both with a new field simply named "lanes".
Signed-off-by Johan Hovold <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 52 ++++++++++--------------- 1 file changed, 20 insertions(+), 32 deletions(-)drivers/phy/qualcomm/phy-qcom-qmp-usb.c +19
-31@@ -1429,8 +1429,7 @@ static const struct qmp_phy_init_tbl sc8280xp_usb3_uniphy_pcs_tbl[] = {/* struct qmp_phy_cfg - per-PHY initialization config */ struct qmp_phy_cfg { -/* number of lanes provided by phy */ -int nlanes; +int lanes;/* Init sequence for PHY blocks - serdes, tx, rx, pcs */ const struct qmp_phy_init_tbl *serdes_tbl;@@ -1470,8 +1469,6 @@ struct qmp_phy_cfg {/* true, if PHY has a separate DP_COM control block */ bool has_phy_dp_com_ctrl; -/* true, if PHY has secondary tx/rx lanes to be configured */ -bool is_dual_lane_phy;/* Offset from PCS to PCS_USB region */ unsigned int pcs_usb_offset;@@ -1603,7 +1600,7 @@ static const char * const qmp_phy_vreg_l[] = { };static const struct qmp_phy_cfg ipq8074_usb3phy_cfg = { - .nlanes =1 , + .lanes =1 , .serdes_tbl = ipq8074_usb3_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (ipq8074_usb3_serdes_tbl),@@ -1627,7 +1624,7 @@ static const struct qmp_phy_cfg ipq8074_usb3phy_cfg = { };static const struct qmp_phy_cfg msm8996_usb3phy_cfg = { - .nlanes =1 , + .lanes =1 , .serdes_tbl = msm8996_usb3_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (msm8996_usb3_serdes_tbl),@@ -1651,7 +1648,7 @@ static const struct qmp_phy_cfg msm8996_usb3phy_cfg = { };static const struct qmp_phy_cfg qmp_v3_usb3phy_cfg = { - .nlanes =1 , + .lanes =2 , .serdes_tbl = qmp_v3_usb3_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (qmp_v3_usb3_serdes_tbl),@@ -1678,11 +1675,10 @@ static const struct qmp_phy_cfg qmp_v3_usb3phy_cfg = { .pwrdn_delay_max = POWER_DOWN_DELAY_US_MAX, .has_phy_dp_com_ctrl = true, - .is_dual_lane_phy = true, };static const struct qmp_phy_cfg sc7180_usb3phy_cfg = { - .nlanes =1 , + .lanes =2 , .serdes_tbl = qmp_v3_usb3_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (qmp_v3_usb3_serdes_tbl),@@ -1709,11 +1705,10 @@ static const struct qmp_phy_cfg sc7180_usb3phy_cfg = { .pwrdn_delay_max = POWER_DOWN_DELAY_US_MAX, .has_phy_dp_com_ctrl = true, - .is_dual_lane_phy = true, };static const struct qmp_phy_cfg sc8280xp_usb3_uniphy_cfg = { - .nlanes =1 , + .lanes =1 , .serdes_tbl = sc8280xp_usb3_uniphy_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sc8280xp_usb3_uniphy_serdes_tbl),@@ -1741,7 +1736,7 @@ static const struct qmp_phy_cfg sc8280xp_usb3_uniphy_cfg = { };static const struct qmp_phy_cfg qmp_v3_usb3_uniphy_cfg = { - .nlanes =1 , + .lanes =1 , .serdes_tbl = qmp_v3_usb3_uniphy_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (qmp_v3_usb3_uniphy_serdes_tbl),@@ -1769,7 +1764,7 @@ static const struct qmp_phy_cfg qmp_v3_usb3_uniphy_cfg = { };static const struct qmp_phy_cfg msm8998_usb3phy_cfg = { - .nlanes =1 , + .lanes =2 , .serdes_tbl = msm8998_usb3_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (msm8998_usb3_serdes_tbl),@@ -1790,12 +1785,10 @@ static const struct qmp_phy_cfg msm8998_usb3phy_cfg = { .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN, .phy_status = PHYSTATUS, - - .is_dual_lane_phy = true, };static const struct qmp_phy_cfg sm8150_usb3phy_cfg = { - .nlanes =1 , + .lanes =2 , .serdes_tbl = sm8150_usb3_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sm8150_usb3_serdes_tbl),@@ -1826,11 +1819,10 @@ static const struct qmp_phy_cfg sm8150_usb3phy_cfg = { .pwrdn_delay_max = POWER_DOWN_DELAY_US_MAX, .has_phy_dp_com_ctrl = true, - .is_dual_lane_phy = true, };static const struct qmp_phy_cfg sm8150_usb3_uniphy_cfg = { - .nlanes =1 , + .lanes =1 , .serdes_tbl = sm8150_usb3_uniphy_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sm8150_usb3_uniphy_serdes_tbl),@@ -1861,7 +1853,7 @@ static const struct qmp_phy_cfg sm8150_usb3_uniphy_cfg = { };static const struct qmp_phy_cfg sm8250_usb3phy_cfg = { - .nlanes =1 , + .lanes =2 , .serdes_tbl = sm8150_usb3_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sm8150_usb3_serdes_tbl),@@ -1891,11 +1883,10 @@ static const struct qmp_phy_cfg sm8250_usb3phy_cfg = { .pwrdn_delay_max = POWER_DOWN_DELAY_US_MAX, .has_phy_dp_com_ctrl = true, - .is_dual_lane_phy = true, };static const struct qmp_phy_cfg sm8250_usb3_uniphy_cfg = { - .nlanes =1 , + .lanes =1 , .serdes_tbl = sm8150_usb3_uniphy_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sm8150_usb3_uniphy_serdes_tbl),@@ -1926,7 +1917,7 @@ static const struct qmp_phy_cfg sm8250_usb3_uniphy_cfg = { };static const struct qmp_phy_cfg sdx55_usb3_uniphy_cfg = { - .nlanes =1 , + .lanes =1 , .serdes_tbl = sm8150_usb3_uniphy_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sm8150_usb3_uniphy_serdes_tbl),@@ -1957,7 +1948,7 @@ static const struct qmp_phy_cfg sdx55_usb3_uniphy_cfg = { };static const struct qmp_phy_cfg sdx65_usb3_uniphy_cfg = { - .nlanes =1 , + .lanes =1 , .serdes_tbl = sm8150_usb3_uniphy_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sm8150_usb3_uniphy_serdes_tbl),@@ -1988,7 +1979,7 @@ static const struct qmp_phy_cfg sdx65_usb3_uniphy_cfg = { };static const struct qmp_phy_cfg sm8350_usb3phy_cfg = { - .nlanes =1 , + .lanes =2 , .serdes_tbl = sm8150_usb3_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sm8150_usb3_serdes_tbl),@@ -2018,11 +2009,10 @@ static const struct qmp_phy_cfg sm8350_usb3phy_cfg = { .pwrdn_delay_max = POWER_DOWN_DELAY_US_MAX, .has_phy_dp_com_ctrl = true, - .is_dual_lane_phy = true, };static const struct qmp_phy_cfg sm8350_usb3_uniphy_cfg = { - .nlanes =1 , + .lanes =1 , .serdes_tbl = sm8150_usb3_uniphy_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (sm8150_usb3_uniphy_serdes_tbl),@@ -2053,7 +2043,7 @@ static const struct qmp_phy_cfg sm8350_usb3_uniphy_cfg = { };static const struct qmp_phy_cfg qcm2290_usb3phy_cfg = { - .nlanes =1 , + .lanes =2 , .serdes_tbl = qcm2290_usb3_serdes_tbl, .serdes_tbl_num =ARRAY_SIZE (qcm2290_usb3_serdes_tbl),@@ -2074,8 +2064,6 @@ static const struct qmp_phy_cfg qcm2290_usb3phy_cfg = { .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN, .phy_status = PHYSTATUS, - - .is_dual_lane_phy = true, }; static void qmp_usb_configure_lane(void __iomem *base,@@ -2232,14 +2220,14 @@ static int qmp_usb_power_on(struct phy *phy)/* Tx, Rx, and PCS configurations */ qmp_usb_configure_lane (tx, cfg->regs, cfg->tx_tbl, cfg->tx_tbl_num,1 ); -if (cfg->is_dual_lane_phy) { +if (cfg->lanes >=2 ) {qmp_usb_configure_lane (qphy->tx2, cfg->regs, cfg->tx_tbl, cfg->tx_tbl_num,2 ); }qmp_usb_configure_lane (rx, cfg->regs, cfg->rx_tbl, cfg->rx_tbl_num,1 ); -if (cfg->is_dual_lane_phy) { +if (cfg->lanes >=2 ) {qmp_usb_configure_lane (qphy->rx2, cfg->regs, cfg->rx_tbl, cfg->rx_tbl_num,2 ); }
drivers/phy/qualcomm/phy-qcom-qmp-usb.c int qmp_usb_create(struct device *dev, struct device_node *np, int id, · line 2607
Quoted 8 lines
drivers/phy/qualcomm/phy-qcom-qmp-usb.c +1
-1@@ -2613,7 +2601,7 @@ int qmp_usb_create(struct device *dev, struct device_node *np, int id,if (cfg->pcs_usb_offset) qphy->pcs_usb = qphy->pcs + cfg->pcs_usb_offset; -if (cfg->is_dual_lane_phy) { +if (cfg->lanes >=2 ) { qphy->tx2 =devm_of_iomap (dev, np,3 ,NULL );if (IS_ERR (qphy->tx2))return PTR_ERR (qphy->tx2);
Signature · 3 lines
linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH 17/17] phy: qcom-qmp-combo: drop redundant DP config flag
In reply to Johan HovoldQuoted 154 lines · Johan Hovold
Drop the
DP_COMcontrol block flag from the configuration data, which is set for all combo PHYs and hence no longer needed since the QMP driver split.Signed-off-by Johan Hovold <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 63 +++++++---------------- 1 file changed, 18 insertions(+), 45 deletions(-)drivers/phy/qualcomm/phy-qcom-qmp-combo.c +15
-41@@ -876,9 +876,6 @@ struct qmp_phy_cfg {int pwrdn_delay_min;int pwrdn_delay_max; -/* true, if PHY has a separate DP_COM control block */ -bool has_phy_dp_com_ctrl; -/* Offset from PCS to PCS_USB region */ unsigned int pcs_usb_offset;@@ -1051,8 +1048,6 @@ static const struct qmp_phy_cfg sc7180_usb3phy_cfg = { .has_pwrdn_delay = true, .pwrdn_delay_min = POWER_DOWN_DELAY_US_MIN, .pwrdn_delay_max = POWER_DOWN_DELAY_US_MAX, - - .has_phy_dp_com_ctrl = true, };static const struct qmp_phy_cfg sc7180_dpphy_cfg = {@@ -1086,8 +1081,6 @@ static const struct qmp_phy_cfg sc7180_dpphy_cfg = { .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = qmp_v3_usb3phy_regs_layout, - .has_phy_dp_com_ctrl = true, - .dp_aux_init = qcom_qmp_v3_phy_dp_aux_init, .configure_dp_tx = qcom_qmp_v3_phy_configure_dp_tx, .configure_dp_phy = qcom_qmp_v3_phy_configure_dp_phy,@@ -1126,8 +1119,6 @@ static const struct qmp_phy_cfg sdm845_usb3phy_cfg = { .has_pwrdn_delay = true, .pwrdn_delay_min = POWER_DOWN_DELAY_US_MIN, .pwrdn_delay_max = POWER_DOWN_DELAY_US_MAX, - - .has_phy_dp_com_ctrl = true, };static const struct qmp_phy_combo_cfg sdm845_usb3dpphy_cfg = {@@ -1166,8 +1157,6 @@ static const struct qmp_phy_cfg sm8150_usb3phy_cfg = { .has_pwrdn_delay = true, .pwrdn_delay_min = POWER_DOWN_DELAY_US_MIN, .pwrdn_delay_max = POWER_DOWN_DELAY_US_MAX, - - .has_phy_dp_com_ctrl = true, };static const struct qmp_phy_cfg sc8180x_dpphy_cfg = {@@ -1201,8 +1190,6 @@ static const struct qmp_phy_cfg sc8180x_dpphy_cfg = { .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = qmp_v3_usb3phy_regs_layout, - .has_phy_dp_com_ctrl = true, - .dp_aux_init = qcom_qmp_v4_phy_dp_aux_init, .configure_dp_tx = qcom_qmp_v4_phy_configure_dp_tx, .configure_dp_phy = qcom_qmp_v4_phy_configure_dp_phy,@@ -1242,8 +1229,6 @@ static const struct qmp_phy_cfg sc8280xp_usb43dp_usb_cfg = { .has_pwrdn_delay = true, .pwrdn_delay_min = POWER_DOWN_DELAY_US_MIN, .pwrdn_delay_max = POWER_DOWN_DELAY_US_MAX, - - .has_phy_dp_com_ctrl = true, };static const struct qmp_phy_cfg sc8280xp_usb43dp_dp_cfg = {@@ -1277,8 +1262,6 @@ static const struct qmp_phy_cfg sc8280xp_usb43dp_dp_cfg = { .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = qmp_v4_usb3phy_regs_layout, - .has_phy_dp_com_ctrl = true, - .dp_aux_init = qcom_qmp_v4_phy_dp_aux_init, .configure_dp_tx = qcom_qmp_v4_phy_configure_dp_tx, .configure_dp_phy = qcom_qmp_v5_phy_configure_dp_phy,@@ -1320,8 +1303,6 @@ static const struct qmp_phy_cfg sm8250_usb3phy_cfg = { .has_pwrdn_delay = true, .pwrdn_delay_min = POWER_DOWN_DELAY_US_MIN, .pwrdn_delay_max = POWER_DOWN_DELAY_US_MAX, - - .has_phy_dp_com_ctrl = true, };static const struct qmp_phy_cfg sm8250_dpphy_cfg = {@@ -1355,8 +1336,6 @@ static const struct qmp_phy_cfg sm8250_dpphy_cfg = { .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = qmp_v4_usb3phy_regs_layout, - .has_phy_dp_com_ctrl = true, - .dp_aux_init = qcom_qmp_v4_phy_dp_aux_init, .configure_dp_tx = qcom_qmp_v4_phy_configure_dp_tx, .configure_dp_phy = qcom_qmp_v4_phy_configure_dp_phy,@@ -1995,28 +1974,25 @@ static int qmp_combo_com_init(struct qmp_phy *qphy)if (ret) goto err_assert_reset; -if (cfg->has_phy_dp_com_ctrl) { -qphy_setbits (dp_com,QPHY_V3_DP_COM_POWER_DOWN_CTRL , -SW_PWRDN ); -/* override hardware control for reset of qmp phy */ -qphy_setbits (dp_com,QPHY_V3_DP_COM_RESET_OVRD_CTRL , -SW_DPPHY_RESET_MUX |SW_DPPHY_RESET | -SW_USB3PHY_RESET_MUX |SW_USB3PHY_RESET ); +qphy_setbits (dp_com,QPHY_V3_DP_COM_POWER_DOWN_CTRL ,SW_PWRDN ); -/* Default type-c orientation, i.e CC1 */ -qphy_setbits (dp_com,QPHY_V3_DP_COM_TYPEC_CTRL ,0x02 ); +/* override hardware control for reset of qmp phy */ +qphy_setbits (dp_com,QPHY_V3_DP_COM_RESET_OVRD_CTRL , +SW_DPPHY_RESET_MUX |SW_DPPHY_RESET | +SW_USB3PHY_RESET_MUX |SW_USB3PHY_RESET ); -qphy_setbits (dp_com,QPHY_V3_DP_COM_PHY_MODE_CTRL , -USB3_MODE |DP_MODE ); +/* Default type-c orientation, i.e CC1 */ +qphy_setbits (dp_com,QPHY_V3_DP_COM_TYPEC_CTRL ,0x02 ); -/* bring both QMP USB and QMP DP PHYs PCS block out of reset */ -qphy_clrbits (dp_com,QPHY_V3_DP_COM_RESET_OVRD_CTRL , -SW_DPPHY_RESET_MUX |SW_DPPHY_RESET | -SW_USB3PHY_RESET_MUX |SW_USB3PHY_RESET ); +qphy_setbits (dp_com,QPHY_V3_DP_COM_PHY_MODE_CTRL ,USB3_MODE |DP_MODE ); -qphy_clrbits (dp_com,QPHY_V3_DP_COM_SWI_CTRL ,0x03 ); -qphy_clrbits (dp_com,QPHY_V3_DP_COM_SW_RESET ,SW_RESET ); - } +/* bring both QMP USB and QMP DP PHYs PCS block out of reset */ +qphy_clrbits (dp_com,QPHY_V3_DP_COM_RESET_OVRD_CTRL , +SW_DPPHY_RESET_MUX |SW_DPPHY_RESET | +SW_USB3PHY_RESET_MUX |SW_USB3PHY_RESET ); + +qphy_clrbits (dp_com,QPHY_V3_DP_COM_SWI_CTRL ,0x03 ); +qphy_clrbits (dp_com,QPHY_V3_DP_COM_SW_RESET ,SW_RESET );if (cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL ]) qphy_setbits(pcs,@@ -2838,12 +2814,9 @@ static int qmp_combo_probe(struct platform_device *pdev)if (IS_ERR (serdes))return PTR_ERR (serdes); -/* per PHY dp_com; if PHY has dp_com control block */ -if (cfg->has_phy_dp_com_ctrl) {
drivers/phy/qualcomm/phy-qcom-qmp-combo.c static int qmp_combo_probe(struct platform_device *pdev) · line 2822
Quoted 10 lines
drivers/phy/qualcomm/phy-qcom-qmp-combo.c +3
-4- qmp->dp_com =devm_platform_ioremap_resource (pdev,1 ); -if (IS_ERR (qmp->dp_com)) -return PTR_ERR (qmp->dp_com); - } + qmp->dp_com =devm_platform_ioremap_resource (pdev,1 ); +if (IS_ERR (qmp->dp_com)) +return PTR_ERR (qmp->dp_com);/* Only two serdes for combo PHY */ dp_serdes =devm_platform_ioremap_resource (pdev,2 );
Signature · 3 lines
linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH 17/17] phy: qcom-qmp-combo: drop redundant DP config flag
Quoted 8 lines · Neil Armstrong
Quoted 5 lines · Johan Hovold
Drop the
DP_COMcontrol block flag from the configuration data, which is set for all combo PHYs and hence no longer needed since the QMP driver split.Signed-off-by Johan Hovold <[email protected]>Reviewed-by Neil Armstrong <[email protected]>
Thanks for reviewing, Neil.
Johan
Signature · 3 lines
linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH 01/17] phy: qcom-qmp-pcie: drop unused type from config
In reply to Johan HovoldQuoted 8 lines · Johan Hovold
The configuration PHY type is no longer used since the QMP driver split so drop it from the configurations.
Signed-off-by Johan Hovold <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 14 -------------- 1 file changed, 14 deletions(-)
Signature · 2 lines
With best wishes Dmitry
Re: [PATCH 03/17] phy: qcom-qmp-ufs: drop unused type from config
In reply to Johan HovoldQuoted 8 lines · Johan Hovold
The configuration PHY type is no longer used since the QMP driver split so drop it from the configuration.
Signed-off-by Johan Hovold <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 8 -------- 1 file changed, 8 deletions(-)
Signature · 2 lines
With best wishes Dmitry
Re: [PATCH 07/17] phy: qcom-qmp: drop unused forward declarations
In reply to Johan HovoldQuoted 10 lines · Johan Hovold
Only the combo QMP driver needs a forward declaration of struct
qmp_phy.Signed-off-by Johan Hovold <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c | 2 -- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 2 -- drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 2 -- drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 2 -- 4 files changed, 8 deletions(-)
Signature · 2 lines
With best wishes Dmitry
Re: [PATCH 02/17] phy: qcom-qmp-pcie-msm8996: drop unused type from config
In reply to Johan HovoldQuoted 4 lines · Johan Hovold
The configuration PHY type is no longer used since the QMP driver split so drop it from the configuration.
Signed-off-by Johan Hovold <[email protected]>
Signature · 2 lines
With best wishes Dmitry
Re: [PATCH 04/17] phy: qcom-qmp-usb: drop unused type from config
In reply to Johan HovoldQuoted 8 lines · Johan Hovold
The configuration PHY type is no longer needed since the QMP driver split so drop it from the configuration and suspend callbacks.
Signed-off-by Johan Hovold <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 26 ------------------------- 1 file changed, 26 deletions(-)
Signature · 2 lines
With best wishes Dmitry
Re: [PATCH 05/17] phy: qcom-qmp-pcie: drop init and exit wrappers
In reply to Johan HovoldQuoted 7 lines · Johan Hovold
Drop the unnecessary PHY init and exit callback wrappers.
Signed-off-by Johan Hovold <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 29 ++++-------------------- 1 file changed, 4 insertions(+), 25 deletions(-)
Initially I thought that it might be possible to unify the com_init/com_exit functions, however it doesn't seem really possible. Let's clean this up.
Signature · 8 lines
With best wishes Dmitry -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH 06/17] phy: qcom-qmp-usb: drop init and exit wrappers
In reply to Johan HovoldQuoted 6 lines · Johan Hovold
Drop the unnecessary PHY init and exit callback wrappers.
Signed-off-by Johan Hovold <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 29 ++++--------------------- 1 file changed, 4 insertions(+), 25 deletions(-)
Signature · 2 lines
With best wishes Dmitry
Re: [PATCH 08/17] phy: qcom-qmp-pcie-msm8996: drop unused kernel doc
In reply to Johan HovoldQuoted 6 lines · Johan Hovold
Drop the removed mode field from the struct
qmp_phykernel doc.Signed-off-by Johan Hovold <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c | 1 - 1 file changed, 1 deletion(-)
Signature · 8 lines
With best wishes Dmitry -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH 09/17] phy: qcom-qmp-pcie: drop unused mode field
In reply to Johan HovoldQuoted 6 lines · Johan Hovold
Drop the unused mode field from struct
qmp_phy.Signed-off-by Johan Hovold <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 2 -- 1 file changed, 2 deletions(-)
Signature · 8 lines
With best wishes Dmitry -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH 10/17] phy: qcom-qmp-pcie: drop unused config field
In reply to Johan HovoldQuoted 6 lines · Johan Hovold
Drop the unused
mask_com_pcs_readyfield from structqmp_phy_cfg.Signed-off-by Johan Hovold <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 1 - 1 file changed, 1 deletion(-)
Signature · 8 lines
With best wishes Dmitry -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH 11/17] phy: qcom-qmp: drop unused index field
In reply to Johan HovoldQuoted 10 lines · Johan Hovold
Only the MSM8996 PCIe QMP driver uses the index field so drop it from the other drivers.
Signed-off-by Johan Hovold <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 3 --- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 3 --- drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 3 --- drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 3 --- 4 files changed, 12 deletions(-)
Signature · 8 lines
With best wishes Dmitry -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH 13/17] phy: qcom-qmp-pcie-msm8996: rename nlanes config
In reply to Johan HovoldQuoted 7 lines · Johan Hovold
The nlanes configuration parameter is really the number of PHYs provided by this QMP block on MSM8996. Rename it accordingly.
Signed-off-by Johan Hovold <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Signature · 8 lines
With best wishes Dmitry -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH 14/17] phy: qcom-qmp-combo: consolidate lane config
In reply to Johan HovoldQuoted 10 lines · Johan Hovold
For legacy reasons, there are two configuration parameters that appear to describe the number of lanes a PHY has, even if "nlanes" was actually used for a different purpose.
Replace them both with a new field simply named "lanes".
Signed-off-by Johan Hovold <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 38 ++++++++--------------- 1 file changed, 13 insertions(+), 25 deletions(-)
Signature · 8 lines
With best wishes Dmitry -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH 15/17] phy: qcom-qmp-ufs: consolidate lane config
In reply to Johan HovoldQuoted 9 lines · Johan Hovold
For legacy reasons, there are two configuration parameters that describe the number of lanes a PHY has.
Replace them both with a new field simply named "lanes".
Signed-off-by Johan Hovold <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 31 ++++++++----------------- 1 file changed, 10 insertions(+), 21 deletions(-)
Signature · 8 lines
With best wishes Dmitry -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH 16/17] phy: qcom-qmp-usb: consolidate lane config
In reply to Johan HovoldQuoted 11 lines · Johan Hovold
For legacy reasons, there are two configuration parameters that appear to describe the number of lanes a PHY has, even if "nlanes" was actually used for a different purpose.
Replace them both with a new field simply named "lanes".
Signed-off-by Johan Hovold <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 52 ++++++++++--------------- 1 file changed, 20 insertions(+), 32 deletions(-)
Signature · 8 lines
With best wishes Dmitry -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH 17/17] phy: qcom-qmp-combo: drop redundant DP config flag
In reply to Johan HovoldQuoted 8 lines · Johan Hovold
Drop the
DP_COMcontrol block flag from the configuration data, which is set for all combo PHYs and hence no longer needed since the QMP driver split.Signed-off-by Johan Hovold <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 63 +++++++---------------- 1 file changed, 18 insertions(+), 45 deletions(-)
Signature · 8 lines
With best wishes Dmitry -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH 12/17] phy: qcom-qmp-pcie: consolidate lane config
In reply to Johan HovoldQuoted 9 lines · Johan Hovold
For legacy reasons, there are two configuration parameters that describe the number of lanes a PHY has.
Replace them both with a new field simply named "lanes".
Signed-off-by Johan Hovold <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 39 ++++++++++-------------- 1 file changed, 16 insertions(+), 23 deletions(-)
Signature · 8 lines
With best wishes Dmitry -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH 17/17] phy: qcom-qmp-combo: drop redundant DP config flag
In reply to Dmitry BaryshkovQuoted 11 lines · Dmitry Baryshkov
Quoted 8 lines · Johan Hovold
Drop the
DP_COMcontrol block flag from the configuration data, which is set for all combo PHYs and hence no longer needed since the QMP driver split.Signed-off-by Johan Hovold <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 63 +++++++---------------- 1 file changed, 18 insertions(+), 45 deletions(-)Reviewed-by Dmitry Baryshkov <[email protected]>
Thanks for the review, Dmitry.
Johan
Quoted 9 lines · Johan Hovold
Here's the next and hopefully last set of QMP driver cleanups for a while.
These patches drops further configuration parameters that are unused or redundant since the QMP driver split.
This notably includes consolidating the lane configuration, which for legacy reasons was inconsistent.
Applied, thanks for the cleanup!
Signature · 1 line
~Vinod