Skip to contentSkip to conversation

power: supply: bq256xx: Init ichg/vbat value with chip default value

PATCH In review Hermes Zhang 2 participants 2 messages Jan 10, 2023 – Feb 3, 2023 Power supply

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 power: supply: bq256xx: Init ichg/vbat value with chip default value

Init the ichg/vbat reg with chip default value instead of the max value used now. The max value set in driver will result an unsafe case (e.g. battery is over charging when in a hot environment) if no user space update the value later.

---

Notes:

    V2
 drivers/power/supply/bq256xx_charger.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/power/supply/bq256xx_charger.c +2 -2
index 01ad84fd147c..6b5435bf2ed4 100644
@@ -1563,7 +1563,7 @@ static int bq256xx_hw_init(struct bq256xx_device *bq)
 		return ret;
 
 	ret = bq->chip_info->bq256xx_set_ichg(bq,
-				bat_info->constant_charge_current_max_ua);
+				bq->chip_info->bq256xx_def_ichg);
 	if (ret)
 		return ret;
 
@@ -1573,7 +1573,7 @@ static int bq256xx_hw_init(struct bq256xx_device *bq)
 		return ret;
 
 	ret = bq->chip_info->bq256xx_set_vbatreg(bq,
-				bat_info->constant_charge_voltage_max_uv);
+				bq->chip_info->bq256xx_def_vbatreg);
 	if (ret)
 		return ret;
 
Signature · 1 line
2.30.2
#1 lore raw

Hi,

Quoted 7 lines · Hermes Zhang

Init the ichg/vbat reg with chip default value instead of the max value used now. The max value set in driver will result an unsafe case (e.g. battery is over charging when in a hot environment) if no user space update the value later.

---

Thanks, queued.

-- Sebastian

Quoted 32 lines

Notes:

    V2
 drivers/power/supply/bq256xx_charger.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/power/supply/bq256xx_charger.c +2 -2
index 01ad84fd147c..6b5435bf2ed4 100644
@@ -1563,7 +1563,7 @@ static int bq256xx_hw_init(struct bq256xx_device *bq)
 		return ret;
 
 	ret = bq->chip_info->bq256xx_set_ichg(bq,
-				bat_info->constant_charge_current_max_ua);
+				bq->chip_info->bq256xx_def_ichg);
 	if (ret)
 		return ret;
 
@@ -1573,7 +1573,7 @@ static int bq256xx_hw_init(struct bq256xx_device *bq)
 		return ret;
 
 	ret = bq->chip_info->bq256xx_set_vbatreg(bq,
-				bat_info->constant_charge_voltage_max_uv);
+				bq->chip_info->bq256xx_def_vbatreg);
 	if (ret)
 		return ret;
 
Signature · 1 line
2.30.2