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

Commit edfc38fc authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "power: qpnp-fg-gen4: Fix maintenance SOC reporting logic"

parents a23f93ea 0d08e699
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
 * Copyright (c) 2018-2020 The Linux Foundation. All rights reserved.
 */

#define pr_fmt(fmt)	"FG: %s: " fmt, __func__
@@ -2745,14 +2745,14 @@ static int fg_gen4_update_maint_soc(struct fg_dev *fg)
		goto out;
	}

	if (msoc > fg->maint_soc) {
	if (msoc >= fg->maint_soc) {
		/*
		 * When the monotonic SOC goes above maintenance SOC, we should
		 * stop showing the maintenance SOC.
		 */
		fg->delta_soc = 0;
		fg->maint_soc = 0;
	} else if (fg->maint_soc && msoc <= fg->last_msoc) {
	} else if (fg->maint_soc && msoc < fg->last_msoc) {
		/* MSOC is decreasing. Decrease maintenance SOC as well */
		fg->maint_soc -= 1;
		if (!(msoc % 10)) {