12 #include <linux/slab.h>
15 #include <linux/types.h>
16 #include <mach/hardware.h>
20 #define PRCC_PCKEN 0x000
21 #define PRCC_PCKDIS 0x004
22 #define PRCC_KCKEN 0x008
23 #define PRCC_KCKDIS 0x00C
24 #define PRCC_PCKSR 0x010
25 #define PRCC_KCKSR 0x014
27 #define to_clk_prcc(_hw) container_of(_hw, struct clk_prcc, hw)
38 static int clk_prcc_pclk_enable(
struct clk_hw *
hw)
50 static void clk_prcc_pclk_disable(
struct clk_hw *
hw)
58 static int clk_prcc_kclk_enable(
struct clk_hw *
hw)
70 static void clk_prcc_kclk_disable(
struct clk_hw *hw)
78 static int clk_prcc_is_enabled(
struct clk_hw *hw)
84 static struct clk_ops clk_prcc_pclk_ops = {
85 .enable = clk_prcc_pclk_enable,
86 .disable = clk_prcc_pclk_disable,
87 .is_enabled = clk_prcc_is_enabled,
90 static struct clk_ops clk_prcc_kclk_ops = {
91 .enable = clk_prcc_kclk_enable,
92 .disable = clk_prcc_kclk_disable,
93 .is_enabled = clk_prcc_is_enabled,
96 static struct clk *clk_reg_prcc(
const char *
name,
97 const char *parent_name,
104 struct clk_init_data clk_prcc_init;
108 pr_err(
"clk_prcc: %s invalid arguments passed\n", __func__);
114 pr_err(
"clk_prcc: %s could not allocate clk\n", __func__);
125 clk_prcc_init.name =
name;
126 clk_prcc_init.ops = clk_prcc_ops;
127 clk_prcc_init.flags =
flags;
128 clk_prcc_init.parent_names = (parent_name ? &parent_name :
NULL);
129 clk_prcc_init.num_parents = (parent_name ? 1 : 0);
130 clk->
hw.init = &clk_prcc_init;
133 if (IS_ERR_OR_NULL(clk_reg))
142 pr_err(
"clk_prcc: %s failed to register clk\n", __func__);
147 const char *parent_name,
152 return clk_reg_prcc(name, parent_name, phy_base, cg_sel, flags,
157 const char *parent_name,
162 return clk_reg_prcc(name, parent_name, phy_base, cg_sel, flags,