aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2014-07-23 09:00:49 -0400
committerJason Cooper <jason@lakedaemon.net>2014-07-24 07:47:20 -0400
commitc3c7fe7ce0d8a3ef55ebb88f3b24e074735845dd (patch)
tree40fe9570c822e474f0a1c0d093755fb583437ab5
parentf50ee824713863016dd684fe43c9eb472963f4fd (diff)
cpuidle: mvebu: add Armada 370 support
This commit adds the list of cpuidle states supported by the Armada 370 SoC in the cpuidle-mvebu-v7 driver, as well as the necessary logic around it to support this SoC. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lkml.kernel.org/r/1406120453-29291-13-git-send-email-thomas.petazzoni@free-electrons.com Signed-off-by: Jason Cooper <jason@lakedaemon.net>
-rw-r--r--drivers/cpuidle/cpuidle-mvebu-v7.c35
1 files changed, 33 insertions, 2 deletions
diff --git a/drivers/cpuidle/cpuidle-mvebu-v7.c b/drivers/cpuidle/cpuidle-mvebu-v7.c
index 7252fd8e4ef3..d23597f25093 100644
--- a/drivers/cpuidle/cpuidle-mvebu-v7.c
+++ b/drivers/cpuidle/cpuidle-mvebu-v7.c
@@ -70,11 +70,32 @@ static struct cpuidle_driver armadaxp_idle_driver = {
70 .state_count = 3, 70 .state_count = 3,
71}; 71};
72 72
73static struct cpuidle_driver armada370_idle_driver = {
74 .name = "armada_370_idle",
75 .states[0] = ARM_CPUIDLE_WFI_STATE,
76 .states[1] = {
77 .enter = mvebu_v7_enter_idle,
78 .exit_latency = 100,
79 .power_usage = 5,
80 .target_residency = 1000,
81 .flags = (CPUIDLE_FLAG_TIME_VALID |
82 MVEBU_V7_FLAG_DEEP_IDLE),
83 .name = "Deep Idle",
84 .desc = "CPU and L2 Fabric power down",
85 },
86 .state_count = 2,
87};
88
73static int mvebu_v7_cpuidle_probe(struct platform_device *pdev) 89static int mvebu_v7_cpuidle_probe(struct platform_device *pdev)
74{ 90{
75
76 mvebu_v7_cpu_suspend = pdev->dev.platform_data; 91 mvebu_v7_cpu_suspend = pdev->dev.platform_data;
77 return cpuidle_register(&armadaxp_idle_driver, NULL); 92
93 if (!strcmp(pdev->dev.driver->name, "cpuidle-armada-xp"))
94 return cpuidle_register(&armadaxp_idle_driver, NULL);
95 else if (!strcmp(pdev->dev.driver->name, "cpuidle-armada-370"))
96 return cpuidle_register(&armada370_idle_driver, NULL);
97 else
98 return -EINVAL;
78} 99}
79 100
80static struct platform_driver armadaxp_cpuidle_plat_driver = { 101static struct platform_driver armadaxp_cpuidle_plat_driver = {
@@ -87,6 +108,16 @@ static struct platform_driver armadaxp_cpuidle_plat_driver = {
87 108
88module_platform_driver(armadaxp_cpuidle_plat_driver); 109module_platform_driver(armadaxp_cpuidle_plat_driver);
89 110
111static struct platform_driver armada370_cpuidle_plat_driver = {
112 .driver = {
113 .name = "cpuidle-armada-370",
114 .owner = THIS_MODULE,
115 },
116 .probe = mvebu_v7_cpuidle_probe,
117};
118
119module_platform_driver(armada370_cpuidle_plat_driver);
120
90MODULE_AUTHOR("Gregory CLEMENT <gregory.clement@free-electrons.com>"); 121MODULE_AUTHOR("Gregory CLEMENT <gregory.clement@free-electrons.com>");
91MODULE_DESCRIPTION("Marvell EBU v7 cpuidle driver"); 122MODULE_DESCRIPTION("Marvell EBU v7 cpuidle driver");
92MODULE_LICENSE("GPL"); 123MODULE_LICENSE("GPL");