• Home
  • Raw
  • Download

Lines Matching refs:range

403 	struct spmi_voltage_range		*range;  member
481 .range = name##_ranges, \
669 const struct spmi_voltage_range *range; in spmi_regulator_select_voltage() local
675 lim_min_uV = vreg->set_points->range[0].set_point_min_uV; in spmi_regulator_select_voltage()
677 vreg->set_points->range[vreg->set_points->count - 1].set_point_max_uV; in spmi_regulator_select_voltage()
691 range_max_uV = vreg->set_points->range[i - 1].set_point_max_uV; in spmi_regulator_select_voltage()
697 range = &vreg->set_points->range[range_id]; in spmi_regulator_select_voltage()
703 voltage_sel = DIV_ROUND_UP(uV - range->min_uV, range->step_uV); in spmi_regulator_select_voltage()
704 uV = voltage_sel * range->step_uV + range->min_uV; in spmi_regulator_select_voltage()
716 selector += vreg->set_points->range[i].n_voltages; in spmi_regulator_select_voltage()
717 selector += (uV - range->set_point_min_uV) / range->step_uV; in spmi_regulator_select_voltage()
726 const struct spmi_voltage_range *range, *end; in spmi_sw_selector_to_hw() local
729 range = vreg->set_points->range; in spmi_sw_selector_to_hw()
730 end = range + vreg->set_points->count; in spmi_sw_selector_to_hw()
732 for (; range < end; range++) { in spmi_sw_selector_to_hw()
733 if (selector < range->n_voltages) { in spmi_sw_selector_to_hw()
738 offset = range->set_point_min_uV - range->min_uV; in spmi_sw_selector_to_hw()
739 offset /= range->step_uV; in spmi_sw_selector_to_hw()
741 *range_sel = range->range_sel; in spmi_sw_selector_to_hw()
745 selector -= range->n_voltages; in spmi_sw_selector_to_hw()
752 const struct spmi_voltage_range *range) in spmi_hw_selector_to_sw() argument
756 const struct spmi_voltage_range *r = vreg->set_points->range; in spmi_hw_selector_to_sw()
760 if (r == range && range->n_voltages) { in spmi_hw_selector_to_sw()
767 offset = range->set_point_min_uV - range->min_uV; in spmi_hw_selector_to_sw()
768 offset /= range->step_uV; in spmi_hw_selector_to_sw()
772 max_hw_sel = range->set_point_max_uV - range->min_uV; in spmi_hw_selector_to_sw()
773 max_hw_sel /= range->step_uV; in spmi_hw_selector_to_sw()
789 const struct spmi_voltage_range *range, *end; in spmi_regulator_find_range() local
791 range = vreg->set_points->range; in spmi_regulator_find_range()
792 end = range + vreg->set_points->count; in spmi_regulator_find_range()
796 for (; range < end; range++) in spmi_regulator_find_range()
797 if (range->range_sel == range_sel) in spmi_regulator_find_range()
798 return range; in spmi_regulator_find_range()
806 const struct spmi_voltage_range *range; in spmi_regulator_select_voltage_same_range() local
810 range = spmi_regulator_find_range(vreg); in spmi_regulator_select_voltage_same_range()
811 if (!range) in spmi_regulator_select_voltage_same_range()
814 if (uV < range->min_uV && max_uV >= range->min_uV) in spmi_regulator_select_voltage_same_range()
815 uV = range->min_uV; in spmi_regulator_select_voltage_same_range()
817 if (uV < range->min_uV || uV > range->max_uV) { in spmi_regulator_select_voltage_same_range()
826 uV = DIV_ROUND_UP(uV - range->min_uV, range->step_uV); in spmi_regulator_select_voltage_same_range()
827 uV = uV * range->step_uV + range->min_uV; in spmi_regulator_select_voltage_same_range()
839 if (uV >= vreg->set_points->range[i].set_point_min_uV in spmi_regulator_select_voltage_same_range()
840 && uV <= vreg->set_points->range[i].set_point_max_uV) { in spmi_regulator_select_voltage_same_range()
842 (uV - vreg->set_points->range[i].set_point_min_uV) in spmi_regulator_select_voltage_same_range()
843 / vreg->set_points->range[i].step_uV; in spmi_regulator_select_voltage_same_range()
847 selector += vreg->set_points->range[i].n_voltages; in spmi_regulator_select_voltage_same_range()
920 const struct spmi_voltage_range *range; in spmi_regulator_common_get_voltage() local
925 range = spmi_regulator_find_range(vreg); in spmi_regulator_common_get_voltage()
926 if (!range) in spmi_regulator_common_get_voltage()
929 return spmi_hw_selector_to_sw(vreg, voltage_sel, range); in spmi_regulator_common_get_voltage()
935 const struct spmi_voltage_range *range; in spmi_regulator_ftsmps426_get_voltage() local
942 range = vreg->set_points->range; in spmi_regulator_ftsmps426_get_voltage()
944 return (uV - range->set_point_min_uV) / range->step_uV; in spmi_regulator_ftsmps426_get_voltage()
1009 const struct spmi_voltage_range *range; in spmi_regulator_ult_lo_smps_get_voltage() local
1014 range = spmi_regulator_find_range(vreg); in spmi_regulator_ult_lo_smps_get_voltage()
1015 if (!range) in spmi_regulator_ult_lo_smps_get_voltage()
1018 if (range->range_sel == 1) in spmi_regulator_ult_lo_smps_get_voltage()
1021 return spmi_hw_selector_to_sw(vreg, voltage_sel, range); in spmi_regulator_ult_lo_smps_get_voltage()
1035 if (selector < vreg->set_points->range[i].n_voltages) { in spmi_regulator_common_list_voltage()
1036 uV = selector * vreg->set_points->range[i].step_uV in spmi_regulator_common_list_voltage()
1037 + vreg->set_points->range[i].set_point_min_uV; in spmi_regulator_common_list_voltage()
1041 selector -= vreg->set_points->range[i].n_voltages; in spmi_regulator_common_list_voltage()
1680 struct spmi_voltage_range *range = points->range; in spmi_calculate_num_voltages() local
1682 for (; range < points->range + points->count; range++) { in spmi_calculate_num_voltages()
1684 if (range->set_point_max_uV) { in spmi_calculate_num_voltages()
1685 n = range->set_point_max_uV - range->set_point_min_uV; in spmi_calculate_num_voltages()
1686 n = (n / range->step_uV) + 1; in spmi_calculate_num_voltages()
1688 range->n_voltages = n; in spmi_calculate_num_voltages()
1754 const struct spmi_voltage_range *range; in spmi_regulator_init_slew_rate() local
1762 range = spmi_regulator_find_range(vreg); in spmi_regulator_init_slew_rate()
1763 if (!range) in spmi_regulator_init_slew_rate()
1782 slew_rate = SPMI_FTSMPS_CLOCK_RATE * range->step_uV * (1 << step); in spmi_regulator_init_slew_rate()
1799 const struct spmi_voltage_range *range = &vreg->set_points->range[0]; in spmi_regulator_init_slew_rate_ftsmps426() local
1811 slew_rate = clock_rate * range->step_uV; in spmi_regulator_init_slew_rate_ftsmps426()
2374 const struct spmi_voltage_range *range; in qcom_spmi_regulator_probe() local
2464 range = vreg->set_points->range; in qcom_spmi_regulator_probe()
2465 vreg->desc.uV_step = range->step_uV; in qcom_spmi_regulator_probe()