mmc: rockchip_sdhci: Gate clock for glitch free phase switching
authorJonas Karlman <jonas@kwiboo.se>
Mon, 7 Apr 2025 22:46:55 +0000 (22:46 +0000)
committerKever Yang <kever.yang@rock-chips.com>
Wed, 23 Apr 2025 14:12:04 +0000 (22:12 +0800)
commitc6999ac42c87f46ed653356c410f9556a0bd34e6
treea0e6570f25554ecae2ed09936a51c05e39dd78c1
parent9de20c1243056f9c943809546e15ecf4fafa6bb6
mmc: rockchip_sdhci: Gate clock for glitch free phase switching

Enable clock stopping to gate clock during phase code change to ensure
glitch free phase switching in auto-tuning circuit. Fixes HS200 mode
on RK3528.

POST_CHANGE_DLY
Time taken for phase switching and stable clock output.
- Less than 4-cycle latency

PRE_CHANGE_DLY
Maximum Latency specification between transmit clock and receive clock.
- Less than 4-cycle latency

TUNE_CLK_STOP_EN
Clock stopping control for Tuning and auto-tuning circuit. When enabled,
clock gate control output is pulled low before changing phase select
codes. This effectively stops the receive clock. Changing phase code
when clocks are stopped ensures glitch free phase switching.
- Clocks stopped during phase code change

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
drivers/mmc/rockchip_sdhci.c