From: Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
To: Kevin Hilman <khilman-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org>
Cc: linux-arm-kernel-xIg/pKzrS19vn6HldHNs0ANdhmdF6hFW@public.gmane.org,
linux-arm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Tero Kristo <tero.kristo-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
Subject: Re: [PATCH 10/10] OMAP: PM: Added suspend target state control to debugfs for OMAP3
Date: Mon, 17 Aug 2009 11:10:16 +0300 [thread overview]
Message-ID: <20090817081016.GL7278@atomide.com> (raw)
In-Reply-To: <1250182359-18830-11-git-send-email-khilman-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org>
* Kevin Hilman <khilman-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org> [090813 19:54]:
> From: Tero Kristo <tero.kristo-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
>
> Target state can be read / programmed via files under:
> [debugfs]/pm_debug/[pwrdm]/suspend
Does this compile when CONFIG_DEBUG_FS is not set?
Tony
>
> Signed-off-by: Tero Kristo <tero.kristo-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
> Signed-off-by: Kevin Hilman <khilman-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org>
> ---
> 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-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-arm" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2009-08-17 8:10 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 [this message]
2009-08-18 12:43 ` Kevin Hilman
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=20090817081016.GL7278@atomide.com \
--to=tony-4v6ys6ai5vpbdgjk7y7tuq@public.gmane.org \
--cc=khilman-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org \
--cc=linux-arm-kernel-xIg/pKzrS19vn6HldHNs0ANdhmdF6hFW@public.gmane.org \
--cc=linux-arm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=tero.kristo-xNZwKgViW5gAvxtiuMwx3w@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.