Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 76b77f1d authored by Stephen Boyd's avatar Stephen Boyd
Browse files

Merge tag 'imx-clk-5.3' of...

Merge tag 'imx-clk-5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into clk-imx

Pull i.MX clk driver changes from Shawn Guo:

 - A series from Abel Vesa to switch i.MX6 and i.MX7 clock drivers to
   clk_hw based API
 - Add GPIO, SNVS and GIC clocks for i.MX8 drivers
 - Create a common function imx_mmdc_mask_handshake() for masking MMDC
   handshake
 - Drop __init for function imx_check_clocks() and imx_register_uart_clocks(),
   so that they can be used by i.MX8 clock drivers which use driver model
 - Use devm_platform_ioremap_resource() instead of of_iomap() for imx8mq
   clock driver
 - Mark imx6sx/ul/ull/sll MMDC_P1_IPG and imx8mm DRAM_APB as critical clock.
 - Correct imx7ulp nic1_bus_clk and imx8mm audio_pll2_clk clock setting

* tag 'imx-clk-5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: (38 commits)
  clk: imx8mq: Keep uart clocks on during system boot
  clk: imx: Remove __init for imx_register_uart_clocks() API
  clk: imx6q: fix section mismatch warning
  clk: imx8mq: Use devm_platform_ioremap_resource() instead of of_iomap()
  clk: imx8mq: Use imx_check_clocks() API directly
  clk: imx: Remove __init for imx_check_clocks() API
  clk: imx6sll: Switch to clk_hw based API
  clk: imx7d: Switch to clk_hw based API
  clk: imx6ul: Switch to clk_hw based API
  clk: imx6sx: Switch to clk_hw based API
  clk: imx6q: Switch to clk_hw based API
  clk: imx6sl: Switch to clk_hw based API
  clk: imx: Switch wrappers to clk_hw based API
  clk: imx: clk-fixup-mux: Switch to clk_hw based API
  clk: imx: clk-fixup-div: Switch to clk_hw based API
  clk: imx: clk-gate-exclusive: Switch to clk_hw based API
  clk: imx: clk-pfd: Switch to clk_hw based API
  clk: imx: clk-pllv3: Switch to clk_hw based API
  clk: imx: clk-gate2: Switch to clk_hw based API
  clk: imx: clk-cpu: Switch to clk_hw based API
  ...
parents a188339c 15c64ff7
Loading
Loading
Loading
Loading
+20 −10
Original line number Diff line number Diff line
@@ -78,13 +78,14 @@ static const struct clk_ops clk_busy_divider_ops = {
	.set_rate = clk_busy_divider_set_rate,
};

