public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: l.majewski@samsung.com (Lukasz Majewski)
To: linux-arm-kernel@lists.infradead.org
Subject: Regulator framework usage in suspend/resume contex.
Date: Thu, 17 Dec 2009 17:54:21 +0100	[thread overview]
Message-ID: <000301ca7f39$96047b60$c20d7220$%majewski@samsung.com> (raw)

Hello all,

I'm trying to use the regulator framework in conjunction with suspend/resume
(code based on a s3c Samsung SoC platform).
My goal is to change values of regulators output before going to sleep and
restore their values after resume.

I use echo mem > /sys/power/state to suspend to RAM.
I've implemented platform_suspend_ops' .begin method and from it I'm calling
the regulator_suspend_prepare(state) function from regulator framework
(declared at include/linux/regulator/machine.h, defined at core.c).
After this step I'm going to sleep. And it seems that voltage values are
changed/disabled as they should (according to .constraints->.state_mem
struct fields).

The problem is when I disable normally enabled source or change its voltage
value to new_value when entering the suspend to RAM state.

.state_mem      = {
	.enabled= 0,
},

Or

.state_mem      = {
	.uV= new_value,
	.enabled= 1,
},

I don't know how to enable this source again after resume or restore source
microvolts setting as before suspend?

As I suppose, the preferred place for performing this would be a .finish
method from platform_suspend_ops' structure (declared in
include/linux/suspend.h).

It looks like some relevant method is missing in the framework, or I haven't
look deep enough to spot one :-).

One possible workaround would be to reinitialize all regulators with
regulator_init_complete(void) function, but I'm not sure if then old
microvolt settings would be restored. Probably not...
Does anybody have any idea how to solve this problem?

I was grepping a little and it looks, that regulator_suspend_prepare()
method is not used by any suspend/resume driver in the kernel linux tree (at
least up to kernel version 2.6.32-rc8), so there is no reference code.



Thanks in advance,
Lukasz Majewski

             reply	other threads:[~2009-12-17 16:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-17 16:54 Lukasz Majewski [this message]
2009-12-18 11:13 ` Regulator framework usage in suspend/resume contex Mark Brown

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='000301ca7f39$96047b60$c20d7220$%majewski@samsung.com' \
    --to=l.majewski@samsung.com \
    --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