Skip to content

Commit 3930624

Browse files
smaeuljernejsk
authored andcommitted
clk: sunxi-ng: d1: Limit PLL rates to stable ranges
Set the min/max rates for audio and video PLLs to keep them from going outside their documented stable ranges. Use the most restrictive of the "stable" and "actual" frequencies listed in the manual. Signed-off-by: Samuel Holland <[email protected]> Acked-by: Jernej Skrabec <[email protected]> Signed-off-by: Jernej Skrabec <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 568035b commit 3930624

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/clk/sunxi-ng/ccu-sun20i-d1.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ static struct ccu_nm pll_video0_4x_clk = {
104104
.lock = BIT(28),
105105
.n = _SUNXI_CCU_MULT_MIN(8, 8, 12),
106106
.m = _SUNXI_CCU_DIV(1, 1), /* input divider */
107+
.min_rate = 252000000U,
108+
.max_rate = 2400000000U,
107109
.common = {
108110
.reg = 0x040,
109111
.hw.init = CLK_HW_INIT_PARENTS_DATA("pll-video0-4x", osc24M,
@@ -126,6 +128,8 @@ static struct ccu_nm pll_video1_4x_clk = {
126128
.lock = BIT(28),
127129
.n = _SUNXI_CCU_MULT_MIN(8, 8, 12),
128130
.m = _SUNXI_CCU_DIV(1, 1), /* input divider */
131+
.min_rate = 252000000U,
132+
.max_rate = 2400000000U,
129133
.common = {
130134
.reg = 0x048,
131135
.hw.init = CLK_HW_INIT_PARENTS_DATA("pll-video1-4x", osc24M,
@@ -175,6 +179,8 @@ static struct ccu_nm pll_audio0_4x_clk = {
175179
.m = _SUNXI_CCU_DIV(16, 6),
176180
.sdm = _SUNXI_CCU_SDM(pll_audio0_sdm_table, BIT(24),
177181
0x178, BIT(31)),
182+
.min_rate = 180000000U,
183+
.max_rate = 3000000000U,
178184
.common = {
179185
.reg = 0x078,
180186
.features = CCU_FEATURE_SIGMA_DELTA_MOD,
@@ -202,6 +208,8 @@ static struct ccu_nm pll_audio1_clk = {
202208
.lock = BIT(28),
203209
.n = _SUNXI_CCU_MULT_MIN(8, 8, 12),
204210
.m = _SUNXI_CCU_DIV(1, 1),
211+
.min_rate = 180000000U,
212+
.max_rate = 3000000000U,
205213
.common = {
206214
.reg = 0x080,
207215
.hw.init = CLK_HW_INIT_PARENTS_DATA("pll-audio1", osc24M,

0 commit comments

Comments
 (0)