Merge branch 'develop-3.10' of ssh://10.10.10.29/rk/kernel into develop-3.10
[firefly-linux-kernel-4.4.55.git] / drivers / power / power_supply_sysfs.c
index 5a5fef4447e35638a9866b3890ae0d0d3df0273c..1f7d79b03725fcb6aad3c8ccfef0549fc7d6e85c 100644 (file)
@@ -105,7 +105,10 @@ static ssize_t power_supply_show_property(struct device *dev,
        else if (off >= POWER_SUPPLY_PROP_MODEL_NAME)
                return sprintf(buf, "%s\n", value.strval);
 
-       return sprintf(buf, "%d\n", value.intval);
+       if (off == POWER_SUPPLY_PROP_CHARGE_COUNTER_EXT)
+               return sprintf(buf, "%lld\n", value.int64val);
+       else
+               return sprintf(buf, "%d\n", value.intval);
 }
 
 static ssize_t power_supply_store_property(struct device *dev,
@@ -193,6 +196,8 @@ static struct device_attribute power_supply_attrs[] = {
        POWER_SUPPLY_ATTR(usb_hc),
        POWER_SUPPLY_ATTR(usb_otg),
        POWER_SUPPLY_ATTR(charge_enabled),
+       /* Local extensions of type int64_t */
+       POWER_SUPPLY_ATTR(charge_counter_ext),
        /* Properties of type `const char *' */
        POWER_SUPPLY_ATTR(model_name),
        POWER_SUPPLY_ATTR(manufacturer),