Thread (1 message) 1 message, 1 author, 2017-01-29

Re: [PATCH v4 3/8] power: power_supply: add battery information struct

From: Sebastian Reichel <hidden>
Date: 2017-01-29 18:23:51
Also in: linux-devicetree

Hi,

On Sat, Jan 21, 2017 at 11:13:59PM -0800, Matt Ranostay wrote:
quoted hunk
Add power_supply_battery_info structure that is used to
enumerate battery state machine settings.

Signed-off-by: Matt Ranostay <redacted>
---
 include/linux/power_supply.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 3965503315ef..59674a257d5e 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -288,6 +288,18 @@ struct power_supply_info {
 	int use_for_apm;
 };
 
+/*
+ * This is the recommended struct to specify static battery parameters.
+ * Power supply class itself doesn't use this, but it implements access
+ * that most platform drivers should use for consistency.
+ */
+
+struct power_supply_battery_info {
+	int energy;		/* uWh */
+	int power;		/* uAh */
+	int nominal_voltage;	/* uV */
+};
+
 extern struct atomic_notifier_head power_supply_notifier;
 extern int power_supply_reg_notifier(struct notifier_block *nb);
 extern void power_supply_unreg_notifier(struct notifier_block *nb);
You can merge this into the next patch, which adds the API
for using this struct.

-- Sebastian

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help