public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] omap2plus: Remove auto selection on PMICs
@ 2011-02-23 12:11 Sanjeev Premi
  2011-02-25 18:16 ` Tony Lindgren
  0 siblings, 1 reply; 6+ messages in thread
From: Sanjeev Premi @ 2011-02-23 12:11 UTC (permalink / raw)
  To: linux-omap; +Cc: Sanjeev Premi

The current implementation almost assumes that only
TWL4030/TWL5030/TWl6030 are (or can be) used with the
OMAP processors. This is, however, not true.

This patch removes the automatic selection of the PMIC
from Kconfig. Current defaults are chosen in default
configuration omap2plus_defconfig and can easily be
added to configuration for any board, there should be
no compile/run-time impact.

Signed-off-by: Sanjeev Premi <premi@ti.com>
---
Compiled omap2plus-defconfig and boot tested on
OMAP3EVM Rev G.

 arch/arm/mach-omap2/Kconfig |    3 ---
 drivers/mfd/Kconfig         |    4 ++--
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index ae7f47d..9c4f903 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -16,9 +16,6 @@ config ARCH_OMAP2PLUS_TYPICAL
 	select I2C
 	select I2C_OMAP
 	select MFD_SUPPORT
-	select MENELAUS if ARCH_OMAP2
-	select TWL4030_CORE if ARCH_OMAP3 || ARCH_OMAP4
-	select TWL4030_POWER if ARCH_OMAP3 || ARCH_OMAP4
 	help
 	  Compile a kernel suitable for booting most boards
 
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index fd01836..67dcee4 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -155,7 +155,7 @@ config MENELAUS
 
 config TWL4030_CORE
 	bool "Texas Instruments TWL4030/TWL5030/TWL6030/TPS659x0 Support"
-	depends on I2C=y && GENERIC_HARDIRQS
+	depends on I2C=y && GENERIC_HARDIRQS && (ARCH_OMAP3 || ARCH_OMAP4)
 	help
 	  Say yes here if you have TWL4030 / TWL6030 family chip on your board.
 	  This core driver provides register access and IRQ handling
@@ -169,7 +169,7 @@ config TWL4030_CORE
 
 config TWL4030_POWER
 	bool "Support power resources on TWL4030 family chips"
-	depends on TWL4030_CORE && ARM
+	depends on TWL4030_CORE && (ARCH_OMAP3 || ARCH_OMAP4)
 	help
 	  Say yes here if you want to use the power resources on the
 	  TWL4030 family chips.  Most of these resources are regulators,
-- 
1.7.2.2


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

* Re: [PATCH] omap2plus: Remove auto selection on PMICs
  2011-02-23 12:11 [PATCH] omap2plus: Remove auto selection on PMICs Sanjeev Premi
@ 2011-02-25 18:16 ` Tony Lindgren
  2011-02-25 18:17   ` [PATCH] omap: Fix compile if MTD_NAND_OMAP2 is not selected Tony Lindgren
  2011-02-26  8:29   ` [PATCH] omap2plus: Remove auto selection on PMICs Premi, Sanjeev
  0 siblings, 2 replies; 6+ messages in thread
From: Tony Lindgren @ 2011-02-25 18:16 UTC (permalink / raw)
  To: Sanjeev Premi; +Cc: linux-omap

* Sanjeev Premi <premi@ti.com> [110223 04:11]:
> The current implementation almost assumes that only
> TWL4030/TWL5030/TWl6030 are (or can be) used with the
> OMAP processors. This is, however, not true.

If selecting these on platforms that don't have twl
causes problems the problem should be fixed.

You can disable CONFIG_ARCH_OMAP2PLUS_TYPICAL, and
then these don't get selected.
 
> This patch removes the automatic selection of the PMIC
> from Kconfig. Current defaults are chosen in default
> configuration omap2plus_defconfig and can easily be
> added to configuration for any board, there should be
> no compile/run-time impact.

The reason for CONFIG_ARCH_OMAP2PLUS_TYPICAL is to
produce a booting kernel if you do the following:

