Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 316619
b: refs/heads/master
c: 015ba40
h: refs/heads/master
i:
  316617: 8bc6f2c
  316615: 2d4b55f
v: v3
  • Loading branch information
Grant Likely authored and Mike Turquette committed Jul 12, 2012
1 parent 1e21792 commit 9a42401
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 766e6a4ec602d0c107553b91b3434fe9c03474f4
refs/heads/master: 015ba40246497ae02a5f644d4c8adfec76d9b75c
23 changes: 23 additions & 0 deletions trunk/drivers/clk/clk-fixed-rate.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <linux/slab.h>
#include <linux/io.h>
#include <linux/err.h>
#include <linux/of.h>

/*
* DOC: basic fixed-rate clock that cannot gate
Expand Down Expand Up @@ -79,3 +80,25 @@ struct clk *clk_register_fixed_rate(struct device *dev, const char *name,

return clk;
}

#ifdef CONFIG_OF
/**
* of_fixed_clk_setup() - Setup function for simple fixed rate clock
*/
void __init of_fixed_clk_setup(struct device_node *node)
{
struct clk *clk;
const char *clk_name = node->name;
u32 rate;

if (of_property_read_u32(node, "clock-frequency", &rate))
return;

of_property_read_string(node, "clock-output-names", &clk_name);

clk = clk_register_fixed_rate(NULL, clk_name, NULL, CLK_IS_ROOT, rate);
if (clk)
of_clk_add_provider(node, of_clk_src_simple_get, clk);
}
EXPORT_SYMBOL_GPL(of_fixed_clk_setup);
#endif
2 changes: 2 additions & 0 deletions trunk/include/linux/clk-provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ struct clk *clk_register_fixed_rate(struct device *dev, const char *name,
const char *parent_name, unsigned long flags,
unsigned long fixed_rate);

void of_fixed_clk_setup(struct device_node *np);

/**
* struct clk_gate - gating clock
*
Expand Down

0 comments on commit 9a42401

Please sign in to comment.