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

Commit f607b1c4 authored by David Dai's avatar David Dai Committed by Gerrit - the friendly Code Review server
Browse files

clk: qcom: clk-debug: Add bandwidth voting for MM clock measures



Due to a new requirement to disconnect configuration space for
multimedia clients when MMCX is power collapsed, the debug driver
needs to reconnect the ports before trying to access any of the
multimedia config slaves. Add bandwidth voting before attempting
to access any of the MM clock controller to satisfy this requirement.

Change-Id: I17ac1fc605da884d51a00b731cc0462bb222c5c2
Signed-off-by: default avatarDavid Dai <daidavid1@codeaurora.org>
parent 8911e102
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@
#include <linux/clk-provider.h>
#include <linux/of.h>
#include <linux/bitops.h>
#include <linux/msm-bus.h>

#include "clk-regmap.h"
#include "clk-debug.h"
@@ -243,6 +244,13 @@ static int clk_debug_measure_get(void *data, u64 *val)

	mutex_lock(&clk_debug_lock);

	/*
	 * Vote for bandwidth to re-connect config ports
	 * to multimedia clock controllers.
	 */
	if (meas->bus_cl_id)
		msm_bus_scale_client_update_request(meas->bus_cl_id, 1);

	ret = clk_set_parent(measure->clk, hw->clk);
	if (!ret) {
		par = measure;
@@ -280,6 +288,8 @@ static int clk_debug_measure_get(void *data, u64 *val)
exit1:
	disable_debug_clks(meas, index);
exit:
	if (meas->bus_cl_id)
		msm_bus_scale_client_update_request(meas->bus_cl_id, 0);
	mutex_unlock(&clk_debug_lock);
	return ret;
}
@@ -335,11 +345,13 @@ void clk_debug_measure_add(struct clk_hw *hw, struct dentry *dentry)
	}

	meas = to_clk_measure(measure);
	if (meas->bus_cl_id)
		msm_bus_scale_client_update_request(meas->bus_cl_id, 1);
	ret = clk_set_parent(measure->clk, hw->clk);
	if (ret) {
		pr_debug("Unable to set %s as %s's parent, ret=%d\n",
			clk_hw_get_name(hw), clk_hw_get_name(measure), ret);
		return;
		goto err;
	}

	index = clk_debug_mux_get_parent(measure);
@@ -349,6 +361,9 @@ void clk_debug_measure_add(struct clk_hw *hw, struct dentry *dentry)
	else
		debugfs_create_file("clk_measure", 0444, dentry, hw,
					&clk_measure_fops);
err:
	if (meas->bus_cl_id)
		msm_bus_scale_client_update_request(meas->bus_cl_id, 0);
}
EXPORT_SYMBOL(clk_debug_measure_add);

+1 −0
Original line number Diff line number Diff line
@@ -120,6 +120,7 @@ struct clk_debug_mux {
	u32 post_div_mask;
	u32 post_div_shift;
	u32 period_offset;
	u32 bus_cl_id;
	struct clk_hw hw;
};