From 514e483a478b813f54daa0792b32d86b70a2b1a6 Mon Sep 17 00:00:00 2001 From: Manaf Meethalavalappu Pallikunhi Date: Wed, 15 Feb 2017 18:09:35 +0530 Subject: [PATCH] power: bcl_peripheral: Enable BCL LMH algorithm only once Currently BCL LMH algorithm enable request goes for every time BCL threshold enablement. It needs to be enabled only once. So Enable BCL LMH algorithm only once. Change-Id: I94c7326b7730830f71b71c92df21a589ddd2347b Signed-off-by: Manaf Meethalavalappu Pallikunhi --- drivers/power/supply/qcom/bcl_peripheral.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/power/supply/qcom/bcl_peripheral.c b/drivers/power/supply/qcom/bcl_peripheral.c index cae4967f1ef4..2d237f27b062 100644 --- a/drivers/power/supply/qcom/bcl_peripheral.c +++ b/drivers/power/supply/qcom/bcl_peripheral.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2016, The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2017, 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 @@ -482,8 +482,10 @@ static int bcl_access_monitor_enable(bool enable) if (enable == bcl_perph->enabled) goto access_exit; - if ((bcl_perph_version == BCL_PMI8998) && !hw_enabled && enable) + if ((bcl_perph_version == BCL_PMI8998) && !hw_enabled && enable) { bcl_lmh_dcvs_enable(); + hw_enabled = true; + } for (; i < BCL_PARAM_MAX; i++) { perph_data = &bcl_perph->param[i]; -- 2.11.0