From patchwork Wed Jul 31 10:00:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 170131 Delivered-To: patch@linaro.org Received: by 2002:a92:512:0:0:0:0:0 with SMTP id q18csp3802721ile; Wed, 31 Jul 2019 03:01:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqxa0zU6pUDlYusWM9J0pfQj5ilJl8wVdYHnSqAajt31qrUCctyXUMMDePN9Xt3INHR7SIKh X-Received: by 2002:a17:902:9a07:: with SMTP id v7mr12170669plp.245.1564567260302; Wed, 31 Jul 2019 03:01:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564567260; cv=none; d=google.com; s=arc-20160816; b=bu2tseTdP0ko4SwFpco0+IMU0zC9yTX9dDckbfbONulqqwxUzDchOv2TXjvNFn+36O 6AFMNVe+hlRdrR22ELIe9tWXamNK3UBvQjM4YFqkc2bX7yFby3yne44nOvuL0ZoFfCSt pXDdtcUhFGblhjAUAC7dyCNwYS2Kh5tkYrh8vH3MwuESkJf2Feu1vQLTS4Qx1pQRUrWG UWC+zPqRnhpV5CH5B6w4KWTCcmeA9RfEaTi0G7pEb5H3rIHqvM+khcD5h58aNV3uSgZP i7Y6RHPimjZ4l+Ta3GhbLfZwE6kUAv41eGJ9m6Ce5biQ7JP0CY1o567oFSwzOwlS6M0x NrxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=i+zcdOKM4uEsoBGbIg99q0zdIYp2a4lDHZin2ZyV6Ts=; b=ly6OzN2Vsh7FQH+Z/GzRUwujpkoHYJTkgE/ybeWpsb3+kBeI2Eg7LpltSwQsY8Z7jf 2mLN/dgoyAJ94aTCBomGV68uFULaS252Cc0uMJxKLnen4IcO7WCjIwsRx7Ge+FisBsS8 CTK3D4LWa8IG3UzqW/bx1/KS+T/HFqjW6wwpMTRZec6x97MY2F7OOVz0XtP4Pu4RhMWd H3ZJDdoMPR7UvnY/7WBGOFLb63eU5ZCEpzGQXNHMPgcAGuDbEsKa3xoMo+psu+3jlpAn 4BM1uuw1iBBqz8OEkAyBSum3g1TIY/4KjYmq/f9/98s0aw88HTk+uU28mGcTgdJ9CwOS JHow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=H77GUufa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h3si32613928pld.32.2019.07.31.03.01.00; Wed, 31 Jul 2019 03:01:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=H77GUufa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387680AbfGaKA6 (ORCPT + 29 others); Wed, 31 Jul 2019 06:00:58 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:42731 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387668AbfGaKA4 (ORCPT ); Wed, 31 Jul 2019 06:00:56 -0400 Received: by mail-pl1-f196.google.com with SMTP id ay6so30306301plb.9 for ; Wed, 31 Jul 2019 03:00:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=i+zcdOKM4uEsoBGbIg99q0zdIYp2a4lDHZin2ZyV6Ts=; b=H77GUufatg+2unukyfaUu5mIxtf9dK45weuozY3ifgIb2dgL2u+aeUCplrl82Pq2sP b2RX+7J/p/p2zmCozRuWIf8QArtB5MJKTKSI2W5+wf5MGGRL9fquoTMXWRZQeETW5oNG 9AyOc2po9ajcww/AZ4Gk49nuuQezsh8pG3bp8pmqo6iV+urV4s2bkTAOF5lSjIztR9Cu qZOES5sOtvdtqd4j4eaANh/hLCDVHh9kULIB9iwNmy8npgfW4MWuOq18H202bivWBtxy ONuRYh2HtoahAfiLP7XBvyHSsMKGMpLWD+kd5UMYrtfkNLBu6fIixasyARHKZFxhCrrX zrUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=i+zcdOKM4uEsoBGbIg99q0zdIYp2a4lDHZin2ZyV6Ts=; b=Et4jQxKHUAf2I83SRjq5Im+G2zNztOhUOg0TNz0mp4CSU6Qu0ctmU7C50/JuayBik/ GKvGUPreuGGXSWu4Zfi0S6PC12dX6cggU74h7hEEaxm1/y6XkfTwEo/caGaT7pywZvC2 BLZUvIjapPAdXxzlWbuzR9K0cg33qnWIQRlwW8xeFMwof7fuiX/+i5EFrJU0HMWRU4NO RIFNjJjYe7DwdDJP4mbwVbJmIX91M51KxP6N8icDmWizJhEy5i82KG7B+ILJLPlcLu9g PQPWrIzEIyQQ/egm5f5PPwhiMZoIy5CvwSTwfa7sozKsAit9LLUB/gGmmfEci9f8d52i 5HQg== X-Gm-Message-State: APjAAAUDjeaCIGGzideARV/CRzsrZ3YvPOht/mW/oanTutT/OGpyqz0y lYPjqZZchByvAPL5c8JpIqtf8Q== X-Received: by 2002:a17:902:4401:: with SMTP id k1mr96016005pld.193.1564567255904; Wed, 31 Jul 2019 03:00:55 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id m6sm68611352pfb.151.2019.07.31.03.00.53 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 31 Jul 2019 03:00:55 -0700 (PDT) From: Baolin Wang 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 Message-Id: <84abc5a002dcc29e51bf6525aee0ca2aace8e30a.1564566425.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yuanjiang Yu 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 Signed-off-by: Baolin Wang --- drivers/power/supply/sc27xx_fuel_gauge.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 1.7.9.5 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,