linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] mfd: Add a dependency on OF
@ 2017-06-06 14:45 Keerthy
  2017-06-06 14:45 ` [PATCH 1/5] mfd: palmas: " Keerthy
                   ` (4 more replies)
  0 siblings, 5 replies; 17+ messages in thread
From: Keerthy @ 2017-06-06 14:45 UTC (permalink / raw)
  To: tony, milo.kim, lee.jones; +Cc: j-keerthy, linux-omap, linux-kernel

Currently few of the drivers boot only via device tree hence add a
dependency on OF.

Signed-off-by: Keerthy <j-keerthy@ti.com> 

Keerthy (5):
  mfd: palmas: Add a dependency on OF
  mfd: tps65218: Add a dependency on OF
  mfd: tps65217: Add a dependency on OF
  mfd: lp873x: Add a dependency on OF
  mfd: lp3943: Add a dependency on OF

 drivers/mfd/Kconfig | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

-- 
1.9.1

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

* [PATCH 1/5] mfd: palmas: Add a dependency on OF
  2017-06-06 14:45 [PATCH 0/5] mfd: Add a dependency on OF Keerthy
@ 2017-06-06 14:45 ` Keerthy
  2017-06-06 14:45 ` [PATCH 2/5] mfd: tps65218: " Keerthy
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 17+ messages in thread
From: Keerthy @ 2017-06-06 14:45 UTC (permalink / raw)
  To: tony, milo.kim, lee.jones; +Cc: j-keerthy, linux-omap, linux-kernel

Currently the driver boots only via device tree hence add a
dependency on OF.

Signed-off-by: Keerthy <j-keerthy@ti.com>
---
 drivers/mfd/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 3eb5c93..b845d28 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -1223,7 +1223,7 @@ config MFD_PALMAS
 	select MFD_CORE
 	select REGMAP_I2C
 	select REGMAP_IRQ
-	depends on I2C=y
+	depends on I2C=y && OF
 	help
 	  If you say yes here you get support for the Palmas
 	  series of PMIC chips from Texas Instruments.
-- 
1.9.1

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

* [PATCH 2/5] mfd: tps65218: Add a dependency on OF
  2017-06-06 14:45 [PATCH 0/5] mfd: Add a dependency on OF Keerthy
  2017-06-06 14:45 ` [PATCH 1/5] mfd: palmas: " Keerthy
@ 2017-06-06 14:45 ` Keerthy
  2017-06-06 14:45 ` [PATCH 3/5] mfd: tps65217: " Keerthy
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 17+ messages in thread
From: Keerthy @ 2017-06-06 14:45 UTC (permalink / raw)
  To: tony, milo.kim, lee.jones; +Cc: j-keerthy, linux-omap, linux-kernel

Currently the driver boots only via device tree hence add a
dependency on OF.

Signed-off-by: Keerthy <j-keerthy@ti.com>
---
 drivers/mfd/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index b845d28..75b59f1 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -1327,7 +1327,7 @@ config MFD_TI_LP873X
 
 config MFD_TPS65218
 	tristate "TI TPS65218 Power Management chips"
-	depends on I2C
+	depends on I2C && OF
 	select MFD_CORE
 	select REGMAP_I2C
 	select REGMAP_IRQ
-- 
1.9.1

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

* [PATCH 3/5] mfd: tps65217: Add a dependency on OF
  2017-06-06 14:45 [PATCH 0/5] mfd: Add a dependency on OF Keerthy
  2017-06-06 14:45 ` [PATCH 1/5] mfd: palmas: " Keerthy
  2017-06-06 14:45 ` [PATCH 2/5] mfd: tps65218: " Keerthy
@ 2017-06-06 14:45 ` Keerthy
  2017-06-06 15:04   ` Enric Balletbo Serra
  2017-06-06 14:45 ` [PATCH 4/5] mfd: lp873x: " Keerthy
  2017-06-06 14:45 ` [PATCH 5/5] mfd: lp3943: " Keerthy
  4 siblings, 1 reply; 17+ messages in thread
From: Keerthy @ 2017-06-06 14:45 UTC (permalink / raw)
  To: tony, milo.kim, lee.jones; +Cc: j-keerthy, linux-omap, linux-kernel

Currently the driver boots only via device tree hence add a
dependency on OF.

Signed-off-by: Keerthy <j-keerthy@ti.com>
---
 drivers/mfd/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 75b59f1..2d1425d 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -1297,7 +1297,7 @@ config MFD_TPS65090
 
 config MFD_TPS65217
 	tristate "TI TPS65217 Power Management / White LED chips"
-	depends on I2C
+	depends on I2C && OF
 	select MFD_CORE
 	select REGMAP_I2C
 	select IRQ_DOMAIN
-- 
1.9.1

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

* [PATCH 4/5] mfd: lp873x: Add a dependency on OF
  2017-06-06 14:45 [PATCH 0/5] mfd: Add a dependency on OF Keerthy
                   ` (2 preceding siblings ...)
  2017-06-06 14:45 ` [PATCH 3/5] mfd: tps65217: " Keerthy
@ 2017-06-06 14:45 ` Keerthy
  2017-06-06 14:45 ` [PATCH 5/5] mfd: lp3943: " Keerthy
  4 siblings, 0 replies; 17+ messages in thread
From: Keerthy @ 2017-06-06 14:45 UTC (permalink / raw)
  To: tony, milo.kim, lee.jones; +Cc: j-keerthy, linux-omap, linux-kernel

Currently the driver boots only via device tree hence add a
dependency on OF.

Signed-off-by: Keerthy <j-keerthy@ti.com>
---
 drivers/mfd/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 2d1425d..83d6b57 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -1313,7 +1313,7 @@ config MFD_TPS65217
 
 config MFD_TI_LP873X
 	tristate "TI LP873X Power Management IC"
-	depends on I2C
+	depends on I2C && OF
 	select MFD_CORE
 	select REGMAP_I2C
 	help
-- 
1.9.1

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

* [PATCH 5/5] mfd: lp3943: Add a dependency on OF
  2017-06-06 14:45 [PATCH 0/5] mfd: Add a dependency on OF Keerthy
                   ` (3 preceding siblings ...)
  2017-06-06 14:45 ` [PATCH 4/5] mfd: lp873x: " Keerthy
@ 2017-06-06 14:45 ` Keerthy
  4 siblings, 0 replies; 17+ messages in thread
