From: daniel.lezcano@linaro.org (Daniel Lezcano)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v6 09/11] ARM: mvebu: Register notifier callback for the cpuidle transition
Date: Thu, 03 Apr 2014 10:18:20 +0200 [thread overview]
Message-ID: <533D194C.6020700@linaro.org> (raw)
In-Reply-To: <1396005211-15573-10-git-send-email-gregory.clement@free-electrons.com>
On 03/28/2014 12:13 PM, Gregory CLEMENT wrote:
> In order to have well encapsulated code, we use notifier callbacks for
> CPU_PM_ENTER and CPU_PM_EXIT inside the mvebu power management code.
>
> Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
> ---
> arch/arm/mach-mvebu/pmsu.c | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
>
> diff --git a/arch/arm/mach-mvebu/pmsu.c b/arch/arm/mach-mvebu/pmsu.c
> index 968c8c02c126..9ea2bb44d573 100644
> --- a/arch/arm/mach-mvebu/pmsu.c
> +++ b/arch/arm/mach-mvebu/pmsu.c
> @@ -18,6 +18,7 @@
>
> #define pr_fmt(fmt) "mvebu-pmsu: " fmt
>
> +#include <linux/cpu_pm.h>
> #include <linux/kernel.h>
> #include <linux/init.h>
> #include <linux/of_address.h>
> @@ -263,4 +264,21 @@ static noinline void armada_370_xp_pmsu_idle_restore(void)
> writel(reg, pmsu_mp_base + PMSU_STATUS_AND_MASK(hw_cpu));
> }
>
> +static int armada_370_xp_cpu_pm_notify(struct notifier_block *self,
> + unsigned long action, void *hcpu)
> +{
> + if (action == CPU_PM_ENTER) {
> + unsigned int hw_cpu = cpu_logical_map(smp_processor_id());
> + mvebu_pmsu_set_cpu_boot_addr(hw_cpu, armada_370_xp_cpu_resume);
> + } else if (action == CPU_PM_EXIT) {
> + armada_370_xp_pmsu_idle_restore();
> + }
> +
> + return NOTIFY_OK;
> +}
> +
> +static struct notifier_block armada_370_xp_cpu_pm_notifier = {
> + .notifier_call = armada_370_xp_cpu_pm_notify,
> +};
> +
> early_initcall(armada_370_xp_pmsu_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:[~2014-04-03 8:18 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-28 11:13 [PATCH v6 00/11] CPU idle for Armada XP Gregory CLEMENT
2014-03-28 11:13 ` [PATCH v6 01/11] ARM: PJ4B: Add cpu_suspend/cpu_resume hooks for PJ4B Gregory CLEMENT
2014-03-28 11:13 ` [PATCH v6 02/11] ARM: mvebu: remove the address parameter for ll_set_cpu_coherent Gregory CLEMENT
2014-03-28 11:13 ` [PATCH v6 03/11] ARM: mvebu: ll_set_cpu_coherent always uses the current CPU Gregory CLEMENT
2014-03-28 11:13 ` [PATCH v6 04/11] ARM: mvebu: Remove the unused argument of set_cpu_coherent() Gregory CLEMENT
2014-03-28 11:13 ` [PATCH v6 05/11] ARM: mvebu: Split low level functions to manipulate HW coherency Gregory CLEMENT
2014-03-28 11:13 ` [PATCH v6 06/11] ARM: mvebu: Low level function to disable HW coherency support Gregory CLEMENT
2014-03-28 11:13 ` [PATCH v6 07/11] ARM: mvebu: Allow to power down L2 cache controller in idle mode Gregory CLEMENT
2014-03-28 11:13 ` [PATCH v6 08/11] ARM: mvebu: Add the PMSU related part of the cpu idle functions Gregory CLEMENT
2014-03-28 11:13 ` [PATCH v6 09/11] ARM: mvebu: Register notifier callback for the cpuidle transition Gregory CLEMENT
2014-04-03 8:18 ` Daniel Lezcano [this message]
2014-03-28 11:13 ` [PATCH v6 10/11] cpuidle: mvebu: Add initial CPU idle support for Armada 370/XP SoC Gregory CLEMENT
2014-04-03 8:16 ` Daniel Lezcano
2014-04-04 8:20 ` Gregory CLEMENT
2014-03-28 11:13 ` [PATCH v6 11/11] ARM: mvebu: register the cpuidle driver for the Armada XP SoCs Gregory CLEMENT
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=533D194C.6020700@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).