4 #include <linux/pm_opp.h>
5 #include <linux/platform_device.h>
7 static const struct of_device_id machines
[] __initconst
= {
8 { .compatible
= "sigma,tango4" },
12 static int __init
tango_cpufreq_init(void)
14 struct device
*cpu_dev
= get_cpu_device(0);
15 unsigned long max_freq
;
19 if (!of_match_node(machines
, of_root
))
22 cpu_clk
= clk_get(cpu_dev
, NULL
);
26 max_freq
= clk_get_rate(cpu_clk
);
28 dev_pm_opp_add(cpu_dev
, max_freq
/ 1, 0);
29 dev_pm_opp_add(cpu_dev
, max_freq
/ 2, 0);
30 dev_pm_opp_add(cpu_dev
, max_freq
/ 3, 0);
31 dev_pm_opp_add(cpu_dev
, max_freq
/ 5, 0);
32 dev_pm_opp_add(cpu_dev
, max_freq
/ 9, 0);
34 res
= platform_device_register_data(NULL
, "cpufreq-dt", -1, NULL
, 0);
36 return PTR_ERR_OR_ZERO(res
);
38 device_initcall(tango_cpufreq_init
);