public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: ben@fluff.org.uk
Cc: ben@fluff.org, linux-kernel@vger.kernel.org,
	sm5xx-devel@lists.berlios.de, Ben Dooks <ben-linux@fluff.org>
Subject: Re: [patch #2 1/6] SM501: suspend support
Date: Tue, 19 Jun 2007 11:31:37 -0700	[thread overview]
Message-ID: <20070619113137.f6f8d6e5.akpm@linux-foundation.org> (raw)
In-Reply-To: <20070618210341.669263489@fluff.org.uk>

On Mon, 18 Jun 2007 21:56:21 +0100
ben@fluff.org.uk wrote:

> +/* power management support */
> +
> +static int sm501_plat_suspend(struct platform_device *pdev, pm_message_t state)
> +{
> +	struct sm501_devdata *sm = platform_get_drvdata(pdev);
> +
> +	sm->in_suspend = 1;
> +	sm->pm_misc = readl(sm->regs + SM501_MISC_CONTROL);
> +
> +	sm501_dump_regs(sm);
> +	return 0;
> +}
> +
> +static int sm501_plat_resume(struct platform_device *pdev)
> +{
> +	struct sm501_devdata *sm = platform_get_drvdata(pdev);
> +
> +	sm501_dump_regs(sm);
> +	sm501_dump_gate(sm);
> +	sm501_dump_clk(sm);
> +
> +	/* check to see if we are in the same state as when suspended */
> +
> +	if (readl(sm->regs + SM501_MISC_CONTROL) != sm->pm_misc) {
> +		dev_info(sm->dev, "SM501_MISC_CONTROL changed over sleep\n");
> +		writel(sm->pm_misc, sm->regs + SM501_MISC_CONTROL);
> +
> +		/* our suspend causes the controller state to change,
> +		 * either by something attempting setup, power loss,
> +		 * or an external reset event on power change */
> +
> +		if (sm->platdata && sm->platdata->init) {
> +			sm501_init_regs(sm, sm->platdata->init);
> +		}
> +	}
> +
> +	/* dump our state from resume */
> +
> +	sm501_dump_regs(sm);
> +	sm501_dump_clk(sm);
> +
> +	sm->in_suspend = 0;
> +
> +	return 0;
> +}
> +
> +
>  /* Initialisation data for PCI devices */
>  
>  static struct sm501_initdata sm501_pci_initdata = {
> @@ -1126,6 +1207,8 @@ static struct platform_driver sm501_plat
>  	},
>  	.probe		= sm501_plat_probe,
>  	.remove		= sm501_plat_remove,
> +	.suspend	= sm501_plat_suspend,
> +	.resume		= sm501_plat_resume,
>  };

Do we want to compile this in if CONFIG_PM=n?

  reply	other threads:[~2007-06-19 18:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-18 20:56 [patch #2 0/6] [#2] SM501 updates ben
2007-06-18 20:56 ` [patch #2 1/6] SM501: suspend support ben
2007-06-19 18:31   ` Andrew Morton [this message]
2007-06-18 20:56 ` [patch #2 2/6] SM501: initialise SDRAM clock before bus clocks ben
2007-06-18 20:56 ` [patch #2 3/6] SM501: Fix sm501_init_reg() mask/set order ben
2007-06-18 20:56 ` [patch #2 4/6] SM501: Clock updates and checks ben
2007-06-18 20:56 ` [patch #2 5/6] SM501: Add Documentation/SM501.txt ben
2007-06-18 20:56 ` [patch #2 6/6] SM501: Check SM501 ID register on initialisation ben

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=20070619113137.f6f8d6e5.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=ben-linux@fluff.org \
    --cc=ben@fluff.org \
    --cc=ben@fluff.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sm5xx-devel@lists.berlios.de \
    /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