linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: khilman@linaro.org (Kevin Hilman)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 4/4] ARM: OMAP4+: CPUidle: Consolidate idle driver for OMAP5 support
Date: Fri, 05 Apr 2013 14:29:03 -0700	[thread overview]
Message-ID: <878v4wll9c.fsf@linaro.org> (raw)
In-Reply-To: <1365166743-5940-5-git-send-email-santosh.shilimkar@ti.com> (Santosh Shilimkar's message of "Fri, 5 Apr 2013 18:29:03 +0530")

Santosh Shilimkar <santosh.shilimkar@ti.com> writes:

> The OMAP5 idle driver can re-use most of OMAP4 CPUidle driver
> implementation. Also the next derivative SOCs are going to re-use
> the MPUSS so, same driver with minor updates can be re-used.
>
> Prepare the code so that its easier to add CPUidle support for
> OMAP5 devices.
>
> Acked-by: Nishanth Menon <nm@ti.com>
> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>

Due to dependencies, I'll add this one to my for_3.10/cleanup/cpuidle
branch.

Kevin

> ---
>  arch/arm/mach-omap2/cpuidle44xx.c |   31 ++++++++++++++++---------------
>  1 file changed, 16 insertions(+), 15 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/cpuidle44xx.c b/arch/arm/mach-omap2/cpuidle44xx.c
> index 767f657..ca1551a 100644
> --- a/arch/arm/mach-omap2/cpuidle44xx.c
> +++ b/arch/arm/mach-omap2/cpuidle44xx.c
> @@ -1,7 +1,7 @@
>  /*
> - * OMAP4 CPU idle Routines
> + * OMAP4+ CPU idle Routines
>   *
> - * Copyright (C) 2011 Texas Instruments, Inc.
> + * Copyright (C) 2011-2013 Texas Instruments, Inc.
>   * Santosh Shilimkar <santosh.shilimkar@ti.com>
>   * Rajendra Nayak <rnayak@ti.com>
>   *
> @@ -24,13 +24,13 @@
>  #include "clockdomain.h"
>  
>  /* Machine specific information */
> -struct omap4_idle_statedata {
> +struct idle_statedata {
>  	u32 cpu_state;
>  	u32 mpu_logic_state;
>  	u32 mpu_state;
>  };
>  
> -static struct omap4_idle_statedata omap4_idle_data[] = {
> +static struct idle_statedata omap4_idle_data[] = {
>  	{
>  		.cpu_state = PWRDM_POWER_ON,
>  		.mpu_state = PWRDM_POWER_ON,
> @@ -53,11 +53,12 @@ static struct clockdomain *cpu_clkdm[NR_CPUS];
>  
>  static atomic_t abort_barrier;
>  static bool cpu_done[NR_CPUS];
> +static struct idle_statedata *state_ptr = &omap4_idle_data[0];
>  
>  /* Private functions */
>  
>  /**
> - * omap4_enter_idle_coupled_[simple/coupled] - OMAP4 cpuidle entry functions
> + * omap_enter_idle_[simple/coupled] - OMAP4PLUS cpuidle entry functions
>   * @dev: cpuidle device
>   * @drv: cpuidle driver
>   * @index: the index of state to be entered
> @@ -66,7 +67,7 @@ static bool cpu_done[NR_CPUS];
>   * specified low power state selected by the governor.
>   * Returns the amount of time spent in the low power state.
>   */
> -static int omap4_enter_idle_simple(struct cpuidle_device *dev,
> +static int omap_enter_idle_simple(struct cpuidle_device *dev,
>  			struct cpuidle_driver *drv,
>  			int index)
>  {
> @@ -74,11 +75,11 @@ static int omap4_enter_idle_simple(struct cpuidle_device *dev,
>  	return index;
>  }
>  
> -static int omap4_enter_idle_coupled(struct cpuidle_device *dev,
> +static int omap_enter_idle_coupled(struct cpuidle_device *dev,
>  			struct cpuidle_driver *drv,
>  			int index)
>  {
> -	struct omap4_idle_statedata *cx = &omap4_idle_data[index];
> +	struct idle_statedata *cx = state_ptr + index;
>  	int cpu_id = smp_processor_id();
>  
>  	/*
> @@ -168,7 +169,7 @@ static void omap_setup_broadcast_timer(void *arg)
>  	clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ON, &cpu);
>  }
>  
> -static DEFINE_PER_CPU(struct cpuidle_device, omap4_idle_dev);
> +static DEFINE_PER_CPU(struct cpuidle_device, omap_idle_dev);
>  
>  static struct cpuidle_driver omap4_idle_driver = {
>  	.name				= "omap4_idle",
> @@ -180,7 +181,7 @@ static struct cpuidle_driver omap4_idle_driver = {
>  			.exit_latency = 2 + 2,
>  			.target_residency = 5,
>  			.flags = CPUIDLE_FLAG_TIME_VALID,
> -			.enter = omap4_enter_idle_simple,
> +			.enter = omap_enter_idle_simple,
>  			.name = "C1",
>  			.desc = "CPUx ON, MPUSS ON"
>  		},
> @@ -189,7 +190,7 @@ static struct cpuidle_driver omap4_idle_driver = {
>  			.exit_latency = 328 + 440,
>  			.target_residency = 960,
>  			.flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_COUPLED,
> -			.enter = omap4_enter_idle_coupled,
> +			.enter = omap_enter_idle_coupled,
>  			.name = "C2",
>  			.desc = "CPUx OFF, MPUSS CSWR",
>  		},
> @@ -198,7 +199,7 @@ static struct cpuidle_driver omap4_idle_driver = {
>  			.exit_latency = 460 + 518,
>  			.target_residency = 1100,
>  			.flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_COUPLED,
> -			.enter = omap4_enter_idle_coupled,
> +			.enter = omap_enter_idle_coupled,
>  			.name = "C3",
>  			.desc = "CPUx OFF, MPUSS OSWR",
>  		},
> @@ -210,9 +211,9 @@ static struct cpuidle_driver omap4_idle_driver = {
>  /* Public functions */
>  
>  /**
> - * omap4_idle_init - Init routine for OMAP4 idle
> + * omap4_idle_init - Init routine for OMAP4+ idle
>   *
> - * Registers the OMAP4 specific cpuidle driver to the cpuidle
> + * Registers the OMAP4+ specific cpuidle driver to the cpuidle
>   * framework with the valid set of states.
>   */
>  int __init omap4_idle_init(void)
> @@ -240,7 +241,7 @@ int __init omap4_idle_init(void)
>  	}
>  
>  	for_each_cpu(cpu_id, cpu_online_mask) {
> -		dev = &per_cpu(omap4_idle_dev, cpu_id);
> +		dev = &per_cpu(omap_idle_dev, cpu_id);
>  		dev->cpu = cpu_id;
>  #ifdef CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED
>  		dev->coupled_cpus = *cpu_online_mask;

  reply	other threads:[~2013-04-05 21:29 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-05 12:58 [PATCH v3 0/4] ARM: OMAP4+: PM: Consolidate code for re-use on OMAP5 Santosh Shilimkar
2013-04-05 12:59 ` [PATCH v3 1/4] ARM: OMAP4+: PM: Consolidate MPU subsystem PM code for re-use Santosh Shilimkar
2013-04-05 13:19   ` Felipe Balbi
2013-04-05 13:35     ` Nishanth Menon
2013-04-05 13:39       ` Santosh Shilimkar
2013-04-05 14:04       ` Felipe Balbi
2013-04-05 14:18         ` Nishanth Menon
2013-04-05 14:29           ` Felipe Balbi
2013-04-05 13:37     ` Santosh Shilimkar
2013-04-05 12:59 ` [PATCH v3 2/4] ARM: OMAP4+: PM: Consolidate OMAP4 PM code to re-use it for OMAP5 Santosh Shilimkar
2013-04-05 13:21   ` Felipe Balbi
2013-04-05 13:35     ` Santosh Shilimkar
2013-04-05 21:34   ` Tony Lindgren
2013-04-08 10:48     ` Santosh Shilimkar
2013-04-08 16:42       ` Tony Lindgren
2013-04-09  6:13         ` Santosh Shilimkar
2013-04-09 16:55           ` Tony Lindgren
2013-04-10  6:17             ` Santosh Shilimkar
2013-04-05 12:59 ` [PATCH v3 3/4] ARM: OMAP4+: Make secondary_startup function name more consistent Santosh Shilimkar
2013-04-05 12:59 ` [PATCH v3 4/4] ARM: OMAP4+: CPUidle: Consolidate idle driver for OMAP5 support Santosh Shilimkar
2013-04-05 21:29   ` Kevin Hilman [this message]
2013-04-05 23:42 ` [PATCH v3 0/4] ARM: OMAP4+: PM: Consolidate code for re-use on OMAP5 Kevin Hilman
2013-04-08 11:03   ` Santosh Shilimkar

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=878v4wll9c.fsf@linaro.org \
    --to=khilman@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).