Unverified Commit ef21e555 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!8938 clk: sunxi-ng: h6: Reparent CPUX during PLL CPUX rate change

parents 578519b7 a2c5cbb1
Loading
Loading
Loading
Loading
+17 −2
Original line number Diff line number Diff line
@@ -1181,12 +1181,19 @@ static const u32 usb2_clk_regs[] = {
	SUN50I_H6_USB3_CLK_REG,
};

static struct ccu_mux_nb sun50i_h6_cpu_nb = {
	.common		= &cpux_clk.common,
	.cm		= &cpux_clk.mux,
	.delay_us       = 1,
	.bypass_index   = 0, /* index of 24 MHz oscillator */
};

static int sun50i_h6_ccu_probe(struct platform_device *pdev)
{
	struct resource *res;
	void __iomem *reg;
	int i, ret;
	u32 val;
	int i;

	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	reg = devm_ioremap_resource(&pdev->dev, res);
@@ -1240,7 +1247,15 @@ static int sun50i_h6_ccu_probe(struct platform_device *pdev)
	val |= BIT(24);
	writel(val, reg + SUN50I_H6_HDMI_CEC_CLK_REG);

	return sunxi_ccu_probe(pdev->dev.of_node, reg, &sun50i_h6_ccu_desc);
	ret = sunxi_ccu_probe(pdev->dev.of_node, reg, &sun50i_h6_ccu_desc);
	if (ret)
		return ret;

	/* Reparent CPU during PLL CPUX rate changes */
	ccu_mux_notifier_register(pll_cpux_clk.common.hw.clk,
				  &sun50i_h6_cpu_nb);

	return 0;
}

static const struct of_device_id sun50i_h6_ccu_ids[] = {