linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RESEND RFT PATCH 0/2] mfd: max14577: Allow the driver to be built as a module
@ 2016-05-26 16:32 Javier Martinez Canillas
  2016-05-26 16:32 ` [RESEND RFT PATCH 1/2] mfd: max14577: Use module_init() instead of subsys_initcall() Javier Martinez Canillas
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Javier Martinez Canillas @ 2016-05-26 16:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-samsung-soc, Chanwoo Choi, Javier Martinez Canillas,
	Krzysztof Kozlowski, Lee Jones

Hello,

This series is similar to [0] and allows the max14577 PMIC MFD driver to
be built as a module. Currently the Kconfig symbol for the driver is a
boolean but there isn't really a reason for this restriction.

Chanwoo Choi tried to test the original post but found a build issue [1].
The fix for that issue landed in v4.6 so I'm resending this series now
that there are no in-flight dependencies anymore.

The patches have been just built tested because I don't have any of the
boards using this driver, so testing will be highly appreciated.

[0]: https://lkml.org/lkml/2016/2/11/857
[1]: https://lkml.org/lkml/2016/3/17/546

Best regards,
Javier


Javier Martinez Canillas (2):
  mfd: max14577: Use module_init() instead of subsys_initcall()
  mfd: max14577: Allow driver to be built as a module

 drivers/mfd/Kconfig    | 4 ++--
 drivers/mfd/max14577.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

-- 
2.5.5

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

* [RESEND RFT PATCH 1/2] mfd: max14577: Use module_init() instead of subsys_initcall()
  2016-05-26 16:32 [RESEND RFT PATCH 0/2] mfd: max14577: Allow the driver to be built as a module Javier Martinez Canillas
@ 2016-05-26 16:32 ` Javier Martinez Canillas
  2016-06-16 10:41   ` Lee Jones
  2016-05-26 16:32 ` [RESEND RFT PATCH 2/2] mfd: max14577: Allow driver to be built as a module Javier Martinez Canillas
  2016-06-15 14:03 ` [RESEND RFT PATCH 0/2] mfd: max14577: Allow the " Javier Martinez Canillas
  2 siblings, 1 reply; 8+ messages in thread
From: Javier Martinez Canillas @ 2016-05-26 16:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-samsung-soc, Chanwoo Choi, Javier Martinez Canillas,
	Krzysztof Kozlowski, Lee Jones

The driver's init function is called at subsys init call level but the
dependencies provided by the driver are looked up by drivers that have
probe deferral support, so manual ordering of init calls isn't needed.

Suggested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>

---
Hello,

I checked an the only users in mainline for this driver are the Exynos3250
Monk and Rinato boards. In both, only two regulators are used (safeout_reg
and motor_reg) and these are looked up by the drivers phy-samsung-usb2 and
regulator-haptic respectively, and both support probe deferral.

Best regards,
Javier

 drivers/mfd/max14577.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mfd/max14577.c b/drivers/mfd/max14577.c
index 2280b3fdcf68..6c245128ab2e 100644
--- a/drivers/mfd/max14577.c
+++ b/drivers/mfd/max14577.c
@@ -561,7 +561,7 @@ static int __init max14577_i2c_init(void)
 
 	return i2c_add_driver(&max14577_i2c_driver);
 }
-subsys_initcall(max14577_i2c_init);
+module_init(max14577_i2c_init);
 
 static void __exit max14577_i2c_exit(void)
 {
-- 
2.5.5

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

* [RESEND RFT PATCH 2/2] mfd: max14577: Allow driver to be built as a module
  2016-05-26 16:32 [RESEND RFT PATCH 0/2] mfd: max14577: Allow the driver to be built as a module Javier Martinez Canillas
  2016-05-26 16:32 ` [RESEND RFT PATCH 1/2] mfd: max14577: Use module_init() instead of subsys_initcall() Javier Martinez Canillas
@ 2016-05-26 16:32 ` Javier Martinez Canillas
  2016-06-16 10:40   ` Lee Jones
  2016-06-16 14:22   ` Lee Jones
  2016-06-15 14:03 ` [RESEND RFT PATCH 0/2] mfd: max14577: Allow the " Javier Martinez Canillas
  2 siblings, 2 replies; 8+ messages in thread
From: Javier Martinez Canillas @ 2016-05-26 16:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-samsung-soc, Chanwoo Choi, Javier Martinez Canillas, Lee Jones

The driver's Kconfig symbol is a boolean but nothing prevents the driver
to be built as a module instead of built-in. It is true that most system
integrators will choose the latter but the config should not restrict it.

Suggested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>

---

 drivers/mfd/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index a49565cc1a6b..33d112f390fe 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -514,8 +514,8 @@ config MFD_88PM860X
 	  battery-charger under the corresponding menus.
 
 config MFD_MAX14577