From: Keerthy @ 2017-06-06 14:45 UTC (permalink / raw)
  To: tony, milo.kim, lee.jones; +Cc: j-keerthy, linux-omap, linux-kernel

Currently the driver boots only via device tree hence add a
dependency on OF.

Signed-off-by: Keerthy <j-keerthy@ti.com>
---
 drivers/mfd/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 83d6b57..4decbfb 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -1178,7 +1178,7 @@ config MFD_DM355EVM_MSP
 
 config MFD_LP3943
 	tristate "TI/National Semiconductor LP3943 MFD Driver"
-	depends on I2C
+	depends on I2C && OF
 	select MFD_CORE
 	select REGMAP_I2C
 	help
-- 
1.9.1

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

* Re: [PATCH 3/5] mfd: tps65217: Add a dependency on OF
  2017-06-06 14:45 ` [PATCH 3/5] mfd: tps65217: " Keerthy
@ 2017-06-06 15:04   ` Enric Balletbo Serra
  2017-06-07  4:45     ` Keerthy
  0 siblings, 1 reply; 17+ messages in thread
From: Enric Balletbo Serra @ 2017-06-06 15:04 UTC (permalink / raw)
  To: Keerthy; +Cc: Tony Lindgren, milo.kim, Lee Jones, linux-omap, linux-kernel

Hi Keerthy,

By change I was looking at this. Some comments below that I think can
be applied to all patches in this series

2017-06-06 16:45 GMT+02:00 Keerthy <j-keerthy@ti.com>:
> Currently the driver boots only via device tree hence add a
> dependency on OF.
>
> Signed-off-by: Keerthy <j-keerthy@ti.com>
> ---
>  drivers/mfd/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> index 75b59f1..2d1425d 100644
> --- a/drivers/mfd/Kconfig
> +++ b/drivers/mfd/Kconfig
> @@ -1297,7 +1297,7 @@ config MFD_TPS65090
>
>  config MFD_TPS65217
>         tristate "TI TPS65217 Power Management / White LED chips"
> -       depends on I2C
> +       depends on I2C && OF

Shouldn't you add || COMPILE_TEST here ?

>         select MFD_CORE
>         select REGMAP_I2C
>         select IRQ_DOMAIN
> --
> 1.9.1
>

I think you can remove the of_match_device checks in some drivers too

i.e:

http://elixir.free-electrons.com/linux/latest/source/drivers/mfd/tps65217.c#L330

Regards,
 Enric

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

* Re: [PATCH 3/5] mfd: tps65217: Add a dependency on OF
  2017-06-06 15:04   ` Enric Balletbo Serra
