From: David Brownell <david-b@pacbell.net>
To: "Pillai, Manikandan" <mani.pillai@ti.com>
Cc: "linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
"broonie@sirena.org.uk" <broonie@sirena.org.uk>
Subject: Re: [PATCH 1/2] Include TPS6235x based Power regulator support
Date: Wed, 14 Jan 2009 09:55:58 -0800 [thread overview]
Message-ID: <200901140955.58616.david-b@pacbell.net> (raw)
In-Reply-To: <19F8576C6E063C45BE387C64729E739403ECF70CCA@dbde02.ent.ti.com>
On Wednesday 14 January 2009, Pillai, Manikandan wrote:
> Let me summarise the main problem I have been facing with regulators.
>
> The TPS6235x are I2C based devices.
>
> The regulator_register() functions require that the regulator_init_data is
> passed as platform_data(). But for i2c_client's platform data is initialized
> to some other value in the I2C driver. So the regulator_register() function
> fails.
Then you're initializing the i2c_board_info.platform_data field
incorrectly. Do that right (pass regulator_init_data), and this
problem vanishes. Only the tps6235x.c driver, and in this case
the regulator framework (sigh), care about that platform_data.
> The other problem which I encounter is with the function regulator_get().
> Regulator_get() requires 2 parameters - device pointer should point to the
> One passed during regulator_register. It also takes a string a second parameter
> Which is compared with the supply string initialized in the regulator init data
> element regulator_consumer_supply.supply.
You need to intialize regulator_init_data.consumer_supplies
(and num_consumer_supplies) to include those two parameters.
Your pr785.c file will need to set up the regulator_init_data
before it declares the regulators.
(And yes, there *could* be a chicken/egg problem there where
it gets awkward to get all those devices in hand -- and pass
them to the regulator framework -- before their probe routines
get called and try using their regulators. So far, careful
initcall sequencing has sufficed to resolve that...)
> Passing the client->dev, invoking regulator_register() fails.
Of course. That's the regulator -- an I2C device -- not the
regulated device. You pass regulator_get() the name of the
regulated device and a logical name for its supply regulator.
It then looks for data from a regulator_consumer_supply, which
was handed to the regulator framework via regulator_init_data.
Remember: the whole point of a driver using regulator_get() to
get a client handle to its supply regulator is that it won't
already *have* any knowledge about what regulator is used on
any given board.
- Dave
next prev parent reply other threads:[~2009-01-14 17:56 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-13 7:41 [PATCH 1/2] Include TPS6235x based Power regulator support Manikandan Pillai
2009-01-13 21:15 ` Mark Brown
2009-01-13 22:07 ` Mark Brown
2009-01-14 10:02 ` Pillai, Manikandan
2009-01-14 11:01 ` Mark Brown
2009-01-14 11:04 ` Pillai, Manikandan
2009-01-14 11:57 ` Mark Brown
2009-01-14 18:21 ` David Brownell
2009-01-14 18:16 ` David Brownell
2009-01-14 0:19 ` David Brownell
2009-01-14 10:39 ` Pillai, Manikandan
2009-01-14 11:48 ` Mark Brown
2009-01-14 17:55 ` David Brownell [this message]
2009-01-14 18:10 ` Mark Brown
2009-01-14 18:40 ` David Brownell
[not found] ` <200901201106.00914.david-b@pacbell.net>
2009-01-20 20: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=200901140955.58616.david-b@pacbell.net \
--to=david-b@pacbell.net \
--cc=broonie@sirena.org.uk \
--cc=linux-omap@vger.kernel.org \
--cc=mani.pillai@ti.com \
/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.