power_supply: Add new power supply AUTHENTIC property
authorRamakrishna Pallala <ramakrishna.pallala@intel.com>
Thu, 23 Aug 2012 01:20:21 +0000 (06:50 +0530)
committerAnton Vorontsov <anton.vorontsov@linaro.org>
Thu, 23 Aug 2012 02:56:37 +0000 (19:56 -0700)
It is possible that users can use non-standard chargers or use invalid
batteries especially with mobile devices.

This patch adds a new power supply property called 'AUTHENTIC' to
indicate this to the user(user space).

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Documentation/power/power_supply_class.txt
drivers/power/power_supply_sysfs.c
include/linux/power_supply.h

index 2f0ddc15b5ac3621a4caaa7933cfbc656b47016b..48badec1cec34a7437abf7ac6b1315799cca805d 100644 (file)
@@ -81,6 +81,9 @@ This defines trickle and fast charges.  For batteries that
 are already charged or discharging, 'n/a' can be displayed (or
 'unknown', if the status is not known).
 
+AUTHENTIC - indicates the power supply (battery or charger) connected
+to the platform is authentic(1) or non authentic(0).
+
 HEALTH - represents health of the battery, values corresponds to
 POWER_SUPPLY_HEALTH_*, defined in battery.h.
 
index 1d96614a17a42d7e8c48d4bb0421301c6ea997ea..be34a6d4664d27d98b10980096cb49af89901497 100644 (file)
@@ -138,6 +138,7 @@ static struct device_attribute power_supply_attrs[] = {
        POWER_SUPPLY_ATTR(health),
        POWER_SUPPLY_ATTR(present),
        POWER_SUPPLY_ATTR(online),
+       POWER_SUPPLY_ATTR(authentic),
        POWER_SUPPLY_ATTR(technology),
        POWER_SUPPLY_ATTR(cycle_count),
        POWER_SUPPLY_ATTR(voltage_max),
index 0bafbb15f29cf55fb76672972bdc4b947bb2fa2c..204d43dc6ddc48646bd77583effd58497119c0f9 100644 (file)
@@ -88,6 +88,7 @@ enum power_supply_property {
        POWER_SUPPLY_PROP_HEALTH,
        POWER_SUPPLY_PROP_PRESENT,
        POWER_SUPPLY_PROP_ONLINE,
+       POWER_SUPPLY_PROP_AUTHENTIC,
        POWER_SUPPLY_PROP_TECHNOLOGY,
        POWER_SUPPLY_PROP_CYCLE_COUNT,
        POWER_SUPPLY_PROP_VOLTAGE_MAX,