$ echo CONFIG_ARCH_OMAP=y > .config
$ yes "" | ARCH=arm make oldconfig
$ ARCH=arm CROSS_COMPILE=mycompiler uImage

So I'd rather keep it around for now. In the long run
omap2plus_defconfig should build a working kernel with
everything as modules though..

BTW, looks like small patch is needed with the patches queued
in omap-for-linus to make the above compile. Will post
as a reply to this mail.

Regards,

Tony


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

* [PATCH] omap: Fix compile if MTD_NAND_OMAP2 is not selected
  2011-02-25 18:16 ` Tony Lindgren
@ 2011-02-25 18:17   ` Tony Lindgren
  2011-02-26  8:29   ` [PATCH] omap2plus: Remove auto selection on PMICs Premi, Sanjeev
  1 sibling, 0 replies; 6+ messages in thread
From: Tony Lindgren @ 2011-02-25 18:17 UTC (permalink / raw)
  To: Sanjeev Premi; +Cc: linux-omap

Fix compile if MTD_NAND_OMAP2 is not selected

Signed-off-by: Tony Lindgren <tony@atomide.com>

--- a/arch/arm/mach-omap2/board-flash.c
+++ b/arch/arm/mach-omap2/board-flash.c
@@ -154,7 +154,7 @@ __init board_nand_init(struct mtd_partition *nand_parts,
 }
 #else
 void
-__init board_nand_init(struct mtd_partition *nand_parts, u8 nr_parts, u8 cs)
+__init board_nand_init(struct mtd_partition *nand_parts, u8 nr_parts, u8 cs, int nand_type)
 {
 }
 #endif /* CONFIG_MTD_NAND_OMAP2 || CONFIG_MTD_NAND_OMAP2_MODULE */

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

* RE: [PATCH] omap2plus: Remove auto selection on PMICs
  2011-02-25 18:16 ` Tony Lindgren
  2011-02-25 18:17   ` [PATCH] omap: Fix compile if MTD_NAND_OMAP2 is not selected Tony Lindgren
@ 2011-02-26  8:29   ` Premi, Sanjeev
  2011-03-02 18:04     ` Tony Lindgren
  1 sibling, 1 reply; 6+ messages in thread
From: Premi, Sanjeev @ 2011-02-26  8:29 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-omap@vger.kernel.org

> -----Original Message-----
> From: Tony Lindgren [mailto:tony@atomide.com]
> Sent: Friday, February 25, 2011 11:47 PM
> To: Premi, Sanjeev
> Cc: linux-omap@vger.kernel.org
> Subject: Re: [PATCH] omap2plus: Remove auto selection on PMICs
> 
> * Sanjeev Premi <premi@ti.com> [110223 04:11]:
> > The current implementation almost assumes that only
> > TWL4030/TWL5030/TWl6030 are (or can be) used with the
> > OMAP processors. This is, however, not true.
> 
> If selecting these on platforms that don't have twl
> causes problems the problem should be fixed.
> 
> You can disable CONFIG_ARCH_OMAP2PLUS_TYPICAL, and
> then these don't get selected.

[sp] But this means MUTLI_OMAP breaks. And same uImage
     won't run on the AM3517 EVM.

     If I remember, the problem is caused due to twl specific
     functions called even if it isn't present. And there is
     implicit assumption on TWL in most of code.
> 
> > This patch removes the automatic selection of the PMIC
> > from Kconfig. Current defaults are chosen in default
> > configuration omap2plus_defconfig and can easily be
> > added to configuration for any board, there should be
> > no compile/run-time impact.
> 
> The reason for CONFIG_ARCH_OMAP2PLUS_TYPICAL is to
> produce a booting kernel if you do the following:
> 
> $ echo CONFIG_ARCH_OMAP=y > .config
> $ yes "" | ARCH=arm make oldconfig
> $ ARCH=arm CROSS_COMPILE=mycompiler uImage
> 
> So I'd rather keep it around for now. In the long run
> omap2plus_defconfig should build a working kernel with
> everything as modules though..

[sp] I will be away from work for next week; may not
     be able to try this; but don't you think dependency
     on ARM is too generic? And this should still be fixed..

-	depends on TWL4030_CORE && ARM
+	depends on TWL4030_CORE && (ARCH_OMAP3 || ARCH_OMAP4)

~sanjeev

> 
> BTW, looks like small patch is needed with the patches queued
> in omap-for-linus to make the above compile. Will post
> as a reply to this mail.
> 
> Regards,
> 
> Tony


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

* Re: [PATCH] omap2plus: Remove auto selection on PMICs
  2011-02-26  8:29   ` [PATCH] omap2plus: Remove auto selection on PMICs Premi, Sanjeev