@ 2017-06-07  4:45     ` Keerthy
  2017-06-07 10:37       ` Lee Jones
  0 siblings, 1 reply; 17+ messages in thread
From: Keerthy @ 2017-06-07  4:45 UTC (permalink / raw)
  To: Enric Balletbo Serra
  Cc: Tony Lindgren, milo.kim, Lee Jones, linux-omap, linux-kernel



On Tuesday 06 June 2017 08:34 PM, Enric Balletbo Serra wrote:
> Hi Keerthy,
> 
> By change I was looking at this. Some comments below that I think can
> be applied to all patches in this series
> 
> 2017-06-06 16:45 GMT+02:00 Keerthy <j-keerthy@ti.com>:
>> Currently the driver boots only via device tree hence add a
>> dependency on OF.
>>
>> Signed-off-by: Keerthy <j-keerthy@ti.com>
>> ---
>>  drivers/mfd/Kconfig | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
>> index 75b59f1..2d1425d 100644
>> --- a/drivers/mfd/Kconfig
>> +++ b/drivers/mfd/Kconfig
>> @@ -1297,7 +1297,7 @@ config MFD_TPS65090
>>
>>  config MFD_TPS65217
>>         tristate "TI TPS65217 Power Management / White LED chips"
>> -       depends on I2C
>> +       depends on I2C && OF
> 
> Shouldn't you add || COMPILE_TEST here ?

Sure.

> 
>>         select MFD_CORE
>>         select REGMAP_I2C
>>         select IRQ_DOMAIN
>> --
>> 1.9.1
>>
> 
> I think you can remove the of_match_device checks in some drivers too
> 
> i.e:
> 
> http://elixir.free-electrons.com/linux/latest/source/drivers/mfd/tps65217.c#L330

Yes that and removal of unused i2c_device_id. I will follow it up once
this OF dependency is in.

> 
> Regards,
>  Enric
> 

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

* Re: [PATCH 3/5] mfd: tps65217: Add a dependency on OF
  2017-06-07  4:45     ` Keerthy
@ 2017-06-07 10:37       ` Lee Jones
  2017-06-07 10:38         ` Lee Jones
  2017-06-07 10:39         ` Keerthy
  0 siblings, 2 replies; 17+ messages in thread
From: Lee Jones @ 2017-06-07 10:37 UTC (permalink / raw)
  To: Keerthy
  Cc: Enric Balletbo Serra, Tony Lindgren, milo.kim, linux-omap, linux-kernel

On Wed, 07 Jun 2017, Keerthy wrote:

> 
> 
> On Tuesday 06 June 2017 08:34 PM, Enric Balletbo Serra wrote:
> > Hi Keerthy,
> > 
> > By change I was looking at this. Some comments below that I think can
> > be applied to all patches in this series
> > 
> > 2017-06-06 16:45 GMT+02:00 Keerthy <j-keerthy@ti.com>:
> >> Currently the driver boots only via device tree hence add a
> >> dependency on OF.
> >>
> >> Signed-off-by: Keerthy <j-keerthy@ti.com>
> >> ---
> >>  drivers/mfd/Kconfig | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> >> index 75b59f1..2d1425d 100644
> >> --- a/drivers/mfd/Kconfig
> >> +++ b/drivers/mfd/Kconfig
> >> @@ -1297,7 +1297,7 @@ config MFD_TPS65090
> >>
> >>  config MFD_TPS65217
> >>         tristate "TI TPS65217 Power Management / White LED chips"
> >> -       depends on I2C
> >> +       depends on I2C && OF
> > 
> > Shouldn't you add || COMPILE_TEST here ?
> 
> Sure.
> 
> > 
> >>         select MFD_CORE
> >>         select REGMAP_I2C
> >>         select IRQ_DOMAIN
> >>
> > 
> > I think you can remove the of_match_device checks in some drivers too
> > 
> > i.e:
> > 
> > http://elixir.free-electrons.com/linux/latest/source/drivers/mfd/tps65217.c#L330
> 
> Yes that and removal of unused i2c_device_id. I will follow it up once
> this OF dependency is in.

The of_match_device() checks should be removed with the OF patch.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH 3/5] mfd: tps65217: Add a dependency on OF
  2017-06-07 10:37       ` Lee Jones
@ 2017-06-07 10:38         ` Lee Jones
  2017-06-07 11:24           ` Keerthy
  2017-06-07 10:39         ` Keerthy
  1 sibling, 1 reply; 17+ messages in thread
From: Lee Jones @ 2017-06-07 10:38 UTC (permalink / raw)
  To: Keerthy
  Cc: Enric Balletbo Serra, Tony Lindgren, milo.kim, linux-omap, linux-kernel

