Lines Matching refs:ccm
244 struct abx500_charge_curr_maximization ccm; member
818 di->ccm.original_iset = in init_maxim_chg_curr()
820 di->ccm.current_iset = in init_maxim_chg_curr()
822 di->ccm.test_delta_i = di->bm->maxi->charger_curr_step; in init_maxim_chg_curr()
823 di->ccm.max_current = di->bm->maxi->chg_curr; in init_maxim_chg_curr()
824 di->ccm.condition_cnt = di->bm->maxi->wait_cycles; in init_maxim_chg_curr()
825 di->ccm.level = 0; in init_maxim_chg_curr()
844 delta_i = di->ccm.original_iset - di->batt_data.inst_curr; in abx500_chargalg_chg_curr_maxim()
848 di->ccm.wait_cnt); in abx500_chargalg_chg_curr_maxim()
849 if (di->ccm.wait_cnt == 0) { in abx500_chargalg_chg_curr_maxim()
851 di->ccm.wait_cnt++; in abx500_chargalg_chg_curr_maxim()
852 di->ccm.condition_cnt = di->bm->maxi->wait_cycles; in abx500_chargalg_chg_curr_maxim()
853 di->ccm.max_current = in abx500_chargalg_chg_curr_maxim()
854 di->ccm.current_iset - di->ccm.test_delta_i; in abx500_chargalg_chg_curr_maxim()
855 di->ccm.current_iset = di->ccm.max_current; in abx500_chargalg_chg_curr_maxim()
856 di->ccm.level--; in abx500_chargalg_chg_curr_maxim()
861 di->ccm.wait_cnt = (di->ccm.wait_cnt + 1) % 3; in abx500_chargalg_chg_curr_maxim()
866 di->ccm.wait_cnt = 0; in abx500_chargalg_chg_curr_maxim()
868 if ((di->batt_data.inst_curr > di->ccm.original_iset)) { in abx500_chargalg_chg_curr_maxim()
871 di->batt_data.inst_curr, di->ccm.original_iset, in abx500_chargalg_chg_curr_maxim()
872 di->ccm.current_iset); in abx500_chargalg_chg_curr_maxim()
874 if (di->ccm.current_iset == di->ccm.original_iset) in abx500_chargalg_chg_curr_maxim()
877 di->ccm.condition_cnt = di->bm->maxi->wait_cycles; in abx500_chargalg_chg_curr_maxim()
878 di->ccm.current_iset = di->ccm.original_iset; in abx500_chargalg_chg_curr_maxim()
879 di->ccm.level = 0; in abx500_chargalg_chg_curr_maxim()
884 if (delta_i > di->ccm.test_delta_i && in abx500_chargalg_chg_curr_maxim()
885 (di->ccm.current_iset + di->ccm.test_delta_i) < in abx500_chargalg_chg_curr_maxim()
886 di->ccm.max_current) { in abx500_chargalg_chg_curr_maxim()
887 if (di->ccm.condition_cnt-- == 0) { in abx500_chargalg_chg_curr_maxim()
889 di->ccm.condition_cnt = di->bm->maxi->wait_cycles; in abx500_chargalg_chg_curr_maxim()
890 di->ccm.current_iset += di->ccm.test_delta_i; in abx500_chargalg_chg_curr_maxim()
891 di->ccm.level++; in abx500_chargalg_chg_curr_maxim()
895 di->ccm.test_delta_i, in abx500_chargalg_chg_curr_maxim()
896 di->ccm.current_iset, in abx500_chargalg_chg_curr_maxim()
897 di->ccm.original_iset, in abx500_chargalg_chg_curr_maxim()
898 di->ccm.level); in abx500_chargalg_chg_curr_maxim()
904 di->ccm.condition_cnt = di->bm->maxi->wait_cycles; in abx500_chargalg_chg_curr_maxim()
918 di->ccm.current_iset); in handle_maxim_chg_curr()