Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp469287imm; Wed, 26 Sep 2018 01:36:07 -0700 (PDT) X-Google-Smtp-Source: ACcGV62WzYq9p/FO/h6YzFv4qmWMB+YgnFd+c3OJOSH5G0mxo7XuuVrn/IBoc9eH1dFtBOKM3GfX X-Received: by 2002:a62:6781:: with SMTP id t1-v6mr5124534pfj.200.1537950967115; Wed, 26 Sep 2018 01:36:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537950967; cv=none; d=google.com; s=arc-20160816; b=gI7v1E0c0q2mJZhruwRbYVBjL+OOR1SkQLf2AKilBJgjdFHiJd5JpDPU+LT0OlKKPA t325r5VBzTZF1IxrL9mZh7YAD8eU/IGqMJ/kXZK1T1kMfLx1eDhwQZIs/oNni3agF4Hz eF+VqWoAoxFFC6hMU8BkkOxcVn+JApL57sBsI0VhY+A7PN+iHKIS8Oikpk0PXh/r7DjM 6ohrU8l02ywhfn4dr71QbxVdotSuaBCthZ5eI7Zonu5AjIC7if0tJJb3cTZxYyv9ceJN uhq+lTfDw8JbmF8znTI+8pW/CXnSGrX/MBdDYR5vMm8V3ejGv82dat+WKOkbt2vgk7IP VHrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature; bh=sWgQF2wJUEsyW+CUeCYaTleJ3LvSVRzQqE+MmPYAtb4=; b=lUZZwBePeIialkVyjh6JHdVC0/O5qINB6xMzt4KA9A1CykFozhXr4IPNKoz++KZzNU 9+jUOLfMyzz94BGxfmgBAcgN/0HxMcH4B5ij9Wt3a2VnIWsKnrTzPiEU1f7iWmYjtgtX 0sfnxZJOdQFdNqRj1SXyw5S4JpqnW1UzAPXYEMo16S8O3uFFxkss0DokX4OeKChrHdfS CjVukQ2j8iE3cO3545b+N4x1ZuywshC+LzrJXZH8aZU/ceo2/YpXsLbnlEQ8rEaaOLyy 7c/je3l1sqRrGsS5p1476+RwFBSWJGv3qGEeUIn+skhmQJhjmeK75oHmo7MBMKNLV69/ PeOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QXJdkbqi; 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 w15-v6si4801224pgg.529.2018.09.26.01.35.51; Wed, 26 Sep 2018 01:36:07 -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=QXJdkbqi; 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 S1727377AbeIZOp0 (ORCPT + 99 others); Wed, 26 Sep 2018 10:45:26 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:46877 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727157AbeIZOp0 (ORCPT ); Wed, 26 Sep 2018 10:45:26 -0400 Received: by mail-lf1-f67.google.com with SMTP id q2-v6so12499563lfc.13 for ; Wed, 26 Sep 2018 01:33:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=sWgQF2wJUEsyW+CUeCYaTleJ3LvSVRzQqE+MmPYAtb4=; b=QXJdkbqi5eknCaFm1m980VPwAnhMh8TWQ8R3dvVLObJ83Soyb9a5sN71N8Ad+GLpAD QXZ8Axx/l10xM3hhO4OUYXjCMSlVM/ObxWj7370U4H012ULhqTLnI/5M8G5M+D2Kv2h2 n4cOuNG2+WEk1mvav+NkccF466Q6vqIKUNUxs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=sWgQF2wJUEsyW+CUeCYaTleJ3LvSVRzQqE+MmPYAtb4=; b=gt/vVezMS4rxBvXh5jNnfIvuR2oMKSK521eAcEVICyM37hDPQxmR2fz+XPK/IuUU+T kh5ug+LZLJ35Kwnsuox9WWy0lx/O6KEegmzE4r0Fe9BhljpQ+kwJ8LKHeSWJiWfX+hfN byOpV8bDUft9UWG2mZM6UbHFiziCuvRcdSjnU26TEkdgATikSw4uJnAWRbV+C9+YQRF4 Svrg58x98+VTsbyw8Feyuq+kkE+2EeeyRMmZvqhLJUmGz6SFQ2Cs+l9eeg3pNMm0TVVz s5P6jInfGs1e/7H6+MUKAsjPVfjcudVqoXfcyzTvF5U39FHg8sBsAr7NV0pIsP+XlW09 q0aQ== X-Gm-Message-State: ABuFfohMo1a7VzPOEap/wq3rEfXLucarKHtgnXUoBMXCypTHQ4xvbAEA fuYwez9sRJUzvERbI6I+kPUgqNCvYL79z/LTw/hJrw== X-Received: by 2002:a19:124b:: with SMTP id h72-v6mr3290894lfi.72.1537950817022; Wed, 26 Sep 2018 01:33:37 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:95d7:0:0:0:0:0 with HTTP; Wed, 26 Sep 2018 01:33:36 -0700 (PDT) In-Reply-To: References: <358665e3f4f9ec105dc2f8a2dc6dd98dbe761fae.1537930252.git.baolin.wang@linaro.org> <707ebff8a188d41de374314414c8bfd927183d33.1537930252.git.baolin.wang@linaro.org> From: Baolin Wang Date: Wed, 26 Sep 2018 16:33:36 +0800 Message-ID: Subject: Re: [PATCH v2 4/4] power: supply: Add Spreadtrum SC27XX fuel gauge unit driver To: Linus Walleij Cc: Sebastian Reichel , Rob Herring , Mark Rutland , Linux PM list , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , "linux-kernel@vger.kernel.org" , yuanjiang.yu@unisoc.com, Mark Brown , Craig Tatlor Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Linus, On 26 September 2018 at 16:09, Linus Walleij wrote: > On Wed, Sep 26, 2018 at 5:00 AM Baolin Wang wrote: > >> This patch adds the Spreadtrum SC27XX serial PMICs fuel gauge support, >> which is used to calculate the battery capacity. >> >> Original-by: Yuanjiang Yu >> Signed-off-by: Baolin Wang >> --- >> Changes from v1: >> - Use battery standard properties to get internal resistance and ocv table. >> - Change devm_gpiod_get_optional() to devm_gpiod_get(). >> - Add power_supply_changed() when detecting battery present change. >> - Return micro volts for sc27xx_fgu_get_vbat_ocv(). > > Acked-by: Linus Walleij > > I see that you need to have the internal resistance as parameter to > this equation so it needs to come in. (I guess as factor/typical > internal resistance as suggested.) > > IIUC this reliance on an uncertain internal resistance is the reason > why fuel gauges / coloumb counters are seen as crude ways to > estimate battery capacity, and their accuracy and reliability worsen > over the lifetime of the battery, and this is why safety-critical devices > include ways to measure the internal resistance as well. Yes. Thanks for your reviewing. > > But the hardware is as it is, and probably for some good reasons, > like cost. > > Yours, > Linus Walleij -- Baolin Wang Best Regards