On Wed, 07 Jun 2017, Lee Jones wrote:

> On Wed, 07 Jun 2017, Keerthy wrote:
> 
> > 
> > 
> > On Tuesday 06 June 2017 08:34 PM, Enric Balletbo Serra wrote:
> > > Hi Keerthy,
> > > 
> > > By change I was looking at this. Some comments below that I think can
> > > be applied to all patches in this series
> > > 
> > > 2017-06-06 16:45 GMT+02:00 Keerthy <j-keerthy@ti.com>:
> > >> Currently the driver boots only via device tree hence add a
> > >> dependency on OF.
> > >>
> > >> Signed-off-by: Keerthy <j-keerthy@ti.com>
> > >> ---
> > >>  drivers/mfd/Kconfig | 2 +-
> > >>  1 file changed, 1 insertion(+), 1 deletion(-)
> > >>
> > >> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> > >> index 75b59f1..2d1425d 100644
> > >> --- a/drivers/mfd/Kconfig
> > >> +++ b/drivers/mfd/Kconfig
> > >> @@ -1297,7 +1297,7 @@ config MFD_TPS65090
> > >>
> > >>  config MFD_TPS65217
> > >>         tristate "TI TPS65217 Power Management / White LED chips"
> > >> -       depends on I2C
> > >> +       depends on I2C && OF
> > > 
> > > Shouldn't you add || COMPILE_TEST here ?
> > 
> > Sure.
> > 
> > > 
> > >>         select MFD_CORE
> > >>         select REGMAP_I2C
> > >>         select IRQ_DOMAIN
> > >>
> > > 
> > > I think you can remove the of_match_device checks in some drivers too
> > > 
> > > i.e:
> > > 
> > > http://elixir.free-electrons.com/linux/latest/source/drivers/mfd/tps65217.c#L330
> > 
> > Yes that and removal of unused i2c_device_id. I will follow it up once
> > this OF dependency is in.
> 
> The of_match_device() checks should be removed with the OF patch.

In fact, just squash these changes into the I2C removal patches.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH 3/5] mfd: tps65217: Add a dependency on OF
  2017-06-07 10:37       ` Lee Jones
  2017-06-07 10:38         ` Lee Jones
@ 2017-06-07 10:39         ` Keerthy
  1 sibling, 0 replies; 17+ messages in thread
From: Keerthy @ 2017-06-07 10:39 UTC (permalink / raw)
  To: Lee Jones
  Cc: Enric Balletbo Serra, Tony Lindgren, milo.kim, linux-omap, linux-kernel



On Wednesday 07 June 2017 04:07 PM, Lee Jones wrote:
> On Wed, 07 Jun 2017, Keerthy wrote:
> 
>>
>>
>> On Tuesday 06 June 2017 08:34 PM, Enric Balletbo Serra wrote:
>>> Hi Keerthy,
>>>
>>> By change I was looking at this. Some comments below that I think can
>>> be applied to all patches in this series
>>>
>>> 2017-06-06 16:45 GMT+02:00 Keerthy <j-keerthy@ti.com>:
>>>> Currently the driver boots only via device tree hence add a
>>>> dependency on OF.
>>>>
>>>> Signed-off-by: Keerthy <j-keerthy@ti.com>
>>>> ---
>>>>  drivers/mfd/Kconfig | 2 +-
>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
>>>> index 75b59f1..2d1425d 100644
>>>> --- a/drivers/mfd/Kconfig
>>>> +++ b/drivers/mfd/Kconfig
>>>> @@ -1297,7 +1297,7 @@ config MFD_TPS65090
>>>>
>>>>  config MFD_TPS65217
>>>>         tristate "TI TPS65217 Power Management / White LED chips"
>>>> -       depends on I2C
>>>> +       depends on I2C && OF
>>>
>>> Shouldn't you add || COMPILE_TEST here ?
>>
>> Sure.
>>
>>>
>>>>         select MFD_CORE
>>>>         select REGMAP_I2C
>>>>         select IRQ_DOMAIN
>>>>
>>>
>>> I think you can remove the of_match_device checks in some drivers too
>>>
>>> i.e:
>>>
>>> http://elixir.free-electrons.com/linux/latest/source/drivers/mfd/tps65217.c#L330
>>
>> Yes that and removal of unused i2c_device_id. I will follow it up once
>> this OF dependency is in.
> 
> The of_match_device() checks should be removed with the OF patch.

okay

> 

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

* Re: [PATCH 3/5] mfd: tps65217: Add a dependency on OF
  2017-06-07 10:38         ` Lee Jones
