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

Configure Feed

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

phy: qcom: qmp-usbc: Move USB-only init to usb_power_on

The current implementation programs USB-specific registers in
qmp_usbc_com_init(), which is shared by both USB and DP modes. This
causes unnecessary configuration when the PHY is used for DP.

Move USB-only register setup from com_init to qmp_usbc_usb_power_on,
so it runs only for USB mode.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Xiangxu Yin <xiangxu.yin@oss.qualcomm.com>
Link: https://patch.msgid.link/20251215-add-displayport-support-for-qcs615-platform-v8-7-cbc72c88a44e@oss.qualcomm.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Xiangxu Yin and committed by
Vinod Koul
cb225582 049e708e

+10 -12
+10 -12
drivers/phy/qualcomm/phy-qcom-qmp-usbc.c
··· 30 30 #include "phy-qcom-qmp-pcs-misc-v3.h" 31 31 32 32 #define PHY_INIT_COMPLETE_TIMEOUT 10000 33 + #define SW_PORTSELECT_VAL BIT(0) 34 + #define SW_PORTSELECT_MUX BIT(1) 33 35 34 36 /* set of registers with offsets different per-PHY */ 35 37 enum qphy_reg_layout { ··· 533 531 { 534 532 struct qmp_usbc *qmp = phy_get_drvdata(phy); 535 533 const struct qmp_phy_cfg *cfg = qmp->cfg; 536 - void __iomem *pcs = qmp->pcs; 537 - u32 val = 0; 538 534 int ret; 539 535 540 536 ret = regulator_bulk_enable(cfg->num_vregs, qmp->vregs); ··· 556 556 ret = clk_bulk_prepare_enable(qmp->num_clks, qmp->clks); 557 557 if (ret) 558 558 goto err_assert_reset; 559 - 560 - qphy_setbits(pcs, cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL], SW_PWRDN); 561 - 562 - #define SW_PORTSELECT_VAL BIT(0) 563 - #define SW_PORTSELECT_MUX BIT(1) 564 - /* Use software based port select and switch on typec orientation */ 565 - val = SW_PORTSELECT_MUX; 566 - if (qmp->orientation == TYPEC_ORIENTATION_REVERSE) 567 - val |= SW_PORTSELECT_VAL; 568 - writel(val, qmp->pcs_misc); 569 559 570 560 return 0; 571 561 ··· 588 598 void __iomem *status; 589 599 unsigned int val; 590 600 int ret; 601 + 602 + qphy_setbits(qmp->pcs, cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL], SW_PWRDN); 603 + 604 + /* Use software based port select and switch on typec orientation */ 605 + val = SW_PORTSELECT_MUX; 606 + if (qmp->orientation == TYPEC_ORIENTATION_REVERSE) 607 + val |= SW_PORTSELECT_VAL; 608 + writel(val, qmp->pcs_misc); 591 609 592 610 qmp_configure(qmp->dev, qmp->serdes, cfg->serdes_tbl, 593 611 cfg->serdes_tbl_num);