mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Doubt about Regulator Framework and VBAT use case
@ 2009-11-30 10:41 Eduardo Valentin
  2009-11-30 10:43 ` Eduardo Valentin
  2009-11-30 11:45 ` Mark Brown
  0 siblings, 2 replies; 6+ messages in thread
From: Eduardo Valentin @ 2009-11-30 10:41 UTC (permalink / raw)
  To: Mark Brown
  Cc: Hogander Jouni (Nokia-D/Tampere),
	De-Schrijver Peter (Nokia-D/Helsinki),
	Keski-Saari Juha.1 (EXT-Teleca/Helsinki),
	LKML

Hello Mark and Liam,

I'm writing to ask about VBAT use case. What is the expected
way to use regulator framework in case of rail coming from battery?
Should it be added to the regulator framework at all?

In that case, the rail should not be controllable. So I don't see
any reason to add it to the regulator framework board definitions,
as we should not be controlling it.

However, drivers for devices on that rail would require their regulator anyway.
And I guess the point would be that drivers should not be aware that they are on VBAT
or any other rail.

So, what's the correct way to solve this?

- Should drivers fail nicely if a regulator_get fail? And continue even if one fails.
- Should drivers disable regfw usage completely in the driver if regulator_get doesn't
give valid regulator ?
- or Should a fake fixed regulator be added for vbat so drivers can still get a valid
regulator with regulator_get.

The last options seams to be the one that does not require much changes on drivers.
But it will be adding a regulator that does basically nothing in the system.

BR,

-- 
Eduardo Valentin

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Doubt about Regulator Framework and VBAT use case
  2009-11-30 10:41 Doubt about Regulator Framework and VBAT use case Eduardo Valentin
@ 2009-11-30 10:43 ` Eduardo Valentin
  2009-11-30 11:45 ` Mark Brown
  1 sibling, 0 replies; 6+ messages in thread
From: Eduardo Valentin @ 2009-11-30 10:43 UTC (permalink / raw)
  To: Valentin Eduardo (Nokia-D/Helsinki)
  Cc: Mark Brown, Hogander Jouni (Nokia-D/Tampere),
	De-Schrijver Peter (Nokia-D/Helsinki),
	Keski-Saari Juha.1 (EXT-Teleca/Helsinki),
	LKML, Liam Girdwood

Forgot to add Liam into Cc. Doing it so.


On Mon, Nov 30, 2009 at 11:41:02AM +0100, Valentin Eduardo (Nokia-D/Helsinki) wrote:
> Hello Mark and Liam,
> 
> I'm writing to ask about VBAT use case. What is the expected
> way to use regulator framework in case of rail coming from battery?
> Should it be added to the regulator framework at all?
> 
> In that case, the rail should not be controllable. So I don't see
> any reason to add it to the regulator framework board definitions,
> as we should not be controlling it.
> 
> However, drivers for devices on that rail would require their regulator anyway.
> And I guess the point would be that drivers should not be aware that they are on VBAT
> or any other rail.
> 
> So, what's the correct way to solve this?
> 
> - Should drivers fail nicely if a regulator_get fail? And continue even if one fails.
> - Should drivers disable regfw usage completely in the driver if regulator_get doesn't
> give valid regulator ?
> - or Should a fake fixed regulator be added for vbat so drivers can still get a valid
> regulator with regulator_get.
> 
> The last options seams to be the one that does not require much changes on drivers.
> But it will be adding a regulator that does basically nothing in the system.
> 
> BR,
> 
> -- 
> Eduardo Valentin
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

-- 
Eduardo Valentin

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Doubt about Regulator Framework and VBAT use case
  2009-11-30 10:41 Doubt about Regulator Framework and VBAT use case Eduardo Valentin
  2009-11-30 10:43 ` Eduardo Valentin
@ 2009-11-30 11:45 ` Mark Brown
  2009-12-02 11:32   ` Högander Jouni
  1 sibling, 1 reply; 6+ messages in thread
From: Mark Brown @ 2009-11-30 11:45 UTC (permalink / raw)
  To: Eduardo Valentin
  Cc: Hogander Jouni (Nokia-D/Tampere),
	De-Schrijver Peter (Nokia-D/Helsinki),
	Keski-Saari Juha.1 (EXT-Teleca/Helsinki),
	LKML, lrg

On Mon, Nov 30, 2009 at 12:41:02PM +0200, Eduardo Valentin wrote:

> I'm writing to ask about VBAT use case. What is the expected
> way to use regulator framework in case of rail coming from battery?
> Should it be added to the regulator framework at all?

...

> However, drivers for devices on that rail would require their regulator anyway.
> And I guess the point would be that drivers should not be aware that they are on VBAT
> or any other rail.

I'd add it as a fixed voltage regulator and either not specify the
voltage or specify the nominal voltage.

> - Should drivers fail nicely if a regulator_get fail? And continue even if one fails.
> - Should drivers disable regfw usage completely in the driver if regulator_get doesn't
> give valid regulator ?

These are reasonable approaches if the supply is an optional one that
the device does not need - the driver shouldn't be failing if it doesn't
need to.

> - or Should a fake fixed regulator be added for vbat so drivers can still get a valid
> regulator with regulator_get.

That's the way to do it, yes.

> The last options seams to be the one that does not require much changes on drivers.
> But it will be adding a regulator that does basically nothing in the system.

It's not quite doing nothing, it's mapping out the supply on the board.
Otherwise there's no good way to tell the difference between a supply
not being available because the regulator failed to initialise and the
supply not being available because it's provided by some other invisible 
means.

If the regulator API starts getting a lot of usage on boards that have
primarily fixed regulators we may want to have some support in the core
for automatically faking up supplies if requested by the board but
there's not been much demand for that yet and there's risks.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Doubt about Regulator Framework and VBAT use case
  2009-11-30 11:45 ` Mark Brown
