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: Add DP-related fields for USB/DP switchable PHY

Extend qmp_usbc_offsets and qmp_phy_cfg with DP-specific fields,
including register offsets, init tables, and callback hooks. Also
update qmp_usbc struct to track DP-related resources and state.
This enables support for USB/DP switchable Type-C PHYs that operate
in either 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-3-cbc72c88a44e@oss.qualcomm.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Xiangxu Yin and committed by
Vinod Koul
0599a4b9 9f5f6083

+46 -8
+46 -8
drivers/phy/qualcomm/phy-qcom-qmp-usbc.c
··· 293 293 /* for PHYs with >= 2 lanes */ 294 294 u16 tx2; 295 295 u16 rx2; 296 + 297 + u16 dp_serdes; 298 + u16 dp_txa; 299 + u16 dp_txb; 300 + u16 dp_dp_phy; 296 301 }; 297 302 298 - /* struct qmp_phy_cfg - per-PHY initialization config */ 303 + struct qmp_usbc; 299 304 struct qmp_phy_cfg { 300 305 const struct qmp_usbc_offsets *offsets; 301 306 302 - /* Init sequence for PHY blocks - serdes, tx, rx, pcs */ 307 + /* Init sequence for USB PHY blocks - serdes, tx, rx, pcs */ 303 308 const struct qmp_phy_init_tbl *serdes_tbl; 304 309 int serdes_tbl_num; 305 310 const struct qmp_phy_init_tbl *tx_tbl; ··· 313 308 int rx_tbl_num; 314 309 const struct qmp_phy_init_tbl *pcs_tbl; 315 310 int pcs_tbl_num; 311 + 312 + /* Init sequence for DP PHY blocks - serdes, tx, rbr, hbr, hbr2 */ 313 + const struct qmp_phy_init_tbl *dp_serdes_tbl; 314 + int dp_serdes_tbl_num; 315 + const struct qmp_phy_init_tbl *dp_tx_tbl; 316 + int dp_tx_tbl_num; 317 + const struct qmp_phy_init_tbl *serdes_tbl_rbr; 318 + int serdes_tbl_rbr_num; 319 + const struct qmp_phy_init_tbl *serdes_tbl_hbr; 320 + int serdes_tbl_hbr_num; 321 + const struct qmp_phy_init_tbl *serdes_tbl_hbr2; 322 + int serdes_tbl_hbr2_num; 323 + 324 + const u8 (*swing_tbl)[4][4]; 325 + const u8 (*pre_emphasis_tbl)[4][4]; 326 + 327 + /* DP PHY callbacks */ 328 + void (*dp_aux_init)(struct qmp_usbc *qmp); 329 + void (*configure_dp_tx)(struct qmp_usbc *qmp); 330 + int (*configure_dp_phy)(struct qmp_usbc *qmp); 331 + int (*calibrate_dp_phy)(struct qmp_usbc *qmp); 316 332 317 333 /* regulators to be requested */ 318 334 const char * const *vreg_list; ··· 355 329 void __iomem *rx; 356 330 void __iomem *tx2; 357 331 void __iomem *rx2; 358 - 359 - struct regmap *tcsr_map; 360 - u32 vls_clamp_reg; 332 + void __iomem *dp_dp_phy; 333 + void __iomem *dp_tx; 334 + void __iomem *dp_tx2; 335 + void __iomem *dp_serdes; 361 336 362 337 struct clk *pipe_clk; 338 + struct clk_fixed_rate pipe_clk_fixed; 339 + 340 + struct clk_hw dp_link_hw; 341 + struct clk_hw dp_pixel_hw; 363 342 struct clk_bulk_data *clks; 364 343 int num_clks; 365 344 int num_resets; 366 345 struct reset_control_bulk_data *resets; 367 346 struct regulator_bulk_data *vregs; 347 + 348 + struct regmap *tcsr_map; 349 + u32 vls_clamp_reg; 350 + u32 dp_phy_mode_reg; 368 351 369 352 struct mutex phy_mutex; 370 353 ··· 381 346 enum phy_mode mode; 382 347 unsigned int usb_init_count; 383 348 384 - struct clk_fixed_rate pipe_clk_fixed; 349 + struct phy *dp_phy; 350 + unsigned int dp_aux_cfg; 351 + struct phy_configure_opts_dp dp_opts; 352 + unsigned int dp_init_count; 385 353 386 354 struct typec_switch_dev *sw; 387 355 enum typec_orientation orientation; ··· 727 689 728 690 dev_vdbg(dev, "Suspending QMP phy, mode:%d\n", qmp->mode); 729 691 730 - if (!qmp->usb_init_count) { 692 + if (!qmp->usb_init_count && !qmp->dp_init_count) { 731 693 dev_vdbg(dev, "PHY not initialized, bailing out\n"); 732 694 return 0; 733 695 } ··· 747 709 748 710 dev_vdbg(dev, "Resuming QMP phy, mode:%d\n", qmp->mode); 749 711 750 - if (!qmp->usb_init_count) { 712 + if (!qmp->usb_init_count && !qmp->dp_init_count) { 751 713 dev_vdbg(dev, "PHY not initialized, bailing out\n"); 752 714 return 0; 753 715 }