cpcap_charger_current_to_regval
if (cpcap_charger_current_to_regval(val->intval) < 0)
ichrg = cpcap_charger_current_to_regval(max_current);