All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Input: TPS6507X - define MFD dependencies for touch and regulator unit
@ 2011-07-11 10:50 Yegor Yefremov
  2011-07-11 12:20 ` Mark Brown
  0 siblings, 1 reply; 7+ messages in thread
From: Yegor Yefremov @ 2011-07-11 10:50 UTC (permalink / raw)
  To: linux-input; +Cc: dmitry.torokhov

both touchscreen and regulator units are only working if
mfd device is activated. So if mfd support is enabled,
select TPS6507X mfd support automatically.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
---
 drivers/input/touchscreen/Kconfig |    3 ++-
 drivers/regulator/Kconfig         |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

Index: b/drivers/input/touchscreen/Kconfig
===================================================================
--- a/drivers/input/touchscreen/Kconfig
+++ b/drivers/input/touchscreen/Kconfig
@@ -716,7 +716,8 @@
 
 config TOUCHSCREEN_TPS6507X
 	tristate "TPS6507x based touchscreens"
-	depends on I2C
+	depends on I2C && MFD_SUPPORT
+	select TPS6507X
 	help
 	  Say Y here if you have a TPS6507x based touchscreen
 	  controller.
Index: b/drivers/regulator/Kconfig
===================================================================
--- a/drivers/regulator/Kconfig
+++ b/drivers/regulator/Kconfig
@@ -242,7 +242,8 @@
 
 config REGULATOR_TPS6507X
 	tristate "TI TPS6507X Power regulators"
-	depends on I2C
+	depends on I2C && MFD_SUPPORT
+	select TPS6507X
 	help
 	  This driver supports TPS6507X voltage regulator chips. TPS6507X provides
 	  three step-down converters and two general-purpose LDO voltage regulators.


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

* Re: [PATCH] Input: TPS6507X - define MFD dependencies for touch and regulator unit
  2011-07-11 10:50 [PATCH] Input: TPS6507X - define MFD dependencies for touch and regulator unit Yegor Yefremov
@ 2011-07-11 12:20 ` Mark Brown
  2011-07-11 12:29   ` Yegor Yefremov
  2011-07-11 16:41   ` Dmitry Torokhov
  0 siblings, 2 replies; 7+ messages in thread
From: Mark Brown @ 2011-07-11 12:20 UTC (permalink / raw)
  To: yegor_sub1; +Cc: linux-input, dmitry.torokhov

On Mon, Jul 11, 2011 at 12:50:19PM +0200, Yegor Yefremov wrote:
> both touchscreen and regulator units are only working if
> mfd device is activated. So if mfd support is enabled,
> select TPS6507X mfd support automatically.
> 
> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>

This should be split into separate patches and sent to *all* the
relevant maintainers.

>  config TOUCHSCREEN_TPS6507X
>  	tristate "TPS6507x based touchscreens"
> -	depends on I2C
> +	depends on I2C && MFD_SUPPORT
> +	select TPS6507X

This isn't a good fix, the driver should depend on the MFD core not
select it.

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

* Re: [PATCH] Input: TPS6507X - define MFD dependencies for touch and regulator unit
  2011-07-11 12:20 ` Mark Brown
@ 2011-07-11 12:29   ` Yegor Yefremov
  2011-07-11 14:08     ` Mark Brown
  2011-07-11 16:41   ` Dmitry Torokhov
  1 sibling, 1 reply; 7+ messages in thread
From: Yegor Yefremov @ 2011-07-11 12:29 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-input, dmitry.torokhov

Am 11.07.2011 14:20, schrieb Mark Brown:
> On Mon, Jul 11, 2011 at 12:50:19PM +0200, Yegor Yefremov wrote:
>> both touchscreen and regulator units are only working if
>> mfd device is activated. So if mfd support is enabled,
>> select TPS6507X mfd support automatically.
>>
>> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
> This should be split into separate patches and sent to *all* the
> relevant maintainers.
>
>>  config TOUCHSCREEN_TPS6507X
>>  	tristate "TPS6507x based touchscreens"
>> -	depends on I2C
>> +	depends on I2C && MFD_SUPPORT
>> +	select TPS6507X
> This isn't a good fix, the driver should depend on the MFD core not
> select it.

Thanks for reviewing. Should I change the patch like this:

touchscreen unit is only working if mfd device is activated.
So if mfd support is enabled, select TPS6507X mfd support
automatically.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
---
 drivers/input/touchscreen/Kconfig |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: b/drivers/input/touchscreen/Kconfig
===================================================================
--- a/drivers/input/touchscreen/Kconfig
+++ b/drivers/input/touchscreen/Kconfig
@@ -716,7 +716,7 @@

 config TOUCHSCREEN_TPS6507X
        tristate "TPS6507x based touchscreens"
-       depends on I2C
+       depends on I2C && TPS6507X
        help
          Say Y here if you have a TPS6507x based touchscreen
          controller.


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

* Re: [PATCH] Input: TPS6507X - define MFD dependencies for touch and regulator unit
  2011-07-11 12:29   ` Yegor Yefremov
@ 2011-07-11 14:08     ` Mark Brown
  0 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2011-07-11 14:08 UTC (permalink / raw)
  To: Yegor Yefremov; +Cc: linux-input, dmitry.torokhov

On Mon, Jul 11, 2011 at 02:29:39PM +0200, Yegor Yefremov wrote:
> Am 11.07.2011 14:20, schrieb Mark Brown:

