Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: support hardware-specific debugfs entries

Add a new clk_ops->debug_init method to allow a clock hardware
driver to populate the clock's debugfs directory with entries
beyond those common for every clock.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Mike Turquette <mturquette@linaro.org>

authored by

Alex Elder and committed by
Mike Turquette
c646cbf1 afbd1a0c

+12
+4
drivers/clk/clk.c
··· 277 277 if (!d) 278 278 goto err_out; 279 279 280 + if (clk->ops->debug_init) 281 + if (clk->ops->debug_init(clk->hw, clk->dentry)) 282 + goto err_out; 283 + 280 284 ret = 0; 281 285 goto out; 282 286
+8
include/linux/clk-provider.h
··· 32 32 #define CLK_GET_ACCURACY_NOCACHE BIT(8) /* do not use the cached clk accuracy */ 33 33 34 34 struct clk_hw; 35 + struct dentry; 35 36 36 37 /** 37 38 * struct clk_ops - Callback operations for hardware clocks; these are to ··· 128 127 * separately via calls to .set_parent and .set_rate. 129 128 * Returns 0 on success, -EERROR otherwise. 130 129 * 130 + * @debug_init: Set up type-specific debugfs entries for this clock. This 131 + * is called once, after the debugfs directory entry for this 132 + * clock has been created. The dentry pointer representing that 133 + * directory is provided as an argument. Called with 134 + * prepare_lock held. Returns 0 on success, -EERROR otherwise. 135 + * 131 136 * 132 137 * The clk_enable/clk_disable and clk_prepare/clk_unprepare pairs allow 133 138 * implementations to split any work between atomic (enable) and sleepable ··· 172 165 unsigned long (*recalc_accuracy)(struct clk_hw *hw, 173 166 unsigned long parent_accuracy); 174 167 void (*init)(struct clk_hw *hw); 168 + int (*debug_init)(struct clk_hw *hw, struct dentry *dentry); 175 169 }; 176 170 177 171 /**