@ 2017-06-07 11:24           ` Keerthy
  2017-06-07 13:37             ` Enric Balletbo Serra
  0 siblings, 1 reply; 17+ messages in thread
From: Keerthy @ 2017-06-07 11:24 UTC (permalink / raw)
  To: Lee Jones, Enric Balletbo Serra
  Cc: Tony Lindgren, milo.kim, linux-omap, linux-kernel



On Wednesday 07 June 2017 04:08 PM, Lee Jones wrote:
> On Wed, 07 Jun 2017, Lee Jones wrote:
> 
>> On Wed, 07 Jun 2017, Keerthy wrote:
>>
>>>
>>>
>>> On Tuesday 06 June 2017 08:34 PM, Enric Balletbo Serra wrote:
>>>> Hi Keerthy,
>>>>
>>>> By change I was looking at this. Some comments below that I think can
>>>> be applied to all patches in this series
>>>>
>>>> 2017-06-06 16:45 GMT+02:00 Keerthy <j-keerthy@ti.com>:
>>>>> Currently the driver boots only via device tree hence add a
>>>>> dependency on OF.
>>>>>
>>>>> Signed-off-by: Keerthy <j-keerthy@ti.com>
>>>>> ---
>>>>>  drivers/mfd/Kconfig | 2 +-
>>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
>>>>> index 75b59f1..2d1425d 100644
>>>>> --- a/drivers/mfd/Kconfig
>>>>> +++ b/drivers/mfd/Kconfig
>>>>> @@ -1297,7 +1297,7 @@ config MFD_TPS65090
>>>>>
>>>>>  config MFD_TPS65217
>>>>>         tristate "TI TPS65217 Power Management / White LED chips"
>>>>> -       depends on I2C
>>>>> +       depends on I2C && OF
>>>>
>>>> Shouldn't you add || COMPILE_TEST here ?
>>>
>>> Sure.
>>>
>>>>
>>>>>         select MFD_CORE
>>>>>         select REGMAP_I2C
>>>>>         select IRQ_DOMAIN
>>>>>
>>>>
>>>> I think you can remove the of_match_device checks in some drivers too
>>>>
>>>> i.e:
>>>>
>>>> http://elixir.free-electrons.com/linux/latest/source/drivers/mfd/tps65217.c#L330
>>>
>>> Yes that and removal of unused i2c_device_id. I will follow it up once
>>> this OF dependency is in.
>>
>> The of_match_device() checks should be removed with the OF patch.

Lee Jones/ Enric,

IIUC of_match_device call is still needed to obtain a match and in case
there are multiple compatibles with different match data then this call
is definitely needed.

There is no need to check for return value as we will find one match for
sure and that can be removed.

Even checks like 'if (client->dev.of_node) {' can surely be removed with
depends on OF.

Please correct me if i am wrong.

Regards,
Keerthy
> 
> In fact, just squash these changes into the I2C removal patches.
> 

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

