diff options
author | Haojian Zhuang <haojian.zhuang@linaro.org> | 2013-03-28 18:05:49 +0800 |
---|---|---|
committer | Haojian Zhuang <haojian.zhuang@linaro.org> | 2013-04-03 23:46:45 +0800 |
commit | 2c037e1c7da4c473c39b02e61a4b1f114f4d20bf (patch) | |
tree | 2bcee9909544c5d5c2c63d573ce9a0ee2eb07192 /drivers | |
parent | 43a5a88fb984c0bd3fc331a46cace8290af5687f (diff) |
clk: hi3xxx: support clocks in EDC domain
Some hw clocks are defined in EDC register domain. And the operations on
those clocks are same with other hi3xxx clocks. So append the support
in clk-hi3xxx driver.
Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/clk/hisilicon/clk-hi3xxx.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/clk/hisilicon/clk-hi3xxx.c b/drivers/clk/hisilicon/clk-hi3xxx.c index ce13c3907b6..c61041a3b49 100644 --- a/drivers/clk/hisilicon/clk-hi3xxx.c +++ b/drivers/clk/hisilicon/clk-hi3xxx.c @@ -49,6 +49,7 @@ enum { HS_PMCTRL, HS_SYSCTRL, + HS_EDC, }; struct hi3620_periclk { @@ -82,6 +83,7 @@ struct hi3620_divclk { struct hs_clk { void __iomem *pmctrl; void __iomem *sctrl; + void __iomem *edc; spinlock_t lock; }; @@ -383,7 +385,8 @@ void __init hs_fixed_factor_setup(struct device_node *np) return; parent_names[0] = of_clk_get_parent_name(np, 0); - clk = clk_register_fixed_factor(NULL, clk_name, parent_names[0], 0, + clk = clk_register_fixed_factor(NULL, clk_name, parent_names[0], + CLK_SET_RATE_PARENT, data[0], data[1]); if (IS_ERR(clk)) goto err; @@ -644,6 +647,7 @@ CLK_OF_DECLARE(hs_fixed, "hisilicon,clk-fixed-factor", hs_fixed_factor_setup) static const struct of_device_id hs_of_match[] = { { .compatible = "hisilicon,pmctrl", .data = (void *)HS_PMCTRL, }, { .compatible = "hisilicon,sysctrl", .data = (void *)HS_SYSCTRL, }, + { .compatible = "hisilicon,hi3620-fb", .data = (void *)HS_EDC, }, }; static void __iomem __init *hs_init_clocks(struct device_node *np) @@ -677,6 +681,15 @@ static void __iomem __init *hs_init_clocks(struct device_node *np) ret = hs_clk.sctrl; } break; + case HS_EDC: + if (!hs_clk.edc) { + ret = of_iomap(parent, 0); + WARN_ON(!ret); + hs_clk.edc = ret; + } else { + ret = hs_clk.edc; + } + break; } out: return ret; |