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-next>] [day] [month] [year] [list]
Date:	Mon, 29 Aug 2011 10:03:58 -0700
From:	Philip Rakity <prakity@...vell.com>
To:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC:	"adharmap@...eaurora.org" <adharmap@...eaurora.org>,
	"cbou@...l.ru" <cbou@...l.ru>,
	David Woodhouse <dwmw2@...radead.org>,
	Anton Vorontsov <cbouatmailru@...il.com>,
	Mark Brown <broonie@...nsource.wolfsonmicro.com>
Subject: [PATCH 1/3]  power: add two properties: charge_to_use and
  voltage_to_use


Add two new properties
a) POWER_SUPPLY_PROP_VOLTAGE_TO_USE
b) POWER_SUPPLY_PROP_CHARGE_TO_USE

These 2 properties can be returned by the battery to
tell the charger what voltage and charge to use.

Signed-off-by: Philip Rakity <prakity@...vell.com>
---
 drivers/power/power_supply_sysfs.c |    2 ++
 include/linux/power_supply.h       |    4 ++++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/power/power_supply_sysfs.c b/drivers/power/power_supply_sysfs.c
index c9e9479..bffc67b 100644
--- a/drivers/power/power_supply_sysfs.c
+++ b/drivers/power/power_supply_sysfs.c
@@ -167,6 +167,8 @@ static struct device_attribute power_supply_attrs[] = {
 	POWER_SUPPLY_ATTR(time_to_full_now),
 	POWER_SUPPLY_ATTR(time_to_full_avg),
 	POWER_SUPPLY_ATTR(type),
+	POWER_SUPPLY_ATTR(charge_to_use),
+	POWER_SUPPLY_ATTR(voltage_to_use),
 	/* Properties of type `const char *' */
 	POWER_SUPPLY_ATTR(model_name),
 	POWER_SUPPLY_ATTR(manufacturer),
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 204c18d..a41b510 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -116,6 +116,8 @@ enum power_supply_property {
 	POWER_SUPPLY_PROP_TIME_TO_FULL_NOW,
 	POWER_SUPPLY_PROP_TIME_TO_FULL_AVG,
 	POWER_SUPPLY_PROP_TYPE, /* use power_supply.type instead */
+	POWER_SUPPLY_PROP_CHARGE_TO_USE,
+	POWER_SUPPLY_PROP_VOLTAGE_TO_USE,
 	/* Properties of type `const char *' */
 	POWER_SUPPLY_PROP_MODEL_NAME,
 	POWER_SUPPLY_PROP_MANUFACTURER,
@@ -228,6 +230,7 @@ static inline bool power_supply_is_amp_property(enum power_supply_property psp)
 	case POWER_SUPPLY_PROP_CURRENT_MAX:
 	case POWER_SUPPLY_PROP_CURRENT_NOW:
 	case POWER_SUPPLY_PROP_CURRENT_AVG:
+	case POWER_SUPPLY_PROP_CHARGE_TO_USE:
 		return 1;
 	default:
 		break;
@@ -252,6 +255,7 @@ static inline bool power_supply_is_watt_property(enum power_supply_property psp)
 	case POWER_SUPPLY_PROP_VOLTAGE_NOW:
 	case POWER_SUPPLY_PROP_VOLTAGE_AVG:
 	case POWER_SUPPLY_PROP_POWER_NOW:
+	case POWER_SUPPLY_PROP_VOLTAGE_TO_USE:
 		return 1;
 	default:
 		break;
-- 
1.7.6


--
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