Skip to content

Commit d772c93

Browse files
committed
Merge tag 'sunxi-clk-for-6.1-1' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into clk-allwinner
Pull Allwinner clk driver updates from Jernej Skrabec: Refactor A80 DE & USB and DE2 code to use dev_err_probe() helper * tag 'sunxi-clk-for-6.1-1' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: clk: sunxi-ng: ccu-sun9i-a80-usb: Use dev_err_probe() helper clk: sunxi-ng: ccu-sun9i-a80-de: Use dev_err_probe() helper clk: sunxi-ng: sun8i-de2: Use dev_err_probe() helper clk: sunxi-ng: d1: Limit PLL rates to stable ranges
2 parents 568035b + 6a64344 commit d772c93

File tree

4 files changed

+26
-38
lines changed

4 files changed

+26
-38
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,

drivers/clk/sunxi-ng/ccu-sun8i-de2.c

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -256,29 +256,19 @@ static int sunxi_de2_clk_probe(struct platform_device *pdev)
256256
return PTR_ERR(reg);
257257

258258
bus_clk = devm_clk_get(&pdev->dev, "bus");
259-
if (IS_ERR(bus_clk)) {
260-
ret = PTR_ERR(bus_clk);
261-
if (ret != -EPROBE_DEFER)
262-
dev_err(&pdev->dev, "Couldn't get bus clk: %d\n", ret);
263-
return ret;
264-
}
259+
if (IS_ERR(bus_clk))
260+
return dev_err_probe(&pdev->dev, PTR_ERR(bus_clk),
261+
"Couldn't get bus clk\n");
265262

266263
mod_clk = devm_clk_get(&pdev->dev, "mod");
267-
if (IS_ERR(mod_clk)) {
268-
ret = PTR_ERR(mod_clk);
269-
if (ret != -EPROBE_DEFER)
270-
dev_err(&pdev->dev, "Couldn't get mod clk: %d\n", ret);
271-
return ret;
272-
}
264+
if (IS_ERR(mod_clk))
265+
return dev_err_probe(&pdev->dev, PTR_ERR(mod_clk),
266+
"Couldn't get mod clk\n");
273267

274268
rstc = devm_reset_control_get_exclusive(&pdev->dev, NULL);
275-
if (IS_ERR(rstc)) {
276-
ret = PTR_ERR(rstc);
277-
if (ret != -EPROBE_DEFER)
278-
dev_err(&pdev->dev,
279-
"Couldn't get reset control: %d\n", ret);
280-
return ret;
281-
}
269+
if (IS_ERR(rstc))
270+
return dev_err_probe(&pdev->dev, PTR_ERR(rstc),
271+
"Couldn't get reset control\n");
282272

283273
/* The clocks need to be enabled for us to access the registers */
284274
ret = clk_prepare_enable(bus_clk);

drivers/clk/sunxi-ng/ccu-sun9i-a80-de.c

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -213,21 +213,14 @@ static int sun9i_a80_de_clk_probe(struct platform_device *pdev)
213213
return PTR_ERR(reg);
214214

215215
bus_clk = devm_clk_get(&pdev->dev, "bus");
216-
if (IS_ERR(bus_clk)) {
217-
ret = PTR_ERR(bus_clk);
218-
if (ret != -EPROBE_DEFER)
219-
dev_err(&pdev->dev, "Couldn't get bus clk: %d\n", ret);
220-
return ret;
221-
}
216+
if (IS_ERR(bus_clk))
217+
return dev_err_probe(&pdev->dev, PTR_ERR(bus_clk),
218+
"Couldn't get bus clk\n");
222219
223220
rstc = devm_reset_control_get_exclusive(&pdev->dev, NULL);
224-
if (IS_ERR(rstc)) {
225-
ret = PTR_ERR(rstc);
226-
if (ret != -EPROBE_DEFER)
227-
dev_err(&pdev->dev,
228-
"Couldn't get reset control: %d\n", ret);
229-
return ret;
230-
}
221+
if (IS_ERR(rstc))
222+
return dev_err_probe(&pdev->dev, PTR_ERR(rstc),
223+
"Couldn't get reset control\n");
231224

232225
/* The bus clock needs to be enabled for us to access the registers */
233226
ret = clk_prepare_enable(bus_clk);

drivers/clk/sunxi-ng/ccu-sun9i-a80-usb.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,9 @@ static int sun9i_a80_usb_clk_probe(struct platform_device *pdev)
101101
return PTR_ERR(reg);
102102

103103
bus_clk = devm_clk_get(&pdev->dev, "bus");
104-
if (IS_ERR(bus_clk)) {
105-
ret = PTR_ERR(bus_clk);
106-
if (ret != -EPROBE_DEFER)
107-
dev_err(&pdev->dev, "Couldn't get bus clk: %d\n", ret);
108-
return ret;
109-
}
104+
if (IS_ERR(bus_clk))
105+
return dev_err_probe(&pdev->dev, PTR_ERR(bus_clk),
106+
"Couldn't get bus clk\n");
110107

111108
/* The bus clock needs to be enabled for us to access the registers */
112109
ret = clk_prepare_enable(bus_clk);

0 commit comments

Comments
 (0)