From: nicolas.ferre@atmel•com (Nicolas Ferre)
To: linux-arm-kernel@lists•infradead.org
Subject: [RFC patch 2/2] ARM: at91: cpuidle: move the driver to drivers/cpuidle directory
Date: Mon, 15 Apr 2013 16:14:08 +0200 [thread overview]
Message-ID: <516C0B30.501@atmel.com> (raw)
In-Reply-To: <1366032598-23053-3-git-send-email-daniel.lezcano@linaro.org>
On 04/15/2013 03:29 PM, Daniel Lezcano :
> We don't have any dependency with the SoC specific code.
>
> Move the driver to the drivers/cpuidle directory.
>
> Add Nicolas Ferre as author of the driver, so it will be in copy of the emails.
Unfortunately, I am not the author of this driver. It is the work of
Albin Tonnerre <albin.tonnerre@free-electrons•com>. So, for sure, I (and
Jean-Christohpe) can babysit this code but I cannot be awarded for it...
You can certainly add to the header of this file:
Maintained by the AT91 crew: Nicolas Ferre, Jean-Christophe
Plagniol-Villard (together with email addresses).
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro•org>
> ---
> arch/arm/mach-at91/Makefile | 1 -
> arch/arm/mach-at91/cpuidle.c | 55 ----------------------------------------
> drivers/cpuidle/Makefile | 1 +
> drivers/cpuidle/at91.c | 57 ++++++++++++++++++++++++++++++++++++++++++
No, sorry this file name is not appropriate: I prefer cpuidle-at91.c
> 4 files changed, 58 insertions(+), 56 deletions(-)
> delete mode 100644 arch/arm/mach-at91/cpuidle.c
> create mode 100644 drivers/cpuidle/at91.c
>
> diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
> index 39218ca..3c7fca1 100644
> --- a/arch/arm/mach-at91/Makefile
> +++ b/arch/arm/mach-at91/Makefile
> @@ -99,7 +99,6 @@ obj-y += leds.o
> # Power Management
> obj-$(CONFIG_PM) += pm.o
> obj-$(CONFIG_AT91_SLOW_CLOCK) += pm_slowclock.o
> -obj-$(CONFIG_CPU_IDLE) += cpuidle.o
>
> ifeq ($(CONFIG_PM_DEBUG),y)
> CFLAGS_pm.o += -DDEBUG
> diff --git a/arch/arm/mach-at91/cpuidle.c b/arch/arm/mach-at91/cpuidle.c
> deleted file mode 100644
> index b2bec92..0000000
> --- a/arch/arm/mach-at91/cpuidle.c
> +++ /dev/null
> @@ -1,55 +0,0 @@
> -/*
> - * based on arch/arm/mach-kirkwood/cpuidle.c
> - *
> - * CPU idle support for AT91 SoC
> - *
> - * This file is licensed under the terms of the GNU General Public
> - * License version 2. This program is licensed "as is" without any
> - * warranty of any kind, whether express or implied.
> - *
> - * The cpu idle uses wait-for-interrupt and RAM self refresh in order
> - * to implement two idle states -
> - * #1 wait-for-interrupt
> - * #2 wait-for-interrupt and RAM self refresh
> - */
> -
> -#include <linux/module.h>
> -#include <linux/init.h>
> -#include <linux/cpuidle.h>
> -#include <asm/cpuidle.h>
> -
> -#define AT91_MAX_STATES 2
> -
> -extern void (*at91_standby_ops)(void);
> -
> -/* Actual code that puts the SoC in different idle states */
> -static int at91_enter_idle(struct cpuidle_device *dev,
> - struct cpuidle_driver *drv,
> - int index)
> -{
> - at91_standby_ops();
> - return index;
> -}
> -
> -static struct cpuidle_driver at91_idle_driver = {
> - .name = "at91_idle",
> - .owner = THIS_MODULE,
> - .states[0] = ARM_CPUIDLE_WFI_STATE,
> - .states[1] = {
> - .enter = at91_enter_idle,
> - .exit_latency = 10,
> - .target_residency = 100000,
> - .flags = CPUIDLE_FLAG_TIME_VALID,
> - .name = "RAM_SR",
> - .desc = "WFI and DDR Self Refresh",
> - },
> - .state_count = AT91_MAX_STATES,
> -};
> -
> -/* Initialize CPU idle by registering the idle states */
> -static int __init at91_init_cpuidle(void)
> -{
> - return cpuidle_register(&at91_idle_driver, NULL);
> -}
> -
> -device_initcall(at91_init_cpuidle);
> diff --git a/drivers/cpuidle/Makefile b/drivers/cpuidle/Makefile
> index 0d8bd55..ba4e977 100644
> --- a/drivers/cpuidle/Makefile
> +++ b/drivers/cpuidle/Makefile
> @@ -7,3 +7,4 @@ obj-$(CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED) += coupled.o
>
> obj-$(CONFIG_CPU_IDLE_CALXEDA) += cpuidle-calxeda.o
> obj-$(CONFIG_ARCH_KIRKWOOD) += cpuidle-kirkwood.o
> +obj-$(CONFIG_ARCH_AT91) += at91.o
> diff --git a/drivers/cpuidle/at91.c b/drivers/cpuidle/at91.c
> new file mode 100644
> index 0000000..2bc745b
> --- /dev/null
> +++ b/drivers/cpuidle/at91.c
> @@ -0,0 +1,57 @@
> +/*
> + * based on arch/arm/mach-kirkwood/cpuidle.c
> + *
> + * CPU idle support for AT91 SoC
> + *
> + * Author: Nicolas Ferre <nicolas.ferre@atmel•com>
> + *
> + * This file is licensed under the terms of the GNU General Public
> + * License version 2. This program is licensed "as is" without any
> + * warranty of any kind, whether express or implied.
> + *
> + * The cpu idle uses wait-for-interrupt and RAM self refresh in order
> + * to implement two idle states -
> + * #1 wait-for-interrupt
> + * #2 wait-for-interrupt and RAM self refresh
> + */
> +
> +#include <linux/module.h>
> +#include <linux/init.h>
> +#include <linux/cpuidle.h>
> +#include <asm/cpuidle.h>
> +
> +#define AT91_MAX_STATES 2
> +
> +extern void (*at91_standby_ops)(void);
> +
> +/* Actual code that puts the SoC in different idle states */
> +static int at91_enter_idle(struct cpuidle_device *dev,
> + struct cpuidle_driver *drv,
> + int index)
> +{
> + at91_standby_ops();
> + return index;
> +}
> +
> +static struct cpuidle_driver at91_idle_driver = {
> + .name = "at91_idle",
> + .owner = THIS_MODULE,
> + .states[0] = ARM_CPUIDLE_WFI_STATE,
> + .states[1] = {
> + .enter = at91_enter_idle,
> + .exit_latency = 10,
> + .target_residency = 100000,
> + .flags = CPUIDLE_FLAG_TIME_VALID,
> + .name = "RAM_SR",
> + .desc = "WFI and DDR Self Refresh",
> + },
> + .state_count = AT91_MAX_STATES,
> +};
> +
> +/* Initialize CPU idle by registering the idle states */
> +static int __init at91_init_cpuidle(void)
> +{
> + return cpuidle_register(&at91_idle_driver, NULL);
> +}
> +
> +device_initcall(at91_init_cpuidle);
>
--
Nicolas Ferre
next prev parent reply other threads:[~2013-04-15 14:14 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-15 13:29 [RFC patch 0/2] ARM: at91: cpuidle: move driver to drivers/cpuidle Daniel Lezcano
2013-04-15 13:29 ` [RFC patch 1/2] ARM: at91: cpuidle: encapsulate the standby code Daniel Lezcano
2013-04-15 13:54 ` Nicolas Ferre
2013-04-15 14:13 ` Daniel Lezcano
2013-04-15 14:17 ` Jean-Christophe PLAGNIOL-VILLARD
2013-04-15 13:29 ` [RFC patch 2/2] ARM: at91: cpuidle: move the driver to drivers/cpuidle directory Daniel Lezcano
2013-04-15 14:14 ` Nicolas Ferre [this message]
2013-04-15 14:29 ` Daniel Lezcano
2013-04-15 14:20 ` Jean-Christophe PLAGNIOL-VILLARD
2013-04-15 14:37 ` Daniel Lezcano
2013-04-15 16:00 ` Jean-Christophe PLAGNIOL-VILLARD
2013-04-16 22:39 ` Daniel Lezcano
2013-06-21 10:51 ` Daniel Lezcano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=516C0B30.501@atmel.com \
--to=nicolas.ferre@atmel$(echo .)com \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox