ufs_mtk_clk_scale(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ufs_mtk_clk_scale β€” a kernel API manual moment (section 9, bestie)

okay so welcome to the group chat, the function we're all here for is ufs_mtk_clk_scale and she is literally the internal clk scaling operation. internal!! she works behind the scenes, no cap ✨


✨ NAME ✨

ufs_mtk_clk_scale β€” Internal clk scaling operation

like, she scales clocks. internally. that's the whole vibe πŸ•°οΈ


πŸŽ€ SYNOPSIS πŸŽ€

void ufs_mtk_clk_scale (struct ufs_hba *hba , bool scale_up );

returns nothing (void, she's humble like that), takes two things and pops off πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • hba β€” per adapter instance. that's your adapter girly, one per instance, you know the drill πŸ’–
  • scale_up β€” True for scaling up and false for scaling down. yes bestie, up vs down, the classic binary of it all πŸ”Ό

🌸 DESCRIPTION 🌸

okay so here's the tea, and I need you to listen β˜•

The MTK platform supports clk scaling by switching the parent of ufs_sel(mux). mux drama, but make it silicon.

The ufs_sel is downstream to ufs_ck, which feeds directly into the UFS hardware. direct line, no middleman, icon behaviour πŸ‘‘

The max and min clocks rate of ufs_sel defined in dts should match the rate of "ufs_sel_max_src" and "ufs_sel_min_src" respectively. respectively!!! match them up, don't be messy πŸ™ˆ

why do we care, you ask? because this prevents changing the rate of the pll clock that is shared between modules. shared clock = shared custody, and we do not touch it 🫢

πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./drivers/ufs/host/ufs-mediatek.c, plus her whole friend group:

go read them, iykyk πŸ“šβœ¨


and that's the page!! this little manual lives under ./drivers/ufs/host β€” version vibes from October 2026, manual section 9, ufs_mtk_clk_scale(9) and all her glory πŸŽ€πŸ’œ mwah, slay, periodt πŸ’…

πŸ“¦ where this page comes from