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;
497 val->intval = POWER_SUPPLY_CAPACITY_LEVEL_UNKNOWN;
505 union power_supply_propval *val)
515 val->intval = adp5061_iend[regval];
520 static int adp5061_set_termination_current(struct adp5061_state *st, int val)
526 val);
537 union power_supply_propval *val)
551 val->intval = 0;
553 val->intval = 1;
556 return adp5061_get_chg_type(st, val);
561 return adp5061_get_input_current_limit(st, val);
566 return adp5061_get_max_voltage(st, val);
572 return adp5061_get_min_voltage(st, val);
577 return adp5061_get_chg_volt_lim(st, val);
583 return adp5061_get_const_chg_current(st, val);
589 return adp5061_get_prechg_current(st, val);
596 return adp5061_get_vweak_th(st, val);
602 return adp5061_get_charger_status(st, val);
608 return adp5061_get_battery_status(st, val);
611 return adp5061_get_termination_current(st, val);
621 const union power_supply_propval *val)
627 return adp5061_set_input_current_limit(st, val->intval);
629 return adp5061_set_max_voltage(st, val->intval);
631 return adp5061_set_min_voltage(st, val->intval);
633 return adp5061_set_const_chg_vmax(st, val->intval);
635 return adp5061_set_const_chg_current(st, val->intval);
637 return adp5061_set_prechg_current(st, val->intval);
639 return adp5061_set_vweak_th(st, val->intval);
641 return adp5061_set_termination_current(st, val->intval);