vdso: don't require 64-bit math in standalone test
[linux/fpc-iii.git] / drivers / cpuidle / cpuidle-clps711x.c
blob5243811daa6ea9c5d8ceeeb8cb9454f30c19ecc2
1 /*
2 * CLPS711X CPU idle driver
4 * Copyright (C) 2014 Alexander Shiyan <shc_work@mail.ru>
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.
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>
18 #define CLPS711X_CPUIDLE_NAME "clps711x-cpuidle"
20 static void __iomem *clps711x_halt;
22 static int clps711x_cpuidle_halt(struct cpuidle_device *dev,
23 struct cpuidle_driver *drv, int index)
25 writel(0xaa, clps711x_halt);
27 return index;
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,
39 .state_count = 1,
42 static int __init clps711x_cpuidle_probe(struct platform_device *pdev)
44 struct resource *res;
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);
51 return cpuidle_register(&clps711x_idle_driver, NULL);
54 static struct platform_driver clps711x_cpuidle_driver = {
55 .driver = {
56 .name = CLPS711X_CPUIDLE_NAME,
57 .owner = THIS_MODULE,
60 module_platform_driver_probe(clps711x_cpuidle_driver, clps711x_cpuidle_probe);
62 MODULE_AUTHOR("Alexander Shiyan <shc_work@mail.ru>");
63 MODULE_DESCRIPTION("CLPS711X CPU idle driver");
64 MODULE_LICENSE("GPL");