diff options
Diffstat (limited to 'drivers/clk/clk.c')
-rw-r--r-- | drivers/clk/clk.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index a38f339420..19377b893c 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -17,6 +17,8 @@ #include <common.h> #include <errno.h> #include <malloc.h> +#include <stringlist.h> +#include <complete.h> #include <linux/clk.h> #include <linux/err.h> @@ -583,3 +585,23 @@ void clk_dump(int verbose) dump_one(c, verbose, 0); } } + +int clk_name_complete(struct string_list *sl, char *instr) +{ + struct clk *c; + int len; + + if (!instr) + instr = ""; + + len = strlen(instr); + + list_for_each_entry(c, &clks, list) { + if (strncmp(instr, c->name, len)) + continue; + + string_list_add_asprintf(sl, "%s ", c->name); + } + + return COMPLETE_CONTINUE; +} |