From patchwork Fri Oct 19 10:53:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 149252 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp3143342lji; Fri, 19 Oct 2018 03:53:48 -0700 (PDT) X-Google-Smtp-Source: ACcGV62dbTtL7WqY2fwHTzAzqj1lbMmZaXhJxCmlLCaqHigbwHn701jB2qrfAzyoNS3pp4SUkdsl X-Received: by 2002:a17:902:848f:: with SMTP id c15-v6mr32677292plo.119.1539946428852; Fri, 19 Oct 2018 03:53:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539946428; cv=none; d=google.com; s=arc-20160816; b=KcKqp/3rI06RFsOnInKaUDHk6nanLZgSU1vYydMjm4pgF8xeXGpShG6/JlRBfFvsmQ a1Q6e5WVl1Fxo6X+wGVmOf6OgvEeM9xgRtkZJsoh/6hwn24cx+7UT6OGAioRBW3O2q6+ 49Mkog51BZ1xJrPR3UvO4GK8L75L5iwFRpfgLhtVudFtWZykBcpxYDQKE1cGZiABPiA4 aAz4v1FiXRfHwD2FEBxbIHMszkeJLWKSNYNPV9vHEFzTgRrcWb8jWEG/RI2K4bGzdObe xAqNK0AjyMXORbY0zxkmlQxiJc2MEQPqeELYrkgaI0HP5e9u09zB87XbBFmKXLEY60pK 8LiA== 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=iqKD9byHso6OMx8L+zAYM7NHKckUL6NGilBoDBaqk1Y=; b=kfegeuSGofs84V9h871bqVty7CiXf8ooccIjiqk4C1MEmz0j3Dx2N03c6g2weCJZix W5bnFVfniF1mmz5nsv6tzYvROokpRthyz/I10s8Y/B79lbXnr0xyiaxVlQPyQgNcwhJb 17WDvmYMPJ0dK3BCm4gZNGYAfAw8EnSnCT83/9xJ/kJlWTFJBAPciCtaRUuhWyDryDyD n04IfzWj2x7VeLzrXu9mdo/JTJp+WWJLBB0xCrsjnw5oCKpsEI61GJk81IoQyFxYWVVP Pbr+lnCtwRxx655bPPbhlBhEukeF3PzAKSHJXb1hTI1NPLE8slTnIwUpXHGpHJW4K8+d kpqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UnHMeEeq; 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 q13-v6si23310790pgq.526.2018.10.19.03.53.48; Fri, 19 Oct 2018 03:53:48 -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=UnHMeEeq; 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 S1727175AbeJSS7K (ORCPT + 32 others); Fri, 19 Oct 2018 14:59:10 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:40731 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726647AbeJSS7J (ORCPT ); Fri, 19 Oct 2018 14:59:09 -0400 Received: by mail-pg1-f196.google.com with SMTP id n31-v6so15621956pgm.7 for ; Fri, 19 Oct 2018 03:53:37 -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=iqKD9byHso6OMx8L+zAYM7NHKckUL6NGilBoDBaqk1Y=; b=UnHMeEeq5DgBn1FBAnCUVHjVAQ3cCPpbV2op4fk/HIXIw0+1RzpNUfolS7d8PK5jN5 IGH6HUMRsn34E4vn/bAfWLblkzE0bZ+9QJ4G36bIUpM6YFxNV65fAunw3AEIOCi7etb6 1PEnP3GkQTvWwkc/inwzmM2p9P3M6LRCW7DtU= 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=iqKD9byHso6OMx8L+zAYM7NHKckUL6NGilBoDBaqk1Y=; b=LHphmTcIBBlpFHhQP3/Z8oEgneZ4lpuGYpkqTxvKXizcOvTGRaZRi0mhNJNUwuCW/L MF0KA/vVRyWAhDYe3+6M52OWCz/s8ZVk65Jjo0uFxELwOjCSsA8510y2n+EkUPn+FbFu qc2wslQ6ix4JNmFxcykSduA0UWLzmZBb04pD09pa7voULn9ITCk9mG5gsblIMWOndjr4 BbJ9dNoF/P8HbSJDr4rzBqb2yTJ4z8XfM9F3ZTlzGPYwh/hB8/d/sUqWiYT2u0u97mKL 90dbaBg/ERXqUJQj1ypw2UvEDFO60SzL+F+npj2IOR89eJK7HmBZEeZCQtjMHwbzf3aO du9g== X-Gm-Message-State: ABuFfojC92Kp3Civfnx6FxmXO6lfJag5F4egYzXQBAgkLN6xPr43v62Z V6ZiYj9PccOxDfdlNAdH9iom/g== X-Received: by 2002:a63:1f05:: with SMTP id f5-v6mr1341281pgf.313.1539946416809; Fri, 19 Oct 2018 03:53:36 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id m67-v6sm54918pfm.13.2018.10.19.03.53.32 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 19 Oct 2018 03:53:35 -0700 (PDT) From: Baolin Wang To: sre@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, yuanjiang.yu@unisoc.com, baolin.wang@linaro.org, broonie@kernel.org, ctatlor97@gmail.com, linus.walleij@linaro.org Subject: [PATCH v5 2/6] power: supply: core: Add one field to present the battery internal resistance Date: Fri, 19 Oct 2018 18:53:11 +0800 Message-Id: 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 Add one field for 'struct power_supply_battery_info' to present the battery factory internal resistance. Signed-off-by: Baolin Wang Reviewed-by: Linus Walleij --- Changes from v4: - None. Changes from v3: - New patch in v3, which splits code into one separate patch. - Add Linusw reviewed tag. --- drivers/power/supply/power_supply_core.c | 3 +++ include/linux/power_supply.h | 1 + 2 files changed, 4 insertions(+) -- 1.7.9.5 diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c index e853618..307e0995 100644 --- a/drivers/power/supply/power_supply_core.c +++ b/drivers/power/supply/power_supply_core.c @@ -579,6 +579,7 @@ int power_supply_get_battery_info(struct power_supply *psy, info->charge_term_current_ua = -EINVAL; info->constant_charge_current_max_ua = -EINVAL; info->constant_charge_voltage_max_uv = -EINVAL; + info->factory_internal_resistance_uohm = -EINVAL; if (!psy->of_node) { dev_warn(&psy->dev, "%s currently only supports devicetree\n", @@ -616,6 +617,8 @@ int power_supply_get_battery_info(struct power_supply *psy, &info->constant_charge_current_max_ua); of_property_read_u32(battery_np, "constant_charge_voltage_max_microvolt", &info->constant_charge_voltage_max_uv); + of_property_read_u32(battery_np, "factory-internal-resistance-micro-ohms", + &info->factory_internal_resistance_uohm); return 0; } diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index f807691..d089566 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h @@ -326,6 +326,7 @@ struct power_supply_battery_info { int charge_term_current_ua; /* microAmps */ int constant_charge_current_max_ua; /* microAmps */ int constant_charge_voltage_max_uv; /* microVolts */ + int factory_internal_resistance_uohm; /* microOhms */ }; extern struct atomic_notifier_head power_supply_notifier;