linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] power: supply: Allow charger manager can be built as a module
@ 2020-03-06  2:34 Baolin Wang
  2020-03-06 20:47 ` Sebastian Reichel
  0 siblings, 1 reply; 5+ messages in thread
From: Baolin Wang @ 2020-03-06  2:34 UTC (permalink / raw)
  To: sre
  Cc: baolin.wang7, orsonzhai, zhang.lyra, saravanak, kernel-team,
	linux-pm, linux-kernel

Allow charger manager can be built as a module like other charger
drivers.

Signed-off-by: Baolin Wang <baolin.wang7@gmail.com>
---
Changes from v1:
 - Use IS_ENABLED() instead.
---
 drivers/power/supply/Kconfig          | 2 +-
 include/linux/power/charger-manager.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/power/supply/Kconfig b/drivers/power/supply/Kconfig
index 9a5591a..195bc04 100644
--- a/drivers/power/supply/Kconfig
+++ b/drivers/power/supply/Kconfig
@@ -480,7 +480,7 @@ config CHARGER_GPIO
 	  called gpio-charger.
 
 config CHARGER_MANAGER
-	bool "Battery charger manager for multiple chargers"
+	tristate "Battery charger manager for multiple chargers"
 	depends on REGULATOR
 	select EXTCON
 	help
diff --git a/include/linux/power/charger-manager.h b/include/linux/power/charger-manager.h
index ad19e68..ae94dce 100644
--- a/include/linux/power/charger-manager.h
+++ b/include/linux/power/charger-manager.h
@@ -248,7 +248,7 @@ struct charger_manager {
 	u64 charging_end_time;
 };
 
-#ifdef CONFIG_CHARGER_MANAGER
+#if IS_ENABLED(CONFIG_CHARGER_MANAGER)
 extern void cm_notify_event(struct power_supply *psy,
 				enum cm_event_types type, char *msg);
 #else
-- 
1.9.1


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

* Re: [PATCH v2] power: supply: Allow charger manager can be built as a module
  2020-03-06  2:34 [PATCH v2] power: supply: Allow charger manager can be built as a module Baolin Wang
@ 2020-03-06 20:47 ` Sebastian Reichel
  2020-03-09  3:20   ` Baolin Wang
  0 siblings, 1 reply; 5+ messages in thread
From: Sebastian Reichel @ 2020-03-06 20:47 UTC (permalink / raw)
  To: Baolin Wang
  Cc: orsonzhai, zhang.lyra, saravanak, kernel-team, linux-pm, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1518 bytes --]

Hi,

On Fri, Mar 06, 2020 at 10:34:10AM +0800, Baolin Wang wrote:
> Allow charger manager can be built as a module like other charger
> drivers.
> 
> Signed-off-by: Baolin Wang <baolin.wang7@gmail.com>
> ---

Thanks, queued. I do not like this driver, but its the best we have
at the moment.

-- Sebastian

> Changes from v1:
>  - Use IS_ENABLED() instead.
> ---
>  drivers/power/supply/Kconfig          | 2 +-
>  include/linux/power/charger-manager.h | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/power/supply/Kconfig b/drivers/power/supply/Kconfig
> index 9a5591a..195bc04 100644
> --- a/drivers/power/supply/Kconfig
> +++ b/drivers/power/supply/Kconfig
> @@ -480,7 +480,7 @@ config CHARGER_GPIO
>  	  called gpio-charger.
>  
>  config CHARGER_MANAGER
> -	bool "Battery charger manager for multiple chargers"
> +	tristate "Battery charger manager for multiple chargers"
>  	depends on REGULATOR
>  	select EXTCON
>  	help
> diff --git a/include/linux/power/charger-manager.h b/include/linux/power/charger-manager.h
> index ad19e68..ae94dce 100644
> --- a/include/linux/power/charger-manager.h
> +++ b/include/linux/power/charger-manager.h
> @@ -248,7 +248,7 @@ struct charger_manager {
>  	u64 charging_end_time;
>  };
>  
> -#ifdef CONFIG_CHARGER_MANAGER
> +#if IS_ENABLED(CONFIG_CHARGER_MANAGER)
>  extern void cm_notify_event(struct power_supply *psy,
>  				enum cm_event_types type, char *msg);
>  #else
> -- 
> 1.9.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH v2] power: supply: Allow charger manager can be built as a module
  2020-03-06 20:47 ` Sebastian Reichel
@ 2020-03-09  3:20   ` Baolin Wang
  2020-03-11 22:18     ` Sebastian Reichel
  0 siblings, 1 reply; 5+ messages in thread
From: Baolin Wang @ 2020-03-09  3:20 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: Orson Zhai, Chunyan Zhang, Saravana Kannan, Android Kernel Team,
	Linux PM, LKML

Hi Sebastian,

On Sat, Mar 7, 2020 at 4:47 AM Sebastian Reichel <sre@kernel.org> wrote:
>
> Hi,
>
> On Fri, Mar 06, 2020 at 10:34:10AM +0800, Baolin Wang wrote:
> > Allow charger manager can be built as a module like other charger
> > drivers.
> >
> > Signed-off-by: Baolin Wang <baolin.wang7@gmail.com>
> > ---
>
> Thanks, queued. I do not like this driver, but its the best we have
> at the moment.

Thanks. I understood your concern, do you have any plan to re-design
the charger manager driver in kernel? Or do you have some thoughts
about re-designing it? Now we have some out of tree code to use the
old charger manger, and we'd like to change to the new charger manger
driver and upstream them.

-- 
Baolin Wang

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

* Re: [PATCH v2] power: supply: Allow charger manager can be built as a module
  2020-03-09  3:20   ` Baolin Wang
@ 2020-03-11 22:18     ` Sebastian Reichel
  2020-03-12  2:35       ` Baolin Wang
  0 siblings, 1 reply; 5+ messages in thread
From: Sebastian Reichel @ 2020-03-11 22:18 UTC (permalink / raw)
  To: Baolin Wang
  Cc: Orson Zhai, Chunyan Zhang, Saravana Kannan, Android Kernel Team,
	Linux PM, LKML

[-- Attachment #1: Type: text/plain, Size: 1179 bytes --]

Hi,

On Mon, Mar 09, 2020 at 11:20:41AM +0800, Baolin Wang wrote:
> On Sat, Mar 7, 2020 at 4:47 AM Sebastian Reichel <sre@kernel.org> wrote:
> > On Fri, Mar 06, 2020 at 10:34:10AM +0800, Baolin Wang wrote:
> > > Allow charger manager can be built as a module like other charger
> > > drivers.
> > >
> > > Signed-off-by: Baolin Wang <baolin.wang7@gmail.com>
> > > ---
> >
> > Thanks, queued. I do not like this driver, but its the best we have
> > at the moment.
> 
> Thanks. I understood your concern, do you have any plan to re-design
> the charger manager driver in kernel? Or do you have some thoughts
> about re-designing it? Now we have some out of tree code to use the
> old charger manger, and we'd like to change to the new charger manger
> driver and upstream them.

I don't have anything ready yet and not enough time unfortunately.
The proper way would be to have something equivialent to charger-manager
in the power-supply core. The core should be able to monitor batteries
and handle connected chargers automatically.  Also there shouldn't be
any DT entry for the software managing the charger, since DT is about
hardware.

-- Sebastian

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH v2] power: supply: Allow charger manager can be built as a module
  2020-03-11 22:18     ` Sebastian Reichel
@ 2020-03-12  2:35       ` Baolin Wang
  0 siblings, 0 replies; 5+ messages in thread
From: Baolin Wang @ 2020-03-12  2:35 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: Orson Zhai, Chunyan Zhang, Saravana Kannan, Android Kernel Team,
	Linux PM, LKML

On Thu, Mar 12, 2020 at 6:18 AM Sebastian Reichel <sre@kernel.org> wrote:
>
> Hi,
>
> On Mon, Mar 09, 2020 at 11:20:41AM +0800, Baolin Wang wrote:
> > On Sat, Mar 7, 2020 at 4:47 AM Sebastian Reichel <sre@kernel.org> wrote:
> > > On Fri, Mar 06, 2020 at 10:34:10AM +0800, Baolin Wang wrote:
> > > > Allow charger manager can be built as a module like other charger
> > > > drivers.
> > > >
> > > > Signed-off-by: Baolin Wang <baolin.wang7@gmail.com>
> > > > ---
> > >
> > > Thanks, queued. I do not like this driver, but its the best we have
> > > at the moment.
> >
> > Thanks. I understood your concern, do you have any plan to re-design
> > the charger manager driver in kernel? Or do you have some thoughts
> > about re-designing it? Now we have some out of tree code to use the
> > old charger manger, and we'd like to change to the new charger manger
> > driver and upstream them.
>
> I don't have anything ready yet and not enough time unfortunately.
> The proper way would be to have something equivialent to charger-manager
> in the power-supply core. The core should be able to monitor batteries
> and handle connected chargers automatically.  Also there shouldn't be
> any DT entry for the software managing the charger, since DT is about
> hardware.

OK. We'll think about it according to your suggestion. Thanks.

-- 
Baolin Wang

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

end of thread, other threads:[~2020-03-12  2:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-06  2:34 [PATCH v2] power: supply: Allow charger manager can be built as a module Baolin Wang
2020-03-06 20:47 ` Sebastian Reichel
2020-03-09  3:20   ` Baolin Wang
2020-03-11 22:18     ` Sebastian Reichel
2020-03-12  2:35       ` Baolin Wang

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