lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri,  6 Mar 2015 16:03:26 +0530
From:	Jenny TC <jenny.tc@...el.com>
To:	linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
	Sebastian Reichel <sre@...nel.org>
Cc:	Anton Vorontsov <anton.vorontsov@...aro.org>,
	David Woodhouse <dwmw2@...radead.org>,
	jonghwa3.lee@...sung.com, myungjoo.ham@...il.com,
	Pallala Ramakrishna <ramakrishna.pallala@...el.com>,
	Jenny TC <jenny.tc@...el.com>
Subject: [RFC 3/4] power_supply: Introduce charger control interface

Introduce power_supply charger control interfaces to control
charging from charging framework like charger-manager. The interfaces
are similar to the existing power supply get/set interfaces, but
introduce a different set of properties in order to differentiate
itself from other power supply properties which exposed in sysfs

Signed-off-by: Jenny TC <jenny.tc@...el.com>
---
 include/linux/power_supply.h |   28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 30145d8e..a80a3ef 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -176,6 +176,32 @@ union power_supply_propval {
 struct device;
 struct device_node;
 
+enum psy_charger_control_property {
+	PSY_CHARGER_PROP_ENABLE_CHARGING = 0,
+	PSY_CHARGER_PROP_ENABLE_CHARGER,
+	PSY_CHARGER_PROP_RESET_WDT,
+};
+
+/**
+ * struct power_supply_charger - power supply charger driver
+ * @get_property: get property function to retrieve charger properties defined
+ *	in enum power_supply_charger_property
+ * @set_property: get property function to retrieve charger properties defined
+ *	in enum power_supply_charger_property
+ *
+ * This structure is used by charger drivers to register with power supply
+ * charging driver
+ */
+
+struct power_supply_charger {
+	int (*get_property)(struct power_supply_charger *psyc,
+			    enum psy_charger_control_property pspc,
+			    union power_supply_propval *val);
+	int (*set_property)(struct power_supply_charger *psyc,
+			    enum psy_charger_control_property pspc,
+			    const union power_supply_propval *val);
+};
+
 struct power_supply {
 	const char *name;
 	enum power_supply_type type;
@@ -200,6 +226,8 @@ struct power_supply {
 	void (*external_power_changed)(struct power_supply *psy);
 	void (*set_charged)(struct power_supply *psy);
 
+	struct power_supply_charger *psy_charger;
+
 	/*
 	 * Set if thermal zone should not be created for this power supply.
 	 * For example for virtual supplies forwarding calls to actual
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