Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp5919207ybi; Wed, 31 Jul 2019 05:29:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqyjYrtmRRkRgtLOZcQYsstzO6RdIBaP3DGB5l9aTr5vV3EXZE9QNk6wwKRmmH6Z5ubGU2GB X-Received: by 2002:a63:6b46:: with SMTP id g67mr72906765pgc.386.1564576144768; Wed, 31 Jul 2019 05:29:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564576144; cv=none; d=google.com; s=arc-20160816; b=Al6paMGkE1StSwq6xH9jZKmc00ztNTkf3vGRU4gZbVfUZC3K+Iy+dyRRAkErKUEXxp An2uHZ3x0kszP9F6BIOz05vSR/kYzYrf9Ta94+IH7fjf89t7ourNPKc8QFaidrFISniZ EfnUieboXmXkg8BJhUd76ZQuyR9qC4p/mKCFyN6oDH4q05yutVCIeF1NRFKdIAWPr/Cr /y3vXEN2xEmy6lAs0xMIQPa4zhvs2gEaMR89bXJRdWgWpzmIKfAvOexp/GgNanVHBvMS WpNb4lD/MsHfzN8Iv5PidLcD8cIsjtbr0WNaYalp+rSbeO1ykWu/59+K6rHQoEhIMvls Mczg== 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 x12si29764672plo.64.2019.07.31.05.28.49; Wed, 31 Jul 2019 05:29:04 -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 S2387644AbfGaKA5 (ORCPT + 99 others); Wed, 31 Jul 2019 06:00:57 -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(-) 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