Release 4.12 drivers/cpufreq/dbx500-cpufreq.c
  
  
  
/*
 * Copyright (C) STMicroelectronics 2009
 * Copyright (C) ST-Ericsson SA 2010-2012
 *
 * License Terms: GNU General Public License v2
 * Author: Sundar Iyer <sundar.iyer@stericsson.com>
 * Author: Martin Persson <martin.persson@stericsson.com>
 * Author: Jonas Aaberg <jonas.aberg@stericsson.com>
 */
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/cpufreq.h>
#include <linux/cpu_cooling.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/platform_device.h>
#include <linux/clk.h>
static struct cpufreq_frequency_table *freq_table;
static struct clk *armss_clk;
static struct thermal_cooling_device *cdev;
static int dbx500_cpufreq_target(struct cpufreq_policy *policy,
				unsigned int index)
{
	/* update armss clk frequency */
	return clk_set_rate(armss_clk, freq_table[index].frequency * 1000);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp | 
| Martin Persson | 16 | 51.61% | 1 | 16.67% | 
| Viresh Kumar | 7 | 22.58% | 2 | 33.33% | 
| Ulf Hansson | 4 | 12.90% | 1 | 16.67% | 
| Jonas Aaberg | 3 | 9.68% | 1 | 16.67% | 
| Lee Jones | 1 | 3.23% | 1 | 16.67% | 
| Total | 31 | 100.00% | 6 | 100.00% | 
static int dbx500_cpufreq_init(struct cpufreq_policy *policy)
{
	policy->clk = armss_clk;
	return cpufreq_generic_init(policy, freq_table, 20 * 1000);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp | 
| Martin Persson | 18 | 62.07% | 1 | 20.00% | 
| Viresh Kumar | 9 | 31.03% | 2 | 40.00% | 
| Lee Jones | 1 | 3.45% | 1 | 20.00% | 
| Linus Walleij | 1 | 3.45% | 1 | 20.00% | 
| Total | 29 | 100.00% | 5 | 100.00% | 
static int dbx500_cpufreq_exit(struct cpufreq_policy *policy)
{
	if (!IS_ERR(cdev))
		cpufreq_cooling_unregister(cdev);
	return 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp | 
| Viresh Kumar | 27 | 100.00% | 1 | 100.00% | 
| Total | 27 | 100.00% | 1 | 100.00% | 
static void dbx500_cpufreq_ready(struct cpufreq_policy *policy)
{
	cdev = cpufreq_cooling_register(policy->cpus);
	if (IS_ERR(cdev))
		pr_err("Failed to register cooling device %ld\n", PTR_ERR(cdev));
	else
		pr_info("Cooling device registered: %s\n", cdev->type);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp | 
| Viresh Kumar | 47 | 100.00% | 1 | 100.00% | 
| Total | 47 | 100.00% | 1 | 100.00% | 
static struct cpufreq_driver dbx500_cpufreq_driver = {
	.flags  = CPUFREQ_STICKY | CPUFREQ_CONST_LOOPS |
			CPUFREQ_NEED_INITIAL_FREQ_CHECK,
	.verify = cpufreq_generic_frequency_table_verify,
	.target_index = dbx500_cpufreq_target,
	.get    = cpufreq_generic_get,
	.init   = dbx500_cpufreq_init,
	.exit  = dbx500_cpufreq_exit,
	.ready  = dbx500_cpufreq_ready,
	.name   = "DBX500",
	.attr   = cpufreq_generic_attr,
};
static int dbx500_cpufreq_probe(struct platform_device *pdev)
{
	struct cpufreq_frequency_table *pos;
	freq_table = dev_get_platdata(&pdev->dev);
	if (!freq_table) {
		pr_err("dbx500-cpufreq: Failed to fetch cpufreq table\n");
		return -ENODEV;
	}
	armss_clk = clk_get(&pdev->dev, "armss");
	if (IS_ERR(armss_clk)) {
		pr_err("dbx500-cpufreq: Failed to get armss clk\n");
		return PTR_ERR(armss_clk);
	}
	pr_info("dbx500-cpufreq: Available frequencies:\n");
	cpufreq_for_each_entry(pos, freq_table)
		pr_info("  %d Mhz\n", pos->frequency / 1000);
	return cpufreq_register_driver(&dbx500_cpufreq_driver);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp | 
| Ulf Hansson | 86 | 83.50% | 3 | 50.00% | 
| Stratos Karafotis | 12 | 11.65% | 1 | 16.67% | 
| Lee Jones | 3 | 2.91% | 1 | 16.67% | 
| Jonas Aaberg | 2 | 1.94% | 1 | 16.67% | 
| Total | 103 | 100.00% | 6 | 100.00% | 
static struct platform_driver dbx500_cpufreq_plat_driver = {
	.driver = {
		.name = "cpufreq-ux500",
        },
	.probe = dbx500_cpufreq_probe,
};
static int __init dbx500_cpufreq_register(void)
{
	return platform_driver_register(&dbx500_cpufreq_plat_driver);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp | 
| Martin Persson | 12 | 75.00% | 1 | 25.00% | 
| Lee Jones | 2 | 12.50% | 1 | 25.00% | 
| Ulf Hansson | 1 | 6.25% | 1 | 25.00% | 
| Linus Walleij | 1 | 6.25% | 1 | 25.00% | 
| Total | 16 | 100.00% | 4 | 100.00% | 
device_initcall(dbx500_cpufreq_register);
MODULE_LICENSE("GPL v2");
MODULE_DESCRIPTION("cpufreq driver for DBX500");
Overall Contributors
| Person | Tokens | Prop | Commits | CommitProp | 
| Ulf Hansson | 133 | 34.19% | 4 | 22.22% | 
| Viresh Kumar | 115 | 29.56% | 7 | 38.89% | 
| Martin Persson | 99 | 25.45% | 1 | 5.56% | 
| Lee Jones | 17 | 4.37% | 2 | 11.11% | 
| Stratos Karafotis | 12 | 3.08% | 1 | 5.56% | 
| Linus Walleij | 6 | 1.54% | 1 | 5.56% | 
| Jonas Aaberg | 5 | 1.29% | 1 | 5.56% | 
| Fabio Baltieri | 2 | 0.51% | 1 | 5.56% | 
| Total | 389 | 100.00% | 18 | 100.00% | 
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.