From patchwork Wed Jul 31 10:00:27 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: 170134 Delivered-To: patch@linaro.org Received: by 2002:a92:512:0:0:0:0:0 with SMTP id q18csp3802980ile; Wed, 31 Jul 2019 03:01:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqxLoHJxVrCOvj7zFPshaYGY93KpW+tTTqklNKQgsPsNie6mM1pU8X+RzKjVSlEpZI+xvezT X-Received: by 2002:a62:7641:: with SMTP id r62mr46230527pfc.35.1564567270352; Wed, 31 Jul 2019 03:01:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564567270; cv=none; d=google.com; s=arc-20160816; b=bJF+0aaN9Ni6ia2twgo8sCpEXtWNBegojJHdYhlh//jSC+C+h6B2gl86IVLtLtTIMr DVFfjqC7fi6uEhahGzZeEgwX4fqiSQqboIDZDi8uaGsCUrxhdXZ4VeJ0QwJMGEASZcqz eV3waG+/ZvAUtFGTYsQ+EtrrWfL3nzYloliExOC8jotq/pWHiw15U38h7KfuzreZsoLR 2q5FVgsI4O6WI3LE9nTgcUPLrKVNLBGdqo86kMVt36YSL40R94LkS8wmUN2eyK3KJmaJ 0KT+kPv2IkLKsXkI4AHkElaKDHv3RAzHwWk88QUoJwxKs/RnPyJV43GYbIi+BAJvD6Do VS7Q== 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=hT++od96JIv4ERj/5q43A9sdV6GV4nXuETH/GErjU/I=; b=GCQbGr63u3d5zjs7XntjessSyNthzzSnlnFtTJ5aFd4pNlinHa4fmxUbL+y5/qlmaH djM5PMTvdK7zRofCs3Stp9mWBStjsLkEdOsA38lP5r0TFt8+k1HbGU+z2ChWiA92qni0 m1wk6Chm94yEWAvYNI2SH+f34wLm2+31ZNzXV1dvv7hPqlBraTThfQnd3900PQ4UOCFE nAm+hkN/BEGyre33XkvGsLQcPbj7eNBEWT+fxkywYsh+oqDlE3ipVbCtZY7j4WztBhkd M3AaSY26H3u1UieApw0YbgLhlUzG0OW0d6MQXX49xYM3pgg/LY9YgXcgiImQREaaZc1B imIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kIXAp4Mz; 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 g1si29366795plg.353.2019.07.31.03.01.10; Wed, 31 Jul 2019 03:01:10 -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=kIXAp4Mz; 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 S1728994AbfGaKBI (ORCPT + 29 others); Wed, 31 Jul 2019 06:01:08 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:44545 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387667AbfGaKBE (ORCPT ); Wed, 31 Jul 2019 06:01:04 -0400 Received: by mail-pg1-f196.google.com with SMTP id i18so31716009pgl.11 for ; Wed, 31 Jul 2019 03:01:03 -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=hT++od96JIv4ERj/5q43A9sdV6GV4nXuETH/GErjU/I=; b=kIXAp4MzviR01IRWqe7+ak4T/tIj/IFNOIOhRvpjmPe4Iky3tFm/wfi5mHwn+pc5DK BQr4/V2CGVXy3LsdNBMhg93+PTiKMQhTlHIm5KoA1US4OPQS9jfABuFeaTh5gnT+r2aX nIoi4PywtlKhdVqSZOj3IKK1NvCelqy/7qMhasvUnDLoaz2EMKpUZIxxfyXFzAraP4Ox iKncbdTOLXT99eGgIOaUMIJJzvIoi2zdT+fSBRWqENUmT/UezZtf8dIF2BK3IICY2HN+ D695VleypTnWA8Je1k4uXVgjgWZ8D8GJiwdlybFBgC7IWA4KSWK3FBUq7x1kMW9XG3xw eB2A== 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=hT++od96JIv4ERj/5q43A9sdV6GV4nXuETH/GErjU/I=; b=rpPxLIO1cUaaoCWS1GHhA9ISQGI2USoYIuY52GoUD57ombqHBgEHrBuEyutMeoYqwj WR595MiSDW4QcPBF+ILVWzQyaTOY4/Or4YHvRmPl8O4khxGKRAW2lKUzWeOH86Ah800I ba02eg3gzPY06iYz21kgv1ebgbF5sO4kNUAgfjiNvgA8iOLTVdC4eLJqK1Ocdm8sKemr 2Z4IP16KZd+n5zCKKFAjX4cPsOhwCJMBMbK9g/4lb9403khmUMFcB1tKUdkEVF14lj+U 1MOKEMGX0N8ggoo5loM0QUc5FQFq8F8zdK8T3nemFKSK6b7k2l8SCIQB4te9k4xikXUR 9yaw== X-Gm-Message-State: APjAAAUZcWhUKk5RBB/5I9TMPGw6NLNbdAyvsMz0PWeQAuruHj86Gb50 CrFRF0xH55V0RFSDNKJAnBnsyQ== X-Received: by 2002:aa7:8acb:: with SMTP id b11mr44975412pfd.109.1564567263283; Wed, 31 Jul 2019 03:01:03 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id m6sm68611352pfb.151.2019.07.31.03.01.00 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 31 Jul 2019 03:01:02 -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 5/6] power: supply: sc27xx: Make sure the alarm capacity is larger than 0 Date: Wed, 31 Jul 2019 18:00:27 +0800 Message-Id: <5c3bb516c6020410a932c12eb2481fd75c34b7fe.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 must make sure the alarm capacity is larger than 0, to help to calibrate the low battery capacity. Signed-off-by: Yuanjiang Yu Signed-off-by: Baolin Wang --- drivers/power/supply/sc27xx_fuel_gauge.c | 2 ++ 1 file changed, 2 insertions(+) -- 1.7.9.5 diff --git a/drivers/power/supply/sc27xx_fuel_gauge.c b/drivers/power/supply/sc27xx_fuel_gauge.c index f670131..fa85f40 100644 --- a/drivers/power/supply/sc27xx_fuel_gauge.c +++ b/drivers/power/supply/sc27xx_fuel_gauge.c @@ -915,6 +915,8 @@ static int sc27xx_fgu_hw_init(struct sc27xx_fgu_data *data) data->alarm_cap = power_supply_ocv2cap_simple(data->cap_table, data->table_len, data->min_volt); + if (!data->alarm_cap) + data->alarm_cap += 1; power_supply_put_battery_info(data->battery, &info);