>         tristate "TPS6507x based touchscreens"
> -       depends on I2C
> +       depends on I2C && TPS6507X

You can just remove the I2C dependency, the core won't be enabled if teh
control bus isn't there.

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

* Re: [PATCH] Input: TPS6507X - define MFD dependencies for touch and regulator unit
  2011-07-11 12:20 ` Mark Brown
  2011-07-11 12:29   ` Yegor Yefremov
@ 2011-07-11 16:41   ` Dmitry Torokhov
  2011-07-11 22:33     ` Mark Brown
  1 sibling, 1 reply; 7+ messages in thread
From: Dmitry Torokhov @ 2011-07-11 16:41 UTC (permalink / raw)
  To: Mark Brown; +Cc: yegor_sub1, linux-input

On Mon, Jul 11, 2011 at 01:20:04PM +0100, Mark Brown wrote:
> On Mon, Jul 11, 2011 at 12:50:19PM +0200, Yegor Yefremov wrote:
> > both touchscreen and regulator units are only working if
> > mfd device is activated. So if mfd support is enabled,
> > select TPS6507X mfd support automatically.
> > 
> > Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
> 
> This should be split into separate patches and sent to *all* the
> relevant maintainers.
> 
> >  config TOUCHSCREEN_TPS6507X
> >  	tristate "TPS6507x based touchscreens"
> > -	depends on I2C
> > +	depends on I2C && MFD_SUPPORT
> > +	select TPS6507X
> 
> This isn't a good fix, the driver should depend on the MFD core not
> select it.

The problem with such dependencies is that user has to first enable MFD
core and then hunt through all other menus in search of the function
drivers for that chip...

Depending on what other things TPS6507X depends on it might be good idea
to go ahead and select it.

-- 
Dmitry

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

* Re: [PATCH] Input: TPS6507X - define MFD dependencies for touch and regulator unit
  2011-07-11 16:41   ` Dmitry Torokhov
@ 2011-07-11 22:33     ` Mark Brown
  2011-07-12  8:23       ` Yegor Yefremov
  0 siblings, 1 reply; 7+ messages in thread
From: Mark Brown @ 2011-07-11 22:33 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: yegor_sub1, linux-input

On Mon, Jul 11, 2011 at 09:41:24AM -0700, Dmitry Torokhov wrote:
> On Mon, Jul 11, 2011 at 01:20:04PM +0100, Mark Brown wrote:

> > This isn't a good fix, the driver should depend on the MFD core not
> > select it.

> The problem with such dependencies is that user has to first enable MFD
> core and then hunt through all other menus in search of the function
> drivers for that chip...

> Depending on what other things TPS6507X depends on it might be good idea
> to go ahead and select it.

If this is an issue it's going to be much more useful to have the boards
select their MFD cores than have random function drivers do that, in
most situations it's not actually going to be useful to select the core
driver as the core driver itself needs something to select either the
I2C or SPI bus interface for the device in order to actually communicate
with it.

Remember that this is for embedded systems where the user will normally
have a pretty good idea what's on their system, someone will have had to
explicitly plumb the device into the board anyway.

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

* Re: [PATCH] Input: TPS6507X - define MFD dependencies for touch and regulator unit
  2011-07-11 22:33     ` Mark Brown
@ 2011-07-12  8:23       ` Yegor Yefremov
  0 siblings, 0 replies; 7+ messages in thread
From: Yegor Yefremov @ 2011-07-12  8:23 UTC (permalink / raw)
  To: Mark Brown; +Cc: Dmitry Torokhov, linux-input

Am 12.07.2011 00:33, schrieb Mark Brown:
> On Mon, Jul 11, 2011 at 09:41:24AM -0700, Dmitry Torokhov wrote:
>> On Mon, Jul 11, 2011 at 01:20:04PM +0100, Mark Brown wrote:
>>> This isn't a good fix, the driver should depend on the MFD core not
>>> select it.
>> The problem with such dependencies is that user has to first enable MFD
>> core and then hunt through all other menus in search of the function
>> drivers for that chip...
>> Depending on what other things TPS6507X depends on it might be good idea
>> to go ahead and select it.
> If this is an issue it's going to be much more useful to have the boards
> select their MFD cores than have random function drivers do that, in
> most situations it's not actually going to be useful to select the core
> driver as the core driver itself needs something to select either the
> I2C or SPI bus interface for the device in order to actually communicate
> with it.
>
> Remember that this is for embedded systems where the user will normally
> have a pretty good idea what's on their system, someone will have had to
> explicitly plumb the device into the board anyway.

The reason for the patch was following. I have a custom board, that is very close to some other board except of this PMIC (TPS650732). So I copied the platform code from the second board, but  not the configuration. Then I activated the touchscreen driver and wondered, why on earth i2c driver doesn't see this device? At last I found out, that this driver depends on MFD driver and so I made this patch to avoid this situation in the future.

Yegor

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

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

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-11 10:50 [PATCH] Input: TPS6507X - define MFD dependencies for touch and regulator unit Yegor Yefremov
2011-07-11 12:20 ` Mark Brown
2011-07-11 12:29   ` Yegor Yefremov
2011-07-11 14:08     ` Mark Brown
2011-07-11 16:41   ` Dmitry Torokhov
2011-07-11 22:33     ` Mark Brown
2011-07-12  8:23       ` Yegor Yefremov

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.