Re: parent/child hierarchy for regulator

2015-03-05 Thread Peter Chen
On Thu, Mar 05, 2015 at 12:22:34PM +, Mark Brown wrote:
> On Thu, Mar 05, 2015 at 06:35:36PM +0800, Peter Chen wrote:
> 
> > Any good ways at code/dts to show parent/child hierarchy for regulator?
> 
> There's plenty of examples in mainline...
> 

Thanks, I get answer for adding parent regulator for fixed regulator,
it is very easy, we only need to add 'vin-supply = <_reg>;'
at fixed's property.

-- 

Best Regards,
Peter Chen
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: parent/child hierarchy for regulator

2015-03-05 Thread Peter Chen
On Thu, Mar 05, 2015 at 12:22:34PM +, Mark Brown wrote:
> On Thu, Mar 05, 2015 at 06:35:36PM +0800, Peter Chen wrote:
> 
> > Any good ways at code/dts to show parent/child hierarchy for regulator?
> 
> There's plenty of examples in mainline...
> 

thanks, I am back to study again.

> > The related regulators at my platforms like below:
> > PMIC (SWB 5v) --> Switch Chip (GPIO Regulator) --> USB VBUS
> 
> > PMIC has one 5V regulator (eg, swbst at pfuse), and it is the input
> > for USB power switch chip, and there are two gpios at this switch
> > chip to control if 5V is output or not, we register these two gpios as 
> > fixed regulators, currently, if regulator swbst is disabled, the
> > gpio regulator has no way to know, and cause the vbus voltage is wrong.
> 
> Can you please clarify why you're registering two fixed voltage
> regulators for the switch chip and how you're doing that?

Two fixed regulators for two USB vbus, there are no relationships beween
them, but both of them needs PMIC 5V (swbst at pfuse) to be enabled.

> The picture
> above looks like you should just have a single regulator there and
> nothing should care if the either regulator is enabled when querying the
> parent for its voltage.

I need to care about its parent's status, currently, the usb code does
not consider parent regulator, so after below patch, the voltage of
vbus is incorrect, due to parent regulator is disabled after boots up,
there is no user for this parent regulator.

commit a6dcf9782f99a0d844b4d06f65cc990468424068
Author: Sean Cross 
Date:   Mon May 26 16:45:40 2014 +0800

regulator: pfuze100: Support SWB enable/disable

The SWB regulators have the ability to be turned on and off.
Add enable/disable support for these regulators.

-- 

Best Regards,
Peter Chen
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: parent/child hierarchy for regulator

2015-03-05 Thread Peter Chen
On Thu, Mar 05, 2015 at 01:18:54PM +0100, Stefan Wahren wrote:
> Hi Peter,
> 
> Am 05.03.2015 um 11:35 schrieb Peter Chen:
> > Hi lists,
> >
> > Any good ways at code/dts to show parent/child hierarchy for regulator?
> >
> > The related regulators at my platforms like below:
> > PMIC (SWB 5v) --> Switch Chip (GPIO Regulator) --> USB VBUS
> >
> > PMIC has one 5V regulator (eg, swbst at pfuse), and it is the input
> > for USB power switch chip, and there are two gpios at this switch
> > chip to control if 5V is output or not, we register these two gpios as 
> > fixed regulators, currently, if regulator swbst is disabled, the
> > gpio regulator has no way to know, and cause the vbus voltage is wrong.
> >
> > Thanks in advance.
> >
> 
> i don't have an answer to your question, but do you think of i.MX28
> platform?
> 

No, many Freescale i.mx6 SDB boards need to consider this problem.
-- 

Best Regards,
Peter Chen
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: parent/child hierarchy for regulator

2015-03-05 Thread Mark Brown
On Thu, Mar 05, 2015 at 06:35:36PM +0800, Peter Chen wrote:

> Any good ways at code/dts to show parent/child hierarchy for regulator?

There's plenty of examples in mainline...

> The related regulators at my platforms like below:
> PMIC (SWB 5v) --> Switch Chip (GPIO Regulator) --> USB VBUS

