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

Commit 1c121fc3 authored by Shilpa Suresh's avatar Shilpa Suresh Committed by Gerrit - the friendly Code Review server
Browse files

power: vm_bms: Release the wake-source after an OCV update



The VBMS driver holds a wake-source for the userspace to pick
up the data for processing, this wake-source stays held for
500ms (timeout) which may stall a system suspend if the data
processing is complete.
Fix this by releasing the wake-source after the userspace has
written back OCV which indicates that processing is complete.

Change-Id: Id527881800407f5b7476b62dd86f805c00304689
Signed-off-by: default avatarShilpa Suresh <sbsure@codeaurora.org>
parent 4d6eb766
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
/* Copyright (c) 2014-2016, 2018-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2014-2016, 2018-2020, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -2416,6 +2416,7 @@ static int qpnp_vm_bms_power_set_property(struct power_supply *psy,
		pr_debug("IBATT = %d\n", val->intval);
		break;
	case POWER_SUPPLY_PROP_VOLTAGE_OCV:
		pm_relax(chip->dev);
		cancel_delayed_work_sync(&chip->monitor_soc_work);
		chip->last_ocv_uv = val->intval;
		pr_debug("OCV = %d\n", val->intval);