power: max17048: correct voltage unit to uV
Hyongbin Kim [Mon, 26 Aug 2013 10:50:37 +0000 (19:50 +0900)]
In framework, voltage unit is uV.

Bug 1355391

Change-Id: I8a8af62850365b298857289c5a6f0d89bf45d47b
Signed-off-by: Hyongbin Kim <hyongbink@nvidia.com>
Reviewed-on: http://git-master/r/266048
(cherry picked from commit b5e18de3eebebf8a66bcdaa44b842ac9b1935b45)
Reviewed-on: http://git-master/r/271359
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>

drivers/power/max17048_battery.c

index c34eb8a..b2a9c6c 100644 (file)
@@ -190,7 +190,8 @@ static int max17048_get_property(struct power_supply *psy,
                val->intval = chip->status;
                break;
        case POWER_SUPPLY_PROP_VOLTAGE_NOW:
-               val->intval = chip->vcell;
+               /* unit is uV */
+               val->intval = chip->vcell * 1000;
                break;
        case POWER_SUPPLY_PROP_CAPACITY:
                val->intval = chip->soc;
@@ -202,7 +203,8 @@ static int max17048_get_property(struct power_supply *psy,
                val->intval = chip->capacity_level;
                break;
        case POWER_SUPPLY_PROP_VOLTAGE_OCV:
-               val->intval = max17048_get_ocv(chip);
+               /* unit is uV */
+               val->intval = max17048_get_ocv(chip) * 1000;
                break;
        default:
        return -EINVAL;