Commit ffe05540 authored by Stephen Boyd's avatar Stephen Boyd
Browse files

Merge branches 'clk-renesas', 'clk-allwinner', 'clk-tegra', 'clk-meson' and...

Merge branches 'clk-renesas', 'clk-allwinner', 'clk-tegra', 'clk-meson' and 'clk-rockchip' into clk-next

* clk-renesas:
  clk: renesas: rcar-gen3: Add HS400 quirk for SD clock
  clk: renesas: rcar-gen3: Add documentation for SD clocks
  clk: renesas: rcar-gen3: Set state when registering SD clocks
  clk: renesas: r8a77995: Simplify PLL3 multiplier/divider
  clk: renesas: r8a77995: Add missing CPEX clock
  clk: renesas: r8a77995: Remove non-existent SSP clocks
  clk: renesas: r8a77995: Remove non-existent VIN5-7 module clocks
  clk: renesas: r8a77995: Correct parent clock of DU
  clk: renesas: r8a77990: Correct parent clock of DU
  clk: renesas: r8a77970: Add CPEX clock
  clk: renesas: r8a77965: Add CPEX clock
  clk: renesas: r8a7796: Add CPEX clock
  clk: renesas: r8a7795: Add CPEX clock
  clk: renesas: r8a774a1: Add CPEX clock
  dt-bindings: clock: r8a7796: Remove CSIREF clock
  dt-bindings: clock: r8a7795: Remove CSIREF clock
  clk: renesas: Mark rza2_cpg_clk_register static
  clk: renesas: r7s9210: Add USB clocks
  clk: renesas: r8a77970: Add RPC clocks
  clk: renesas: r7s9210: Add SDHI clocks

* clk-allwinner:
  clk: sunxi-ng: a64: Allow parent change for VE clock
  clk: sunxi-ng: a33: Set CLK_SET_RATE_PARENT for all audio module clocks
  clk: sunxi-ng: a33: Use sigma-delta modulation for audio PLL
  clk: sunxi-ng: h3: Allow parent change for ve clock
  clk: sunxi-ng: add support for suniv F1C100s SoC
  dt-bindings: clock: Add Allwinner suniv F1C100s CCU
  clk: sunxi-ng: h3/h5: Fix CSI_MCLK parent
  clk: sunxi-ng: r40: Force LOSC parent to RTC LOSC output
  clk: sunxi-ng: sun50i: a64: Use sigma-delta modulation for audio PLL
  clk: sunxi-ng: a64: Fix gate bit of DSI DPHY
  clk: sunxi-ng: Enable DE2_CCU for SUN8I and SUN50I
  clk: sunxi-ng: Add support for H6 DE3 clocks
  dt-bindings: clock: sun8i-de2: Add H6 DE3 clock description
  clk: sunxi-ng: h6: Set video PLLs limits
  clk: sunxi-ng: Use u64 for calculation of NM rate
  clk: sunxi-ng: Adjust MP clock parent rate when allowed
  clk: sunxi-ng: sun50i: h6: Fix MMC clock mux width
  clk: sunxi-ng: enable so-said LDOs for A64 SoC's pll-mipi clock

* clk-tegra:
  clk: tegra: Return the exact clock rate from clk_round_rate
  clk: tegra30: Use Tegra CPU powergate helper function
  soc/tegra: pmc: Drop SMP dependency from CPU APIs
  clk: tegra: Fix maximum audio sync clock for Tegra124/210
  clk: tegra: get rid of duplicate defines
  clk: tegra20: Check whether direct PLLM sourcing is turned off for EMC
  clk: tegra20: Turn EMC clock gate into divider

* clk-meson: (25 commits)
  clk: meson: axg-audio: use the clk input helper function
  clk: meson: add clk-input helper function
  clk: meson: Mark some things static
  clk: meson: meson8b: add the read-only video clock trees
  clk: meson: meson8b: add the fractional divider for vid_pll_dco
  clk: meson: meson8b: fix the offset of vid_pll_dco's N value
  clk: meson: Fix GXL HDMI PLL fractional bits width
  clk: meson: meson8b: add the CPU clock post divider clocks
  clk: meson: meson8b: rename cpu_div2/cpu_div3 to cpu_in_div2/cpu_in_div3
  clk: meson: clk-regmap: add read-only gate ops
  clk: meson: meson8b: allow changing the CPU clock tree
  clk: meson: meson8b: run from the XTAL when changing the CPU frequency
  clk: meson: meson8b: add support for more M/N values in sys_pll
  clk: meson: meson8b: mark the CPU clock as CLK_IS_CRITICAL
  clk: meson: meson8b: do not use cpu_div3 for cpu_scale_out_sel
  clk: meson: clk-pll: check if the clock is already enabled
  clk: meson: meson8b: fix the width of the cpu_scale_div clock
  clk: meson: meson8b: fix incorrect divider mapping in cpu_scale_table
  clk: meson: meson8b: use the HHI syscon if available
  dt-bindings: clock: meson8b: use the registers from the HHI syscon
  ...

