mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
Power management and ACPI updates for 3.10-rc1
- ARM big.LITTLE cpufreq driver from Viresh Kumar.
- exynos5440 cpufreq driver from Amit Daniel Kachhap.
- cpufreq core cleanup and code consolidation from Viresh Kumar and
Stratos Karafotis.
- cpufreq scalability improvement from Nathan Zimmer.
- AMD "frequency sensitivity feedback" powersave bias for the ondemand
cpufreq governor from Jacob Shin.
- cpuidle code consolidation and cleanups from Daniel Lezcano.
- ARM OMAP cpuidle fixes from Santosh Shilimkar and Daniel Lezcano.
- ACPICA fixes and other improvements from Bob Moore, Jung-uk Kim,
Lv Zheng, Yinghai Lu, Tang Chen, Colin Ian King, and Linn Crosetto.
- ACPI core updates related to hotplug from Toshi Kani, Paul Bolle,
Yasuaki Ishimatsu, and Rafael J. Wysocki.
- Intel Lynxpoint LPSS (Low-Power Subsystem) support improvements
from Rafael J. Wysocki and Andy Shevchenko.
/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
iQIcBAABAgAGBQJRf8M8AAoJEKhOf7ml8uNsud4P/3cabXP5lDipzibRrpOiONse
puuvIdhtNdMRMc3t1oSDjNH/w/JA51Gc+ICGFAORiyVmqxBc85mpT6J5ibqV7hNd
pCqbKJceoB5PajHZSx22e4wG9O7YN1k3r80p38IfFzA+Ct0KNSuE0ixMEfHKYjiq
p5pXswk6TY3gtBReH9agrafHqDtXw4IMTE0asMuJ+BorPW7vQeiNlrkuA+0qmDuu
26O0Pm2TVkx1ryfTjdM9zSZ9X2G4JuM8rm1/VFZWQJTExwlv3bA2Za1nvQNJlJ99
6JZ0JXfAehcEW2Ye0sqsZ8HSEabDVHM29QvvOszJ5RpBXERiOCHOkhvFleCoTpn0
Xq0rtXPrLMH1G28Ej+cxmsAjfzOLV2Byg30CAoI/GCLuQ+xh+VMCpuNYQuld25CG
9rtYd0fWESeYsAebhDcX0E3xyzJtbrHtOb9PyGwNkbAJ8YQfhVSMCOPi2SX2wa+Q
qXLXi2VaHvjBSUKcAv5BmM+Ya57Be+88D0LxbgXbUeOnYefUK1ljldKDDshkMjgG
P4LPdm4JpoB5ncXSOO1Dz9w9QnNcFexSUySd/TtKLNMha1vEHV8ISzNPYY+9IdXf
XN0VZbFnUDzdj+Fwna7zyFb1cGihDYJKAtpXvRd8Y6RGUxKx9uGLAFJZw/xZB/cR
KZKuML5O8MgJuef37F38
=H/se
-----END PGP SIGNATURE-----
Merge tag 'pm+acpi-3.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull power management and ACPI updates from Rafael J Wysocki:
- ARM big.LITTLE cpufreq driver from Viresh Kumar.
- exynos5440 cpufreq driver from Amit Daniel Kachhap.
- cpufreq core cleanup and code consolidation from Viresh Kumar and
Stratos Karafotis.
- cpufreq scalability improvement from Nathan Zimmer.
- AMD "frequency sensitivity feedback" powersave bias for the ondemand
cpufreq governor from Jacob Shin.
- cpuidle code consolidation and cleanups from Daniel Lezcano.
- ARM OMAP cpuidle fixes from Santosh Shilimkar and Daniel Lezcano.
- ACPICA fixes and other improvements from Bob Moore, Jung-uk Kim, Lv
Zheng, Yinghai Lu, Tang Chen, Colin Ian King, and Linn Crosetto.
- ACPI core updates related to hotplug from Toshi Kani, Paul Bolle,
Yasuaki Ishimatsu, and Rafael J Wysocki.
- Intel Lynxpoint LPSS (Low-Power Subsystem) support improvements from
Rafael J Wysocki and Andy Shevchenko.
* tag 'pm+acpi-3.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (192 commits)
cpufreq: Revert incorrect commit 5800043
cpufreq: MAINTAINERS: Add co-maintainer
cpuidle: add maintainer entry
ACPI / thermal: do not always return THERMAL_TREND_RAISING for active trip points
ARM: s3c64xx: cpuidle: use init/exit common routine
cpufreq: pxa2xx: initialize variables
ACPI: video: correct acpi_video_bus_add error processing
SH: cpuidle: use init/exit common routine
ARM: S5pv210: compiling issue, ARM_S5PV210_CPUFREQ needs CONFIG_CPU_FREQ_TABLE=y
ACPI: Fix wrong parameter passed to memblock_reserve
cpuidle: fix comment format
pnp: use %*phC to dump small buffers
isapnp: remove debug leftovers
ARM: imx: cpuidle: use init/exit common routine
ARM: davinci: cpuidle: use init/exit common routine
ARM: kirkwood: cpuidle: use init/exit common routine
ARM: calxeda: cpuidle: use init/exit common routine
ARM: tegra: cpuidle: use init/exit common routine for tegra3
ARM: tegra: cpuidle: use init/exit common routine for tegra2
ARM: OMAP4: cpuidle: use init/exit common routine
...
This commit is contained in:
commit
3ed1c478ef
253 changed files with 6938 additions and 4145 deletions
|
|
@ -3,7 +3,6 @@
|
|||
#
|
||||
|
||||
obj-y := dma.o pinmux.o io.o arbiter.o
|
||||
obj-$(CONFIG_CPU_FREQ) += cpufreq.o
|
||||
|
||||
clean:
|
||||
|
||||
|
|
|
|||
|
|
@ -1,152 +0,0 @@
|
|||
#include <linux/init.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/cpufreq.h>
|
||||
#include <hwregs/reg_map.h>
|
||||
#include <hwregs/reg_rdwr.h>
|
||||
#include <hwregs/clkgen_defs.h>
|
||||
#include <hwregs/ddr2_defs.h>
|
||||
|
||||
static int
|
||||
cris_sdram_freq_notifier(struct notifier_block *nb, unsigned long val,
|
||||
void *data);
|
||||
|
||||
static struct notifier_block cris_sdram_freq_notifier_block = {
|
||||
.notifier_call = cris_sdram_freq_notifier
|
||||
};
|
||||
|
||||
static struct cpufreq_frequency_table cris_freq_table[] = {
|
||||
{0x01, 6000},
|
||||
{0x02, 200000},
|
||||
{0, CPUFREQ_TABLE_END},
|
||||
};
|
||||
|
||||
static unsigned int cris_freq_get_cpu_frequency(unsigned int cpu)
|
||||
{
|
||||
reg_clkgen_rw_clk_ctrl clk_ctrl;
|
||||
clk_ctrl = REG_RD(clkgen, regi_clkgen, rw_clk_ctrl);
|
||||
return clk_ctrl.pll ? 200000 : 6000;
|
||||
}
|
||||
|
||||
static void cris_freq_set_cpu_state(unsigned int state)
|
||||
{
|
||||
int i = 0;
|
||||
struct cpufreq_freqs freqs;
|
||||
reg_clkgen_rw_clk_ctrl clk_ctrl;
|
||||
clk_ctrl = REG_RD(clkgen, regi_clkgen, rw_clk_ctrl);
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
for_each_present_cpu(i)
|
||||
#endif
|
||||
{
|
||||
freqs.old = cris_freq_get_cpu_frequency(i);
|
||||
freqs.new = cris_freq_table[state].frequency;
|
||||
freqs.cpu = i;
|
||||
}
|
||||
|
||||
cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
|
||||
|
||||
local_irq_disable();
|
||||
|
||||
/* Even though we may be SMP they will share the same clock
|
||||
* so all settings are made on CPU0. */
|
||||
if (cris_freq_table[state].frequency == 200000)
|
||||
clk_ctrl.pll = 1;
|
||||
else
|
||||
clk_ctrl.pll = 0;
|
||||
REG_WR(clkgen, regi_clkgen, rw_clk_ctrl, clk_ctrl);
|
||||
|
||||
local_irq_enable();
|
||||
|
||||
cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
|
||||
};
|
||||
|
||||
static int cris_freq_verify(struct cpufreq_policy *policy)
|
||||
{
|
||||
return cpufreq_frequency_table_verify(policy, &cris_freq_table[0]);
|
||||
}
|
||||
|
||||
static int cris_freq_target(struct cpufreq_policy *policy,
|
||||
unsigned int target_freq,
|
||||
unsigned int relation)
|
||||
{
|
||||
unsigned int newstate = 0;
|
||||
|
||||
if (cpufreq_frequency_table_target(policy, cris_freq_table,
|
||||
target_freq, relation, &newstate))
|
||||
return -EINVAL;
|
||||
|
||||
cris_freq_set_cpu_state(newstate);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int cris_freq_cpu_init(struct cpufreq_policy *policy)
|
||||
{
|
||||
int result;
|
||||
|
||||
/* cpuinfo and default policy values */
|
||||
policy->cpuinfo.transition_latency = 1000000; /* 1ms */
|
||||
policy->cur = cris_freq_get_cpu_frequency(0);
|
||||
|
||||
result = cpufreq_frequency_table_cpuinfo(policy, cris_freq_table);
|
||||
if (result)
|
||||
return (result);
|
||||
|
||||
cpufreq_frequency_table_get_attr(cris_freq_table, policy->cpu);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int cris_freq_cpu_exit(struct cpufreq_policy *policy)
|
||||
{
|
||||
cpufreq_frequency_table_put_attr(policy->cpu);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static struct freq_attr *cris_freq_attr[] = {
|
||||
&cpufreq_freq_attr_scaling_available_freqs,
|
||||
NULL,
|
||||
};
|
||||
|
||||
static struct cpufreq_driver cris_freq_driver = {
|
||||
.get = cris_freq_get_cpu_frequency,
|
||||
.verify = cris_freq_verify,
|
||||
.target = cris_freq_target,
|
||||
.init = cris_freq_cpu_init,
|
||||
.exit = cris_freq_cpu_exit,
|
||||
.name = "cris_freq",
|
||||
.owner = THIS_MODULE,
|
||||
.attr = cris_freq_attr,
|
||||
};
|
||||
|
||||
static int __init cris_freq_init(void)
|
||||
{
|
||||
int ret;
|
||||
ret = cpufreq_register_driver(&cris_freq_driver);
|
||||
cpufreq_register_notifier(&cris_sdram_freq_notifier_block,
|
||||
CPUFREQ_TRANSITION_NOTIFIER);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int
|
||||
cris_sdram_freq_notifier(struct notifier_block *nb, unsigned long val,
|
||||
void *data)
|
||||
{
|
||||
int i;
|
||||
struct cpufreq_freqs *freqs = data;
|
||||
if (val == CPUFREQ_PRECHANGE) {
|
||||
reg_ddr2_rw_cfg cfg =
|
||||
REG_RD(ddr2, regi_ddr2_ctrl, rw_cfg);
|
||||
cfg.ref_interval = (freqs->new == 200000 ? 1560 : 46);
|
||||
|
||||
if (freqs->new == 200000)
|
||||
for (i = 0; i < 50000; i++);
|
||||
REG_WR(bif_core, regi_bif_core, rw_sdram_timing, timing);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
module_init(cris_freq_init);
|
||||
|
|
@ -3,7 +3,6 @@
|
|||
#
|
||||
|
||||
obj-y := dma.o pinmux.o io.o arbiter.o
|
||||
obj-$(CONFIG_CPU_FREQ) += cpufreq.o
|
||||
|
||||
clean:
|
||||
|
||||
|
|
|
|||
|
|
@ -1,145 +0,0 @@
|
|||
#include <linux/init.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/cpufreq.h>
|
||||
#include <hwregs/reg_map.h>
|
||||
#include <arch/hwregs/reg_rdwr.h>
|
||||
#include <arch/hwregs/config_defs.h>
|
||||
#include <arch/hwregs/bif_core_defs.h>
|
||||
|
||||
static int
|
||||
cris_sdram_freq_notifier(struct notifier_block *nb, unsigned long val,
|
||||
void *data);
|
||||
|
||||
static struct notifier_block cris_sdram_freq_notifier_block = {
|
||||
.notifier_call = cris_sdram_freq_notifier
|
||||
};
|
||||
|
||||
static struct cpufreq_frequency_table cris_freq_table[] = {
|
||||
{0x01, 6000},
|
||||
{0x02, 200000},
|
||||
{0, CPUFREQ_TABLE_END},
|
||||
};
|
||||
|
||||
static unsigned int cris_freq_get_cpu_frequency(unsigned int cpu)
|
||||
{
|
||||
reg_config_rw_clk_ctrl clk_ctrl;
|
||||
clk_ctrl = REG_RD(config, regi_config, rw_clk_ctrl);
|
||||
return clk_ctrl.pll ? 200000 : 6000;
|
||||
}
|
||||
|
||||
static void cris_freq_set_cpu_state(unsigned int state)
|
||||
{
|
||||
int i;
|
||||
struct cpufreq_freqs freqs;
|
||||
reg_config_rw_clk_ctrl clk_ctrl;
|
||||
clk_ctrl = REG_RD(config, regi_config, rw_clk_ctrl);
|
||||
|
||||
for_each_possible_cpu(i) {
|
||||
freqs.old = cris_freq_get_cpu_frequency(i);
|
||||
freqs.new = cris_freq_table[state].frequency;
|
||||
freqs.cpu = i;
|
||||
}
|
||||
|
||||
cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
|
||||
|
||||
local_irq_disable();
|
||||
|
||||
/* Even though we may be SMP they will share the same clock
|
||||
* so all settings are made on CPU0. */
|
||||
if (cris_freq_table[state].frequency == 200000)
|
||||
clk_ctrl.pll = 1;
|
||||
else
|
||||
clk_ctrl.pll = 0;
|
||||
REG_WR(config, regi_config, rw_clk_ctrl, clk_ctrl);
|
||||
|
||||
local_irq_enable();
|
||||
|
||||
cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
|
||||
};
|
||||
|
||||
static int cris_freq_verify(struct cpufreq_policy *policy)
|
||||
{
|
||||
return cpufreq_frequency_table_verify(policy, &cris_freq_table[0]);
|
||||
}
|
||||
|
||||
static int cris_freq_target(struct cpufreq_policy *policy,
|
||||
unsigned int target_freq, unsigned int relation)
|
||||
{
|
||||
unsigned int newstate = 0;
|
||||
|
||||
if (cpufreq_frequency_table_target
|
||||
(policy, cris_freq_table, target_freq, relation, &newstate))
|
||||
return -EINVAL;
|
||||
|
||||
cris_freq_set_cpu_state(newstate);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int cris_freq_cpu_init(struct cpufreq_policy *policy)
|
||||
{
|
||||
int result;
|
||||
|
||||
/* cpuinfo and default policy values */
|
||||
policy->cpuinfo.transition_latency = 1000000; /* 1ms */
|
||||
policy->cur = cris_freq_get_cpu_frequency(0);
|
||||
|
||||
result = cpufreq_frequency_table_cpuinfo(policy, cris_freq_table);
|
||||
if (result)
|
||||
return (result);
|
||||
|
||||
cpufreq_frequency_table_get_attr(cris_freq_table, policy->cpu);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int cris_freq_cpu_exit(struct cpufreq_policy *policy)
|
||||
{
|
||||
cpufreq_frequency_table_put_attr(policy->cpu);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct freq_attr *cris_freq_attr[] = {
|
||||
&cpufreq_freq_attr_scaling_available_freqs,
|
||||
NULL,
|
||||
};
|
||||
|
||||
static struct cpufreq_driver cris_freq_driver = {
|
||||
.get = cris_freq_get_cpu_frequency,
|
||||
.verify = cris_freq_verify,
|
||||
.target = cris_freq_target,
|
||||
.init = cris_freq_cpu_init,
|
||||
.exit = cris_freq_cpu_exit,
|
||||
.name = "cris_freq",
|
||||
.owner = THIS_MODULE,
|
||||
.attr = cris_freq_attr,
|
||||
};
|
||||
|
||||
static int __init cris_freq_init(void)
|
||||
{
|
||||
int ret;
|
||||
ret = cpufreq_register_driver(&cris_freq_driver);
|
||||
cpufreq_register_notifier(&cris_sdram_freq_notifier_block,
|
||||
CPUFREQ_TRANSITION_NOTIFIER);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int
|
||||
cris_sdram_freq_notifier(struct notifier_block *nb, unsigned long val,
|
||||
void *data)
|
||||
{
|
||||
int i;
|
||||
struct cpufreq_freqs *freqs = data;
|
||||
if (val == CPUFREQ_PRECHANGE) {
|
||||
reg_bif_core_rw_sdram_timing timing =
|
||||
REG_RD(bif_core, regi_bif_core, rw_sdram_timing);
|
||||
timing.cpd = (freqs->new == 200000 ? 0 : 1);
|
||||
|
||||
if (freqs->new == 200000)
|
||||
for (i = 0; i < 50000; i++) ;
|
||||
REG_WR(bif_core, regi_bif_core, rw_sdram_timing, timing);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
module_init(cris_freq_init);
|
||||
Loading…
Reference in a new issue