Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3022010imm; Fri, 19 Oct 2018 03:54:37 -0700 (PDT) X-Google-Smtp-Source: ACcGV615enhHxqb7p9D0hjR8PX1lidUCYsUynmjQm6uvPlvtEMQQZ8LViT2iItT5wXA1p07/iZVc X-Received: by 2002:a17:902:c01:: with SMTP id 1-v6mr21047402pls.233.1539946477366; Fri, 19 Oct 2018 03:54:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539946477; cv=none; d=google.com; s=arc-20160816; b=NVWq1KV7jPK6b2vro5LIHBb5TJLNv3L/dwtFDUnM43h4a2LEjlss4n+WkIUb/j8A0w cMLM1Gd5bHvBAHS+5v3oj+pKwHuuNaV5RiyQtjnbQlLdjmqwUPSuZZnRtg7TEclSr+LD SCwpsQh06tNYPxyZ77npauESMhVGNKBu40Ogpp9C3rG1Wts9YenbEbF9ZFOjaenJtgoH RBnItgsv9C9WH7ML1l9HP4byiCQg73ycxfZuaPTmt/zjSjAcYBSN3yrDqp2ab20jsHlb 5qRZIuLyv7onY/wfpET9sfdjMoxMKSHWBhXKDAw+/+595j36jXLNuul1edJbjYu4jpDl DhNA== 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 v128-v6si25419556pfc.193.2018.10.19.03.54.06; Fri, 19 Oct 2018 03:54:37 -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 S1727149AbeJSS7K (ORCPT + 99 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(+) 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; -- 1.7.9.5