linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linus.ml.walleij@gmail.com (Linus Walleij)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] AB3100 regulator support v3
Date: Wed, 2 Sep 2009 23:37:00 +0200	[thread overview]
Message-ID: <63386a3d0909021437pe94b5a5m20a63fbad396cd13@mail.gmail.com> (raw)
In-Reply-To: <20090902172438.GA1190@rakim.wolfsonmicro.main>

2009/9/2 Mark Brown <broonie@opensource.wolfsonmicro.com>:

> This looks basically good - my only concern is if the initialisation
> data supplied for the regulators is just setting up the things that can
> be set up via the API or if there's other stuff going on (this was my
> reason for the question I asked the other day). ?If there's other stuff
> being configured then I'm happy with the patch modulo the static thing.

OK so this array:

+       /* Set up regulators */
+       for (i = 0; i < ARRAY_SIZE(ab3100_reg_init_order); i++) {
+               err = ab3100_set_register_interruptible(ab3100,
+                                       ab3100_reg_init_order[i],
+                                       plfdata->reg_initvals[i]);

The initvals are one-byte registers for each regulator plus 2 bytes
of sleep settings for LDO E and BUCK respectively.

The sleep settings are driven by two HW lines, so a regulator
can react by suspending the regulator on line A or B disjunct
either (logical ||) or both (logical &&). (You don't alter that in
runtime so no API has been developed here.)

Apart from that it's just default-zero undefined bits and default
voltage and default on/off setting. It is mainly written here so
that we have a known state, eventhough the boot loader should
have set them up (thus boot_on for some of them). But I like
to be on the safe side. If you for example download the kernel
through something like JTAG you may not have executed the
boot loader, and the reset power-on defaults can be bad,
for example have regulators enabled that should not be.

Currently the framework will enable the .boot_on regulators
effectively setting this one bit right for all regulators.

For *some* of the boot_on regulators I could also use .apply_uV
to set the voltage bits of course, but only if min_uV
and max_uV is the same which is not the case for all
regulators that are default on here.

And I don't see any way for the core (set_machine_constraints)
to set regulators to *off* by default if they happen to be on at
boot.

So my conclusion is that the array of initial settings is really
needed to:

- Set sleep config bits (you don't want to alter this runtime BTW)
- Set some default voltage levels on variable regulators
- Set some regulators default off
- Thus establish a known initial state

OK?

Yours,
Linus Walleij

  reply	other threads:[~2009-09-02 21:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-31 22:04 [PATCH 1/2] AB3100 regulator support v3 Linus Walleij
2009-09-02 17:24 ` Mark Brown
2009-09-02 21:37   ` Linus Walleij [this message]
2009-09-02 21:55     ` 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=63386a3d0909021437pe94b5a5m20a63fbad396cd13@mail.gmail.com \
    --to=linus.ml.walleij@gmail.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;
as well as URLs for NNTP newsgroup(s).