Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 260604
b: refs/heads/master
c: ef7a474
h: refs/heads/master
v: v3
  • Loading branch information
Linus Walleij committed Jun 23, 2011
1 parent f1b4075 commit 2e159c8
Show file tree
Hide file tree
Showing 2 changed files with 49 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: 32d55ff91635c22dc853c532ec85dc16663d251f
refs/heads/master: ef7a474cef00594ccef432ce0840464e51ea4ac0
48 changes: 48 additions & 0 deletions trunk/arch/arm/mach-ux500/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <linux/clk.h>
#include <linux/io.h>
#include <linux/clkdev.h>
#include <linux/cpufreq.h>

#include <plat/mtu.h>
#include <mach/hardware.h>
Expand Down Expand Up @@ -759,6 +760,51 @@ static int __init clk_debugfs_init(void)
late_initcall(clk_debugfs_init);
#endif /* defined(CONFIG_DEBUG_FS) */

unsigned long clk_smp_twd_rate = 400000000;

unsigned long clk_smp_twd_get_rate(struct clk *clk)
{
return clk_smp_twd_rate;
}

static struct clk clk_smp_twd = {
.get_rate = clk_smp_twd_get_rate,
.name = "smp_twd",
};

static struct clk_lookup clk_smp_twd_lookup = {
.dev_id = "smp_twd",
.clk = &clk_smp_twd,
};

#ifdef CONFIG_CPU_FREQ

static int clk_twd_cpufreq_transition(struct notifier_block *nb,
unsigned long state, void *data)
{
struct cpufreq_freqs *f = data;

if (state == CPUFREQ_PRECHANGE) {
/* Save frequency in simple Hz */
clk_smp_twd_rate = f->new * 1000;
}

return NOTIFY_OK;
}

static struct notifier_block clk_twd_cpufreq_nb = {
.notifier_call = clk_twd_cpufreq_transition,
};

static int clk_init_smp_twd_cpufreq(void)
{
return cpufreq_register_notifier(&clk_twd_cpufreq_nb,
CPUFREQ_TRANSITION_NOTIFIER);
}
late_initcall(clk_init_smp_twd_cpufreq);

#endif

int __init clk_init(void)
{
if (cpu_is_u8500ed()) {
Expand All @@ -779,6 +825,8 @@ int __init clk_init(void)
else
clkdev_add_table(u8500_v1_clks, ARRAY_SIZE(u8500_v1_clks));

clkdev_add(&clk_smp_twd_lookup);

#ifdef CONFIG_DEBUG_FS
clk_debugfs_add_table(u8500_common_clks, ARRAY_SIZE(u8500_common_clks));
if (cpu_is_u8500ed())
Expand Down

0 comments on commit 2e159c8

Please sign in to comment.