linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Baolin Wang <baolin.wang@linaro.org>
To: sre@kernel.org
Cc: orsonzhai@gmail.com, zhang.lyra@gmail.com,
	yuanjiang.yu@unisoc.com, baolin.wang@linaro.org,
	vincent.guittot@linaro.org, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 2/6] power: supply: sc27xx: Fix conditon to enable the FGU interrupt
Date: Wed, 31 Jul 2019 18:00:24 +0800	[thread overview]
Message-ID: <84abc5a002dcc29e51bf6525aee0ca2aace8e30a.1564566425.git.baolin.wang@linaro.org> (raw)
In-Reply-To: <cover.1564566425.git.baolin.wang@linaro.org>
In-Reply-To: <cover.1564566425.git.baolin.wang@linaro.org>

From: Yuanjiang Yu <yuanjiang.yu@unisoc.com>

We should allow to enable FGU interrupt to adjust the battery capacity,
when charging status is POWER_SUPPLY_STATUS_DISCHARGING.

Signed-off-by: Yuanjiang Yu <yuanjiang.yu@unisoc.com>
Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
---
 drivers/power/supply/sc27xx_fuel_gauge.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/power/supply/sc27xx_fuel_gauge.c b/drivers/power/supply/sc27xx_fuel_gauge.c
index 2fe97ae..ca7b73e 100644
--- a/drivers/power/supply/sc27xx_fuel_gauge.c
+++ b/drivers/power/supply/sc27xx_fuel_gauge.c
@@ -1098,7 +1098,8 @@ static int sc27xx_fgu_suspend(struct device *dev)
 	 * If we are charging, then no need to enable the FGU interrupts to
 	 * adjust the battery capacity.
 	 */
-	if (status != POWER_SUPPLY_STATUS_NOT_CHARGING)
+	if (status != POWER_SUPPLY_STATUS_NOT_CHARGING &&
+	    status != POWER_SUPPLY_STATUS_DISCHARGING)
 		return 0;
 
 	ret = regmap_update_bits(data->regmap, data->base + SC27XX_FGU_INT_EN,
-- 
1.7.9.5


  parent reply	other threads:[~2019-07-31 10:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-31 10:00 [PATCH 0/6] Optimize the Spreadtrum SC27xx fuel gauge Baolin Wang
2019-07-31 10:00 ` [PATCH 1/6] power: supply: sc27xx: Add POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN attribute Baolin Wang
2019-07-31 10:00 ` Baolin Wang [this message]
2019-07-31 10:00 ` [PATCH 3/6] power: supply: sc27xx: Fix the the accuracy issue of coulomb calculation Baolin Wang
2019-07-31 10:00 ` [PATCH 4/6] power: supply: sc27xx: Optimize the battery capacity calibration Baolin Wang
2019-07-31 10:00 ` [PATCH 5/6] power: supply: sc27xx: Make sure the alarm capacity is larger than 0 Baolin Wang
2019-07-31 10:00 ` [PATCH 6/6] power: supply: sc27xx: Add POWER_SUPPLY_PROP_CALIBRATE attribute Baolin Wang
2019-09-02 21:04 ` [PATCH 0/6] Optimize the Spreadtrum SC27xx fuel gauge Sebastian Reichel
2019-09-03  1:34   ` Baolin Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=84abc5a002dcc29e51bf6525aee0ca2aace8e30a.1564566425.git.baolin.wang@linaro.org \
    --to=baolin.wang@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=orsonzhai@gmail.com \
    --cc=sre@kernel.org \
    --cc=vincent.guittot@linaro.org \
    --cc=yuanjiang.yu@unisoc.com \
    --cc=zhang.lyra@gmail.com \
    --subject='Re: [PATCH 2/6] power: supply: sc27xx: Fix conditon to enable the FGU interrupt' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).