> PMIC has one 5V regulator (eg, swbst at pfuse), and it is the input
> for USB power switch chip, and there are two gpios at this switch
> chip to control if 5V is output or not, we register these two gpios as 
> fixed regulators, currently, if regulator swbst is disabled, the
> gpio regulator has no way to know, and cause the vbus voltage is wrong.

Can you please clarify why you're registering two fixed voltage
regulators for the switch chip and how you're doing that?  The picture
above looks like you should just have a single regulator there and
nothing should care if the either regulator is enabled when querying the
parent for its voltage.


signature.asc
Description: Digital signature


Re: parent/child hierarchy for regulator

2015-03-05 Thread Stefan Wahren
Hi Peter,

Am 05.03.2015 um 11:35 schrieb Peter Chen:
> Hi lists,
>
> Any good ways at code/dts to show parent/child hierarchy for regulator?
>
> The related regulators at my platforms like below:
> PMIC (SWB 5v) --> Switch Chip (GPIO Regulator) --> USB VBUS
>
> PMIC has one 5V regulator (eg, swbst at pfuse), and it is the input
> for USB power switch chip, and there are two gpios at this switch
> chip to control if 5V is output or not, we register these two gpios as 
> fixed regulators, currently, if regulator swbst is disabled, the
> gpio regulator has no way to know, and cause the vbus voltage is wrong.
>
> Thanks in advance.
>

i don't have an answer to your question, but do you think of i.MX28
platform?

Regards
Stefan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


parent/child hierarchy for regulator

2015-03-05 Thread Peter Chen
Hi lists,

Any good ways at code/dts to show parent/child hierarchy for regulator?

The related regulators at my platforms like below:
PMIC (SWB 5v) --> Switch Chip (GPIO Regulator) --> USB VBUS

PMIC has one 5V regulator (eg, swbst at pfuse), and it is the input
for USB power switch chip, and there are two gpios at this switch
chip to control if 5V is output or not, we register these two gpios as 
fixed regulators, currently, if regulator swbst is disabled, the
gpio regulator has no way to know, and cause the vbus voltage is wrong.

Thanks in advance.

-- 

Best Regards,
Peter Chen
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: parent/child hierarchy for regulator

2015-03-05 Thread Peter Chen
On Thu, Mar 05, 2015 at 01:18:54PM +0100, Stefan Wahren wrote:
 Hi Peter,
 
 Am 05.03.2015 um 11:35 schrieb Peter Chen:
  Hi lists,
 
  Any good ways at code/dts to show parent/child hierarchy for regulator?
 
  The related regulators at my platforms like below:
  PMIC (SWB 5v) -- Switch Chip (GPIO Regulator) -- USB VBUS
 
  PMIC has one 5V regulator (eg, swbst at pfuse), and it is the input
  for USB power switch chip, and there are two gpios at this switch
  chip to control if 5V is output or not, we register these two gpios as 
  fixed regulators, currently, if regulator swbst is disabled, the
  gpio regulator has no way to know, and cause the vbus voltage is wrong.
 
  Thanks in advance.
 
 
 i don't have an answer to your question, but do you think of i.MX28
 platform?
 

No, many Freescale i.mx6 SDB boards need to consider this problem.
-- 

Best Regards,
Peter Chen
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: parent/child hierarchy for regulator

2015-03-05 Thread Peter Chen
On Thu, Mar 05, 2015 at 12:22:34PM +, Mark Brown wrote:
 On Thu, Mar 05, 2015 at 06:35:36PM +0800, Peter Chen wrote:
 
  Any good ways at code/dts to show parent/child hierarchy for regulator?
 
 There's plenty of examples in mainline...
 

thanks, I am back to study again.

  The related regulators at my platforms like below:
  PMIC (SWB 5v) -- Switch Chip (GPIO Regulator) -- USB VBUS
 
  PMIC has one 5V regulator (eg, swbst at pfuse), and it is the input
  for USB power switch chip, and there are two gpios at this switch
  chip to control if 5V is output or not, we register these two gpios as 
  fixed regulators, currently, if regulator swbst is disabled, the
  gpio regulator has no way to know, and cause the vbus voltage is wrong.
 
 Can you please clarify why you're registering two fixed voltage
 regulators for the switch chip and how you're doing that?