* Re: [PATCH 3/5] mfd: tps65217: Add a dependency on OF
  2017-06-07 11:24           ` Keerthy
@ 2017-06-07 13:37             ` Enric Balletbo Serra
  2017-06-07 13:45               ` Keerthy
  0 siblings, 1 reply; 17+ messages in thread
From: Enric Balletbo Serra @ 2017-06-07 13:37 UTC (permalink / raw)
  To: Keerthy; +Cc: Lee Jones, Tony Lindgren, milo.kim, linux-omap, linux-kernel

2017-06-07 13:24 GMT+02:00 Keerthy <j-keerthy@ti.com>:
>
>
> On Wednesday 07 June 2017 04:08 PM, Lee Jones wrote:
>> On Wed, 07 Jun 2017, Lee Jones wrote:
>>
>>> On Wed, 07 Jun 2017, Keerthy wrote:
>>>
>>>>
>>>>
>>>> On Tuesday 06 June 2017 08:34 PM, Enric Balletbo Serra wrote:
>>>>> Hi Keerthy,
>>>>>
>>>>> By change I was looking at this. Some comments below that I think can
>>>>> be applied to all patches in this series
>>>>>
>>>>> 2017-06-06 16:45 GMT+02:00 Keerthy <j-keerthy@ti.com>:
>>>>>> Currently the driver boots only via device tree hence add a
>>>>>> dependency on OF.
>>>>>>
>>>>>> Signed-off-by: Keerthy <j-keerthy@ti.com>
>>>>>> ---
>>>>>>  drivers/mfd/Kconfig | 2 +-
>>>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>>>
>>>>>> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
>>>>>> index 75b59f1..2d1425d 100644
>>>>>> --- a/drivers/mfd/Kconfig
>>>>>> +++ b/drivers/mfd/Kconfig
>>>>>> @@ -1297,7 +1297,7 @@ config MFD_TPS65090
>>>>>>
>>>>>>  config MFD_TPS65217
>>>>>>         tristate "TI TPS65217 Power Management / White LED chips"
>>>>>> -       depends on I2C
>>>>>> +       depends on I2C && OF
>>>>>
>>>>> Shouldn't you add || COMPILE_TEST here ?
>>>>
>>>> Sure.
>>>>
>>>>>
>>>>>>         select MFD_CORE
>>>>>>         select REGMAP_I2C
>>>>>>         select IRQ_DOMAIN
>>>>>>
>>>>>
>>>>> I think you can remove the of_match_device checks in some drivers too
>>>>>
>>>>> i.e:
>>>>>
>>>>> http://elixir.free-electrons.com/linux/latest/source/drivers/mfd/tps65217.c#L330
>>>>
>>>> Yes that and removal of unused i2c_device_id. I will follow it up once
>>>> this OF dependency is in.
>>>
>>> The of_match_device() checks should be removed with the OF patch.
>
> Lee Jones/ Enric,
>
> IIUC of_match_device call is still needed to obtain a match and in case
> there are multiple compatibles with different match data then this call
> is definitely needed.
>

Not sure if I follow you. My understanding is that with DT the probe
of this driver is only called if there is a node with the compatible =
"ti,tps65217" string. So if probe is called there is always a match
and the call to of_match_device is redundant.

> There is no need to check for return value as we will find one match for
> sure and that can be removed.
>
> Even checks like 'if (client->dev.of_node) {' can surely be removed with
> depends on OF.
>

Yes I think this should be removed too.

> Please correct me if i am wrong.
>
> Regards,
> Keerthy
>>
>> In fact, just squash these changes into the I2C removal patches.
>>

Regards,
 Enric

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

* Re: [PATCH 3/5] mfd: tps65217: Add a dependency on OF
  2017-06-07 13:37             ` Enric Balletbo Serra
@ 2017-06-07 13:45               ` Keerthy
  2017-06-07 14:10                 ` Javier Martinez Canillas
  0 siblings, 1 reply; 17+ messages in thread
From: Keerthy @ 2017-06-07 13:45 UTC (permalink / raw)
  To: Enric Balletbo Serra
  Cc: Lee Jones, Tony Lindgren, milo.kim, linux-omap, linux-kernel



On Wednesday 07 June 2017 07:07 PM, Enric Balletbo Serra wrote:
> 2017-06-07 13:24 GMT+02:00 Keerthy <j-keerthy@ti.com>:
>>
>>
>> On Wednesday 07 June 2017 04:08 PM, Lee Jones wrote:
>>> On Wed, 07 Jun 2017, Lee Jones wrote:
>>>
>>>> On Wed, 07 Jun 2017, Keerthy wrote:
>>>>
>>>>>
>>>>>
>>>>> On Tuesday 06 June 2017 08:34 PM, Enric Balletbo Serra wrote:
>>>>>> Hi Keerthy,
>>>>>>
>>>>>> By change I was looking at this. Some comments below that I think can
>>>>>> be applied to all patches in this series
>>>>>>
>>>>>> 2017-06-06 16:45 GMT+02:00 Keerthy <j-keerthy@ti.com>:
>>>>>>> Currently the driver boots only via device tree hence add a
>>>>>>> dependency on OF.
>>>>>>>
>>>>>>> Signed-off-by: Keerthy <j-keerthy@ti.com>
>>>>>>> ---
>>>>>>>  drivers/mfd/Kconfig | 2 +-
>>>>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>>>>
>>>>>>> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
>>>>>>> index 75b59f1..2d1425d 100644
>>>>>>> --- a/drivers/mfd/Kconfig
>>>>>>> +++ b/drivers/mfd/Kconfig
>>>>>>> @@ -1297,7 +1297,7 @@ config MFD_TPS65090
>>>>>>>
>>>>>>>  config MFD_TPS65217
>>>>>>>         tristate "TI TPS65217 Power Management / White LED chips"
>>>>>>> -       depends on I2C
>>>>>>> +       depends on I2C && OF
>>>>>>
>>>>>> Shouldn't you add || COMPILE_TEST here ?
>>>>>
>>>>> Sure.
>>>>>
>>>>>>
>>>>>>>         select MFD_CORE
>>>>>>>         select REGMAP_I2C
>>>>>>>         select IRQ_DOMAIN
>>>>>>>
>>>>>>
>>>>>> I think you can remove the of_match_device checks in some drivers too
>>>>>>
>>>>>> i.e:
>>>>>>
>>>>>> http://elixir.free-electrons.com/linux/latest/source/drivers/mfd/tps65217.c#L330
>>>>>
>>>>> Yes that and removal of unused i2c_device_id. I will follow it up once
>>>>> this OF dependency is in.
>>>>
>>>> The of_match_device() checks should be removed with the OF patch.
>>
>> Lee Jones/ Enric,
>>
>> IIUC of_match_device call is still needed to obtain a match and in case
>> there are multiple compatibles with different match data then this call
>> is definitely needed.
>>
> 
> Not sure if I follow you. My understanding is that with DT the probe
> of this driver is only called if there is a node with the compatible =
> "ti,tps65217" string. So if probe is called there is always a match
> and the call to of_match_device is redundant.

