power: supply: Classify Battery Monitor Systems as batteries
CAF's new fuel gauge drivers report POWER_SUPPLY_TYPE_BMS (Battery Monitor System) instead of POWER_SUPPLY_TYPE_BATTERY (battery), and rightfully so because it describes their purpose more accurately. Update the power_supply_is_system_supplied function to recognize BMS power supplies as batteries to prevent it from attempting to query the POWER_SUPPLY_PROP_ONLINE property on our fuel gauge drivers. Signed-off-by: Danny Lin <danny@kdrag0n.dev> Signed-off-by: Adam W. Willis <return.of.octobot@gmail.com> Signed-off-by: dreamisbaka <jolinux.g@gmail.com>
This commit is contained in:
parent
d25a021cea
commit
8098862fa4
1 changed files with 2 additions and 1 deletions
|
@ -355,7 +355,8 @@ static int __power_supply_is_system_supplied(struct device *dev, void *data)
|
|||
unsigned int *count = data;
|
||||
|
||||
(*count)++;
|
||||
if (psy->desc->type != POWER_SUPPLY_TYPE_BATTERY)
|
||||
if (psy->desc->type != POWER_SUPPLY_TYPE_BATTERY &&
|
||||
psy->desc->type != POWER_SUPPLY_TYPE_BMS)
|
||||
if (!psy->desc->get_property(psy, POWER_SUPPLY_PROP_ONLINE,
|
||||
&ret))
|
||||
return ret.intval;
|
||||
|
|
Loading…
Reference in a new issue