clk: qcom: regmap-mux: Add list_registers for muxes

Add list_registers callback for muxes so we can ensure they're
configured to the expected parent in debugging scenarios.

Change-Id: I85baff36e1aea88faa85a1fc470e051836919312
Signed-off-by: Mike Tipton <quic_mdtipton@quicinc.com>
This commit is contained in:
Mike Tipton 2022-08-12 12:44:05 -07:00
parent cdc3459d09
commit 7f4eff6b2c

View File

@ -9,6 +9,7 @@
#include <linux/export.h>
#include "clk-regmap-mux.h"
#include "clk-debug.h"
static inline struct clk_regmap_mux *to_clk_regmap_mux(struct clk_hw *hw)
{
@ -49,9 +50,34 @@ static int mux_set_parent(struct clk_hw *hw, u8 index)
return regmap_update_bits(clkr->regmap, mux->reg, mask, val);
}
static void clk_regmap_mux_list_registers(struct seq_file *f, struct clk_hw *hw)
{
struct clk_regmap_mux *mux = to_clk_regmap_mux(hw);
int val;
regmap_read(mux->clkr.regmap, mux->reg, &val);
clock_debug_output(f, "%20s: 0x%.8x\n", "MUXR", val);
}
static struct clk_regmap_ops clk_regmap_mux_regmap_ops = {
.list_registers = clk_regmap_mux_list_registers,
};
static int clk_regmap_mux_init(struct clk_hw *hw)
{
struct clk_regmap *rclk = to_clk_regmap(hw);
if (!rclk->ops)
rclk->ops = &clk_regmap_mux_regmap_ops;
return 0;
}
const struct clk_ops clk_regmap_mux_closest_ops = {
.get_parent = mux_get_parent,
.set_parent = mux_set_parent,
.determine_rate = __clk_mux_determine_rate_closest,
.init = clk_regmap_mux_init,
.debug_init = clk_common_debug_init,
};
EXPORT_SYMBOL_GPL(clk_regmap_mux_closest_ops);