* clk-rockchip:
  clk: rockchip: add clock-id to gate of ACODEC for rk3328
  clk: rockchip: add clock ID of ACODEC for rk3328
  clk: rockchip: fix ID of 8ch clock of I2S1 for rk3328
  clk: rockchip: fix I2S1 clock gate register for rk3328
  clk: rockchip: make rk3188 hclk_vio_bus critical
  clk: rockchip: fix rk3188 sclk_mac_lbtest parameter ordering
  clk: rockchip: fix rk3188 sclk_smc gate data
  clk: rockchip: fix typo in rk3188 spdif_frac parent
Loading
Loading
Loading
Loading
+5 −8
Original line number Diff line number Diff line
@@ -9,15 +9,13 @@ Required Properties:
	- "amlogic,meson8-clkc" for Meson8 (S802) SoCs
	- "amlogic,meson8b-clkc" for Meson8 (S805) SoCs
	- "amlogic,meson8m2-clkc" for Meson8m2 (S812) SoCs
- reg: it must be composed by two tuples:
	0) physical base address of the xtal register and length of memory
	   mapped region.
	1) physical base address of the clock controller and length of memory
	   mapped region.

- #clock-cells: should be 1.
- #reset-cells: should be 1.

Parent node should have the following properties :
- compatible: "amlogic,meson-hhi-sysctrl", "simple-mfd", "syscon"
- reg: base address and size of the HHI system control register space.

Each clock is assigned an identifier and client nodes can use this identifier
to specify the clock which they consume. All available clocks are defined as
preprocessor macros in the dt-bindings/clock/meson8b-clkc.h header and can be
@@ -30,9 +28,8 @@ device tree sources).