Two fixed regulators for two USB vbus, there are no relationships beween
them, but both of them needs PMIC 5V (swbst at pfuse) to be enabled.

 The picture
 above looks like you should just have a single regulator there and
 nothing should care if the either regulator is enabled when querying the
 parent for its voltage.

I need to care about its parent's status, currently, the usb code does
not consider parent regulator, so after below patch, the voltage of
vbus is incorrect, due to parent regulator is disabled after boots up,
there is no user for this parent regulator.

commit a6dcf9782f99a0d844b4d06f65cc990468424068
Author: Sean Cross x...@kosagi.com
Date:   Mon May 26 16:45:40 2014 +0800

regulator: pfuze100: Support SWB enable/disable

The SWB regulators have the ability to be turned on and off.
Add enable/disable support for these regulators.

-- 

Best Regards,
Peter Chen
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


parent/child hierarchy for regulator

2015-03-05 Thread Peter Chen
Hi lists,

Any good ways at code/dts to show parent/child hierarchy for regulator?

The related regulators at my platforms like below:
PMIC (SWB 5v) -- Switch Chip (GPIO Regulator) -- USB VBUS

PMIC has one 5V regulator (eg, swbst at pfuse), and it is the input
for USB power switch chip, and there are two gpios at this switch
chip to control if 5V is output or not, we register these two gpios as 
fixed regulators, currently, if regulator swbst is disabled, the
gpio regulator has no way to know, and cause the vbus voltage is wrong.

Thanks in advance.

-- 

Best Regards,
Peter Chen
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: parent/child hierarchy for regulator

2015-03-05 Thread Stefan Wahren
Hi Peter,

Am 05.03.2015 um 11:35 schrieb Peter Chen:
 Hi lists,

 Any good ways at code/dts to show parent/child hierarchy for regulator?

 The related regulators at my platforms like below:
 PMIC (SWB 5v) -- Switch Chip (GPIO Regulator) -- USB VBUS

 PMIC has one 5V regulator (eg, swbst at pfuse), and it is the input
 for USB power switch chip, and there are two gpios at this switch
 chip to control if 5V is output or not, we register these two gpios as 
 fixed regulators, currently, if regulator swbst is disabled, the
 gpio regulator has no way to know, and cause the vbus voltage is wrong.

 Thanks in advance.


i don't have an answer to your question, but do you think of i.MX28
platform?

Regards
Stefan
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: parent/child hierarchy for regulator

2015-03-05 Thread Mark Brown
On Thu, Mar 05, 2015 at 06:35:36PM +0800, Peter Chen wrote:

 Any good ways at code/dts to show parent/child hierarchy for regulator?

There's plenty of examples in mainline...

 The related regulators at my platforms like below:
 PMIC (SWB 5v) -- Switch Chip (GPIO Regulator) -- USB VBUS

 PMIC has one 5V regulator (eg, swbst at pfuse), and it is the input
 for USB power switch chip, and there are two gpios at this switch
 chip to control if 5V is output or not, we register these two gpios as 
 fixed regulators, currently, if regulator swbst is disabled, the
 gpio regulator has no way to know, and cause the vbus voltage is wrong.

Can you please clarify why you're registering two fixed voltage
regulators for the switch chip and how you're doing that?  The picture
above looks like you should just have a single regulator there and
nothing should care if the either regulator is enabled when querying the
parent for its voltage.


signature.asc
Description: Digital signature


Re: parent/child hierarchy for regulator

2015-03-05 Thread Peter Chen
On Thu, Mar 05, 2015 at 12:22:34PM +, Mark Brown wrote:
 On Thu, Mar 05, 2015 at 06:35:36PM +0800, Peter Chen wrote:
 
  Any good ways at code/dts to show parent/child hierarchy for regulator?
 
 There's plenty of examples in mainline...
 

Thanks, I get answer for adding parent regulator for fixed regulator,
it is very easy, we only need to add 'vin-supply = parent_reg;'
at fixed's property.

-- 

Best Regards,
Peter Chen
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/