diff options
| author | Linux Build Service Account <lnxbuild@quicinc.com> | 2017-09-26 21:49:52 -0700 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-09-26 21:49:51 -0700 |
| commit | 8abd424c591fff78e375524a371dda4abd41b0da (patch) | |
| tree | 3730f803c276590d7416614669518ba6da778211 | |
| parent | 07c0eb6c3bdf9209e68dab72517166028c3f947f (diff) | |
| parent | ce4ab07431cd9d951b27c2d6ec976be33ba153bf (diff) | |
Merge "battery: reduce SMB only for taper stepper"
| -rw-r--r-- | drivers/power/supply/qcom/battery.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/power/supply/qcom/battery.c b/drivers/power/supply/qcom/battery.c index eb89e9e92266..cb26658e564e 100644 --- a/drivers/power/supply/qcom/battery.c +++ b/drivers/power/supply/qcom/battery.c @@ -349,7 +349,7 @@ done: * FCC * **********/ #define EFFICIENCY_PCT 80 -static void split_fcc(struct pl_data *chip, int total_ua, +static void get_fcc_split(struct pl_data *chip, int total_ua, int *master_ua, int *slave_ua) { int rc, effective_total_ua, slave_limited_ua, hw_cc_delta_ua = 0, @@ -388,7 +388,6 @@ static void split_fcc(struct pl_data *chip, int total_ua, effective_total_ua = max(0, total_ua + hw_cc_delta_ua); slave_limited_ua = min(effective_total_ua, bcl_ua); *slave_ua = (slave_limited_ua * chip->slave_pct) / 100; - *slave_ua = (*slave_ua * chip->taper_pct) / 100; /* * In USBIN_USBIN configuration with internal rsense parallel * charger's current goes through main charger's BATFET, keep @@ -398,6 +397,8 @@ static void split_fcc(struct pl_data *chip, int total_ua, *master_ua = max(0, total_ua); else *master_ua = max(0, total_ua - *slave_ua); + + *slave_ua = (*slave_ua * chip->taper_pct) / 100; } static int pl_fcc_vote_callback(struct votable *votable, void *data, @@ -425,7 +426,8 @@ static int pl_fcc_vote_callback(struct votable *votable, void *data, } if (chip->pl_mode != POWER_SUPPLY_PL_NONE) { - split_fcc(chip, total_fcc_ua, &master_fcc_ua, &slave_fcc_ua); + get_fcc_split(chip, total_fcc_ua, + &master_fcc_ua, &slave_fcc_ua); pval.intval = slave_fcc_ua; rc = power_supply_set_property(chip->pl_psy, |
