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

Commit d8fb4a93 authored by Mark Salyzyn's avatar Mark Salyzyn
Browse files

ANDROID: GKI: power: supply: Add capacity and resistance estimates



Partially taken from commit 5b4457baf0e32ba6a6a8d0933328189ff7335e4
("qpnp-qg: add properities for google_battery requirement")

Signed-off-by: default avatarJack Wu <wjack@google.com>
Bug: 139264914
(cherry picked from commit 5b4457baf0e32ba6a6a8d0933328189ff7335e44)
Signed-off-by: default avatarMark Salyzyn <salyzyn@google.com>
Bug: 150789066
Change-Id: I92678ec7228a46ceb870f41e3acf2f790633fc2a
parent cd5c0c79
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -215,9 +215,15 @@ static ssize_t power_supply_show_property(struct device *dev,
	case POWER_SUPPLY_PROP_CHARGE_COUNTER_EXT:
		ret = sprintf(buf, "%lld\n", value.int64val);
		break;
	case POWER_SUPPLY_PROP_MODEL_NAME ... POWER_SUPPLY_PROP_SERIAL_NUMBER:
	case POWER_SUPPLY_PROP_MODEL_NAME ... POWER_SUPPLY_PROP_CYCLE_COUNTS:
		ret = sprintf(buf, "%s\n", value.strval);
		break;
	/*
	 * FIXME: b/139264914, ignore it temporarily to avoid hit NULL point.
	 * will review it
	 */
	case POWER_SUPPLY_PROP_SERIAL_NUMBER:
		break;
	default:
		ret = sprintf(buf, "%d\n", value.intval);
	}
@@ -467,6 +473,12 @@ static struct device_attribute power_supply_attrs[] = {
	POWER_SUPPLY_ATTR(charge_disable),
	POWER_SUPPLY_ATTR(adapter_details),
	POWER_SUPPLY_ATTR(dead_battery),
	/* Capacity Estimation */
	POWER_SUPPLY_ATTR(batt_ce_ctrl),
	POWER_SUPPLY_ATTR(batt_ce_full),
	/* Resistance Estimaton */
	POWER_SUPPLY_ATTR(resistance_avg),
	POWER_SUPPLY_ATTR(batt_res_filt_cnts),
	/* Charge pump properties */
	POWER_SUPPLY_ATTR(cp_status1),
	POWER_SUPPLY_ATTR(cp_status2),
+6 −0
Original line number Diff line number Diff line
@@ -338,6 +338,12 @@ enum power_supply_property {
	POWER_SUPPLY_PROP_CHARGE_DISABLE,
	POWER_SUPPLY_PROP_ADAPTER_DETAILS,
	POWER_SUPPLY_PROP_DEAD_BATTERY,
	/* Capacity Estimation */
	POWER_SUPPLY_PROP_BATT_CE_CTRL,
	POWER_SUPPLY_PROP_CHARGE_FULL_ESTIMATE,
	/* Resistance Estimaton */
	POWER_SUPPLY_PROP_RESISTANCE_AVG,
	POWER_SUPPLY_PROP_RES_FILTER_COUNT,
	/* Charge pump properties */
	POWER_SUPPLY_PROP_CP_STATUS1,
	POWER_SUPPLY_PROP_CP_STATUS2,