public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@deeprootsystems.com>
To: Tony Lindgren <tony@atomide.com>
Cc: linux-arm-kernel@lists.arm.linux.org.uk,
	linux-arm@vger.kernel.org, linux-omap@vger.kernel.org,
	Tero Kristo <tero.kristo@nokia.com>
Subject: Re: [PATCH 10/10] OMAP: PM: Added suspend target state control to debugfs for OMAP3
Date: Tue, 18 Aug 2009 14:43:36 +0200	[thread overview]
Message-ID: <87zl9xi96v.fsf@deeprootsystems.com> (raw)
In-Reply-To: <20090817081016.GL7278@atomide.com> (Tony Lindgren's message of "Mon\, 17 Aug 2009 11\:10\:16 +0300")

Tony Lindgren <tony@atomide.com> writes:

> * Kevin Hilman <khilman@deeprootsystems.com> [090813 19:54]:
>> From: Tero Kristo <tero.kristo@nokia.com>
>> 
>> Target state can be read / programmed via files under:
>>   [debugfs]/pm_debug/[pwrdm]/suspend
>
>
> Does this compile when CONFIG_DEBUG_FS is not set?
>

Yes.  The relevant code is added to a section that is already
wrapped by #ifdef CONFIG_DEBUG_FS.

Kevin

>
>> 
>> Signed-off-by: Tero Kristo <tero.kristo@nokia.com>
>> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
>> ---
>>  arch/arm/mach-omap2/pm-debug.c |   31 +++++++++++++++++++++++++++++--
>>  arch/arm/mach-omap2/pm.h       |    3 +++
>>  arch/arm/mach-omap2/pm34xx.c   |   24 ++++++++++++++++++++++++
>>  3 files changed, 56 insertions(+), 2 deletions(-)
>>  mode change 100755 => 100644 arch/arm/mach-omap2/pm-debug.c
>> 
>> diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c
>> old mode 100755
>> new mode 100644
>> index 37b883b..eded6a4
>> --- a/arch/arm/mach-omap2/pm-debug.c
>> +++ b/arch/arm/mach-omap2/pm-debug.c
>> @@ -24,6 +24,7 @@
>>  #include <linux/clk.h>
>>  #include <linux/err.h>
>>  #include <linux/io.h>
>> +#include <linux/module.h>
>>  
>>  #include <mach/clock.h>
>>  #include <mach/board.h>
>> @@ -478,10 +479,28 @@ int pm_dbg_regset_init(int reg_set)
>>  	return 0;
>>  }
>>  
>> -static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused)
>> +static int pwrdm_suspend_get(void *data, u64 *val)
>> +{
>> +	*val = omap3_pm_get_suspend_state((struct powerdomain *)data);
>> +
>> +	if (*val >= 0)
>> +		return 0;
>> +	return *val;
>> +}
>> +
>> +static int pwrdm_suspend_set(void *data, u64 val)
>> +{
>> +	return omap3_pm_set_suspend_state((struct powerdomain *)data, (int)val);
>> +}
>> +
>> +DEFINE_SIMPLE_ATTRIBUTE(pwrdm_suspend_fops, pwrdm_suspend_get,
>> +			pwrdm_suspend_set, "%llu\n");
>> +
>> +static int __init pwrdms_setup(struct powerdomain *pwrdm, void *dir)
>>  {
>>  	int i;
>>  	s64 t;
>> +	struct dentry *d;
>>  
>>  	t = sched_clock();
>>  
>> @@ -490,6 +509,14 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused)
>>  
>>  	pwrdm->timer = t;
>>  
>> +	if (strncmp(pwrdm->name, "dpll", 4) == 0)
>> +		return 0;
>> +
>> +	d = debugfs_create_dir(pwrdm->name, (struct dentry *)dir);
>> +
>> +	(void) debugfs_create_file("suspend", S_IRUGO|S_IWUSR, d,
>> +			(void *)pwrdm, &pwrdm_suspend_fops);
>> +
>>  	return 0;
>>  }
>>  
>> @@ -508,7 +535,7 @@ static int __init pm_dbg_init(void)
>>  	(void) debugfs_create_file("time", S_IRUGO,
>>  		d, (void *)DEBUG_FILE_TIMERS, &debug_fops);
>>  
>> -	pwrdm_for_each(pwrdms_setup, NULL);
>> +	pwrdm_for_each(pwrdms_setup, (void *)d);
>>  
>>  	pm_dbg_dir = debugfs_create_dir("registers", d);
>>  	if (IS_ERR(pm_dbg_dir))
>> diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h
>> index 8fa8567..8400f57 100755
>> --- a/arch/arm/mach-omap2/pm.h
>> +++ b/arch/arm/mach-omap2/pm.h
>> @@ -13,6 +13,9 @@
>>  
>>  #include <mach/powerdomain.h>
>>  
>> +extern int omap3_pm_get_suspend_state(struct powerdomain *pwrdm);
>> +extern int omap3_pm_set_suspend_state(struct powerdomain *pwrdm, int state);
>> +
>>  #ifdef CONFIG_PM_DEBUG
>>  extern void omap2_pm_dump(int mode, int resume, unsigned int us);
>>  extern int omap2_pm_debug;
>> diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
>> index 331dfca..26f2aca 100644
>> --- a/arch/arm/mach-omap2/pm34xx.c
>> +++ b/arch/arm/mach-omap2/pm34xx.c
>> @@ -664,6 +664,30 @@ static void __init prcm_setup_regs(void)
>>  	omap3_d2d_idle();
>>  }
>>  
>> +int omap3_pm_get_suspend_state(struct powerdomain *pwrdm)
>> +{
>> +	struct power_state *pwrst;
>> +
>> +	list_for_each_entry(pwrst, &pwrst_list, node) {
>> +		if (pwrst->pwrdm == pwrdm)
>> +			return pwrst->next_state;
>> +	}
>> +	return -EINVAL;
>> +}
>> +
>> +int omap3_pm_set_suspend_state(struct powerdomain *pwrdm, int state)
>> +{
>> +	struct power_state *pwrst;
>> +
>> +	list_for_each_entry(pwrst, &pwrst_list, node) {
>> +		if (pwrst->pwrdm == pwrdm) {
>> +			pwrst->next_state = state;
>> +			return 0;
>> +		}
>> +	}
>> +	return -EINVAL;
>> +}
>> +
>>  static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused)
>>  {
>>  	struct power_state *pwrst;
>> -- 
>> 1.6.4
>> 
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-arm" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2009-08-18 12:43 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-13 16:52 [PATCH 00/10] OMAP PM debug infrastructure for 2.6.32 Kevin Hilman
     [not found] ` <1250182359-18830-1-git-send-email-khilman-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org>
2009-08-13 16:52   ` [PATCH 01/10] OMAP: PM counter infrastructure Kevin Hilman
2009-08-13 16:52     ` [PATCH 02/10] OMAP: PM: Hook into PM counters Kevin Hilman
     [not found]       ` <1250182359-18830-3-git-send-email-khilman-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org>
2009-08-13 16:52         ` [PATCH 03/10] OMAP: PM: Add closures to clkdm_for_each and pwrdm_for_each Kevin Hilman
     [not found]           ` <1250182359-18830-4-git-send-email-khilman-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org>
2009-08-13 16:52             ` [PATCH 04/10] OMAP: PM: Add pm-debug counters Kevin Hilman
2009-08-13 16:52               ` [PATCH 05/10] OMAP: PM debug: make powerdomains use PM-debug counters Kevin Hilman
     [not found]                 ` <1250182359-18830-6-git-send-email-khilman-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org>
2009-08-13 16:52                   ` [PATCH 06/10] OMAP: PM debug: Add PRCM register dump support Kevin Hilman
2009-08-13 18:39                     ` Aguirre Rodriguez, Sergio Alberto
     [not found]                       ` <A24693684029E5489D1D202277BE89444A78397F-EovWT4A8QTWIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2009-08-13 21:34                         ` Kevin Hilman
     [not found]                           ` <87eirfe6uo.fsf-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org>
2009-08-13 22:28                             ` Kevin Hilman
     [not found]                     ` <1250182359-18830-7-git-send-email-khilman-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org>
2009-08-13 16:52                       ` [PATCH 07/10] OMAP: PM: Add definitions for ETK pads and observability registers Kevin Hilman
     [not found]                         ` <1250182359-18830-8-git-send-email-khilman-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org>
2009-08-13 16:52                           ` [PATCH 08/10] OMAP3: Debug observability and ETK padconf implementation Kevin Hilman
     [not found]                             ` <1250182359-18830-9-git-send-email-khilman-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org>
2009-08-13 16:52                               ` [PATCH 09/10] OMAP3: Add debug observablity (debobs) Kconfig item Kevin Hilman
     [not found]                                 ` <1250182359-18830-10-git-send-email-khilman-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org>
2009-08-13 16:52                                   ` [PATCH 10/10] OMAP: PM: Added suspend target state control to debugfs for OMAP3 Kevin Hilman
     [not found]                                     ` <1250182359-18830-11-git-send-email-khilman-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org>
2009-08-13 18:42                                       ` Aguirre Rodriguez, Sergio Alberto
     [not found]                                         ` <A24693684029E5489D1D202277BE89444A78398A-EovWT4A8QTWIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2009-08-13 21:35                                           ` Kevin Hilman
2009-08-17  8:10                                       ` Tony Lindgren
2009-08-18 12:43                                         ` Kevin Hilman [this message]
2009-08-17  8:08                                   ` [PATCH 09/10] OMAP3: Add debug observablity (debobs) Kconfig item Tony Lindgren
2009-08-17  8:07                               ` [PATCH 08/10] OMAP3: Debug observability and ETK padconf implementation Tony Lindgren
2009-08-15  5:10                           ` [PATCH 07/10] OMAP: PM: Add definitions for ETK pads and observability registers Gadiyar, Anand
2009-08-18 12:12                             ` Kevin Hilman
2009-08-17  8:03                       ` [PATCH 06/10] OMAP: PM debug: Add PRCM register dump support Tony Lindgren

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=87zl9xi96v.fsf@deeprootsystems.com \
    --to=khilman@deeprootsystems.com \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-arm@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=tero.kristo@nokia.com \
    --cc=tony@atomide.com \
    /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