Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9aae0cd7 authored by Fenglin Wu's avatar Fenglin Wu
Browse files

power: qpnp-fg: Add SOC_REPORTING_READY to indicate actual SOC reporting



Before battery profile has been loaded, FG reports a default capacity
instead of the actual battery capacity. Add SOC_REPORTING_READY to
indicate if the actual battery capacity is ready.

CRs-Fixed: 1001496
Change-Id: If6cdbc2b5d413e7f2a5c664b2909059afa4dbd44
Signed-off-by: default avatarFenglin Wu <fenglinw@codeaurora.org>
parent 1a67f3c5
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -3217,6 +3217,7 @@ static enum power_supply_property fg_power_props[] = {
	POWER_SUPPLY_PROP_CYCLE_COUNT,
	POWER_SUPPLY_PROP_CYCLE_COUNT,
	POWER_SUPPLY_PROP_CYCLE_COUNT_ID,
	POWER_SUPPLY_PROP_CYCLE_COUNT_ID,
	POWER_SUPPLY_PROP_HI_POWER,
	POWER_SUPPLY_PROP_HI_POWER,
	POWER_SUPPLY_PROP_SOC_REPORTING_READY,
};
};


static int fg_power_get_property(struct power_supply *psy,
static int fg_power_get_property(struct power_supply *psy,
@@ -3304,6 +3305,9 @@ static int fg_power_get_property(struct power_supply *psy,
	case POWER_SUPPLY_PROP_HI_POWER:
	case POWER_SUPPLY_PROP_HI_POWER:
		val->intval = !!chip->bcl_lpm_disabled;
		val->intval = !!chip->bcl_lpm_disabled;
		break;
		break;
	case POWER_SUPPLY_PROP_SOC_REPORTING_READY:
		val->intval = !!chip->profile_loaded;
		break;
	default:
	default:
		return -EINVAL;
		return -EINVAL;
	}
	}