diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-05-16 07:14:20 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-05-16 07:14:20 -0400 |
commit | 9051785f6928456db0692b8ca972778b9bf42099 (patch) | |
tree | f5e7f2e4a86b7571eea8d83a43b4838f45cf6d02 /drivers/cpuidle | |
parent | a6220fc19afc07fe77cfd16f5b8e568615517091 (diff) | |
parent | 7c7f8f7f2c6bf078874e5de35d7e2c66467fc664 (diff) |
Merge branch 'cpuidle/3.16' of git://git.linaro.org/people/daniel.lezcano/linux into pm-cpuidle
Pull ARM cpuidle updates for v3.16 from Daniel Lezcano.
* 'cpuidle/3.16' of git://git.linaro.org/people/daniel.lezcano/linux:
ARM: clps711x: Add cpuidle driver
Diffstat (limited to 'drivers/cpuidle')
-rw-r--r-- | drivers/cpuidle/Kconfig.arm | 6 | ||||
-rw-r--r-- | drivers/cpuidle/Makefile | 1 | ||||
-rw-r--r-- | drivers/cpuidle/cpuidle-clps711x.c | 64 |
3 files changed, 71 insertions, 0 deletions
diff --git a/drivers/cpuidle/Kconfig.arm b/drivers/cpuidle/Kconfig.arm index 97ccc31dbdd8..371e75d2348d 100644 --- a/drivers/cpuidle/Kconfig.arm +++ b/drivers/cpuidle/Kconfig.arm | |||
@@ -13,6 +13,12 @@ config ARM_BIG_LITTLE_CPUIDLE | |||
13 | define different C-states for little and big cores through the | 13 | define different C-states for little and big cores through the |
14 | multiple CPU idle drivers infrastructure. | 14 | multiple CPU idle drivers infrastructure. |
15 | 15 | ||
16 | config ARM_CLPS711X_CPUIDLE | ||
17 | bool "CPU Idle Driver for CLPS711X processors" | ||
18 | depends on ARCH_CLPS711X || COMPILE_TEST | ||
19 | help | ||
20 | Select this to enable cpuidle on Cirrus Logic CLPS711X SOCs. | ||
21 | |||
16 | config ARM_HIGHBANK_CPUIDLE | 22 | config ARM_HIGHBANK_CPUIDLE |
17 | bool "CPU Idle Driver for Calxeda processors" | 23 | bool "CPU Idle Driver for Calxeda processors" |
18 | depends on ARM_PSCI | 24 | depends on ARM_PSCI |
diff --git a/drivers/cpuidle/Makefile b/drivers/cpuidle/Makefile index f71ae1b373c5..534fff575823 100644 --- a/drivers/cpuidle/Makefile +++ b/drivers/cpuidle/Makefile | |||
@@ -8,6 +8,7 @@ obj-$(CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED) += coupled.o | |||
8 | ################################################################################## | 8 | ################################################################################## |
9 | # ARM SoC drivers | 9 | # ARM SoC drivers |
10 | obj-$(CONFIG_ARM_BIG_LITTLE_CPUIDLE) += cpuidle-big_little.o | 10 | obj-$(CONFIG_ARM_BIG_LITTLE_CPUIDLE) += cpuidle-big_little.o |
11 | obj-$(CONFIG_ARM_CLPS711X_CPUIDLE) += cpuidle-clps711x.o | ||
11 | obj-$(CONFIG_ARM_HIGHBANK_CPUIDLE) += cpuidle-calxeda.o | 12 | obj-$(CONFIG_ARM_HIGHBANK_CPUIDLE) += cpuidle-calxeda.o |
12 | obj-$(CONFIG_ARM_KIRKWOOD_CPUIDLE) += cpuidle-kirkwood.o | 13 | obj-$(CONFIG_ARM_KIRKWOOD_CPUIDLE) += cpuidle-kirkwood.o |
13 | obj-$(CONFIG_ARM_ZYNQ_CPUIDLE) += cpuidle-zynq.o | 14 | obj-$(CONFIG_ARM_ZYNQ_CPUIDLE) += cpuidle-zynq.o |
diff --git a/drivers/cpuidle/cpuidle-clps711x.c b/drivers/cpuidle/cpuidle-clps711x.c new file mode 100644 index 000000000000..5243811daa6e --- /dev/null +++ b/drivers/cpuidle/cpuidle-clps711x.c | |||
@@ -0,0 +1,64 @@ | |||
1 | /* | ||
2 | * CLPS711X CPU idle driver | ||
3 | * | ||
4 | * Copyright (C) 2014 Alexander Shiyan <shc_work@mail.ru> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | */ | ||
11 | |||
12 | #include <linux/cpuidle.h> | ||
13 | #include <linux/err.h> | ||
14 | #include <linux/io.h> | ||
15 | #include <linux/module.h> | ||
16 | #include <linux/platform_device.h> | ||
17 | |||
18 | #define CLPS711X_CPUIDLE_NAME "clps711x-cpuidle" | ||
19 | |||
20 | static void __iomem *clps711x_halt; | ||
21 | |||
22 | static int clps711x_cpuidle_halt(struct cpuidle_device *dev, | ||
23 | struct cpuidle_driver *drv, int index) | ||
24 | { | ||
25 | writel(0xaa, clps711x_halt); | ||
26 | |||
27 | return index; | ||
28 | } | ||
29 | |||
30 | static struct cpuidle_driver clps711x_idle_driver = { | ||
31 | .name = CLPS711X_CPUIDLE_NAME, | ||
32 | .owner = THIS_MODULE, | ||
33 | .states[0] = { | ||
34 | .name = "HALT", | ||
35 | .desc = "CLPS711X HALT", | ||
36 | .enter = clps711x_cpuidle_halt, | ||
37 | .exit_latency = 1, | ||
38 | }, | ||
39 | .state_count = 1, | ||
40 | }; | ||
41 | |||
42 | static int __init clps711x_cpuidle_probe(struct platform_device *pdev) | ||
43 | { | ||
44 | struct resource *res; | ||
45 | |||
46 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
47 | clps711x_halt = devm_ioremap_resource(&pdev->dev, res); | ||
48 | if (IS_ERR(clps711x_halt)) | ||
49 | return PTR_ERR(clps711x_halt); | ||
50 | |||
51 | return cpuidle_register(&clps711x_idle_driver, NULL); | ||
52 | } | ||
53 | |||
54 | static struct platform_driver clps711x_cpuidle_driver = { | ||
55 | .driver = { | ||
56 | .name = CLPS711X_CPUIDLE_NAME, | ||
57 | .owner = THIS_MODULE, | ||
58 | }, | ||
59 | }; | ||
60 | module_platform_driver_probe(clps711x_cpuidle_driver, clps711x_cpuidle_probe); | ||
61 | |||
62 | MODULE_AUTHOR("Alexander Shiyan <shc_work@mail.ru>"); | ||
63 | MODULE_DESCRIPTION("CLPS711X CPU idle driver"); | ||
64 | MODULE_LICENSE("GPL"); | ||