-	bool "Maxim Semiconductor MAX14577/77836 MUIC + Charger Support"
-	depends on I2C=y
+	tristate "Maxim Semiconductor MAX14577/77836 MUIC + Charger Support"
+	depends on I2C
 	select MFD_CORE
 	select REGMAP_I2C
 	select REGMAP_IRQ
-- 
2.5.5

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

* Re: [RESEND RFT PATCH 0/2] mfd: max14577: Allow the driver to be built as a module
  2016-05-26 16:32 [RESEND RFT PATCH 0/2] mfd: max14577: Allow the driver to be built as a module Javier Martinez Canillas
  2016-05-26 16:32 ` [RESEND RFT PATCH 1/2] mfd: max14577: Use module_init() instead of subsys_initcall() Javier Martinez Canillas
  2016-05-26 16:32 ` [RESEND RFT PATCH 2/2] mfd: max14577: Allow driver to be built as a module Javier Martinez Canillas
@ 2016-06-15 14:03 ` Javier Martinez Canillas
  2 siblings, 0 replies; 8+ messages in thread
From: Javier Martinez Canillas @ 2016-06-15 14:03 UTC (permalink / raw)
  To: linux-kernel, Chanwoo Choi
  Cc: linux-samsung-soc, Krzysztof Kozlowski, Lee Jones

Hello,

On 05/26/2016 12:32 PM, Javier Martinez Canillas wrote:
> 
> This series is similar to [0] and allows the max14577 PMIC MFD driver to
> be built as a module. Currently the Kconfig symbol for the driver is a
> boolean but there isn't really a reason for this restriction.
> 
> Chanwoo Choi tried to test the original post but found a build issue [1].
> The fix for that issue landed in v4.6 so I'm resending this series now
> that there are no in-flight dependencies anymore.
> 
> The patches have been just built tested because I don't have any of the
> boards using this driver, so testing will be highly appreciated.
> 
> [0]: https://lkml.org/lkml/2016/2/11/857
> [1]: https://lkml.org/lkml/2016/3/17/546
> 
> Best regards,
> Javier
> 
> 
> Javier Martinez Canillas (2):
>   mfd: max14577: Use module_init() instead of subsys_initcall()
>   mfd: max14577: Allow driver to be built as a module
> 
>  drivers/mfd/Kconfig    | 4 ++--
>  drivers/mfd/max14577.c | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 

Any comments about these patches?

Best regards,
-- 
Javier Martinez Canillas
Open Source Group
Samsung Research America

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

* Re: [RESEND RFT PATCH 2/2] mfd: max14577: Allow driver to be built as a module
  2016-05-26 16:32 ` [RESEND RFT PATCH 2/2] mfd: max14577: Allow driver to be built as a module Javier Martinez Canillas
@ 2016-06-16 10:40   ` Lee Jones
  2016-06-16 13:48     ` Javier Martinez Canillas
  2016-06-16 14:22   ` Lee Jones
  1 sibling, 1 reply; 8+ messages in thread
From: Lee Jones @ 2016-06-16 10:40 UTC (permalink / raw)
  To: Javier Martinez Canillas; +Cc: linux-kernel, linux-samsung-soc, Chanwoo Choi

On Thu, 26 May 2016, Javier Martinez Canillas wrote:

> The driver's Kconfig symbol is a boolean but nothing prevents the driver
> to be built as a module instead of built-in. It is true that most system
> integrators will choose the latter but the config should not restrict it.

Does the driver have all of the module related code?

> Suggested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
> 
> ---
> 
>  drivers/mfd/Kconfig | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> index a49565cc1a6b..33d112f390fe 100644
> --- a/drivers/mfd/Kconfig
> +++ b/drivers/mfd/Kconfig
> @@ -514,8 +514,8 @@ config MFD_88PM860X
>  	  battery-charger under the corresponding menus.
>  
>  config MFD_MAX14577
> -	bool "Maxim Semiconductor MAX14577/77836 MUIC + Charger Support"
> -	depends on I2C=y
> +	tristate "Maxim Semiconductor MAX14577/77836 MUIC + Charger Support"
> +	depends on I2C
>  	select MFD_CORE
>  	select REGMAP_I2C
>  	select REGMAP_IRQ

-- 
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] 8+ messages in thread

* Re: [RESEND RFT PATCH 1/2] mfd: max14577: Use module_init() instead of subsys_initcall()
  2016-05-26 16:32 ` [RESEND RFT PATCH 1/2] mfd: max14577: Use module_init() instead of subsys_initcall() Javier Martinez Canillas
@ 2016-06-16 10:41   ` Lee Jones
  0 siblings, 0 replies; 8+ messages in thread
From: Lee Jones @ 2016-06-16 10:41 UTC (permalink / raw)
  To: Javier Martinez Canillas
  Cc: linux-kernel, linux-samsung-soc, Chanwoo Choi, Krzysztof Kozlowski

On Thu, 26 May 2016, Javier Martinez Canillas wrote:

> The driver's init function is called at subsys init call level but the
> dependencies provided by the driver are looked up by drivers that have
> probe deferral support, so manual ordering of init calls isn't needed.
> 
> Suggested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
> 
> ---
> Hello,
> 
> I checked an the only users in mainline for this driver are the Exynos3250
> Monk and Rinato boards. In both, only two regulators are used (safeout_reg
> and motor_reg) and these are looked up by the drivers phy-samsung-usb2 and
> regulator-haptic respectively, and both support probe deferral.
> 
> Best regards,
> Javier
> 
>  drivers/mfd/max14577.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

> diff --git a/drivers/mfd/max14577.c b/drivers/mfd/max14577.c
> index 2280b3fdcf68..6c245128ab2e 100644
> --- a/drivers/mfd/max14577.c
> +++ b/drivers/mfd/max14577.c
> @@ -561,7 +561,7 @@ static int __init max14577_i2c_init(void)
>  
>  	return i2c_add_driver(&max14577_i2c_driver);
>  }
> -subsys_initcall(max14577_i2c_init);
> +module_init(max14577_i2c_init);
>  
>  static void __exit max14577_i2c_exit(void)
>  {

-- 
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] 8+ messages in thread

* Re: [RESEND RFT PATCH 2/2] mfd: max14577: Allow driver to be built as a module
  2016-06-16 10:40   ` Lee Jones
@ 2016-06-16 13:48     ` Javier Martinez Canillas
  0 siblings, 0 replies; 8+ messages in thread
From: Javier Martinez Canillas @ 2016-06-16 13:48 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel, linux-samsung-soc, Chanwoo Choi

Hello Lee,

On 06/16/2016 06:40 AM, Lee Jones wrote:
> On Thu, 26 May 2016, Javier Martinez Canillas wrote:
> 
>> The driver's Kconfig symbol is a boolean but nothing prevents the driver
>> to be built as a module instead of built-in. It is true that most system
>> integrators will choose the latter but the config should not restrict it.
> 
> Does the driver have all of the module related code?
>

Yes, it always did (even has a MODULE_DEVICE_TABLE so autoload should work)
but is just that the Kconfig symbol was bool instead of tristate since most
system integrators will choose to have it built-in.
 
Best regards,
-- 
Javier Martinez Canillas
Open Source Group
Samsung Research America

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

* Re: [RESEND RFT PATCH 2/2] mfd: max14577: Allow driver to be built as a module
  2016-05-26 16:32 ` [RESEND RFT PATCH 2/2] mfd: max14577: Allow driver to be built as a module Javier Martinez Canillas
  2016-06-16 10:40   ` Lee Jones
@ 2016-06-16 14:22   ` Lee Jones
  1 sibling, 0 replies; 8+ messages in thread
From: Lee Jones @ 2016-06-16 14:22 UTC (permalink / raw)
  To: Javier Martinez Canillas; +Cc: linux-kernel, linux-samsung-soc, Chanwoo Choi

On Thu, 26 May 2016, Javier Martinez Canillas wrote:

> The driver's Kconfig symbol is a boolean but nothing prevents the driver
> to be built as a module instead of built-in. It is true that most system
> integrators will choose the latter but the config should not restrict it.
> 
> Suggested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
> 
> ---
> 
>  drivers/mfd/Kconfig | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Applied, thanks.

> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> index a49565cc1a6b..33d112f390fe 100644
> --- a/drivers/mfd/Kconfig
> +++ b/drivers/mfd/Kconfig
> @@ -514,8 +514,8 @@ config MFD_88PM860X
>  	  battery-charger under the corresponding menus.
>  
>  config MFD_MAX14577
> -	bool "Maxim Semiconductor MAX14577/77836 MUIC + Charger Support"
> -	depends on I2C=y
> +	tristate "Maxim Semiconductor MAX14577/77836 MUIC + Charger Support"
> +	depends on I2C
>  	select MFD_CORE
>  	select REGMAP_I2C
>  	select REGMAP_IRQ

-- 
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] 8+ messages in thread

end of thread, other threads:[~2016-06-16 14:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-26 16:32 [RESEND RFT PATCH 0/2] mfd: max14577: Allow the driver to be built as a module Javier Martinez Canillas
2016-05-26 16:32 ` [RESEND RFT PATCH 1/2] mfd: max14577: Use module_init() instead of subsys_initcall() Javier Martinez Canillas
2016-06-16 10:41   ` Lee Jones
2016-05-26 16:32 ` [RESEND RFT PATCH 2/2] mfd: max14577: Allow driver to be built as a module Javier Martinez Canillas
2016-06-16 10:40   ` Lee Jones
2016-06-16 13:48     ` Javier Martinez Canillas
2016-06-16 14:22   ` Lee Jones
2016-06-15 14:03 ` [RESEND RFT PATCH 0/2] mfd: max14577: Allow the " Javier Martinez Canillas

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).