Skip to content

Commit

Permalink
power: supply: sbs-battery: Fall back to Li-ion battery type for bq20z75
Browse files Browse the repository at this point in the history
The older bq20z75 controller doesn't support reporting the battery type
and the type is Li-ion in this case.

Signed-off-by: Dmitry Osipenko <[email protected]>
  • Loading branch information
digetx committed Apr 1, 2021
1 parent 946b1ed commit f238f04
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/power/supply/sbs-battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -813,9 +813,15 @@ static int sbs_get_chemistry(struct i2c_client *client,
else
val->intval = POWER_SUPPLY_TECHNOLOGY_UNKNOWN;

if (val->intval == POWER_SUPPLY_TECHNOLOGY_UNKNOWN)
if (val->intval == POWER_SUPPLY_TECHNOLOGY_UNKNOWN) {
struct sbs_info *chip = i2c_get_clientdata(client);

dev_warn_once(&client->dev, "Unknown chemistry: %s\n", chemistry);

if (chip->flags & SBS_FLAGS_TI_BQ20ZX5)
val->intval = POWER_SUPPLY_TECHNOLOGY_LION;
}

return 0;
}

Expand Down

0 comments on commit f238f04

Please sign in to comment.