Lines Matching refs:range
366 struct spmi_voltage_range *range; member
444 .range = name##_ranges, \
608 const struct spmi_voltage_range *range; in spmi_regulator_select_voltage() local
614 lim_min_uV = vreg->set_points->range[0].set_point_min_uV; in spmi_regulator_select_voltage()
616 vreg->set_points->range[vreg->set_points->count - 1].set_point_max_uV; in spmi_regulator_select_voltage()
630 range_max_uV = vreg->set_points->range[i - 1].set_point_max_uV; in spmi_regulator_select_voltage()
636 range = &vreg->set_points->range[range_id]; in spmi_regulator_select_voltage()
642 voltage_sel = DIV_ROUND_UP(uV - range->min_uV, range->step_uV); in spmi_regulator_select_voltage()
643 uV = voltage_sel * range->step_uV + range->min_uV; in spmi_regulator_select_voltage()
655 selector += vreg->set_points->range[i].n_voltages; in spmi_regulator_select_voltage()
656 selector += (uV - range->set_point_min_uV) / range->step_uV; in spmi_regulator_select_voltage()
665 const struct spmi_voltage_range *range, *end; in spmi_sw_selector_to_hw() local
668 range = vreg->set_points->range; in spmi_sw_selector_to_hw()
669 end = range + vreg->set_points->count; in spmi_sw_selector_to_hw()
671 for (; range < end; range++) { in spmi_sw_selector_to_hw()
672 if (selector < range->n_voltages) { in spmi_sw_selector_to_hw()
677 offset = range->set_point_min_uV - range->min_uV; in spmi_sw_selector_to_hw()
678 offset /= range->step_uV; in spmi_sw_selector_to_hw()
680 *range_sel = range->range_sel; in spmi_sw_selector_to_hw()
684 selector -= range->n_voltages; in spmi_sw_selector_to_hw()
691 const struct spmi_voltage_range *range) in spmi_hw_selector_to_sw() argument
695 const struct spmi_voltage_range *r = vreg->set_points->range; in spmi_hw_selector_to_sw()
699 if (r == range && range->n_voltages) { in spmi_hw_selector_to_sw()
706 offset = range->set_point_min_uV - range->min_uV; in spmi_hw_selector_to_sw()
707 offset /= range->step_uV; in spmi_hw_selector_to_sw()
711 max_hw_sel = range->set_point_max_uV - range->min_uV; in spmi_hw_selector_to_sw()
712 max_hw_sel /= range->step_uV; in spmi_hw_selector_to_sw()
728 const struct spmi_voltage_range *range, *end; in spmi_regulator_find_range() local
730 range = vreg->set_points->range; in spmi_regulator_find_range()
731 end = range + vreg->set_points->count; in spmi_regulator_find_range()
735 for (; range < end; range++) in spmi_regulator_find_range()
736 if (range->range_sel == range_sel) in spmi_regulator_find_range()
737 return range; in spmi_regulator_find_range()
745 const struct spmi_voltage_range *range; in spmi_regulator_select_voltage_same_range() local
749 range = spmi_regulator_find_range(vreg); in spmi_regulator_select_voltage_same_range()
750 if (!range) in spmi_regulator_select_voltage_same_range()
753 if (uV < range->min_uV && max_uV >= range->min_uV) in spmi_regulator_select_voltage_same_range()
754 uV = range->min_uV; in spmi_regulator_select_voltage_same_range()
756 if (uV < range->min_uV || uV > range->max_uV) { in spmi_regulator_select_voltage_same_range()
765 uV = DIV_ROUND_UP(uV - range->min_uV, range->step_uV); in spmi_regulator_select_voltage_same_range()
766 uV = uV * range->step_uV + range->min_uV; in spmi_regulator_select_voltage_same_range()
778 if (uV >= vreg->set_points->range[i].set_point_min_uV in spmi_regulator_select_voltage_same_range()
779 && uV <= vreg->set_points->range[i].set_point_max_uV) { in spmi_regulator_select_voltage_same_range()
781 (uV - vreg->set_points->range[i].set_point_min_uV) in spmi_regulator_select_voltage_same_range()
782 / vreg->set_points->range[i].step_uV; in spmi_regulator_select_voltage_same_range()
786 selector += vreg->set_points->range[i].n_voltages; in spmi_regulator_select_voltage_same_range()
859 const struct spmi_voltage_range *range; in spmi_regulator_common_get_voltage() local
864 range = spmi_regulator_find_range(vreg); in spmi_regulator_common_get_voltage()
865 if (!range) in spmi_regulator_common_get_voltage()
868 return spmi_hw_selector_to_sw(vreg, voltage_sel, range); in spmi_regulator_common_get_voltage()
874 const struct spmi_voltage_range *range; in spmi_regulator_ftsmps426_get_voltage() local
881 range = vreg->set_points->range; in spmi_regulator_ftsmps426_get_voltage()
883 return (uV - range->set_point_min_uV) / range->step_uV; in spmi_regulator_ftsmps426_get_voltage()
948 const struct spmi_voltage_range *range; in spmi_regulator_ult_lo_smps_get_voltage() local
953 range = spmi_regulator_find_range(vreg); in spmi_regulator_ult_lo_smps_get_voltage()
954 if (!range) in spmi_regulator_ult_lo_smps_get_voltage()
957 if (range->range_sel == 1) in spmi_regulator_ult_lo_smps_get_voltage()
960 return spmi_hw_selector_to_sw(vreg, voltage_sel, range); in spmi_regulator_ult_lo_smps_get_voltage()
974 if (selector < vreg->set_points->range[i].n_voltages) { in spmi_regulator_common_list_voltage()
975 uV = selector * vreg->set_points->range[i].step_uV in spmi_regulator_common_list_voltage()
976 + vreg->set_points->range[i].set_point_min_uV; in spmi_regulator_common_list_voltage()
980 selector -= vreg->set_points->range[i].n_voltages; in spmi_regulator_common_list_voltage()
1536 struct spmi_voltage_range *range = points->range; in spmi_calculate_num_voltages() local
1538 for (; range < points->range + points->count; range++) { in spmi_calculate_num_voltages()
1540 if (range->set_point_max_uV) { in spmi_calculate_num_voltages()
1541 n = range->set_point_max_uV - range->set_point_min_uV; in spmi_calculate_num_voltages()
1542 n = (n / range->step_uV) + 1; in spmi_calculate_num_voltages()
1544 range->n_voltages = n; in spmi_calculate_num_voltages()
1610 const struct spmi_voltage_range *range; in spmi_regulator_init_slew_rate() local
1618 range = spmi_regulator_find_range(vreg); in spmi_regulator_init_slew_rate()
1619 if (!range) in spmi_regulator_init_slew_rate()
1638 slew_rate = SPMI_FTSMPS_CLOCK_RATE * range->step_uV * (1 << step); in spmi_regulator_init_slew_rate()
1655 const struct spmi_voltage_range *range = &vreg->set_points->range[0]; in spmi_regulator_init_slew_rate_ftsmps426() local
1667 slew_rate = clock_rate * range->step_uV; in spmi_regulator_init_slew_rate_ftsmps426()
2104 const struct spmi_voltage_range *range; in qcom_spmi_regulator_probe() local
2196 range = vreg->set_points->range; in qcom_spmi_regulator_probe()
2197 vreg->desc.uV_step = range->step_uV; in qcom_spmi_regulator_probe()