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

Commit baf4be13 authored by Umang Agrawal's avatar Umang Agrawal
Browse files

power: battery: Expose FCC stepper algorithm execution status



Add FCC_STEPPING_IN_PROGRESS property to qcom-battery which exposes
state of FCC stepper algorithm. This allows userspace daemon to skip
any FCC manipulation while FCC stepping is in progress.

Change-Id: If85110fa25bfc49277677848b5a7d3c7d3169ecd
Signed-off-by: default avatarUmang Agrawal <uagrawal@codeaurora.org>
parent 1bd31aa0
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -123,6 +123,7 @@ enum {
	SLAVE_PCT,
	RESTRICT_CHG_ENABLE,
	RESTRICT_CHG_CURRENT,
	FCC_STEPPING_IN_PROGRESS,
};

/*******
@@ -389,11 +390,26 @@ static ssize_t restrict_cur_store(struct class *c, struct class_attribute *attr,
}
static CLASS_ATTR_RW(restrict_cur);

/****************************
 * FCC STEPPING IN PROGRESS *
 ****************************/
static ssize_t fcc_stepping_in_progress_show(struct class *c,
				struct class_attribute *attr, char *ubuf)
{
	struct pl_data *chip = container_of(c, struct pl_data,
			qcom_batt_class);

	return snprintf(ubuf, PAGE_SIZE, "%d\n", chip->step_fcc);
}
static CLASS_ATTR_RO(fcc_stepping_in_progress);

static struct attribute *batt_class_attrs[] = {
	[VER]			= &class_attr_version.attr,
	[SLAVE_PCT]		= &class_attr_slave_pct.attr,
	[RESTRICT_CHG_ENABLE]	= &class_attr_restrict_chg.attr,
	[RESTRICT_CHG_CURRENT]	= &class_attr_restrict_cur.attr,
	[FCC_STEPPING_IN_PROGRESS]
				= &class_attr_fcc_stepping_in_progress.attr,
	NULL,
};
ATTRIBUTE_GROUPS(batt_class);