Skip to content

Commit 982f92d

Browse files
lumagvinodkoul
authored andcommitted
phy: qcom: qmp-usb-legacy: drop single-lane support
All PHYs supported by usb-legacy have two lanes. Drop support for single-lane configuration. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Reviewed-by: Konrad DYbcio <konrad.dybcio@linaro.org> Link: https://lore.kernel.org/r/20240126-phy-qmp-merge-common-v2-1-a463d0b57836@linaro.org Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent 80082fc commit 982f92d

1 file changed

Lines changed: 9 additions & 28 deletions

File tree

drivers/phy/qualcomm/phy-qcom-qmp-usb-legacy.c

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -507,8 +507,6 @@ struct qmp_usb_legacy_offsets {
507507

508508
/* struct qmp_phy_cfg - per-PHY initialization config */
509509
struct qmp_phy_cfg {
510-
int lanes;
511-
512510
const struct qmp_usb_legacy_offsets *offsets;
513511

514512
/* Init sequence for PHY blocks - serdes, tx, rx, pcs */
@@ -621,8 +619,6 @@ static const char * const qmp_phy_vreg_l[] = {
621619
};
622620

623621
static const struct qmp_phy_cfg qmp_v3_usb3phy_cfg = {
624-
.lanes = 2,
625-
626622
.serdes_tbl = qmp_v3_usb3_serdes_tbl,
627623
.serdes_tbl_num = ARRAY_SIZE(qmp_v3_usb3_serdes_tbl),
628624
.tx_tbl = qmp_v3_usb3_tx_tbl,
@@ -641,8 +637,6 @@ static const struct qmp_phy_cfg qmp_v3_usb3phy_cfg = {
641637
};
642638

643639
static const struct qmp_phy_cfg sc7180_usb3phy_cfg = {
644-
.lanes = 2,
645-
646640
.serdes_tbl = qmp_v3_usb3_serdes_tbl,
647641
.serdes_tbl_num = ARRAY_SIZE(qmp_v3_usb3_serdes_tbl),
648642
.tx_tbl = qmp_v3_usb3_tx_tbl,
@@ -661,8 +655,6 @@ static const struct qmp_phy_cfg sc7180_usb3phy_cfg = {
661655
};
662656

663657
static const struct qmp_phy_cfg sm8150_usb3phy_cfg = {
664-
.lanes = 2,
665-
666658
.serdes_tbl = sm8150_usb3_serdes_tbl,
667659
.serdes_tbl_num = ARRAY_SIZE(sm8150_usb3_serdes_tbl),
668660
.tx_tbl = sm8150_usb3_tx_tbl,
@@ -684,8 +676,6 @@ static const struct qmp_phy_cfg sm8150_usb3phy_cfg = {
684676
};
685677

686678
static const struct qmp_phy_cfg sm8250_usb3phy_cfg = {
687-
.lanes = 2,
688-
689679
.serdes_tbl = sm8150_usb3_serdes_tbl,
690680
.serdes_tbl_num = ARRAY_SIZE(sm8150_usb3_serdes_tbl),
691681
.tx_tbl = sm8250_usb3_tx_tbl,
@@ -707,8 +697,6 @@ static const struct qmp_phy_cfg sm8250_usb3phy_cfg = {
707697
};
708698

709699
static const struct qmp_phy_cfg sm8350_usb3phy_cfg = {
710-
.lanes = 2,
711-
712700
.serdes_tbl = sm8150_usb3_serdes_tbl,
713701
.serdes_tbl_num = ARRAY_SIZE(sm8150_usb3_serdes_tbl),
714702
.tx_tbl = sm8350_usb3_tx_tbl,
@@ -874,10 +862,8 @@ static int qmp_usb_legacy_power_on(struct phy *phy)
874862
qmp_usb_legacy_configure_lane(tx, cfg->tx_tbl, cfg->tx_tbl_num, 1);
875863
qmp_usb_legacy_configure_lane(rx, cfg->rx_tbl, cfg->rx_tbl_num, 1);
876864

877-
if (cfg->lanes >= 2) {
878-
qmp_usb_legacy_configure_lane(qmp->tx2, cfg->tx_tbl, cfg->tx_tbl_num, 2);
879-
qmp_usb_legacy_configure_lane(qmp->rx2, cfg->rx_tbl, cfg->rx_tbl_num, 2);
880-
}
865+
qmp_usb_legacy_configure_lane(qmp->tx2, cfg->tx_tbl, cfg->tx_tbl_num, 2);
866+
qmp_usb_legacy_configure_lane(qmp->rx2, cfg->rx_tbl, cfg->rx_tbl_num, 2);
881867

882868
qmp_usb_legacy_configure(pcs, cfg->pcs_tbl, cfg->pcs_tbl_num);
883869

@@ -1231,20 +1217,15 @@ static int qmp_usb_legacy_parse_dt_legacy(struct qmp_usb *qmp, struct device_nod
12311217
if (cfg->pcs_usb_offset)
12321218
qmp->pcs_usb = qmp->pcs + cfg->pcs_usb_offset;
12331219

1234-
if (cfg->lanes >= 2) {
1235-
qmp->tx2 = devm_of_iomap(dev, np, 3, NULL);
1236-
if (IS_ERR(qmp->tx2))
1237-
return PTR_ERR(qmp->tx2);
1238-
1239-
qmp->rx2 = devm_of_iomap(dev, np, 4, NULL);
1240-
if (IS_ERR(qmp->rx2))
1241-
return PTR_ERR(qmp->rx2);
1220+
qmp->tx2 = devm_of_iomap(dev, np, 3, NULL);
1221+
if (IS_ERR(qmp->tx2))
1222+
return PTR_ERR(qmp->tx2);
12421223

1243-
qmp->pcs_misc = devm_of_iomap(dev, np, 5, NULL);
1244-
} else {
1245-
qmp->pcs_misc = devm_of_iomap(dev, np, 3, NULL);
1246-
}
1224+
qmp->rx2 = devm_of_iomap(dev, np, 4, NULL);
1225+
if (IS_ERR(qmp->rx2))
1226+
return PTR_ERR(qmp->rx2);
12471227

1228+
qmp->pcs_misc = devm_of_iomap(dev, np, 5, NULL);
12481229
if (IS_ERR(qmp->pcs_misc)) {
12491230
dev_vdbg(dev, "PHY pcs_misc-reg not used\n");
12501231
qmp->pcs_misc = NULL;

0 commit comments

Comments
 (0)