linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: lee.jones@linaro.org (Lee Jones)
To: linux-arm-kernel@lists.infradead.org
Subject: AB8500 Regulators
Date: Tue, 31 Jul 2012 09:46:28 +0100	[thread overview]
Message-ID: <50179B64.60209@linaro.org> (raw)
In-Reply-To: <20120730174831.GP4468@opensource.wolfsonmicro.com>

On 30/07/12 18:48, Mark Brown wrote:
> On Mon, Jul 30, 2012 at 05:32:10PM +0100, Lee Jones wrote:
>> On 30/07/12 16:26, Mark Brown wrote:
>>> On Mon, Jul 30, 2012 at 02:49:43PM +0100, Lee Jones wrote:
>
>>>> could be dealt with using the API. There is currently no API to set
>>>> up ST-Ericsson's configuration. So what's the best thing to do? How
>
>>> Well, a good start would be to work out what those register writes
>>> actually do and then we can have a discussion on how to do whatever
>>> that is.
>
>> Most of the configuration seems to pertain to voltage selection and
>
> So what makes you say there's no API for any of this then?  Clearly
> setting voltages is something that's supported.
>
>> making regulators valid. I assume this means you can enable them via
>> their own registers and the enablement will take hold. This seems
>
> Please be more specific, frankly I'm having a really hard time working
> out what the above means.  Obviously most of what drivers do involves
> writing to registers...
>
>> like pretty routine stuff as far as regulator configuration goes.
>
> Which seems like a very good reason why it shouldn't just be done by a
> magic sequence of undocumented register writes.

Please listen to what I'm saying as a whole. Breaking that paragraph up 
takes it entirely out of context. I'm mostly agreeing with what you're 
saying, and asking you some advice.

Let me attempt to break it down, so there's no more ambiguity:

- I know that Device Drivers write to registers!
- I agree that magic-number blasting is the wrong thing to do here
- My aim is to convert to using whatever current APIs there are
- I'm happy to extend APIs or write new ones as required
- I now know how the changing voltage API works
   - What I don't know is where we'd call it from to initialise them
   - Can we do that from the ab8500 regulator driver's init() or probe()?
- WRT the 'valid' registers, I'm not sure what they do. The doc says:
   "Supply control thru Hardware signal and SysClkReq balls validation."
   - More comments on what the writes do individually can be seen in [1]
   - Perhaps we can extend the API thus:

> diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c
> index 2dac0d6..87fb141 100644
> --- a/drivers/regulator/ab8500.c
> +++ b/drivers/regulator/ab8500.c
> @@ -51,6 +51,10 @@ struct ab8500_regulator_info {
>         int max_uV;
>         int min_uV;
>         int fixed_uV;
> +       u8 valid_bank;
> +       u8 valid_reg;
> +       u8 valid_mask;
> +       u8 valid_val_enable;
>         u8 update_bank;
>         u8 update_reg;
>         u8 update_mask;

Then I think most (if not all) of our bases are covered.

[1] arch/arm/mach-ux500/board-mop500-regulators.c
     'struct ab8500_regulator_reg_init ab8500_regulator_reg_init[]'

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

  reply	other threads:[~2012-07-31  8:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-30 13:49 AB8500 Regulators Lee Jones
2012-07-30 15:26 ` Mark Brown
2012-07-30 16:32   ` Lee Jones
2012-07-30 17:48     ` Mark Brown
2012-07-31  8:46       ` Lee Jones [this message]
2012-07-31 11:08         ` Mark Brown
2012-07-31 12:26           ` Lee Jones
2012-07-31 13:47             ` Mark Brown
2012-07-31 14:21               ` Lee Jones
2012-07-31 14:28                 ` 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=50179B64.60209@linaro.org \
    --to=lee.jones@linaro.org \
    --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).