Lines Matching refs:regul

595 	const struct regul_struct *regul = get_regulator_data(name);  in stpmic1_regulator_levels_mv()  local
597 assert(regul); in stpmic1_regulator_levels_mv()
600 *levels_count = regul->voltage_table_size; in stpmic1_regulator_levels_mv()
603 if (regul->voltage_table == ldo3_voltage_table) in stpmic1_regulator_levels_mv()
608 *levels = regul->voltage_table; in stpmic1_regulator_levels_mv()
613 const struct regul_struct *regul = get_regulator_data(name); in voltage_to_index() local
616 assert(regul->voltage_table); in voltage_to_index()
617 for (i = 0; i < regul->voltage_table_size; i++) in voltage_to_index()
618 if (regul->voltage_table[i] == millivolts) in voltage_to_index()
638 const struct regul_struct *regul = get_regulator_data(name); in stpmic1_regulator_enable() local
640 return stpmic1_register_update(regul->control_reg, in stpmic1_regulator_enable()
641 BIT(regul->enable_pos), in stpmic1_regulator_enable()
642 BIT(regul->enable_pos)); in stpmic1_regulator_enable()
647 const struct regul_struct *regul = get_regulator_data(name); in stpmic1_regulator_disable() local
649 return stpmic1_register_update(regul->control_reg, 0, in stpmic1_regulator_disable()
650 BIT(regul->enable_pos)); in stpmic1_regulator_disable()
655 const struct regul_struct *regul = get_regulator_data(name); in stpmic1_is_regulator_enabled() local
658 if (stpmic1_register_read(regul->control_reg, &val)) in stpmic1_is_regulator_enabled()
661 return val & BIT(regul->enable_pos); in stpmic1_is_regulator_enabled()
679 const struct regul_struct *regul = get_regulator_data(name); in stpmic1_regulator_voltage_set() local
689 return stpmic1_register_update(regul->control_reg, in stpmic1_regulator_voltage_set()
696 const struct regul_struct *regul = get_regulator_data(name); in stpmic1_regulator_mask_reset_set() local
698 if (regul->control_reg == USB_CONTROL_REG) { in stpmic1_regulator_mask_reset_set()
703 return stpmic1_register_update(regul->mask_reset_reg, in stpmic1_regulator_mask_reset_set()
704 BIT(regul->mask_reset_pos), in stpmic1_regulator_mask_reset_set()
706 regul->mask_reset_pos); in stpmic1_regulator_mask_reset_set()
711 const struct regul_struct *regul = get_regulator_data(name); in stpmic1_bo_enable_cfg() local
713 cfg->ctrl_reg = regul->control_reg; in stpmic1_bo_enable_cfg()
714 cfg->enable_pos = regul->enable_pos; in stpmic1_bo_enable_cfg()
731 const struct regul_struct *regul = get_regulator_data(name); in stpmic1_bo_voltage_cfg() local
741 cfg->ctrl_reg = regul->control_reg; in stpmic1_bo_voltage_cfg()
766 const struct regul_struct *regul = get_regulator_data(name); in stpmic1_bo_pull_down_cfg() local
768 if (!regul->pull_down_reg) { in stpmic1_bo_pull_down_cfg()
773 cfg->pd_reg = regul->pull_down_reg; in stpmic1_bo_pull_down_cfg()
774 cfg->pd_value = BIT(regul->pull_down_pos); in stpmic1_bo_pull_down_cfg()
775 cfg->pd_mask = LDO_BUCK_PULL_DOWN_MASK << regul->pull_down_pos; in stpmic1_bo_pull_down_cfg()
790 const struct regul_struct *regul = get_regulator_data(name); in stpmic1_bo_mask_reset_cfg() local
792 if (!regul->mask_reset_reg) { in stpmic1_bo_mask_reset_cfg()
797 cfg->mrst_reg = regul->mask_reset_reg; in stpmic1_bo_mask_reset_cfg()
798 cfg->mrst_value = BIT(regul->mask_reset_pos); in stpmic1_bo_mask_reset_cfg()
799 cfg->mrst_mask = LDO_BUCK_RESET_MASK << regul->mask_reset_pos; in stpmic1_bo_mask_reset_cfg()
814 const struct regul_struct *regul = get_regulator_data(name); in stpmic1_regulator_voltage_get() local
822 if (stpmic1_register_read(regul->control_reg, &value)) in stpmic1_regulator_voltage_get()
827 if (value > regul->voltage_table_size) in stpmic1_regulator_voltage_get()
830 return regul->voltage_table[value]; in stpmic1_regulator_voltage_get()
835 const struct regul_struct *regul = get_regulator_data(name); in stpmic1_lp_copy_reg() local
839 if (!regul->low_power_reg) in stpmic1_lp_copy_reg()
842 status = stpmic1_register_read(regul->control_reg, &val); in stpmic1_lp_copy_reg()
846 return stpmic1_register_write(regul->low_power_reg, val); in stpmic1_lp_copy_reg()
856 const struct regul_struct *regul = get_regulator_data(name); in stpmic1_lp_cfg() local
858 if (!regul->low_power_reg) in stpmic1_lp_cfg()
861 cfg->ctrl_reg = regul->control_reg; in stpmic1_lp_cfg()
862 cfg->lp_reg = regul->low_power_reg; in stpmic1_lp_cfg()
883 const struct regul_struct *regul = get_regulator_data(name); in stpmic1_lp_reg_on_off() local
885 if (!regul->low_power_reg) in stpmic1_lp_reg_on_off()
888 return stpmic1_register_update(regul->low_power_reg, enable, in stpmic1_lp_reg_on_off()
902 const struct regul_struct *regul = get_regulator_data(name); in stpmic1_lp_set_mode() local
904 assert(regul->low_power_reg && (hplp == 0 || hplp == 1)); in stpmic1_lp_set_mode()
906 return stpmic1_register_update(regul->low_power_reg, in stpmic1_lp_set_mode()
922 const struct regul_struct *regul = get_regulator_data(name); in stpmic1_lp_set_voltage() local
931 return stpmic1_register_update(regul->low_power_reg, voltage_index << 2, in stpmic1_lp_set_voltage()