Skip to content

Commit 6a56880

Browse files
committed
Merge tag 'sunxi-clk-fixes-for-6.15' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into clk-fixes
Pull Allwinner clk driver fixes from Chen-Yu Tsai: Only two changes: - Fix the order of arguments in clk macro for SUNXI_CCU_MP_DATA_WITH_MUX_GATE_FEAT that was recently introduced in v6.15-rc1 - Add missing post-divider for D1 MMC clocks to correct halved performance * tag 'sunxi-clk-fixes-for-6.15' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: clk: sunxi-ng: d1: Add missing divider for MMC mod clocks clk: sunxi-ng: fix order of arguments in clock macro
2 parents 3e14c72 + 98e6da6 commit 6a56880

File tree

2 files changed

+48
-21
lines changed

2 files changed

+48
-21
lines changed

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

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -412,19 +412,23 @@ static const struct clk_parent_data mmc0_mmc1_parents[] = {
412412
{ .hw = &pll_periph0_2x_clk.common.hw },
413413
{ .hw = &pll_audio1_div2_clk.common.hw },
414414
};
415-
static SUNXI_CCU_MP_DATA_WITH_MUX_GATE(mmc0_clk, "mmc0", mmc0_mmc1_parents, 0x830,
416-
0, 4, /* M */
417-
8, 2, /* P */
418-
24, 3, /* mux */
419-
BIT(31), /* gate */
420-
0);
421-
422-
static SUNXI_CCU_MP_DATA_WITH_MUX_GATE(mmc1_clk, "mmc1", mmc0_mmc1_parents, 0x834,
423-
0, 4, /* M */
424-
8, 2, /* P */
425-
24, 3, /* mux */
426-
BIT(31), /* gate */
427-
0);
415+
static SUNXI_CCU_MP_DATA_WITH_MUX_GATE_POSTDIV(mmc0_clk, "mmc0",
416+
mmc0_mmc1_parents, 0x830,
417+
0, 4, /* M */
418+
8, 2, /* P */
419+
24, 3, /* mux */
420+
BIT(31), /* gate */
421+
2, /* post-div */
422+
0);
423+
424+
static SUNXI_CCU_MP_DATA_WITH_MUX_GATE_POSTDIV(mmc1_clk, "mmc1",
425+
mmc0_mmc1_parents, 0x834,
426+
0, 4, /* M */
427+
8, 2, /* P */
428+
24, 3, /* mux */
429+
BIT(31), /* gate */
430+
2, /* post-div */
431+
0);
428432

429433
static const struct clk_parent_data mmc2_parents[] = {
430434
{ .fw_name = "hosc" },
@@ -433,12 +437,14 @@ static const struct clk_parent_data mmc2_parents[] = {
433437
{ .hw = &pll_periph0_800M_clk.common.hw },
434438
{ .hw = &pll_audio1_div2_clk.common.hw },
435439
};
436-
static SUNXI_CCU_MP_DATA_WITH_MUX_GATE(mmc2_clk, "mmc2", mmc2_parents, 0x838,
437-
0, 4, /* M */
438-
8, 2, /* P */
439-
24, 3, /* mux */
440-
BIT(31), /* gate */
441-
0);
440+
static SUNXI_CCU_MP_DATA_WITH_MUX_GATE_POSTDIV(mmc2_clk, "mmc2", mmc2_parents,
441+
0x838,
442+
0, 4, /* M */
443+
8, 2, /* P */
444+
24, 3, /* mux */
445+
BIT(31), /* gate */
446+
2, /* post-div */
447+
0);
442448

443449
static SUNXI_CCU_GATE_HWS(bus_mmc0_clk, "bus-mmc0", psi_ahb_hws,
444450
0x84c, BIT(0), 0);

drivers/clk/sunxi-ng/ccu_mp.h

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,28 @@ struct ccu_mp {
5252
} \
5353
}
5454

55+
#define SUNXI_CCU_MP_DATA_WITH_MUX_GATE_POSTDIV(_struct, _name, _parents, \
56+
_reg, \
57+
_mshift, _mwidth, \
58+
_pshift, _pwidth, \
59+
_muxshift, _muxwidth, \
60+
_gate, _postdiv, _flags)\
61+
struct ccu_mp _struct = { \
62+
.enable = _gate, \
63+
.m = _SUNXI_CCU_DIV(_mshift, _mwidth), \
64+
.p = _SUNXI_CCU_DIV(_pshift, _pwidth), \
65+
.mux = _SUNXI_CCU_MUX(_muxshift, _muxwidth), \
66+
.fixed_post_div = _postdiv, \
67+
.common = { \
68+
.reg = _reg, \
69+
.features = CCU_FEATURE_FIXED_POSTDIV, \
70+
.hw.init = CLK_HW_INIT_PARENTS_DATA(_name, \
71+
_parents, \
72+
&ccu_mp_ops, \
73+
_flags), \
74+
} \
75+
}
76+
5577
#define SUNXI_CCU_MP_WITH_MUX_GATE(_struct, _name, _parents, _reg, \
5678
_mshift, _mwidth, \
5779
_pshift, _pwidth, \
@@ -109,8 +131,7 @@ struct ccu_mp {
109131
_mshift, _mwidth, \
110132
_pshift, _pwidth, \
111133
_muxshift, _muxwidth, \
112-
_gate, _features, \
113-
_flags) \
134+
_gate, _flags, _features) \
114135
struct ccu_mp _struct = { \
115136
.enable = _gate, \
116137
.m = _SUNXI_CCU_DIV(_mshift, _mwidth), \

0 commit comments

Comments
 (0)