Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1639448 > unrolled thread

[PATCH 3/4] power: supply: power_supply_core: add constant-charge-current optional property

Started byQuentin Schulz <quentin.schulz@free-electrons.com>
First post2017-05-11 15:50 +0200
Last post2017-05-11 15:50 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 3/4] power: supply: power_supply_core: add constant-charge-current optional property Quentin Schulz <quentin.schulz@free-electrons.com> - 2017-05-11 15:50 +0200

#1639448 — [PATCH 3/4] power: supply: power_supply_core: add constant-charge-current optional property

FromQuentin Schulz <quentin.schulz@free-electrons.com>
Date2017-05-11 15:50 +0200
Subject[PATCH 3/4] power: supply: power_supply_core: add constant-charge-current optional property
Message-ID<tFWDD-6V6-3@gated-at.bofh.it>
This adds the constant-charge-current property to the list of optional
properties for the battery.

The constant charge current is critical for batteries as they can't
handle all charge currents.

Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com>
---
 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 5019bdee0f0b..23887739c95c 100644
--- a/drivers/power/supply/power_supply_core.c
+++ b/drivers/power/supply/power_supply_core.c
@@ -508,6 +508,7 @@ int power_supply_get_battery_info(struct power_supply *psy,
 	info->energy_full_design_uwh = -EINVAL;
 	info->charge_full_design_uah = -EINVAL;
 	info->voltage_min_design_uv  = -EINVAL;
+	info->constant_charge_current_max_ua  = -EINVAL;
 
 	if (!psy->of_node) {
 		dev_warn(&psy->dev, "%s currently only supports devicetree\n",
@@ -537,6 +538,8 @@ int power_supply_get_battery_info(struct power_supply *psy,
 			     &info->charge_full_design_uah);
 	of_property_read_u32(battery_np, "voltage-min-design-microvolt",
 			     &info->voltage_min_design_uv);
+	of_property_read_u32(battery_np, "constant-charge-current-max-microamp",
+			     &info->constant_charge_current_max_ua);
 
 	return 0;
 }
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index e84f1d31d987..6f9c28187caf 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -301,6 +301,7 @@ struct power_supply_battery_info {
 	int energy_full_design_uwh;	/* microWatt-hours */
 	int charge_full_design_uah;	/* microAmp-hours */
 	int voltage_min_design_uv;	/* microVolts */
+	int constant_charge_current_max_ua;		/* microAmps */
 };
 
 extern struct atomic_notifier_head power_supply_notifier;
-- 
2.11.0

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web