.. | .. |
---|
143 | 143 | |
---|
144 | 144 | struct axp_config_info *axp_config = &bat_power->dts_info; |
---|
145 | 145 | |
---|
| 146 | + regmap_bulk_read(bat_power->regmap, AXP803_OCVBATH_RES, temp_val, 2); |
---|
| 147 | + ocv_vol = ((temp_val[0] << 4) | (temp_val[1] & 0xF)) * 1100 / 1000; |
---|
| 148 | + |
---|
146 | 149 | ret = regmap_read(bat_power->regmap, AXP803_CAP, ®_value); |
---|
147 | 150 | if (ret) |
---|
148 | 151 | return ret; |
---|
.. | .. |
---|
160 | 163 | rest_vol = 100; |
---|
161 | 164 | } |
---|
162 | 165 | |
---|
| 166 | + if (ocv_vol < axp_config->pmu_vol_min) { |
---|
| 167 | + pr_err("kickpi: ocv_vol %d < min %d, rest_vol %d -> 0\n", ocv_vol, axp_config->pmu_vol_min, rest_vol); |
---|
| 168 | + rest_vol = 0; |
---|
| 169 | + } |
---|
| 170 | + |
---|
163 | 171 | return rest_vol; |
---|
164 | 172 | } |
---|
165 | 173 | |
---|
.. | .. |
---|
234 | 242 | pr_debug("calc_info: ocv_vol:%d rdc:%d coulumb_counter:%d batt_max_cap:%d\n", |
---|
235 | 243 | ocv_vol, rdc, coulumb_counter, batt_max_cap); |
---|
236 | 244 | } |
---|
| 245 | + |
---|
| 246 | + if (ocv_vol < axp_config->pmu_vol_min) { |
---|
| 247 | + pr_err("kickpi: ocv_vol %d < min %d, rest_vol %d -> 0\n", ocv_vol, axp_config->pmu_vol_min, rest_vol); |
---|
| 248 | + rest_vol = 0; |
---|
| 249 | + } |
---|
237 | 250 | |
---|
238 | 251 | return rest_vol; |
---|
239 | 252 | } |
---|
.. | .. |
---|
917 | 930 | AXP_OF_PROP_READ(pmu_runtime_chgcur, INTCHGCUR / 1000); |
---|
918 | 931 | AXP_OF_PROP_READ(pmu_suspend_chgcur, 1200); |
---|
919 | 932 | AXP_OF_PROP_READ(pmu_shutdown_chgcur, 1200); |
---|
| 933 | + AXP_OF_PROP_READ(pmu_vol_min, 3400); |
---|
920 | 934 | AXP_OF_PROP_READ(pmu_init_chgvol, INTCHGVOL / 1000); |
---|
921 | 935 | AXP_OF_PROP_READ(pmu_init_chgend_rate, INTCHGENDRATE); |
---|
922 | 936 | AXP_OF_PROP_READ(pmu_init_chg_enabled, 1); |
---|