From: Baolin Wang <baolin.wang@linaro.org>
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 v6 2/6] power: supply: core: Add one field to present the battery internal resistance
Date: Mon, 22 Oct 2018 15:43:58 +0800 [thread overview]
Message-ID: <b70d55f008cfbbb79abf27018261d8a6f16e9673.1540189330.git.baolin.wang@linaro.org> (raw)
In-Reply-To: <e7c061535f2dcca54d6498405fdd5ed7098b19f9.1540189330.git.baolin.wang@linaro.org>
In-Reply-To: <e7c061535f2dcca54d6498405fdd5ed7098b19f9.1540189330.git.baolin.wang@linaro.org>
Add one field for 'struct power_supply_battery_info' to present the battery
factory internal resistance.
Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
---
Changes from v5:
- None.
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
next prev parent reply other threads:[~2018-10-22 7:44 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-22 7:43 [PATCH v6 1/6] dt-bindings: power: Introduce one property to present the battery internal resistance Baolin Wang
2018-10-22 7:43 ` Baolin Wang [this message]
2018-10-22 7:43 ` [PATCH v6 3/6] dt-bindings: power: Introduce properties to present the battery OCV capacity table Baolin Wang
2018-10-22 22:10 ` Rob Herring
2018-10-22 7:44 ` [PATCH v6 4/6] power: supply: core: Add some helpers to use " Baolin Wang
2018-11-01 7:22 ` Baolin Wang
2018-11-01 13:50 ` Quentin Schulz
2018-11-01 17:30 ` Baolin Wang
2018-10-22 7:44 ` [PATCH v6 5/6] dt-bindings: power: Add Spreadtrum SC27XX fuel gauge unit documentation Baolin Wang
2018-10-22 7:44 ` [PATCH v6 6/6] power: supply: Add Spreadtrum SC27XX fuel gauge unit driver Baolin Wang
2018-10-31 8:56 ` Linus Walleij
2018-11-01 6:42 ` Baolin Wang
2018-10-25 2:01 ` [PATCH v6 1/6] dt-bindings: power: Introduce one property to present the battery internal resistance Baolin Wang
2018-10-25 20:13 ` Sebastian Reichel
2018-10-26 1:57 ` Baolin Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b70d55f008cfbbb79abf27018261d8a6f16e9673.1540189330.git.baolin.wang@linaro.org \
--to=baolin.wang@linaro.org \
--cc=broonie@kernel.org \
--cc=ctatlor97@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=robh+dt@kernel.org \
--cc=sre@kernel.org \
--cc=yuanjiang.yu@unisoc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).