@ 2011-03-02 18:04     ` Tony Lindgren
  2011-03-07  9:33       ` Premi, Sanjeev
  0 siblings, 1 reply; 6+ messages in thread
From: Tony Lindgren @ 2011-03-02 18:04 UTC (permalink / raw)
  To: Premi, Sanjeev; +Cc: linux-omap@vger.kernel.org

* Premi, Sanjeev <premi@ti.com> [110226 00:27]:
> > -----Original Message-----
> > From: Tony Lindgren [mailto:tony@atomide.com]
> > Sent: Friday, February 25, 2011 11:47 PM
> > To: Premi, Sanjeev
> > Cc: linux-omap@vger.kernel.org
> > Subject: Re: [PATCH] omap2plus: Remove auto selection on PMICs
> > 
> > * Sanjeev Premi <premi@ti.com> [110223 04:11]:
> > > The current implementation almost assumes that only
> > > TWL4030/TWL5030/TWl6030 are (or can be) used with the
> > > OMAP processors. This is, however, not true.
> > 
> > If selecting these on platforms that don't have twl
> > causes problems the problem should be fixed.
> > 
> > You can disable CONFIG_ARCH_OMAP2PLUS_TYPICAL, and
> > then these don't get selected.
> 
> [sp] But this means MUTLI_OMAP breaks. And same uImage
>      won't run on the AM3517 EVM.
> 
>      If I remember, the problem is caused due to twl specific
>      functions called even if it isn't present. And there is
>      implicit assumption on TWL in most of code.

Then let's fix that problem instead. The TWL functions should
not get called (or at least they should not do anything)
unless the TWL chip is there.

> [sp] I will be away from work for next week; may not
>      be able to try this; but don't you think dependency
>      on ARM is too generic? And this should still be fixed..
> 
> -	depends on TWL4030_CORE && ARM
> +	depends on TWL4030_CORE && (ARCH_OMAP3 || ARCH_OMAP4)

Well in theory all the drivers should just build on whatever
platform. I don't know if changing that really improves things,
we should improve the driver instead.

Note for example how the tps65010.c driver also builds on x86.
That allows people doing Linux generic changes to build test
those changes:

$git log --pretty=oneline drivers/mfd/tps65010.c
77b22897da093e80c40f03e8d83bf23e756b9fba mfd: Include <linux/gpio.h> instead of 
afdb32f2e463a195c104555ac9a8cdd39a2b6561 mfd: update workqueue usages
fbae3fb1546e199ab0cd185348f8124411a1ca9d i2c: Remove all i2c_set_clientdata(clie
f322d5f0097333343bfd92b47258ee997c889263 mfd: Fix dangling pointersRegards,
...

So instead of breakage for the tps65010 driver we instead got
the above changes compile tested as an extra bonus.

Regards,

Tony

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

* RE: [PATCH] omap2plus: Remove auto selection on PMICs
  2011-03-02 18:04     ` Tony Lindgren
@ 2011-03-07  9:33       ` Premi, Sanjeev
  0 siblings, 0 replies; 6+ messages in thread
From: Premi, Sanjeev @ 2011-03-07  9:33 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-omap@vger.kernel.org

> -----Original Message-----
> From: Tony Lindgren [mailto:tony@atomide.com]
> Sent: Wednesday, March 02, 2011 11:34 PM
> To: Premi, Sanjeev
> Cc: linux-omap@vger.kernel.org
> Subject: Re: [PATCH] omap2plus: Remove auto selection on PMICs
> 
> * Premi, Sanjeev <premi@ti.com> [110226 00:27]:
> > > -----Original Message-----
> > > From: Tony Lindgren [mailto:tony@atomide.com]
> > > Sent: Friday, February 25, 2011 11:47 PM
> > > To: Premi, Sanjeev
> > > Cc: linux-omap@vger.kernel.org
> > > Subject: Re: [PATCH] omap2plus: Remove auto selection on PMICs
> > >
> > > * Sanjeev Premi <premi@ti.com> [110223 04:11]:
> > > > The current implementation almost assumes that only
> > > > TWL4030/TWL5030/TWl6030 are (or can be) used with the
> > > > OMAP processors. This is, however, not true.
> > >
> > > If selecting these on platforms that don't have twl
> > > causes problems the problem should be fixed.
> > >
> > > You can disable CONFIG_ARCH_OMAP2PLUS_TYPICAL, and
> > > then these don't get selected.
> >
> > [sp] But this means MUTLI_OMAP breaks. And same uImage
> >      won't run on the AM3517 EVM.
> >
> >      If I remember, the problem is caused due to twl specific
> >      functions called even if it isn't present. And there is
> >      implicit assumption on TWL in most of code.
> 
> Then let's fix that problem instead. The TWL functions should
> not get called (or at least they should not do anything)
> unless the TWL chip is there.

[sp] Agree. Driver needs to be fixed. But, will take longer and
     AM35x will continue to suffer. Will start on this... 

> 
> > [sp] I will be away from work for next week; may not
> >      be able to try this; but don't you think dependency
> >      on ARM is too generic? And this should still be fixed..

[sp] I haven't yet tried it myself. Need to clear lot of regular
     backlog before I can try this later this week.

> >
> > -	depends on TWL4030_CORE && ARM
> > +	depends on TWL4030_CORE && (ARCH_OMAP3 || ARCH_OMAP4)
> 
> Well in theory all the drivers should just build on whatever
> platform. I don't know if changing that really improves things,
> we should improve the driver instead.
> 
> Note for example how the tps65010.c driver also builds on x86.
> That allows people doing Linux generic changes to build test
> those changes:
[sp] Agree. But TPS6510 is far more generic PMIC than TWL4030 or
     others in the same family.

     Going by the argument, we should then be removing processor
     dependency altogether, i.e:
 -	depends on TWL4030_CORE && ARM
 +	depends on TWL4030_CORE

> 
> $git log --pretty=oneline drivers/mfd/tps65010.c
> 77b22897da093e80c40f03e8d83bf23e756b9fba mfd: Include <linux/gpio.h>
> instead of
> afdb32f2e463a195c104555ac9a8cdd39a2b6561 mfd: update workqueue usages
> fbae3fb1546e199ab0cd185348f8124411a1ca9d i2c: Remove all
> i2c_set_clientdata(clie
> f322d5f0097333343bfd92b47258ee997c889263 mfd: Fix dangling
> pointersRegards,
> ...
> 
> So instead of breakage for the tps65010 driver we instead got
> the above changes compile tested as an extra bonus.
> 
> Regards,
> 
> Tony

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

end of thread, other threads:[~2011-03-07  9:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-23 12:11 [PATCH] omap2plus: Remove auto selection on PMICs Sanjeev Premi
2011-02-25 18:16 ` Tony Lindgren
2011-02-25 18:17   ` [PATCH] omap: Fix compile if MTD_NAND_OMAP2 is not selected Tony Lindgren
2011-02-26  8:29   ` [PATCH] omap2plus: Remove auto selection on PMICs Premi, Sanjeev
2011-03-02 18:04     ` Tony Lindgren
2011-03-07  9:33       ` Premi, Sanjeev

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