Skip to content

Commit 7c09e60

Browse files
committed
Merge tag 'sunxi-clk-for-5.13-1' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into clk-allwinner
Pull Allwinner clk driver updates from Maxime Ripard: "Our usual PR for the Allwinner SoCs, this time adding support for sigma-delta modulation on the V3s Audio PLL, and fixing a kernel doc header." * tag 'sunxi-clk-for-5.13-1' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: clk: sunxi: Demote non-conformant kernel-doc headers clk: sunxi-ng: v3s: use sigma-delta modulation for audio-pll
2 parents a38fd87 + dcc3545 commit 7c09e60

File tree

4 files changed

+28
-17
lines changed

4 files changed

+28
-17
lines changed

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

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,29 @@ static SUNXI_CCU_NKMP_WITH_GATE_LOCK(pll_cpu_clk, "pll-cpu",
4040
* the base (2x, 4x and 8x), and one variable divider (the one true
4141
* pll audio).
4242
*
43-
* We don't have any need for the variable divider for now, so we just
44-
* hardcode it to match with the clock names
43+
* With sigma-delta modulation for fractional-N on the audio PLL,
44+
* we have to use specific dividers. This means the variable divider
45+
* can no longer be used, as the audio codec requests the exact clock
46+
* rates we support through this mechanism. So we now hard code the
47+
* variable divider to 1. This means the clock rates will no longer
48+
* match the clock names.
4549
*/
4650
#define SUN8I_V3S_PLL_AUDIO_REG 0x008
4751

48-
static SUNXI_CCU_NM_WITH_GATE_LOCK(pll_audio_base_clk, "pll-audio-base",
49-
"osc24M", 0x008,
50-
8, 7, /* N */
51-
0, 5, /* M */
52-
BIT(31), /* gate */
53-
BIT(28), /* lock */
54-
0);
52+
static struct ccu_sdm_setting pll_audio_sdm_table[] = {
53+
{ .rate = 22579200, .pattern = 0xc0010d84, .m = 8, .n = 7 },
54+
{ .rate = 24576000, .pattern = 0xc000ac02, .m = 14, .n = 14 },
55+
};
56+
57+
static SUNXI_CCU_NM_WITH_SDM_GATE_LOCK(pll_audio_base_clk, "pll-audio-base",
58+
"osc24M", 0x008,
59+
8, 7, /* N */
60+
0, 5, /* M */
61+
pll_audio_sdm_table, BIT(24),
62+
0x284, BIT(31),
63+
BIT(31), /* gate */
64+
BIT(28), /* lock */
65+
CLK_SET_RATE_UNGATE);
5566

5667
static SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK(pll_video_clk, "pll-video",
5768
"osc24M", 0x0010,
@@ -524,10 +535,10 @@ static struct ccu_common *sun8i_v3_ccu_clks[] = {
524535
&mipi_csi_clk.common,
525536
};
526537

527-
/* We hardcode the divider to 4 for now */
538+
/* We hardcode the divider to 1 for SDM support */
528539
static CLK_FIXED_FACTOR_HWS(pll_audio_clk, "pll-audio",
529540
clk_parent_pll_audio,
530-
4, 1, CLK_SET_RATE_PARENT);
541+
1, 1, CLK_SET_RATE_PARENT);
531542
static CLK_FIXED_FACTOR_HWS(pll_audio_2x_clk, "pll-audio-2x",
532543
clk_parent_pll_audio,
533544
2, 1, CLK_SET_RATE_PARENT);

drivers/clk/sunxi/clk-sun6i-ar100.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
#include "clk-factors.h"
1818

19-
/**
19+
/*
2020
* sun6i_get_ar100_factors - Calculates factors p, m for AR100
2121
*
2222
* AR100 rate is calculated as follows

drivers/clk/sunxi/clk-sun9i-core.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include "clk-factors.h"
1515

1616

17-
/**
17+
/*
1818
* sun9i_a80_get_pll4_factors() - calculates n, p, m factors for PLL4
1919
* PLL4 rate is calculated as follows
2020
* rate = (parent_rate * n >> p) / (m + 1);
@@ -90,7 +90,7 @@ static void __init sun9i_a80_pll4_setup(struct device_node *node)
9090
CLK_OF_DECLARE(sun9i_a80_pll4, "allwinner,sun9i-a80-pll4-clk", sun9i_a80_pll4_setup);
9191

9292

93-
/**
93+
/*
9494
* sun9i_a80_get_gt_factors() - calculates m factor for GT
9595
* GT rate is calculated as follows
9696
* rate = parent_rate / (m + 1);
@@ -145,7 +145,7 @@ static void __init sun9i_a80_gt_setup(struct device_node *node)
145145
CLK_OF_DECLARE(sun9i_a80_gt, "allwinner,sun9i-a80-gt-clk", sun9i_a80_gt_setup);
146146

147147

148-
/**
148+
/*
149149
* sun9i_a80_get_ahb_factors() - calculates p factor for AHB0/1/2
150150
* AHB rate is calculated as follows
151151
* rate = parent_rate >> p;
@@ -225,7 +225,7 @@ static void __init sun9i_a80_apb0_setup(struct device_node *node)
225225
CLK_OF_DECLARE(sun9i_a80_apb0, "allwinner,sun9i-a80-apb0-clk", sun9i_a80_apb0_setup);
226226

227227

228-
/**
228+
/*
229229
* sun9i_a80_get_apb1_factors() - calculates m, p factors for APB1
230230
* APB1 rate is calculated as follows
231231
* rate = (parent_rate >> p) / (m + 1);

drivers/clk/sunxi/clk-usb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include <linux/spinlock.h>
1616

1717

18-
/**
18+
/*
1919
* sunxi_usb_reset... - reset bits in usb clk registers handling
2020
*/
2121

0 commit comments

Comments
 (0)