-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml --- r: 308240 b: refs/heads/master c: 2af9e6d h: refs/heads/master v: v3
- Loading branch information
Sascha Hauer
committed
May 2, 2012
1 parent
30447dc
commit d52b985
Showing
4 changed files
with
70 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: 6c7b06850c5a1615cc9e660e0d24ce2025bb9bcf | ||
refs/heads/master: 2af9e6db14db9a7a0a6510227352fb2e69f9d032 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#include <linux/clk.h> | ||
#include <linux/clk-provider.h> | ||
#include <linux/io.h> | ||
#include <linux/slab.h> | ||
#include <linux/kernel.h> | ||
#include <linux/err.h> | ||
#include <mach/common.h> | ||
#include <mach/hardware.h> | ||
#include <mach/clock.h> | ||
#include "clk.h" | ||
|
||
/** | ||
* pll v1 | ||
* | ||
* @clk_hw clock source | ||
* @parent the parent clock name | ||
* @base base address of pll registers | ||
* | ||
* PLL clock version 1, found on i.MX1/21/25/27/31/35 | ||
*/ | ||
struct clk_pllv1 { | ||
struct clk_hw hw; | ||
void __iomem *base; | ||
}; | ||
|
||
#define to_clk_pllv1(clk) (container_of(clk, struct clk_pllv1, clk)) | ||
|
||
static unsigned long clk_pllv1_recalc_rate(struct clk_hw *hw, | ||
unsigned long parent_rate) | ||
{ | ||
struct clk_pllv1 *pll = to_clk_pllv1(hw); | ||
|
||
return mxc_decode_pll(readl(pll->base), parent_rate); | ||
} | ||
|
||
struct clk_ops clk_pllv1_ops = { | ||
.recalc_rate = clk_pllv1_recalc_rate, | ||
}; | ||
|
||
struct clk *imx_clk_pllv1(const char *name, const char *parent, | ||
void __iomem *base) | ||
{ | ||
struct clk_pllv1 *pll; | ||
struct clk *clk; | ||
struct clk_init_data init; | ||
|
||
pll = kmalloc(sizeof(*pll), GFP_KERNEL); | ||
if (!pll) | ||
return ERR_PTR(-ENOMEM); | ||
|
||
pll->base = base; | ||
|
||
init.name = name; | ||
init.ops = &clk_pllv1_ops; | ||
init.flags = 0; | ||
init.parent_names = &parent; | ||
init.num_parents = 1; | ||
|
||
pll->hw.init = &init; | ||
|
||
clk = clk_register(NULL, &pll->hw); | ||
if (IS_ERR(clk)) | ||
kfree(pll); | ||
|
||
return clk; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters