diff mbox series

[v2,2/2] power: supply: cpcap-battery: kconfig: depend on ( NVMEM || !NVMEM )

Message ID 20210423145702.e31dd7be8843d97195f98bd3@uvos.xyz (mailing list archive)
State New, archived
Headers show
Series [v2,1/2] power: supply: cpcap-battery: Add battery type auto detection for mapphone devices | expand

Commit Message

Carl Philipp Klemm April 23, 2021, 12:57 p.m. UTC
Signed-off-by: Carl Philipp Klemm <philipp@uvos.xyz>
---
 drivers/power/supply/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Sebastian Reichel June 4, 2021, 12:55 p.m. UTC | #1
Hi,

On Fri, Apr 23, 2021 at 02:57:02PM +0200, Carl Philipp Klemm wrote:
> Signed-off-by: Carl Philipp Klemm <philipp@uvos.xyz>
> ---

This is missing a long patch description, but needs to be squashed
into PATCH 1/2 anyways.

Thanks,

-- Sebastian

>  drivers/power/supply/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/power/supply/Kconfig b/drivers/power/supply/Kconfig
> index 006b95eca673..0775a8cda265 100644
> --- a/drivers/power/supply/Kconfig
> +++ b/drivers/power/supply/Kconfig
> @@ -110,7 +110,7 @@ config BATTERY_ACT8945A
>  
>  config BATTERY_CPCAP
>  	tristate "Motorola CPCAP PMIC battery driver"
> -	depends on MFD_CPCAP && IIO
> +	depends on ( MFD_CPCAP && IIO ) && ( NVMEM || !NVMEM )
>  	default MFD_CPCAP
>  	help
>  	  Say Y here to enable support for battery on Motorola
> -- 
> 2.31.0
> 
>
Carl Philipp Klemm June 7, 2021, 11:01 a.m. UTC | #2
> This is missing a long patch description, but needs to be squashed
> into PATCH 1/2 anyways.
> 
> Thanks,
> 
> -- Sebastian

Im thinking I would rather just drop this entirely, since at least I
and one other user use cpcap-battery with a 3rd party battery with no
nvmem, and Tony and Merlijn use it with a lab power supply.

In these cases requireing NVMEM makes no sense and the code in 
"power: supply: cpcap-battery: Add battery type auto detection
for mapphone devices" works fine without.
Sebastian Reichel June 7, 2021, 11:27 a.m. UTC | #3
Hi,

On Mon, Jun 07, 2021 at 01:01:37PM +0200, Carl Philipp Klemm wrote:
> > This is missing a long patch description, but needs to be squashed
> > into PATCH 1/2 anyways.
> > 
> > Thanks,
> > 
> > -- Sebastian
> 
> Im thinking I would rather just drop this entirely, since at least I
> and one other user use cpcap-battery with a 3rd party battery with no
> nvmem, and Tony and Merlijn use it with a lab power supply.
> 
> In these cases requireing NVMEM makes no sense and the code in 
> "power: supply: cpcap-battery: Add battery type auto detection
> for mapphone devices" works fine without.

"depends (NVMEM || !NVMEM)" does not add a NVMEM dependency. It just
disallows the configuration of built-in cpcap-battery and modular NVMEM,
which does not work:

NVMEM=y CPCAP_BATTERY=y => valid
NVMEM=y CPCAP_BATTERY=m => valid
NVMEM=y CPCAP_BATTERY=n => valid
NVMEM=n CPCAP_BATTERY=y => valid
NVMEM=n CPCAP_BATTERY=m => valid
NVMEM=n CPCAP_BATTERY=n => valid
NVMEM=m CPCAP_BATTERY=y => invalid
NVMEM=m CPCAP_BATTERY=m => valid
NVMEM=m CPCAP_BATTERY=n => valid

But checking the NVMEM config option it's bool instead of tristate
and cannot be modular anyways. Thus its fine to drop this, since
it's useless.

-- Sebastian
diff mbox series

Patch

diff --git a/drivers/power/supply/Kconfig b/drivers/power/supply/Kconfig
index 006b95eca673..0775a8cda265 100644
--- a/drivers/power/supply/Kconfig
+++ b/drivers/power/supply/Kconfig
@@ -110,7 +110,7 @@  config BATTERY_ACT8945A
 
 config BATTERY_CPCAP
 	tristate "Motorola CPCAP PMIC battery driver"
-	depends on MFD_CPCAP && IIO
+	depends on ( MFD_CPCAP && IIO ) && ( NVMEM || !NVMEM )
 	default MFD_CPCAP
 	help
 	  Say Y here to enable support for battery on Motorola