1d2912cb1SThomas Gleixner // SPDX-License-Identifier: GPL-2.0-only 21da177e4SLinus Torvalds /* 31da177e4SLinus Torvalds * linux/drivers/cpufreq/cpufreq_powersave.c 41da177e4SLinus Torvalds * 51da177e4SLinus Torvalds * Copyright (C) 2002 - 2003 Dominik Brodowski <linux@brodo.de> 61da177e4SLinus Torvalds */ 71da177e4SLinus Torvalds 8db701151SViresh Kumar #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 9db701151SViresh Kumar 101da177e4SLinus Torvalds #include <linux/cpufreq.h> 111da177e4SLinus Torvalds #include <linux/init.h> 125ff0a268SViresh Kumar #include <linux/module.h> 131da177e4SLinus Torvalds cpufreq_gov_powersave_limits(struct cpufreq_policy * policy)14e788892bSRafael J. Wysockistatic void cpufreq_gov_powersave_limits(struct cpufreq_policy *policy) 151da177e4SLinus Torvalds { 1616de72b9SRafael J. Wysocki pr_debug("setting to %u kHz\n", policy->min); 17e788892bSRafael J. Wysocki __cpufreq_driver_target(policy, policy->min, CPUFREQ_RELATION_L); 181da177e4SLinus Torvalds } 191da177e4SLinus Torvalds 20de1df26bSRafael J. Wysocki static struct cpufreq_governor cpufreq_gov_powersave = { 211da177e4SLinus Torvalds .name = "powersave", 22e788892bSRafael J. Wysocki .limits = cpufreq_gov_powersave_limits, 231da177e4SLinus Torvalds .owner = THIS_MODULE, 24*218f6687SRafael J. Wysocki .flags = CPUFREQ_GOV_STRICT_TARGET, 251da177e4SLinus Torvalds }; 261da177e4SLinus Torvalds 271da177e4SLinus Torvalds MODULE_AUTHOR("Dominik Brodowski <linux@brodo.de>"); 281da177e4SLinus Torvalds MODULE_DESCRIPTION("CPUfreq policy governor 'powersave'"); 291da177e4SLinus Torvalds MODULE_LICENSE("GPL"); 301da177e4SLinus Torvalds 3130d221dbSAlessandro Guido #ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE cpufreq_default_governor(void)32de1df26bSRafael J. Wysockistruct cpufreq_governor *cpufreq_default_governor(void) 33de1df26bSRafael J. Wysocki { 34de1df26bSRafael J. Wysocki return &cpufreq_gov_powersave; 35de1df26bSRafael J. Wysocki } 3630d221dbSAlessandro Guido #endif 3710dd8573SQuentin Perret 3810dd8573SQuentin Perret cpufreq_governor_init(cpufreq_gov_powersave); 3910dd8573SQuentin Perret cpufreq_governor_exit(cpufreq_gov_powersave); 40