How will you get the matching data?

For the tps65217 case you mentioned we need the match pointer to get the
chip_id right?

chip_id = (unsigned long)match->data;

Also one more case of when we have multiple compatibles with different
matching data. Ex:

http://elixir.free-electrons.com/linux/latest/source/drivers/mfd/palmas.c#L522

You need the match pointer to get the corresponding data.

Hope i am clear.

> 
>> There is no need to check for return value as we will find one match for
>> sure and that can be removed.
>>
>> Even checks like 'if (client->dev.of_node) {' can surely be removed with
>> depends on OF.
>>
> 
> Yes I think this should be removed too.
> 
>> Please correct me if i am wrong.
>>
>> Regards,
>> Keerthy
>>>
>>> In fact, just squash these changes into the I2C removal patches.
>>>
> 
> Regards,
>  Enric
> 

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

* Re: [PATCH 3/5] mfd: tps65217: Add a dependency on OF
  2017-06-07 13:45               ` Keerthy
@ 2017-06-07 14:10                 ` Javier Martinez Canillas
  2017-06-07 14:27                   ` Javier Martinez Canillas
  2017-06-08  4:31                   ` Keerthy
  0 siblings, 2 replies; 17+ messages in thread
From: Javier Martinez Canillas @ 2017-06-07 14:10 UTC (permalink / raw)
  To: Keerthy
  Cc: Enric Balletbo Serra, Lee Jones, Tony Lindgren, Milo Kim,
	linux-omap, linux-kernel

Hello Keerthy,

On Wed, Jun 7, 2017 at 3:45 PM, Keerthy <j-keerthy@ti.com> wrote:

[snip]

>>>>>>>>
>>>>>>>
>>>>>>> I think you can remove the of_match_device checks in some drivers too
>>>>>>>
>>>>>>> i.e:
>>>>>>>
>>>>>>> http://elixir.free-electrons.com/linux/latest/source/drivers/mfd/tps65217.c#L330
>>>>>>
>>>>>> Yes that and removal of unused i2c_device_id. I will follow it up once
>>>>>> this OF dependency is in.
>>>>>
>>>>> The of_match_device() checks should be removed with the OF patch.
>>>
>>> Lee Jones/ Enric,
>>>
>>> IIUC of_match_device call is still needed to obtain a match and in case
>>> there are multiple compatibles with different match data then this call
>>> is definitely needed.
>>>

That's correct...

>>
>> Not sure if I follow you. My understanding is that with DT the probe
>> of this driver is only called if there is a node with the compatible =
>> "ti,tps65217" string. So if probe is called there is always a match
>> and the call to of_match_device is redundant.
>
> How will you get the matching data?
>
> For the tps65217 case you mentioned we need the match pointer to get the
> chip_id right?
>
> chip_id = (unsigned long)match->data;
>

...but this particular driver only has a single entry in the OF table
and so you can just do:

tps->id = TPS65217;

Later if there's a variant for this chip, then you can add the logic
to query the struct of_device_id .data. But for now I think that's
better to just remove as Enric proposes and also remove the .data
field from the struct of_device_id entry.

Best regards,
Javier

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

