|
@@ -2126,6 +2126,31 @@ static const struct file_operations clk_dump_fops = {
|
|
|
.release = single_release,
|
|
|
};
|
|
|
|
|
|
+static int possible_parents_dump(struct seq_file *s, void *data)
|
|
|
+{
|
|
|
+ struct clk_core *core = s->private;
|
|
|
+ int i;
|
|
|
+
|
|
|
+ for (i = 0; i < core->num_parents - 1; i++)
|
|
|
+ seq_printf(s, "%s ", core->parent_names[i]);
|
|
|
+
|
|
|
+ seq_printf(s, "%s\n", core->parent_names[i]);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+static int possible_parents_open(struct inode *inode, struct file *file)
|
|
|
+{
|
|
|
+ return single_open(file, possible_parents_dump, inode->i_private);
|
|
|
+}
|
|
|
+
|
|
|
+static const struct file_operations possible_parents_fops = {
|
|
|
+ .open = possible_parents_open,
|
|
|
+ .read = seq_read,
|
|
|
+ .llseek = seq_lseek,
|
|
|
+ .release = single_release,
|
|
|
+};
|
|
|
+
|
|
|
static int clk_debug_create_one(struct clk_core *core, struct dentry *pdentry)
|
|
|
{
|
|
|
struct dentry *d;
|
|
@@ -2177,6 +2202,13 @@ static int clk_debug_create_one(struct clk_core *core, struct dentry *pdentry)
|
|
|
if (!d)
|
|
|
goto err_out;
|
|
|
|
|
|
+ if (core->num_parents > 1) {
|
|
|
+ d = debugfs_create_file("clk_possible_parents", S_IRUGO,
|
|
|
+ core->dentry, core, &possible_parents_fops);
|
|
|
+ if (!d)
|
|
|
+ goto err_out;
|
|
|
+ }
|
|
|
+
|
|
|
if (core->ops->debug_init) {
|
|
|
ret = core->ops->debug_init(core->hw, core->dentry);
|
|
|
if (ret)
|