ufshcd_setu...adapt_length(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ufshcd_setu...adapt_length(9) πŸ’…

okay bestie, this one's from the Kernel API Manual β€” the title up top is truncated as ufshcd_setu...adapt_length(9), but the actual function is ufshcd_setup_tx_eqtr_adapt_length, and it's giving TX EQTR setup energy πŸ’– let's go.


✨ NAME ✨

ufshcd_setup_tx_eqtr_adapt_length β€” Setup TX adapt length for EQTR. periodt. πŸ‘‘

πŸ› οΈ SYNOPSIS πŸ› οΈ

int ufshcd_setup_tx_eqtr_adapt_length (struct ufs_hba *hba , struct
       ufshcd_tx_eq_params *params , u32 gear );

🫢 ARGUMENTS 🫢

  • hba β€” per adapter instance 🫢 like, one per adapter, bestie.
  • params β€” TX EQ parameters data structure 🌸
  • gear β€” target gear for EQTR βš™οΈ

🌸 DESCRIPTION 🌸

This function determines and configures the proper TX adapt length (TAdapt) for the TX EQTR procedure based on the target gear and RX adapt capabilities of both host and device. no cap, it's literally doing the math so both sides vibe. πŸ’…

Guidelines from MIPI UniPro v3.0 spec β€” select the minimum Adapt Length for the Equalization Training procedure based on the following conditions:

  • If the target High-Speed Gear n is HS-G4 or HS-G5:
    • PA_TxAdaptLength_EQTR[7:0] >= Max (10us, RX_HS_Gn_ADAPT_INITIAL_Capability, PA_PeerRxHsGnAdaptInitial)
    • PA_TxAdaptLength_EQTR[7:0] shall be shorter than PACP_REQUEST_TIMER (10ms)
    • PA_TxAdaptLength_EQTR[15:8] is not relevant for HS-G4 and HS-G5. This field is set to 255 (reserved value).
  • If the target High-Speed Gear n is HS-G6:
    • PA_TxAdapthLength_EQTR >= 10us
    • PA_TxAdapthLength_EQTR[7:0] >= Max (RX_HS_G6_ADAPT_INITIAL_Capability, PA_PeerRxHsG6AdaptInitialL0L3)
    • PA_TxAdapthLength_EQTR[15:8] >= Max (RX_HS_G6_ADAPT_INITIAL_L0_L1_L2_L3_Capability, PA_PeerRxHsG6AdaptInitialL0L1L2L3)
    • PA_TxAdaptLength_EQTR shall be shorter than PACP_REQUEST_TIMER value of 10ms.

Since adapt capabilities encode both range (fine/coarse) and length values, direct comparison is not possible. This function converts adapt capabilities to actual time durations in Unit Intervals (UI) using the Adapt time calculation formular in M-PHY v6.0 spec (Table 8), then selects the maximum to ensure both host and device use adequate TX adapt length. 🧚✨

Returns 0 on success, negative error code otherwise. that's it, that's the return vibe 😌

πŸ‘€ SEE ALSO πŸ‘€

Kernel file ./drivers/ufs/core/ufs-txeq.c and these besties:


Source/version is ./drivers/ufs/core, date is October 2026, and the page is ufshcd_setu...adapt_length(9) β€” bye bestie, slay that TX adapt length setup πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from