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

Commit ef1bbbf5 authored by Vikram Mulukutla's avatar Vikram Mulukutla
Browse files

msm: clock-debug: Enable debug muxes en route to clock being measured



MSM clock debug muxes have gates that need to be enabled
to allow clock signals to be output to the measurement
circuitry. Since we want to ensure that a clock that is
assumed to be off in software is also not outputting a
signal, it is not possible to call clk_enable on the
measure clock. Therefore call the enable op on all the
clocks upstream of the measure clock, except for the clock
being measured. Also, leave the clocks enabled to allow
measurement using a scope.

Change-Id: Ia8016edd460d03b6a0686c58788457aeb6c9e2c5
Signed-off-by: default avatarVikram Mulukutla <markivx@codeaurora.org>
parent ed69e69b
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -72,7 +72,7 @@ static struct clk *measure;

static int clock_debug_measure_get(void *data, u64 *val)
{
	struct clk *clock = data;
	struct clk *clock = data, *par;
	int ret, is_hw_gated;

	/* Check to see if the clock is in hardware gating mode */
@@ -92,6 +92,12 @@ static int clock_debug_measure_get(void *data, u64 *val)
		 */
		if (is_hw_gated && clock->count)
			clock->ops->disable_hwcg(clock);
		par = measure;
		while (par && par != clock) {
			if (par->ops->enable)
				par->ops->enable(par);
			par = par->parent;
		}
		*val = clk_get_rate(measure);
		/* Reenable hwgating if it was disabled */
		if (is_hw_gated && clock->count)