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: Rename USB-specific ops to prepare for DP support

To support following DisplayPort (DP) mode over the Type-C PHY, rename
USB-specific functions and ops to clearly separate them from common or
DP-related logic.

This is a preparatory cleanup to enable USB + DP dual 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-2-cbc72c88a44e@oss.qualcomm.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Xiangxu Yin and committed by
Vinod Koul
9f5f6083 70f12a4c

+27 -28
+27 -28
drivers/phy/qualcomm/phy-qcom-qmp-usbc.c
··· 342 342 343 343 struct mutex phy_mutex; 344 344 345 + struct phy *usb_phy; 345 346 enum phy_mode mode; 346 347 unsigned int usb_init_count; 347 - 348 - struct phy *phy; 349 348 350 349 struct clk_fixed_rate pipe_clk_fixed; 351 350 ··· 453 454 .regs = qmp_v3_usb3phy_regs_layout_qcm2290, 454 455 }; 455 456 456 - static int qmp_usbc_init(struct phy *phy) 457 + static int qmp_usbc_com_init(struct phy *phy) 457 458 { 458 459 struct qmp_usbc *qmp = phy_get_drvdata(phy); 459 460 const struct qmp_phy_cfg *cfg = qmp->cfg; ··· 503 504 return ret; 504 505 } 505 506 506 - static int qmp_usbc_exit(struct phy *phy) 507 + static int qmp_usbc_com_exit(struct phy *phy) 507 508 { 508 509 struct qmp_usbc *qmp = phy_get_drvdata(phy); 509 510 const struct qmp_phy_cfg *cfg = qmp->cfg; ··· 517 518 return 0; 518 519 } 519 520 520 - static int qmp_usbc_power_on(struct phy *phy) 521 + static int qmp_usbc_usb_power_on(struct phy *phy) 521 522 { 522 523 struct qmp_usbc *qmp = phy_get_drvdata(phy); 523 524 const struct qmp_phy_cfg *cfg = qmp->cfg; ··· 565 566 return ret; 566 567 } 567 568 568 - static int qmp_usbc_power_off(struct phy *phy) 569 + static int qmp_usbc_usb_power_off(struct phy *phy) 569 570 { 570 571 struct qmp_usbc *qmp = phy_get_drvdata(phy); 571 572 const struct qmp_phy_cfg *cfg = qmp->cfg; ··· 586 587 return 0; 587 588 } 588 589 589 - static int qmp_usbc_enable(struct phy *phy) 590 + static int qmp_usbc_usb_enable(struct phy *phy) 590 591 { 591 592 struct qmp_usbc *qmp = phy_get_drvdata(phy); 592 593 int ret; 593 594 594 595 mutex_lock(&qmp->phy_mutex); 595 596 596 - ret = qmp_usbc_init(phy); 597 + ret = qmp_usbc_com_init(phy); 597 598 if (ret) 598 599 goto out_unlock; 599 600 600 - ret = qmp_usbc_power_on(phy); 601 + ret = qmp_usbc_usb_power_on(phy); 601 602 if (ret) { 602 - qmp_usbc_exit(phy); 603 + qmp_usbc_com_exit(phy); 603 604 goto out_unlock; 604 605 } 605 606 ··· 610 611 return ret; 611 612 } 612 613 613 - static int qmp_usbc_disable(struct phy *phy) 614 + static int qmp_usbc_usb_disable(struct phy *phy) 614 615 { 615 616 struct qmp_usbc *qmp = phy_get_drvdata(phy); 616 617 int ret; 617 618 618 619 qmp->usb_init_count--; 619 - ret = qmp_usbc_power_off(phy); 620 + ret = qmp_usbc_usb_power_off(phy); 620 621 if (ret) 621 622 return ret; 622 - return qmp_usbc_exit(phy); 623 + return qmp_usbc_com_exit(phy); 623 624 } 624 625 625 - static int qmp_usbc_set_mode(struct phy *phy, enum phy_mode mode, int submode) 626 + static int qmp_usbc_usb_set_mode(struct phy *phy, enum phy_mode mode, int submode) 626 627 { 627 628 struct qmp_usbc *qmp = phy_get_drvdata(phy); 628 629 ··· 631 632 return 0; 632 633 } 633 634 634 - static const struct phy_ops qmp_usbc_phy_ops = { 635 - .init = qmp_usbc_enable, 636 - .exit = qmp_usbc_disable, 637 - .set_mode = qmp_usbc_set_mode, 635 + static const struct phy_ops qmp_usbc_usb_phy_ops = { 636 + .init = qmp_usbc_usb_enable, 637 + .exit = qmp_usbc_usb_disable, 638 + .set_mode = qmp_usbc_usb_set_mode, 638 639 .owner = THIS_MODULE, 639 640 }; 640 641 ··· 689 690 690 691 dev_vdbg(dev, "Suspending QMP phy, mode:%d\n", qmp->mode); 691 692 692 - if (!qmp->phy->init_count) { 693 + if (!qmp->usb_init_count) { 693 694 dev_vdbg(dev, "PHY not initialized, bailing out\n"); 694 695 return 0; 695 696 } ··· 709 710 710 711 dev_vdbg(dev, "Resuming QMP phy, mode:%d\n", qmp->mode); 711 712 712 - if (!qmp->phy->init_count) { 713 + if (!qmp->usb_init_count) { 713 714 dev_vdbg(dev, "PHY not initialized, bailing out\n"); 714 715 return 0; 715 716 } ··· 864 865 qmp->orientation = orientation; 865 866 866 867 if (qmp->usb_init_count) { 867 - qmp_usbc_power_off(qmp->phy); 868 - qmp_usbc_exit(qmp->phy); 868 + qmp_usbc_usb_power_off(qmp->usb_phy); 869 + qmp_usbc_com_exit(qmp->usb_phy); 869 870 870 - qmp_usbc_init(qmp->phy); 871 - qmp_usbc_power_on(qmp->phy); 871 + qmp_usbc_com_init(qmp->usb_phy); 872 + qmp_usbc_usb_power_on(qmp->usb_phy); 872 873 } 873 874 874 875 mutex_unlock(&qmp->phy_mutex); ··· 1096 1097 if (ret) 1097 1098 goto err_node_put; 1098 1099 1099 - qmp->phy = devm_phy_create(dev, np, &qmp_usbc_phy_ops); 1100 - if (IS_ERR(qmp->phy)) { 1101 - ret = PTR_ERR(qmp->phy); 1100 + qmp->usb_phy = devm_phy_create(dev, np, &qmp_usbc_usb_phy_ops); 1101 + if (IS_ERR(qmp->usb_phy)) { 1102 + ret = PTR_ERR(qmp->usb_phy); 1102 1103 dev_err(dev, "failed to create PHY: %d\n", ret); 1103 1104 goto err_node_put; 1104 1105 } 1105 1106 1106 - phy_set_drvdata(qmp->phy, qmp); 1107 + phy_set_drvdata(qmp->usb_phy, qmp); 1107 1108 1108 1109 of_node_put(np); 1109 1110