@ 2009-12-02 11:32   ` Högander Jouni
  2009-12-02 12:02     ` Mark Brown
  0 siblings, 1 reply; 6+ messages in thread
From: Högander Jouni @ 2009-12-02 11:32 UTC (permalink / raw)
  To: ext Mark Brown
  Cc: Valentin Eduardo (Nokia-D/Helsinki),
	De-Schrijver Peter (Nokia-D/Helsinki),
	Keski-Saari Juha.1 (EXT-Teleca/Helsinki),
	LKML, lrg

ext Mark Brown <broonie@opensource.wolfsonmicro.com> writes:

> On Mon, Nov 30, 2009 at 12:41:02PM +0200, Eduardo Valentin wrote:
>
>> I'm writing to ask about VBAT use case. What is the expected
>> way to use regulator framework in case of rail coming from battery?
>> Should it be added to the regulator framework at all?
>
> ...
>
>> However, drivers for devices on that rail would require their regulator anyway.
>> And I guess the point would be that drivers should not be aware that they are on VBAT
>> or any other rail.
>
> I'd add it as a fixed voltage regulator and either not specify the
> voltage or specify the nominal voltage.

I was preparing patch for this when I noticed that fixed voltage
regulator can control only one regulator. Are you aware of any ongoing
work to enable control for multiple regulators in
fixed-voltage-regulator?

-- 
Jouni Högander

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Doubt about Regulator Framework and VBAT use case
  2009-12-02 11:32   ` Högander Jouni
@ 2009-12-02 12:02     ` Mark Brown
  2009-12-02 13:55       ` Högander Jouni
  0 siblings, 1 reply; 6+ messages in thread
From: Mark Brown @ 2009-12-02 12:02 UTC (permalink / raw)
  To: H??gander Jouni
  Cc: Valentin Eduardo (Nokia-D/Helsinki),
	De-Schrijver Peter (Nokia-D/Helsinki),
	Keski-Saari Juha.1 (EXT-Teleca/Helsinki),
	LKML, lrg

On Wed, Dec 02, 2009 at 01:32:06PM +0200, H??gander Jouni wrote:
> ext Mark Brown <broonie@opensource.wolfsonmicro.com> writes:

> > I'd add it as a fixed voltage regulator and either not specify the
> > voltage or specify the nominal voltage.

> I was preparing patch for this when I noticed that fixed voltage
> regulator can control only one regulator. Are you aware of any ongoing
> work to enable control for multiple regulators in
> fixed-voltage-regulator?

It's just a platform device configured with platform data, you can
instantiate as many fixed voltage regulators in your system as you care
to using the current driver.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Doubt about Regulator Framework and VBAT use case
  2009-12-02 12:02     ` Mark Brown
@ 2009-12-02 13:55       ` Högander Jouni
  0 siblings, 0 replies; 6+ messages in thread
From: Högander Jouni @ 2009-12-02 13:55 UTC (permalink / raw)
  To: ext Mark Brown
  Cc: Valentin Eduardo (Nokia-D/Helsinki),
	De-Schrijver Peter (Nokia-D/Helsinki),
	Keski-Saari Juha.1 (EXT-Teleca/Helsinki),
	LKML, lrg

ext Mark Brown <broonie@opensource.wolfsonmicro.com> writes:

> On Wed, Dec 02, 2009 at 01:32:06PM +0200, H??gander Jouni wrote:
>> ext Mark Brown <broonie@opensource.wolfsonmicro.com> writes:
>
>> > I'd add it as a fixed voltage regulator and either not specify the
>> > voltage or specify the nominal voltage.
>
>> I was preparing patch for this when I noticed that fixed voltage
>> regulator can control only one regulator. Are you aware of any ongoing
>> work to enable control for multiple regulators in
>> fixed-voltage-regulator?
>
> It's just a platform device configured with platform data, you can
> instantiate as many fixed voltage regulators in your system as you care
> to using the current driver.

Yes, you are right. This was just my mistake in usage of the
driver. Thanks for the clarification.

-- 
Jouni Högander

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-12-02 13:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-30 10:41 Doubt about Regulator Framework and VBAT use case Eduardo Valentin
2009-11-30 10:43 ` Eduardo Valentin
2009-11-30 11:45 ` Mark Brown
2009-12-02 11:32   ` Högander Jouni
2009-12-02 12:02     ` Mark Brown
2009-12-02 13:55       ` Högander Jouni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®