power: Add CHARGE_NOW function
authorWen Xie <xiewen3@motorola.com>
Sat, 2 Mar 2019 07:18:10 +0000 (15:18 +0800)
committerxiest1 <xiest1@lenovo.com>
Tue, 5 Nov 2019 09:31:25 +0000 (17:31 +0800)
Samsung patch:
fix CHARGE_NOW property function.

From d0b0e57dda8ba436a86a61d95a9d356c4b9b34c2 Mon Sep 17 00:00:00 2001
From: Keunho Hwang <keunho.hwang@samsung.com>
Date: Sat, 2 Mar 2019 12:49:38 +0900
Subject: [PATCH] [Only-For-Test] driver: power: fix CHARGE_NOW property

Signed-off-by: Keunho Hwang <keunho.hwang@samsung.com>
Change-Id: I0d18ca993e3ec4e10dc5135457a1d362eb6dbd99
Signed-off-by: Wen Xie <xiewen3@motorola.com>
Reviewed-on: https://gerrit.mot.com/1316488
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Wei Xu <xuwei9@mt.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key

drivers/power/supply/s2mu00x_battery.c

index 5daccea5970382de0eac2b3feefa6b78ce8b3a51..df5226ca2b9b44b6863ea7bfa6bffb7338eebc4c 100644 (file)
@@ -243,7 +243,6 @@ struct s2mu00x_battery_info {
 
        int topoff_current;
        int cable_type;
-       unsigned int charging_mode;
 
 #if defined(CONFIG_IFCONN_NOTIFIER)
        struct notifier_block ifconn_nb;
@@ -922,9 +921,6 @@ static int s2mu00x_battery_get_property(struct power_supply *psy,
        case POWER_SUPPLY_PROP_CHARGE_TEMP:
                val->intval = battery->charge_temp;
                break;
-       case POWER_SUPPLY_PROP_CHARGE_NOW:
-               val->intval = battery->charging_mode;
-               break;
        case POWER_SUPPLY_PROP_CAPACITY:
                if (!battery->battery_valid)
                        val->intval = FAKE_BAT_LEVEL;
@@ -938,6 +934,7 @@ static int s2mu00x_battery_get_property(struct power_supply *psy,
        case POWER_SUPPLY_PROP_CURRENT_AVG:
                val->intval = battery->current_avg;
                break;
+       case POWER_SUPPLY_PROP_CHARGE_NOW:
        case POWER_SUPPLY_PROP_CHARGE_COUNTER:
                /*Get fuelgauge psy*/
                psy = power_supply_get_by_name(battery->pdata->fuelgauge_name);