* Re: [PATCH 3/5] mfd: tps65217: Add a dependency on OF
  2017-06-07 14:10                 ` Javier Martinez Canillas
@ 2017-06-07 14:27                   ` Javier Martinez Canillas
  2017-06-08  4:31                   ` Keerthy
  1 sibling, 0 replies; 17+ messages in thread
From: Javier Martinez Canillas @ 2017-06-07 14:27 UTC (permalink / raw)
  To: Keerthy
  Cc: Enric Balletbo Serra, Lee Jones, Tony Lindgren, Milo Kim,
	linux-omap, linux-kernel

On Wed, Jun 7, 2017 at 4:10 PM, Javier Martinez Canillas
<javier@dowhile0.org> wrote:

[snip]

>>
>> chip_id = (unsigned long)match->data;
>>
>
> ...but this particular driver only has a single entry in the OF table
> and so you can just do:
>
> tps->id = TPS65217;
>

In fact, it seems that the whole chip id logic can go away since no
one is using it. I see that the regulator driver checks for the chip
id value but I don't think that makes sense since the regulator
driver's probe function won't be called for other chips since they
won't match.

Best regards,
Javier

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

* Re: [PATCH 3/5] mfd: tps65217: Add a dependency on OF
  2017-06-07 14:10                 ` Javier Martinez Canillas
  2017-06-07 14:27                   ` Javier Martinez Canillas
@ 2017-06-08  4:31                   ` Keerthy
  1 sibling, 0 replies; 17+ messages in thread
From: Keerthy @ 2017-06-08  4:31 UTC (permalink / raw)
  To: Javier Martinez Canillas
  Cc: Enric Balletbo Serra, Lee Jones, Tony Lindgren, Milo Kim,
	linux-omap, linux-kernel



On Wednesday 07 June 2017 07:40 PM, Javier Martinez Canillas wrote:
> Hello Keerthy,
> 
> On Wed, Jun 7, 2017 at 3:45 PM, Keerthy <j-keerthy@ti.com> wrote:
> 
> [snip]
> 
>>>>>>>>>
>>>>>>>>
>>>>>>>> I think you can remove the of_match_device checks in some drivers too
>>>>>>>>
>>>>>>>> i.e:
>>>>>>>>
>>>>>>>> http://elixir.free-electrons.com/linux/latest/source/drivers/mfd/tps65217.c#L330
>>>>>>>
>>>>>>> Yes that and removal of unused i2c_device_id. I will follow it up once
>>>>>>> this OF dependency is in.
>>>>>>
>>>>>> The of_match_device() checks should be removed with the OF patch.
>>>>
>>>> Lee Jones/ Enric,
>>>>
>>>> IIUC of_match_device call is still needed to obtain a match and in case
>>>> there are multiple compatibles with different match data then this call
>>>> is definitely needed.
>>>>
> 
> That's correct...

That is what i wanted to know. Thanks.

> 
>>>
>>> Not sure if I follow you. My understanding is that with DT the probe
>>> of this driver is only called if there is a node with the compatible =
>>> "ti,tps65217" string. So if probe is called there is always a match
>>> and the call to of_match_device is redundant.
>>
>> How will you get the matching data?
>>
>> For the tps65217 case you mentioned we need the match pointer to get the
>> chip_id right?
>>
>> chip_id = (unsigned long)match->data;
>>
> 
> ...but this particular driver only has a single entry in the OF table
> and so you can just do:
> 
> tps->id = TPS65217;
> 
> Later if there's a variant for this chip, then you can add the logic
> to query the struct of_device_id .data. But for now I think that's
> better to just remove as Enric proposes and also remove the .data
> field from the struct of_device_id entry.

okay agreed for tps65217.

> 
> Best regards,
> Javier
> 

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

end of thread, other threads:[~2017-06-08  4:31 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-06 14:45 [PATCH 0/5] mfd: Add a dependency on OF Keerthy
2017-06-06 14:45 ` [PATCH 1/5] mfd: palmas: " Keerthy
2017-06-06 14:45 ` [PATCH 2/5] mfd: tps65218: " Keerthy
2017-06-06 14:45 ` [PATCH 3/5] mfd: tps65217: " Keerthy
2017-06-06 15:04   ` Enric Balletbo Serra
2017-06-07  4:45     ` Keerthy
2017-06-07 10:37       ` Lee Jones
2017-06-07 10:38         ` Lee Jones
2017-06-07 11:24           ` Keerthy
2017-06-07 13:37             ` Enric Balletbo Serra
2017-06-07 13:45               ` Keerthy
2017-06-07 14:10                 ` Javier Martinez Canillas
2017-06-07 14:27                   ` Javier Martinez Canillas
2017-06-08  4:31                   ` Keerthy
2017-06-07 10:39         ` Keerthy
2017-06-06 14:45 ` [PATCH 4/5] mfd: lp873x: " Keerthy
2017-06-06 14:45 ` [PATCH 5/5] mfd: lp3943: " Keerthy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).