Commit 6a568805 authored by Stephen Boyd's avatar Stephen Boyd
Browse files

Merge tag 'sunxi-clk-fixes-for-6.15' of...

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
parents 3e14c720 98e6da67
Loading
Loading
Loading
Loading
+25 −19
Original line number Diff line number Diff line
@@ -412,18 +412,22 @@ static const struct clk_parent_data mmc0_mmc1_parents[] = {
	{ .hw = &pll_periph0_2x_clk.common.hw },
	{ .hw = &pll_audio1_div2_clk.common.hw },
};
static SUNXI_CCU_MP_DATA_WITH_MUX_GATE(mmc0_clk, "mmc0", mmc0_mmc1_parents, 0x830,
static SUNXI_CCU_MP_DATA_WITH_MUX_GATE_POSTDIV(mmc0_clk, "mmc0",
					       mmc0_mmc1_parents, 0x830,
					       0, 4,		/* M */
					       8, 2,		/* P */
					       24, 3,		/* mux */
					       BIT(31),		/* gate */
					       2,		/* post-div */
					       0);

static SUNXI_CCU_MP_DATA_WITH_MUX_GATE(mmc1_clk, "mmc1", mmc0_mmc1_parents, 0x834,
static SUNXI_CCU_MP_DATA_WITH_MUX_GATE_POSTDIV(mmc1_clk, "mmc1",
					       mmc0_mmc1_parents, 0x834,
					       0, 4,		/* M */
					       8, 2,		/* P */
					       24, 3,		/* mux */
					       BIT(31),		/* gate */
					       2,		/* post-div */
					       0);

static const struct clk_parent_data mmc2_parents[] = {
@@ -433,11 +437,13 @@ static const struct clk_parent_data mmc2_parents[] = {
	{ .hw = &pll_periph0_800M_clk.common.hw },
	{ .hw = &pll_audio1_div2_clk.common.hw },
};
static SUNXI_CCU_MP_DATA_WITH_MUX_GATE(mmc2_clk, "mmc2", mmc2_parents, 0x838,
static SUNXI_CCU_MP_DATA_WITH_MUX_GATE_POSTDIV(mmc2_clk, "mmc2", mmc2_parents,
					       0x838,
					       0, 4,		/* M */
					       8, 2,		/* P */
					       24, 3,		/* mux */
					       BIT(31),		/* gate */
					       2,		/* post-div */
					       0);

static SUNXI_CCU_GATE_HWS(bus_mmc0_clk, "bus-mmc0", psi_ahb_hws,
+23 −2
Original line number Diff line number Diff line
@@ -52,6 +52,28 @@ struct ccu_mp {
		}							\
	}

#define SUNXI_CCU_MP_DATA_WITH_MUX_GATE_POSTDIV(_struct, _name, _parents, \
						_reg,			\
						_mshift, _mwidth,	\
						_pshift, _pwidth,	\
						_muxshift, _muxwidth,	\
						_gate, _postdiv, _flags)\
	struct ccu_mp _struct = {					\
		.enable	= _gate,					\
		.m	= _SUNXI_CCU_DIV(_mshift, _mwidth),		\
		.p	= _SUNXI_CCU_DIV(_pshift, _pwidth),		\
		.mux	= _SUNXI_CCU_MUX(_muxshift, _muxwidth),		\
		.fixed_post_div	= _postdiv,				\
		.common	= {						\
			.reg		= _reg,				\
			.features	= CCU_FEATURE_FIXED_POSTDIV,	\
			.hw.init	= CLK_HW_INIT_PARENTS_DATA(_name, \
							_parents,	\
							&ccu_mp_ops,	\
							_flags),	\
		}							\
	}

#define SUNXI_CCU_MP_WITH_MUX_GATE(_struct, _name, _parents, _reg,	\
				   _mshift, _mwidth,			\
				   _pshift, _pwidth,			\
@@ -109,8 +131,7 @@ struct ccu_mp {
					     _mshift, _mwidth,		\
					     _pshift, _pwidth,		\
					     _muxshift, _muxwidth,	\
					     _gate, _features,		\
					     _flags)			\
					     _gate, _flags, _features)	\
	struct ccu_mp _struct = {					\
		.enable	= _gate,					\
		.m	= _SUNXI_CCU_DIV(_mshift, _mwidth),		\