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

Commit 9c27abfd authored by Junjie Wu's avatar Junjie Wu
Browse files

clk: qcom: clock-debug-8994: Change debug clocks to use orphan list



Some debug mux parents might not be ready until the clock driver
providing it becomes ready. Use orphan list support to handle external
debug clocks, instead of failing the probe of clock_debug controller.

In addition, move external debug clock registration from
clock-gcc-8994 to clock-debug-8994.

Change-Id: I764d1fd3cab1af878bd567e30e02d62143204711
Signed-off-by: default avatarJunjie Wu <junjiew@codeaurora.org>
parent 0cb64e94
Loading
Loading
Loading
Loading
+9 −19
Original line number Diff line number Diff line
@@ -2676,8 +2676,6 @@ static struct clk_lookup gcc_clocks_8994_v1[] = {
static struct clk_lookup gcc_clocks_8994_common[] = {
	CLK_LIST(gcc_xo),
	CLK_LIST(gcc_xo_a_clk),
	CLK_LIST(debug_mmss_clk),
	CLK_LIST(debug_rpm_clk),
	CLK_LIST(gpll0),
	CLK_LIST(gpll0_ao),
	CLK_LIST(gpll0_out_main),
@@ -2971,6 +2969,9 @@ arch_initcall(msm_gcc_8994_init);

/* ======== Clock Debug Controller ======== */
static struct clk_lookup msm_clocks_measure_8994[] = {
	CLK_LIST(debug_mmss_clk),
	CLK_LIST(debug_rpm_clk),
	CLK_LIST(debug_cpu_clk),
	CLK_LOOKUP_OF("measure", gcc_debug_mux, "debug"),
};

@@ -3001,23 +3002,12 @@ static int msm_clock_debug_8994_probe(struct platform_device *pdev)
		return -ENOMEM;
	}

	debug_mmss_clk.c.parent = clk_get(&pdev->dev, "debug_mmss_clk");
	if (IS_ERR(debug_mmss_clk.c.parent)) {
		dev_err(&pdev->dev, "Failed to get MMSS debug mux\n");
		return PTR_ERR(debug_mmss_clk.c.parent);
	}

	debug_rpm_clk.c.parent = clk_get(&pdev->dev, "debug_rpm_clk");
	if (IS_ERR(debug_rpm_clk.c.parent)) {
		dev_err(&pdev->dev, "Failed to get RPM debug mux\n");
		return PTR_ERR(debug_rpm_clk.c.parent);
	}

	debug_cpu_clk.c.parent = clk_get(&pdev->dev, "debug_cpu_clk");
	if (IS_ERR(debug_cpu_clk.c.parent)) {
		dev_err(&pdev->dev, "Failed to get CPU debug mux\n");
		return PTR_ERR(debug_cpu_clk.c.parent);
	}
	debug_mmss_clk.dev = &pdev->dev;
	debug_mmss_clk.clk_id = "debug_mmss_clk";
	debug_rpm_clk.dev = &pdev->dev;
	debug_rpm_clk.clk_id = "debug_rpm_clk";
	debug_cpu_clk.dev = &pdev->dev;
	debug_cpu_clk.clk_id = "debug_cpu_clk";

	ret = of_msm_clock_register(pdev->dev.of_node,
				    msm_clocks_measure_8994,
+3 −2
Original line number Diff line number Diff line
@@ -113,8 +113,6 @@
/* clock_gcc controlled clocks */
#define clk_gcc_xo 0x7503042f
#define clk_gcc_xo_a_clk 0x344f46f4
#define clk_debug_mmss_clk 0x977c99b6
#define clk_debug_rpm_clk 0x8e2b07ca
#define clk_gpll0 0x1ebe3bc4
#define clk_gpll0_ao 0xa1368304
#define clk_gpll0_out_main 0xe9374de7
@@ -455,6 +453,9 @@
#define clk_a53_div_clk 0x6006022b

/* clock_debug controlled clocks */
#define clk_debug_mmss_clk 0x977c99b6
#define clk_debug_rpm_clk 0x8e2b07ca
#define clk_debug_cpu_clk 0x0e696b2b
#define clk_gcc_debug_mux 0x8121ac15

#endif