Lines Matching refs:constraints

101 	if (rdev->constraints && rdev->constraints->name)  in rdev_get_name()
102 return rdev->constraints->name; in rdev_get_name()
164 if (!rdev->constraints) { in regulator_check_voltage()
168 if (!(rdev->constraints->valid_ops_mask & REGULATOR_CHANGE_VOLTAGE)) { in regulator_check_voltage()
173 if (*max_uV > rdev->constraints->max_uV) in regulator_check_voltage()
174 *max_uV = rdev->constraints->max_uV; in regulator_check_voltage()
175 if (*min_uV < rdev->constraints->min_uV) in regulator_check_voltage()
176 *min_uV = rdev->constraints->min_uV; in regulator_check_voltage()
221 if (!rdev->constraints) { in regulator_check_current_limit()
225 if (!(rdev->constraints->valid_ops_mask & REGULATOR_CHANGE_CURRENT)) { in regulator_check_current_limit()
230 if (*max_uA > rdev->constraints->max_uA) in regulator_check_current_limit()
231 *max_uA = rdev->constraints->max_uA; in regulator_check_current_limit()
232 if (*min_uA < rdev->constraints->min_uA) in regulator_check_current_limit()
233 *min_uA = rdev->constraints->min_uA; in regulator_check_current_limit()
258 if (!rdev->constraints) { in regulator_mode_constrain()
262 if (!(rdev->constraints->valid_ops_mask & REGULATOR_CHANGE_MODE)) { in regulator_mode_constrain()
271 if (rdev->constraints->valid_modes_mask & *mode) in regulator_mode_constrain()
282 if (!rdev->constraints) { in regulator_check_drms()
286 if (!(rdev->constraints->valid_ops_mask & REGULATOR_CHANGE_DRMS)) { in regulator_check_drms()
430 if (!rdev->constraints) in regulator_min_uA_show()
433 return sprintf(buf, "%d\n", rdev->constraints->min_uA); in regulator_min_uA_show()
442 if (!rdev->constraints) in regulator_max_uA_show()
445 return sprintf(buf, "%d\n", rdev->constraints->max_uA); in regulator_max_uA_show()
454 if (!rdev->constraints) in regulator_min_uV_show()
457 return sprintf(buf, "%d\n", rdev->constraints->min_uV); in regulator_min_uV_show()
466 if (!rdev->constraints) in regulator_max_uV_show()
469 return sprintf(buf, "%d\n", rdev->constraints->max_uV); in regulator_max_uV_show()
514 return sprintf(buf, "%d\n", rdev->constraints->state_mem.uV); in regulator_suspend_mem_uV_show()
524 return sprintf(buf, "%d\n", rdev->constraints->state_disk.uV); in regulator_suspend_disk_uV_show()
534 return sprintf(buf, "%d\n", rdev->constraints->state_standby.uV); in regulator_suspend_standby_uV_show()
545 rdev->constraints->state_mem.mode); in regulator_suspend_mem_mode_show()
556 rdev->constraints->state_disk.mode); in regulator_suspend_disk_mode_show()
567 rdev->constraints->state_standby.mode); in regulator_suspend_standby_mode_show()
578 rdev->constraints->state_mem.enabled); in regulator_suspend_mem_state_show()
589 rdev->constraints->state_disk.enabled); in regulator_suspend_disk_state_show()
600 rdev->constraints->state_standby.enabled); in regulator_suspend_standby_state_show()
654 input_uV = rdev->constraints->input_uV; in drms_uA_update()
731 if (!rdev->constraints) in suspend_prepare()
737 &rdev->constraints->state_standby); in suspend_prepare()
740 &rdev->constraints->state_mem); in suspend_prepare()
743 &rdev->constraints->state_disk); in suspend_prepare()
751 struct regulation_constraints *constraints = rdev->constraints; in print_constraints() local
756 if (constraints->min_uV && constraints->max_uV) { in print_constraints()
757 if (constraints->min_uV == constraints->max_uV) in print_constraints()
759 constraints->min_uV / 1000); in print_constraints()
762 constraints->min_uV / 1000, in print_constraints()
763 constraints->max_uV / 1000); in print_constraints()
766 if (!constraints->min_uV || in print_constraints()
767 constraints->min_uV != constraints->max_uV) { in print_constraints()
773 if (constraints->uV_offset) in print_constraints()
775 constraints->uV_offset / 1000); in print_constraints()
777 if (constraints->min_uA && constraints->max_uA) { in print_constraints()
778 if (constraints->min_uA == constraints->max_uA) in print_constraints()
780 constraints->min_uA / 1000); in print_constraints()
783 constraints->min_uA / 1000, in print_constraints()
784 constraints->max_uA / 1000); in print_constraints()
787 if (!constraints->min_uA || in print_constraints()
788 constraints->min_uA != constraints->max_uA) { in print_constraints()
794 if (constraints->valid_modes_mask & REGULATOR_MODE_FAST) in print_constraints()
796 if (constraints->valid_modes_mask & REGULATOR_MODE_NORMAL) in print_constraints()
798 if (constraints->valid_modes_mask & REGULATOR_MODE_IDLE) in print_constraints()
800 if (constraints->valid_modes_mask & REGULATOR_MODE_STANDBY) in print_constraints()
805 if ((constraints->min_uV != constraints->max_uV) && in print_constraints()
806 !(constraints->valid_ops_mask & REGULATOR_CHANGE_VOLTAGE)) in print_constraints()
812 struct regulation_constraints *constraints) in machine_constraints_voltage() argument
818 if (rdev->constraints->apply_uV && in machine_constraints_voltage()
819 rdev->constraints->min_uV == rdev->constraints->max_uV) { in machine_constraints_voltage()
821 rdev->constraints->min_uV, in machine_constraints_voltage()
822 rdev->constraints->max_uV); in machine_constraints_voltage()
825 rdev->constraints->min_uV); in machine_constraints_voltage()
838 int cmin = constraints->min_uV; in machine_constraints_voltage()
839 int cmax = constraints->max_uV; in machine_constraints_voltage()
846 constraints->min_uV = cmin; in machine_constraints_voltage()
847 constraints->max_uV = cmax; in machine_constraints_voltage()
882 if (constraints->min_uV < min_uV) { in machine_constraints_voltage()
884 constraints->min_uV, min_uV); in machine_constraints_voltage()
885 constraints->min_uV = min_uV; in machine_constraints_voltage()
887 if (constraints->max_uV > max_uV) { in machine_constraints_voltage()
889 constraints->max_uV, max_uV); in machine_constraints_voltage()
890 constraints->max_uV = max_uV; in machine_constraints_voltage()
909 const struct regulation_constraints *constraints) in set_machine_constraints() argument
914 if (constraints) in set_machine_constraints()
915 rdev->constraints = kmemdup(constraints, sizeof(*constraints), in set_machine_constraints()
918 rdev->constraints = kzalloc(sizeof(*constraints), in set_machine_constraints()
920 if (!rdev->constraints) in set_machine_constraints()
923 ret = machine_constraints_voltage(rdev, rdev->constraints); in set_machine_constraints()
928 if (rdev->constraints->initial_state) { in set_machine_constraints()
929 ret = suspend_prepare(rdev, rdev->constraints->initial_state); in set_machine_constraints()
936 if (rdev->constraints->initial_mode) { in set_machine_constraints()
943 ret = ops->set_mode(rdev, rdev->constraints->initial_mode); in set_machine_constraints()
953 if ((rdev->constraints->always_on || rdev->constraints->boot_on) && in set_machine_constraints()
965 kfree(rdev->constraints); in set_machine_constraints()
966 rdev->constraints = NULL; in set_machine_constraints()
1443 if (!rdev->constraints) in _regulator_can_change_status()
1446 if (rdev->constraints->valid_ops_mask & REGULATOR_CHANGE_STATUS) in _regulator_can_change_status()
1458 if (rdev->constraints && in _regulator_enable()
1459 (rdev->constraints->valid_ops_mask & REGULATOR_CHANGE_DRMS)) in _regulator_enable()
1559 (rdev->constraints && !rdev->constraints->always_on)) { in _regulator_disable()
1581 if (rdev->constraints && in _regulator_disable()
1582 (rdev->constraints->valid_ops_mask & in _regulator_disable()
1803 if (ret < rdev->constraints->min_uV) in regulator_list_voltage()
1805 else if (ret > rdev->constraints->max_uV) in regulator_list_voltage()
1852 min_uV += rdev->constraints->uV_offset; in _regulator_do_set_voltage()
1853 max_uV += rdev->constraints->uV_offset; in _regulator_do_set_voltage()
2098 return ret - rdev->constraints->uV_offset; in _regulator_get_voltage()
2342 input_uV = rdev->constraints->input_uV; in regulator_set_optimum_mode()
2741 if (!rdev->constraints) in add_regulator_attributes()
2839 const struct regulation_constraints *constraints = NULL; in regulator_register() local
2909 constraints = &init_data->constraints; in regulator_register()
2911 ret = set_machine_constraints(rdev, constraints); in regulator_register()
2976 kfree(rdev->constraints); in regulator_register()
3008 kfree(rdev->constraints); in regulator_unregister()
3064 if ((rdev->use_count > 0 || rdev->constraints->always_on) && in regulator_suspend_finish()
3256 c = rdev->constraints; in regulator_init_complete()