Example: Clock controller node:

	clkc: clock-controller@c1104000 {
	clkc: clock-controller {
		compatible = "amlogic,meson8b-clkc";
		reg = <0xc1108000 0x4>, <0xc1104000 0x460>;
		#clock-cells = <1>;
		#reset-cells = <1>;
	};
+3 −2
Original line number Diff line number Diff line
Allwinner Display Engine 2.0 Clock Control Binding
--------------------------------------------------
Allwinner Display Engine 2.0/3.0 Clock Control Binding
------------------------------------------------------

Required properties :
- compatible: must contain one of the following compatibles:
@@ -8,6 +8,7 @@ Required properties :
		- "allwinner,sun8i-v3s-de2-clk"
		- "allwinner,sun50i-a64-de2-clk"
		- "allwinner,sun50i-h5-de2-clk"
		- "allwinner,sun50i-h6-de3-clk"

- reg: Must contain the registers base address and length
- clocks: phandle to the clocks feeding the display engine subsystem.
+1 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ Required properties :
		- "allwinner,sun50i-h5-ccu"
		- "allwinner,sun50i-h6-ccu"
		- "allwinner,sun50i-h6-r-ccu"
		- "allwinner,suniv-f1c100s-ccu"
		- "nextthing,gr8-ccu"

- reg: Must contain the registers base address and length
+2 −1
Original line number Diff line number Diff line
@@ -2,7 +2,8 @@
# Makefile for Meson specific clk
#

obj-$(CONFIG_COMMON_CLK_AMLOGIC) += clk-pll.o clk-mpll.o clk-phase.o
obj-$(CONFIG_COMMON_CLK_AMLOGIC) += clk-pll.o clk-mpll.o clk-phase.o vid-pll-div.o
obj-$(CONFIG_COMMON_CLK_AMLOGIC) += clk-input.o
obj-$(CONFIG_COMMON_CLK_AMLOGIC_AUDIO)	+= clk-triphase.o sclk-div.o
obj-$(CONFIG_COMMON_CLK_MESON_AO) += meson-aoclk.o
obj-$(CONFIG_COMMON_CLK_MESON8B) += meson8b.o
+24 −59
Original line number Diff line number Diff line
@@ -631,22 +631,23 @@ static struct clk_regmap *const axg_audio_clk_regmaps[] = {
	&axg_tdmout_c_lrclk,
};

static struct clk *devm_clk_get_enable(struct device *dev, char *id)
static int devm_clk_get_enable(struct device *dev, char *id)
{
	struct clk *clk;
	int ret;

	clk = devm_clk_get(dev, id);
	if (IS_ERR(clk)) {
		if (PTR_ERR(clk) != -EPROBE_DEFER)
		ret = PTR_ERR(clk);
		if (ret != -EPROBE_DEFER)
			dev_err(dev, "failed to get %s", id);
		return clk;
		return ret;
	}

	ret = clk_prepare_enable(clk);
	if (ret) {
		dev_err(dev, "failed to enable %s", id);
		return ERR_PTR(ret);
		return ret;
	}

	ret = devm_add_action_or_reset(dev,
@@ -654,74 +655,40 @@ static struct clk *devm_clk_get_enable(struct device *dev, char *id)
				       clk);
	if (ret) {
		dev_err(dev, "failed to add reset action on %s", id);
		return ERR_PTR(ret);
		return ret;
	}

	return clk;
	return 0;
}

static const struct clk_ops axg_clk_no_ops = {};

static struct clk_hw *axg_clk_hw_register_bypass(struct device *dev,
static int axg_register_clk_hw_input(struct device *dev,
				     const char *name,
						 const char *parent_name)
				     unsigned int clkid)
{
	struct clk_hw *hw;
	struct clk_init_data init;
	char *clk_name;
	int ret;

	hw = devm_kzalloc(dev, sizeof(*hw), GFP_KERNEL);
	if (!hw)
		return ERR_PTR(-ENOMEM);
	struct clk_hw *hw;
	int err = 0;

	clk_name = kasprintf(GFP_KERNEL, "axg_%s", name);
	if (!clk_name)
		return ERR_PTR(-ENOMEM);

	init.name = clk_name;
	init.ops = &axg_clk_no_ops;
	init.flags = 0;
	init.parent_names = parent_name ? &parent_name : NULL;
	init.num_parents = parent_name ? 1 : 0;
	hw->init = &init;

	ret = devm_clk_hw_register(dev, hw);
	kfree(clk_name);

	return ret ? ERR_PTR(ret) : hw;
}

static int axg_register_clk_hw_input(struct device *dev,
				     const char *name,
				     unsigned int clkid)
{
	struct clk *parent_clk = devm_clk_get(dev, name);
	struct clk_hw *hw = NULL;

	if (IS_ERR(parent_clk)) {
		int err = PTR_ERR(parent_clk);
		return -ENOMEM;

	hw = meson_clk_hw_register_input(dev, name, clk_name, 0);
	if (IS_ERR(hw)) {
		/* It is ok if an input clock is missing */
		if (err == -ENOENT) {
		if (PTR_ERR(hw) == -ENOENT) {
			dev_dbg(dev, "%s not provided", name);
		} else {
			err = PTR_ERR(hw);
			if (err != -EPROBE_DEFER)
				dev_err(dev, "failed to get %s clock", name);
			return err;
		}
	} else {
		hw = axg_clk_hw_register_bypass(dev, name,
						__clk_get_name(parent_clk));
	}

	if (IS_ERR(hw)) {
		dev_err(dev, "failed to register %s clock", name);
		return PTR_ERR(hw);
		axg_audio_hw_onecell_data.hws[clkid] = hw;
	}

	axg_audio_hw_onecell_data.hws[clkid] = hw;
	return 0;
	kfree(clk_name);
	return err;
}

static int axg_register_clk_hw_inputs(struct device *dev,
@@ -759,7 +726,6 @@ static int axg_audio_clkc_probe(struct platform_device *pdev)
	struct regmap *map;
	struct resource *res;
	void __iomem *regs;
	struct clk *clk;
	struct clk_hw *hw;
	int ret, i;

@@ -775,9 +741,9 @@ static int axg_audio_clkc_probe(struct platform_device *pdev)
	}

	/* Get the mandatory peripheral clock */
	clk = devm_clk_get_enable(dev, "pclk");
	if (IS_ERR(clk))
		return PTR_ERR(clk);
	ret = devm_clk_get_enable(dev, "pclk");
	if (ret)
		return ret;

	ret = device_reset(dev);
	if (ret) {
@@ -786,8 +752,7 @@ static int axg_audio_clkc_probe(struct platform_device *pdev)
	}

	/* Register the peripheral input clock */
	hw = axg_clk_hw_register_bypass(dev, "audio_pclk",
					__clk_get_name(clk));
	hw = meson_clk_hw_register_input(dev, "pclk", "axg_audio_pclk", 0);
	if (IS_ERR(hw))
		return PTR_ERR(hw);

Loading