power: qpnp-fg-gen3: add support for skew in capacity learning algorithm
In some cases, a skew needs to be applied on the learnt capacity to counter the error. Add support for it. Change-Id: I7f80088e7db4e3414d86983722c92e4fc14323e0 Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org> Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
This commit is contained in:
parent
183bc63f12
commit
c4205fe6be
1 changed files with 9 additions and 0 deletions
|
@ -1315,11 +1315,20 @@ static bool is_temp_valid_cap_learning(struct fg_chip *chip)
|
|||
return true;
|
||||
}
|
||||
|
||||
#define QNOVO_CL_SKEW_DECIPCT -30
|
||||
static void fg_cap_learning_post_process(struct fg_chip *chip)
|
||||
{
|
||||
int64_t max_inc_val, min_dec_val, old_cap;
|
||||
int rc;
|
||||
|
||||
if (is_qnovo_en(chip)) {
|
||||
fg_dbg(chip, FG_CAP_LEARN, "applying skew %d on current learnt capacity %lld\n",
|
||||
QNOVO_CL_SKEW_DECIPCT, chip->cl.final_cc_uah);
|
||||
chip->cl.final_cc_uah = chip->cl.final_cc_uah *
|
||||
(1000 + QNOVO_CL_SKEW_DECIPCT);
|
||||
do_div(chip->cl.final_cc_uah, 1000);
|
||||
}
|
||||
|
||||
max_inc_val = chip->cl.learned_cc_uah
|
||||
* (1000 + chip->dt.cl_max_cap_inc);
|
||||
do_div(max_inc_val, 1000);
|
||||
|
|
Loading…
Add table
Reference in a new issue