struct clk *imx_clk_busy_divider(const char *name, const char *parent_name,
struct clk_hw *imx_clk_hw_busy_divider(const char *name, const char *parent_name,
				 void __iomem *reg, u8 shift, u8 width,
				 void __iomem *busy_reg, u8 busy_shift)
{
	struct clk_busy_divider *busy;
	struct clk *clk;
	struct clk_hw *hw;
	struct clk_init_data init;
	int ret;

	busy = kzalloc(sizeof(*busy), GFP_KERNEL);
	if (!busy)
@@ -107,11 +108,15 @@ struct clk *imx_clk_busy_divider(const char *name, const char *parent_name,

	busy->div.hw.init = &init;

	clk = clk_register(NULL, &busy->div.hw);
	if (IS_ERR(clk))
	hw = &busy->div.hw;

	ret = clk_hw_register(NULL, hw);
	if (ret) {
		kfree(busy);
		return ERR_PTR(ret);
	}

	return clk;
	return hw;
}

struct clk_busy_mux {
@@ -152,13 +157,14 @@ static const struct clk_ops clk_busy_mux_ops = {
	.set_parent = clk_busy_mux_set_parent,
};

struct clk *imx_clk_busy_mux(const char *name, void __iomem *reg, u8 shift,
struct clk_hw *imx_clk_hw_busy_mux(const char *name, void __iomem *reg, u8 shift,
			     u8 width, void __iomem *busy_reg, u8 busy_shift,
			     const char * const *parent_names, int num_parents)
{
	struct clk_busy_mux *busy;
	struct clk *clk;
	struct clk_hw *hw;
	struct clk_init_data init;
	int ret;

	busy = kzalloc(sizeof(*busy), GFP_KERNEL);
	if (!busy)
@@ -181,9 +187,13 @@ struct clk *imx_clk_busy_mux(const char *name, void __iomem *reg, u8 shift,

	busy->mux.hw.init = &init;

	clk = clk_register(NULL, &busy->mux.hw);
	if (IS_ERR(clk))
	hw = &busy->mux.hw;

	ret = clk_hw_register(NULL, hw);
	if (ret) {
		kfree(busy);
		return ERR_PTR(ret);
	}

	return clk;
	return hw;
}
+9 −5
Original line number Diff line number Diff line
@@ -75,13 +75,14 @@ static const struct clk_ops clk_cpu_ops = {
	.set_rate	= clk_cpu_set_rate,
};

struct clk *imx_clk_cpu(const char *name, const char *parent_name,
struct clk_hw *imx_clk_hw_cpu(const char *name, const char *parent_name,
		struct clk *div, struct clk *mux, struct clk *pll,
		struct clk *step)
{
	struct clk_cpu *cpu;
	struct clk *clk;
	struct clk_hw *hw;
	struct clk_init_data init;
	int ret;

	cpu = kzalloc(sizeof(*cpu), GFP_KERNEL);
	if (!cpu)
@@ -99,10 +100,13 @@ struct clk *imx_clk_cpu(const char *name, const char *parent_name,
	init.num_parents = 1;

	cpu->hw.init = &init;
	hw = &cpu->hw;

	clk = clk_register(NULL, &cpu->hw);
	if (IS_ERR(clk))
	ret = clk_hw_register(NULL, hw);
	if (ret) {
		kfree(cpu);
		return ERR_PTR(ret);
	}

	return clk;
	return hw;
}
+10 −5
Original line number Diff line number Diff line
@@ -91,13 +91,14 @@ static const struct clk_ops clk_fixup_div_ops = {
	.set_rate = clk_fixup_div_set_rate,
};

struct clk *imx_clk_fixup_divider(const char *name, const char *parent,
struct clk_hw *imx_clk_hw_fixup_divider(const char *name, const char *parent,
				  void __iomem *reg, u8 shift, u8 width,
				  void (*fixup)(u32 *val))
{
	struct clk_fixup_div *fixup_div;
	struct clk *clk;
	struct clk_hw *hw;
	struct clk_init_data init;
	int ret;

	if (!fixup)
		return ERR_PTR(-EINVAL);
@@ -120,9 +121,13 @@ struct clk *imx_clk_fixup_divider(const char *name, const char *parent,
	fixup_div->ops = &clk_divider_ops;
	fixup_div->fixup = fixup;

	clk = clk_register(NULL, &fixup_div->divider.hw);
	if (IS_ERR(clk))
	hw = &fixup_div->divider.hw;

	ret = clk_hw_register(NULL, hw);
	if (ret) {
		kfree(fixup_div);
		return ERR_PTR(ret);
	}

	return clk;
	return hw;
}
+10 −5
Original line number Diff line number Diff line
@@ -69,13 +69,14 @@ static const struct clk_ops clk_fixup_mux_ops = {
	.set_parent = clk_fixup_mux_set_parent,
};

struct clk *imx_clk_fixup_mux(const char *name, void __iomem *reg,
struct clk_hw *imx_clk_hw_fixup_mux(const char *name, void __iomem *reg,
			      u8 shift, u8 width, const char * const *parents,
			      int num_parents, void (*fixup)(u32 *val))
{
	struct clk_fixup_mux *fixup_mux;
	struct clk *clk;
	struct clk_hw *hw;
	struct clk_init_data init;
	int ret;

	if (!fixup)
		return ERR_PTR(-EINVAL);
@@ -98,9 +99,13 @@ struct clk *imx_clk_fixup_mux(const char *name, void __iomem *reg,
	fixup_mux->ops = &clk_mux_ops;
	fixup_mux->fixup = fixup;

	clk = clk_register(NULL, &fixup_mux->mux.hw);
	if (IS_ERR(clk))
	hw = &fixup_mux->mux.hw;

	ret = clk_hw_register(NULL, hw);
	if (ret) {
		kfree(fixup_mux);
		return ERR_PTR(ret);
	}

	return clk;
	return hw;
}
+11 −6
Original line number Diff line number Diff line
@@ -58,13 +58,14 @@ static const struct clk_ops clk_gate_exclusive_ops = {
	.is_enabled = clk_gate_exclusive_is_enabled,
};

struct clk *imx_clk_gate_exclusive(const char *name, const char *parent,
struct clk_hw *imx_clk_hw_gate_exclusive(const char *name, const char *parent,
	 void __iomem *reg, u8 shift, u32 exclusive_mask)
{
	struct clk_gate_exclusive *exgate;
	struct clk_gate *gate;
	struct clk *clk;
	struct clk_hw *hw;
	struct clk_init_data init;
	int ret;

	if (exclusive_mask == 0)
		return ERR_PTR(-EINVAL);
@@ -86,9 +87,13 @@ struct clk *imx_clk_gate_exclusive(const char *name, const char *parent,
	gate->hw.init = &init;
	exgate->exclusive_mask = exclusive_mask;

	clk = clk_register(NULL, &gate->hw);
	if (IS_ERR(clk))
		kfree(exgate);
	hw = &gate->hw;

	return clk;
	ret = clk_hw_register(NULL, hw);
	if (ret) {
		kfree(gate);
		return ERR_PTR(ret);
	}

	return hw;
}
Loading