diff mbox series

[4/5] power: supply: cpcap-charger: fix small mistake in current to register conversion

Message ID 20210117224745.40c38ae352761663db1752c9@uvos.xyz
State Accepted
Commit 8a5a0cc13aa927eac7a9eb3ca82dfc1f82cfc28d
Headers show
Series [1/5] power: supply: cpcap-charger: get the battery inserted infomation from cpcap-battery | expand

Commit Message

Carl Philipp Klemm Jan. 17, 2021, 9:47 p.m. UTC
Signed-off-by: Carl Philipp Klemm <philipp@uvos.xyz>
---
 drivers/power/supply/cpcap-charger.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Tony Lindgren April 4, 2021, 7:23 a.m. UTC | #1
* Carl Philipp Klemm <philipp@uvos.xyz> [210117 23:47]:
> Signed-off-by: Carl Philipp Klemm <philipp@uvos.xyz>


Acked-by: Tony Lindgren <tony@atomide.com>


> ---

>  drivers/power/supply/cpcap-charger.c | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

> 

> diff --git a/drivers/power/supply/cpcap-charger.c b/drivers/power/supply/cpcap-charger.c

> index 152090faf5b2..be7d1da7a5a5 100644

> --- a/drivers/power/supply/cpcap-charger.c

> +++ b/drivers/power/supply/cpcap-charger.c

> @@ -300,7 +300,7 @@ static int cpcap_charger_current_to_regval(int microamp)

>  		return CPCAP_REG_CRM_ICHRG(0x0);

>  	if (miliamp < 177)

>  		return CPCAP_REG_CRM_ICHRG(0x1);

> -	if (miliamp > 1596)

> +	if (miliamp >= 1596)

>  		return CPCAP_REG_CRM_ICHRG(0xe);

>  

>  	res = microamp / 88666;

> -- 

> 2.29.2

>
Sebastian Reichel April 5, 2021, 8:22 a.m. UTC | #2
Hi,

On Sun, Apr 04, 2021 at 10:23:27AM +0300, Tony Lindgren wrote:
> * Carl Philipp Klemm <philipp@uvos.xyz> [210117 23:47]:
> > Signed-off-by: Carl Philipp Klemm <philipp@uvos.xyz>
> 
> Acked-by: Tony Lindgren <tony@atomide.com>

Thanks, queued.

-- Sebastian

> > ---
> >  drivers/power/supply/cpcap-charger.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/power/supply/cpcap-charger.c b/drivers/power/supply/cpcap-charger.c
> > index 152090faf5b2..be7d1da7a5a5 100644
> > --- a/drivers/power/supply/cpcap-charger.c
> > +++ b/drivers/power/supply/cpcap-charger.c
> > @@ -300,7 +300,7 @@ static int cpcap_charger_current_to_regval(int microamp)
> >  		return CPCAP_REG_CRM_ICHRG(0x0);
> >  	if (miliamp < 177)
> >  		return CPCAP_REG_CRM_ICHRG(0x1);
> > -	if (miliamp > 1596)
> > +	if (miliamp >= 1596)
> >  		return CPCAP_REG_CRM_ICHRG(0xe);
> >  
> >  	res = microamp / 88666;
> > -- 
> > 2.29.2
> >
diff mbox series

Patch

diff --git a/drivers/power/supply/cpcap-charger.c b/drivers/power/supply/cpcap-charger.c
index 152090faf5b2..be7d1da7a5a5 100644
--- a/drivers/power/supply/cpcap-charger.c
+++ b/drivers/power/supply/cpcap-charger.c
@@ -300,7 +300,7 @@  static int cpcap_charger_current_to_regval(int microamp)
 		return CPCAP_REG_CRM_ICHRG(0x0);
 	if (miliamp < 177)
 		return CPCAP_REG_CRM_ICHRG(0x1);
-	if (miliamp > 1596)
+	if (miliamp >= 1596)
 		return CPCAP_REG_CRM_ICHRG(0xe);
 
 	res = microamp / 88666;