Skip to content

Commit f8b56ea

Browse files
WuHao270metux
authored andcommitted
power: power_supply_charger: do not enable charging if inlmt < 100mA requested.
Most charger IC doesn't support charging at such low input current limitation so just keep not charging if < 100mA input current requested from power supply level. Change-Id: I2bf4ca81f83ab34da0eda811a87db4a2498f062d Signed-off-by: Hao Wu <hao.wu@intel.com> Tracked-On: https://jira01.devtools.intel.com/browse/OAM-5693 Reviewed-on: https://android.intel.com:443/425425
1 parent 0a22d11 commit f8b56ea

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/power/power_supply_charger.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -787,8 +787,11 @@ static inline void enable_supplied_by_charging
787787
while (cnt--) {
788788
if (!IS_PRESENT(chrgr_lst[cnt]))
789789
continue;
790+
791+
/* Do not enable charging if inlmt < 100mA */
790792
if (is_enable && IS_CHARGING_CAN_BE_ENABLED(chrgr_lst[cnt]) &&
791-
IS_HEALTH_GOOD(chrgr_lst[cnt]))
793+
(INLMT(chrgr_lst[cnt]) >= 100) &&
794+
IS_HEALTH_GOOD(chrgr_lst[cnt]))
792795
enable_charging(chrgr_lst[cnt]);
793796
else
794797
disable_charging(chrgr_lst[cnt]);
@@ -824,7 +827,7 @@ static void __power_supply_trigger_charging_handler(struct power_supply *psy)
824827
disable_charging(psy);
825828
break;
826829
} else if (IS_CHARGING_CAN_BE_ENABLED
827-
(psy)) {
830+
(psy) && (INLMT(psy) >= 100)) {
828831
enable_charging(psy);
829832
}
830833
}

0 commit comments

Comments
 (0)