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

Commit a9bfac93 authored by Umang Agrawal's avatar Umang Agrawal Committed by Guru Das Srinagesh
Browse files

power: qg: Expose cc soc value through power supply property



Charge termination SW workaround requires the value of cc soc for its
execution. Add support to expose cc soc value through POWER_SUPPLY_CC_SOC
property.

Change-Id: I819037e8026a90ce974d95f24da2b138e154889a
Signed-off-by: default avatarUmang Agrawal <uagrawal@codeaurora.org>
parent e1d12886
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2018 The Linux Foundation. All rights reserved.
 * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
 */

#define pr_fmt(fmt)	"QG-K: %s: " fmt, __func__
@@ -1807,6 +1807,9 @@ static int qg_psy_get_property(struct power_supply *psy,
	case POWER_SUPPLY_PROP_SOH:
		pval->intval = chip->soh;
		break;
	case POWER_SUPPLY_PROP_CC_SOC:
		rc = qg_get_cc_soc(chip, &pval->intval);
		break;
	default:
		pr_debug("Unsupported property %d\n", psp);
		break;
@@ -1857,6 +1860,7 @@ static enum power_supply_property qg_psy_props[] = {
	POWER_SUPPLY_PROP_ESR_ACTUAL,
	POWER_SUPPLY_PROP_ESR_NOMINAL,
	POWER_SUPPLY_PROP_SOH,
	POWER_SUPPLY_PROP_CC_SOC,
};

static const struct power_supply_desc qg_psy_desc = {