From: daniel.lezcano@linaro.org (Daniel Lezcano)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 10/12] ARM: shmobile: r8a7740: Add CPUIdle
Date: Mon, 27 May 2013 13:03:31 +0200 [thread overview]
Message-ID: <51A33D83.905@linaro.org> (raw)
In-Reply-To: <1369645193-3595-11-git-send-email-horms+renesas@verge.net.au>
On 05/27/2013 10:59 AM, Simon Horman wrote:
> From: Bastian Hecht <hechtb@gmail.com>
>
> We make use of the r8a7740 Suspend To Ram code to plug together a
> CPUIdle driver.
>
> Signed-off-by: Bastian Hecht <hechtb+renesas@gmail.com>
> Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
> ---
Shouldn't it go through Rafael's tree ? Or does the patch contains some
dependencies on a code only visible in the ARM tree ?
> arch/arm/mach-shmobile/Makefile | 2 +-
> arch/arm/mach-shmobile/cpuidle-r8a7740.c | 62 +++++++++++++++++++++++++
> arch/arm/mach-shmobile/include/mach/r8a7740.h | 1 +
> arch/arm/mach-shmobile/pm-r8a7740.c | 1 +
> 4 files changed, 65 insertions(+), 1 deletion(-)
> create mode 100644 arch/arm/mach-shmobile/cpuidle-r8a7740.c
>
> diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
> index 0568894..2852dcf 100644
> --- a/arch/arm/mach-shmobile/Makefile
> +++ b/arch/arm/mach-shmobile/Makefile
> @@ -30,7 +30,7 @@ obj-$(CONFIG_SUSPEND) += suspend.o
> obj-$(CONFIG_CPU_IDLE) += cpuidle.o
> obj-$(CONFIG_ARCH_SHMOBILE) += pm-rmobile.o
> obj-$(CONFIG_ARCH_SH7372) += pm-sh7372.o sleep-sh7372.o
> -obj-$(CONFIG_ARCH_R8A7740) += pm-r8a7740.o sleep-r8a7740.o
> +obj-$(CONFIG_ARCH_R8A7740) += pm-r8a7740.o sleep-r8a7740.o cpuidle-r8a7740.o
> obj-$(CONFIG_ARCH_R8A7779) += pm-r8a7779.o
> obj-$(CONFIG_ARCH_SH73A0) += pm-sh73a0.o
>
> diff --git a/arch/arm/mach-shmobile/cpuidle-r8a7740.c b/arch/arm/mach-shmobile/cpuidle-r8a7740.c
> new file mode 100644
> index 0000000..48c7a6c
> --- /dev/null
> +++ b/arch/arm/mach-shmobile/cpuidle-r8a7740.c
> @@ -0,0 +1,62 @@
> +/*
> + * CPUIdle code for SoC r8a7740
> + *
> + * Copyright (C) 2013 Bastian Hecht
> + *
> + * This file is subject to the terms and conditions of the GNU General Public
> + * License. See the file "COPYING" in the main directory of this archive
> + * for more details.
> + */
> +#include <linux/cpuidle.h>
> +#include <linux/module.h>
> +#include <asm/cpuidle.h>
> +#include <mach/common.h>
> +#include <mach/r8a7740.h>
> +
> +#if defined(CONFIG_SUSPEND) && defined(CONFIG_CPU_IDLE)
> +static int r8a7740_enter_a3sm_pll_on(struct cpuidle_device *dev,
> + struct cpuidle_driver *drv, int index)
> +{
> + r8a7740_enter_a3sm_common(1);
> + return 1;
> +}
> +
> +static int r8a7740_enter_a3sm_pll_off(struct cpuidle_device *dev,
> + struct cpuidle_driver *drv, int index)
> +{
> + r8a7740_enter_a3sm_common(0);
> + return 2;
> +}
> +
> +static struct cpuidle_driver r8a7740_cpuidle_driver = {
> + .name = "r8a7740_cpuidle",
> + .owner = THIS_MODULE,
> + .en_core_tk_irqen = 1,
> + .state_count = 3,
> + .safe_state_index = 0, /* C1 */
> + .states[0] = ARM_CPUIDLE_WFI_STATE,
> + .states[1] = {
> + .name = "C2",
> + .desc = "A3SM PLL ON",
> + .exit_latency = 40,
> + .target_residency = 30 + 40,
> + .flags = CPUIDLE_FLAG_TIME_VALID,
> + .enter = r8a7740_enter_a3sm_pll_on,
> + },
> + .states[2] = {
> + .name = "C3",
> + .desc = "A3SM PLL OFF",
> + .exit_latency = 120,
> + .target_residency = 30 + 120,
> + .flags = CPUIDLE_FLAG_TIME_VALID,
> + .enter = r8a7740_enter_a3sm_pll_off,
> + },
> +};
> +
> +void r8a7740_cpuidle_init(void)
> +{
> + shmobile_cpuidle_set_driver(&r8a7740_cpuidle_driver);
> +}
> +#else
> +void r8a7740_cpuidle_init(void) {}
> +#endif
> diff --git a/arch/arm/mach-shmobile/include/mach/r8a7740.h b/arch/arm/mach-shmobile/include/mach/r8a7740.h
> index 5cfe5d9..3b538e3 100644
> --- a/arch/arm/mach-shmobile/include/mach/r8a7740.h
> +++ b/arch/arm/mach-shmobile/include/mach/r8a7740.h
> @@ -545,6 +545,7 @@ extern void r8a7740_pinmux_init(void);
> extern void r8a7740_pm_init(void);
> extern void r8a7740_resume(void);
> extern void r8a7740_shutdown(void);
> +extern void r8a7740_cpuidle_init(void);
> extern void r8a7740_enter_a3sm_common(int);
>
> #ifdef CONFIG_PM
> diff --git a/arch/arm/mach-shmobile/pm-r8a7740.c b/arch/arm/mach-shmobile/pm-r8a7740.c
> index fe3c867..2f196bd 100644
> --- a/arch/arm/mach-shmobile/pm-r8a7740.c
> +++ b/arch/arm/mach-shmobile/pm-r8a7740.c
> @@ -237,4 +237,5 @@ static void r8a7740_suspend_init(void) {}
> void __init r8a7740_pm_init(void)
> {
> r8a7740_suspend_init();
> + r8a7740_cpuidle_init();
> }
>
--
<http://www.linaro.org/> Linaro.org ? Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
next prev parent reply other threads:[~2013-05-27 11:03 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-27 8:59 [GIT PULL] Renesas ARM based r8a7740 SoC updates for v3.11 Simon Horman
2013-05-27 8:59 ` [PATCH 01/12] ARM: shmobile: remove "; " from SH_FIXED_RATIO_CLK*() macro Simon Horman
2013-05-27 8:59 ` [PATCH 02/12] ARM: shmobile: r8a7740 pinmux platform device cleanup Simon Horman
2013-05-27 8:59 ` [PATCH 03/12] ARM: shmobile: r8a7740: Add interim sh-eth device name to clocks list Simon Horman
2013-05-27 8:59 ` [PATCH 04/12] ARM: shmobile: r8a7740: Add DT name to clock list for CMT10 Simon Horman
2013-05-28 3:29 ` Olof Johansson
2013-05-28 5:29 ` Simon Horman
2013-05-28 6:22 ` Olof Johansson
2013-05-31 7:57 ` Magnus Damm
2013-05-31 21:39 ` Arnd Bergmann
2013-06-01 4:20 ` Olof Johansson
2013-05-27 8:59 ` [PATCH 05/12] ARM: shmobile: r8a7740: Make private clock arrays static Simon Horman
2013-05-27 8:59 ` [PATCH 06/12] ARM: shmobile: r8a7740: Add I2C DT clock names Simon Horman
2013-05-28 3:30 ` Olof Johansson
2013-05-27 8:59 ` [PATCH 07/12] ARM: shmobile: r8a7740: Add OF support to initialze the GIC Simon Horman
2013-05-28 3:36 ` Olof Johansson
2013-05-27 8:59 ` [PATCH 08/12] ARM: shmobile: r8a7740: Prepare for reference DT setup Simon Horman
2013-05-27 8:59 ` [PATCH 09/12] ARM: shmobile: r8a7740: Add Suspend-To-RAM A3SM Simon Horman
2013-05-28 3:50 ` Olof Johansson
2013-05-28 5:29 ` Simon Horman
2013-05-28 21:20 ` Bastian Hecht
2013-06-04 5:09 ` Simon Horman
2013-06-04 15:34 ` Bastian Hecht
2013-06-06 1:10 ` Simon Horman
2013-05-27 8:59 ` [PATCH 10/12] ARM: shmobile: r8a7740: Add CPUIdle Simon Horman
2013-05-27 11:03 ` Daniel Lezcano [this message]
2013-05-28 3:54 ` Olof Johansson
2013-05-28 6:08 ` Daniel Lezcano
2013-06-04 5:10 ` Simon Horman
2013-05-27 8:59 ` [PATCH 11/12] ARM: shmobile: fix sleep-r8a7740.S miscompiles Simon Horman
2013-05-27 8:59 ` [PATCH 12/12] ARM: shmobile: clock-r8a7740: add TPU PWM support Simon Horman
2013-05-28 3:58 ` [GIT PULL] Renesas ARM based r8a7740 SoC updates for v3.11 Olof Johansson
2013-05-28 5:33 ` Simon Horman
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=51A33D83.905@linaro.org \
--to=daniel.lezcano@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).