public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] OMAP4: Regulator: Specify system has fully specified constraints
@ 2011-06-22  0:24 Girish S G
  2011-06-22 22:12 ` Pandita, Vikram
  0 siblings, 1 reply; 4+ messages in thread
From: Girish S G @ 2011-06-22  0:24 UTC (permalink / raw)
  To: linux-omap; +Cc: Girish S G

As of now, the unused regulators are not getting disabled. Only those
regulators are disabled which are properly handled by drivers.

Calling regulator_has_full_constraints() will cause the regulator
core to disable all regulators which have a zero use count and don't
have always_on=true specified during registration.

Signed-off-by: Girish S G <girishsg@ti.com>
---
 arch/arm/mach-omap2/board-4430sdp.c    |    3 +++
 arch/arm/mach-omap2/board-omap4panda.c |    3 +++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
index 04b7770..46f6800 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -560,6 +560,9 @@ static struct i2c_board_info __initdata sdp4430_i2c_4_boardinfo[] = {
 };
 static int __init omap4_i2c_init(void)
 {
+	/* This will allow unused regulator to be shutdown */
+	regulator_has_full_constraints();
+
 	omap4_pmic_init("twl6030", &sdp4430_twldata);
 	omap_register_i2c_bus(2, 400, NULL, 0);
 	omap_register_i2c_bus(3, 400, sdp4430_i2c_3_boardinfo,
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
index 3415a5e..c425f9f 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -412,6 +412,9 @@ static struct i2c_board_info __initdata panda_i2c_eeprom[] = {
 
 static int __init omap4_panda_i2c_init(void)
 {
+	/* This will allow unused regulator to be shutdown */
+	regulator_has_full_constraints();
+
 	omap4_pmic_init("twl6030", &omap4_panda_twldata);
 	omap_register_i2c_bus(2, 400, NULL, 0);
 	/*
-- 
1.6.0.4


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

* Re: [PATCH 2/2] OMAP4: Regulator: Specify system has fully specified constraints
  2011-06-22  0:24 [PATCH 2/2] OMAP4: Regulator: Specify system has fully specified constraints Girish S G
@ 2011-06-22 22:12 ` Pandita, Vikram
  2011-06-22 22:32   ` Ghongdemath, Girish
  0 siblings, 1 reply; 4+ messages in thread
From: Pandita, Vikram @ 2011-06-22 22:12 UTC (permalink / raw)
  To: Girish S G; +Cc: linux-omap

On Tue, Jun 21, 2011 at 5:24 PM, Girish S G <girishsg@ti.com> wrote:
<snip>
> diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
> index 04b7770..46f6800 100644
> --- a/arch/arm/mach-omap2/board-4430sdp.c
> +++ b/arch/arm/mach-omap2/board-4430sdp.c
> @@ -560,6 +560,9 @@ static struct i2c_board_info __initdata sdp4430_i2c_4_boardinfo[] = {
>  };
>  static int __init omap4_i2c_init(void)
>  {
> +       /* This will allow unused regulator to be shutdown */
> +       regulator_has_full_constraints();
> +

Any particular reason to keep this call in i2c_init() function?
Does not look very intuitive to have generic regulator disable call in
an i2c init function !


>        omap4_pmic_init("twl6030", &sdp4430_twldata);
>        omap_register_i2c_bus(2, 400, NULL, 0);
>        omap_register_i2c_bus(3, 400, sdp4430_i2c_3_boardinfo,
> diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
> index 3415a5e..c425f9f 100644
> --- a/arch/arm/mach-omap2/board-omap4panda.c
> +++ b/arch/arm/mach-omap2/board-omap4panda.c
> @@ -412,6 +412,9 @@ static struct i2c_board_info __initdata panda_i2c_eeprom[] = {
>
>  static int __init omap4_panda_i2c_init(void)
>  {
> +       /* This will allow unused regulator to be shutdown */
> +       regulator_has_full_constraints();
> +

ditto

>        omap4_pmic_init("twl6030", &omap4_panda_twldata);
>        omap_register_i2c_bus(2, 400, NULL, 0);
>        /*
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 2/2] OMAP4: Regulator: Specify system has fully specified constraints
  2011-06-22 22:12 ` Pandita, Vikram
@ 2011-06-22 22:32   ` Ghongdemath, Girish
  2011-06-27 23:11     ` Kevin Hilman
  0 siblings, 1 reply; 4+ messages in thread
