Lines Matching refs:val
145 static int adp5061_get_array_index(const int *array, u8 size, int val)
150 if (val < array[i])
176 union power_supply_propval *val)
186 val->intval = adp5061_in_current_lim[mode] * 1000;
191 static int adp5061_set_input_current_limit(struct adp5061_state *st, int val)
196 val /= 1000;
199 val);
208 static int adp5061_set_min_voltage(struct adp5061_state *st, int val)
213 val /= 1000;
216 val);
226 union power_supply_propval *val)
236 val->intval = adp5061_vmin[regval] * 1000;
242 union power_supply_propval *val)
252 val->intval = adp5061_const_chg_vmax[mode] * 1000;
258 union power_supply_propval *val)
271 val->intval = adp5061_vmax[regval] * 1000;
276 static int adp5061_set_max_voltage(struct adp5061_state *st, int val)
281 val /= 1000;
282 if (val > 4500)
283 val = 4500;
286 ARRAY_SIZE(adp5061_vmax), val);
297 static int adp5061_set_const_chg_vmax(struct adp5061_state *st, int val)
302 val /= 1000;
305 val);
314 static int adp5061_set_const_chg_current(struct adp5061_state *st, int val)
320 val /= 1000;
321 if (val > ADP5061_ICHG_MAX)
322 val = ADP5061_ICHG_MAX;
326 val);
336 union power_supply_propval *val)
349 val->intval = adp5061_const_ichg[regval] * 1000;
355 union power_supply_propval *val)
365 val->intval = adp5061_prechg_current[regval] * 1000;
370 static int adp5061_set_prechg_current(struct adp5061_state *st, int val)
375 val /= 1000;
378 val);
388 union power_supply_propval *val)
398 val->intval = adp5061_vweak_th[regval] * 1000;
403 static int adp5061_set_vweak_th(struct adp5061_state *st, int val)
408 val /= 1000;
411 val);
421 union power_supply_propval *val)
432 val->intval = POWER_SUPPLY_STATUS_UNKNOWN;
434 val->intval = adp5061_chg_type[chg_type];
440 union power_supply_propval *val)
451 val->intval = POWER_SUPPLY_STATUS_NOT_CHARGING;
456 val->intval = POWER_SUPPLY_STATUS_CHARGING;
459 val->intval = POWER_SUPPLY_STATUS_FULL;
463 val->intval = POWER_SUPPLY_STATUS_DISCHARGING;
466 val->intval = POWER_SUPPLY_STATUS_UNKNOWN;
473 union power_supply_propval *val)
485 val->intval = POWER_SUPPLY_CAPACITY_LEVEL_UNKNOWN;
488 val->intval = POWER_SUPPLY_CAPACITY_LEVEL_CRITICAL;
491 val->intval = POWER_SUPPLY_CAPACITY_LEVEL_LOW;
494 val->intval = POWER_SUPPLY_CAPACITY_LEVEL_NORMAL;
502 union power_supply_propval *val)
512 val->intval = adp5061_iend[regval];
517 static int adp5061_set_termination_current(struct adp5061_state *st, int val)
523 val);
534 union power_supply_propval *val)
548 val->intval = 0;
550 val->intval = 1;
553 return adp5061_get_chg_type(st, val);
558 return adp5061_get_input_current_limit(st, val);
563 return adp5061_get_max_voltage(st, val);
569 return adp5061_get_min_voltage(st, val);
574 return adp5061_get_chg_volt_lim(st, val);
580 return adp5061_get_const_chg_current(st, val);
586 return adp5061_get_prechg_current(st, val);
593 return adp5061_get_vweak_th(st, val);
599 return adp5061_get_charger_status(st, val);
605 return adp5061_get_battery_status(st, val);
608 return adp5061_get_termination_current(st, val);
618 const union power_supply_propval *val)
624 return adp5061_set_input_current_limit(st, val->intval);
626 return adp5061_set_max_voltage(st, val->intval);
628 return adp5061_set_min_voltage(st, val->intval);
630 return adp5061_set_const_chg_vmax(st, val->intval);
632 return adp5061_set_const_chg_current(st, val->intval);
634 return adp5061_set_prechg_current(st, val->intval);
636 return adp5061_set_vweak_th(st, val->intval);
638 return adp5061_set_termination_current(st, val->intval);