Thermal: build thermal governors into thermal_sys module

The thermal governors are part of the thermal framework,
rather than a seperate feature/module.
Because the generic thermal layer can not work without
thermal governors, and it must load the thermal governors
during its initialization.

Build them into one module in this patch.

This also fix a problem that the generic thermal layer does not
work when CONFIG_THERMAL=m and CONFIG_THERMAL_GOV_XXX=y.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>
Acked-by: Durgadoss R <durgadoss.r@intel.com>
This commit is contained in:
Zhang Rui
2013-03-26 16:38:29 +08:00
parent 5fc024ab47
commit 80a26a5c22
8 changed files with 84 additions and 66 deletions

View File

@@ -22,9 +22,6 @@
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h>
#include <linux/thermal.h>
#include "thermal_core.h"
@@ -111,23 +108,15 @@ static int fair_share_throttle(struct thermal_zone_device *tz, int trip)
static struct thermal_governor thermal_gov_fair_share = {
.name = "fair_share",
.throttle = fair_share_throttle,
.owner = THIS_MODULE,
};
static int __init thermal_gov_fair_share_init(void)
int thermal_gov_fair_share_register(void)
{
return thermal_register_governor(&thermal_gov_fair_share);
}
static void __exit thermal_gov_fair_share_exit(void)
void thermal_gov_fair_share_unregister(void)
{
thermal_unregister_governor(&thermal_gov_fair_share);
}
/* This should load after thermal framework */
fs_initcall(thermal_gov_fair_share_init);
module_exit(thermal_gov_fair_share_exit);
MODULE_AUTHOR("Durgadoss R");
MODULE_DESCRIPTION("A simple weight based thermal throttling governor");
MODULE_LICENSE("GPL");