From: Ghongdemath, Girish @ 2011-06-22 22:32 UTC (permalink / raw)
  To: Pandita, Vikram; +Cc: linux-omap

On Wed, Jun 22, 2011 at 5:12 PM, Pandita, Vikram <vikram.pandita@ti.com> wrote:
> On Tue, Jun 21, 2011 at 5:24 PM, Girish S G <girishsg@ti.com> wrote:
> <snip>
>> diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
>> index 04b7770..46f6800 100644
>> --- a/arch/arm/mach-omap2/board-4430sdp.c
>> +++ b/arch/arm/mach-omap2/board-4430sdp.c
>> @@ -560,6 +560,9 @@ static struct i2c_board_info __initdata sdp4430_i2c_4_boardinfo[] = {
>>  };
>>  static int __init omap4_i2c_init(void)
>>  {
>> +       /* This will allow unused regulator to be shutdown */
>> +       regulator_has_full_constraints();
>> +
>
> Any particular reason to keep this call in i2c_init() function?
> Does not look very intuitive to have generic regulator disable call in
> an i2c init function !

In the regulator late init call the core will decide on regulator
status, so this has to be specified
before the pmic/twl data is registered.


Regards,
Girish

>
>
>>        omap4_pmic_init("twl6030", &sdp4430_twldata);
>>        omap_register_i2c_bus(2, 400, NULL, 0);
>>        omap_register_i2c_bus(3, 400, sdp4430_i2c_3_boardinfo,
>> diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
>> index 3415a5e..c425f9f 100644
>> --- a/arch/arm/mach-omap2/board-omap4panda.c
>> +++ b/arch/arm/mach-omap2/board-omap4panda.c
>> @@ -412,6 +412,9 @@ static struct i2c_board_info __initdata panda_i2c_eeprom[] = {
>>
>>  static int __init omap4_panda_i2c_init(void)
>>  {
>> +       /* This will allow unused regulator to be shutdown */
>> +       regulator_has_full_constraints();
>> +
>
> ditto
>
>>        omap4_pmic_init("twl6030", &omap4_panda_twldata);
>>        omap_register_i2c_bus(2, 400, NULL, 0);
>>        /*
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 2/2] OMAP4: Regulator: Specify system has fully specified constraints
  2011-06-22 22:32   ` Ghongdemath, Girish
@ 2011-06-27 23:11     ` Kevin Hilman
  0 siblings, 0 replies; 4+ messages in thread
From: Kevin Hilman @ 2011-06-27 23:11 UTC (permalink / raw)
  To: Ghongdemath, Girish; +Cc: Pandita, Vikram, linux-omap

"Ghongdemath, Girish" <girishsg@ti.com> writes:

> On Wed, Jun 22, 2011 at 5:12 PM, Pandita, Vikram <vikram.pandita@ti.com> wrote:
>> On Tue, Jun 21, 2011 at 5:24 PM, Girish S G <girishsg@ti.com> wrote:
>> <snip>
>>> diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
>>> index 04b7770..46f6800 100644
>>> --- a/arch/arm/mach-omap2/board-4430sdp.c
>>> +++ b/arch/arm/mach-omap2/board-4430sdp.c
>>> @@ -560,6 +560,9 @@ static struct i2c_board_info __initdata sdp4430_i2c_4_boardinfo[] = {
>>>  };
>>>  static int __init omap4_i2c_init(void)
>>>  {
>>> +       /* This will allow unused regulator to be shutdown */
>>> +       regulator_has_full_constraints();
>>> +
>>
>> Any particular reason to keep this call in i2c_init() function?
>> Does not look very intuitive to have generic regulator disable call in
>> an i2c init function !
>
> In the regulator late init call the core will decide on regulator
> status, so this has to be specified
> before the pmic/twl data is registered.

Vikram's point still stands.   This is not related to I2C init, so it
should not be in the i2c init function.

Just make it the last call the machine-specific .init_machine function.

Kevin

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2011-06-27 23:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-22  0:24 [PATCH 2/2] OMAP4: Regulator: Specify system has fully specified constraints Girish S G
2011-06-22 22:12 ` Pandita, Vikram
2011-06-22 22:32   ` Ghongdemath, Girish
2011-06-27 23:11     ` Kevin Hilman

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