Lines Matching refs:cfg
703 int stpmic1_bo_enable_cfg(const char *name, struct stpmic1_bo_cfg *cfg) in stpmic1_bo_enable_cfg() argument
707 cfg->ctrl_reg = regul->control_reg; in stpmic1_bo_enable_cfg()
708 cfg->enable_pos = regul->enable_pos; in stpmic1_bo_enable_cfg()
713 int stpmic1_bo_enable_unpg(struct stpmic1_bo_cfg *cfg) in stpmic1_bo_enable_unpg() argument
715 return stpmic1_register_update(cfg->ctrl_reg, in stpmic1_bo_enable_unpg()
716 BIT(cfg->enable_pos), in stpmic1_bo_enable_unpg()
717 BIT(cfg->enable_pos)); in stpmic1_bo_enable_unpg()
722 struct stpmic1_bo_cfg *cfg) in stpmic1_bo_voltage_cfg() argument
735 cfg->ctrl_reg = regul->control_reg; in stpmic1_bo_voltage_cfg()
736 cfg->min_value = min_index << LDO_BUCK_VOLTAGE_SHIFT; in stpmic1_bo_voltage_cfg()
737 cfg->mask = mask; in stpmic1_bo_voltage_cfg()
742 int stpmic1_bo_voltage_unpg(struct stpmic1_bo_cfg *cfg) in stpmic1_bo_voltage_unpg() argument
746 assert(cfg->ctrl_reg); in stpmic1_bo_voltage_unpg()
748 if (stpmic1_register_read(cfg->ctrl_reg, &value)) in stpmic1_bo_voltage_unpg()
751 if ((value & cfg->mask) >= cfg->min_value) in stpmic1_bo_voltage_unpg()
754 return stpmic1_register_update(cfg->ctrl_reg, cfg->min_value, in stpmic1_bo_voltage_unpg()
755 cfg->mask); in stpmic1_bo_voltage_unpg()
758 int stpmic1_bo_pull_down_cfg(const char *name, struct stpmic1_bo_cfg *cfg) in stpmic1_bo_pull_down_cfg() argument
767 cfg->pd_reg = regul->pull_down_reg; in stpmic1_bo_pull_down_cfg()
768 cfg->pd_value = BIT(regul->pull_down_pos); in stpmic1_bo_pull_down_cfg()
769 cfg->pd_mask = LDO_BUCK_PULL_DOWN_MASK << regul->pull_down_pos; in stpmic1_bo_pull_down_cfg()
774 int stpmic1_bo_pull_down_unpg(struct stpmic1_bo_cfg *cfg) in stpmic1_bo_pull_down_unpg() argument
776 assert(cfg->pd_reg); in stpmic1_bo_pull_down_unpg()
778 return stpmic1_register_update(cfg->pd_reg, cfg->pd_value, in stpmic1_bo_pull_down_unpg()
779 cfg->pd_mask); in stpmic1_bo_pull_down_unpg()
782 int stpmic1_bo_mask_reset_cfg(const char *name, struct stpmic1_bo_cfg *cfg) in stpmic1_bo_mask_reset_cfg() argument
791 cfg->mrst_reg = regul->mask_reset_reg; in stpmic1_bo_mask_reset_cfg()
792 cfg->mrst_value = BIT(regul->mask_reset_pos); in stpmic1_bo_mask_reset_cfg()
793 cfg->mrst_mask = LDO_BUCK_RESET_MASK << regul->mask_reset_pos; in stpmic1_bo_mask_reset_cfg()
798 int stpmic1_bo_mask_reset_unpg(struct stpmic1_bo_cfg *cfg) in stpmic1_bo_mask_reset_unpg() argument
800 assert(cfg->mrst_reg); in stpmic1_bo_mask_reset_unpg()
802 return stpmic1_register_update(cfg->mrst_reg, cfg->mrst_value, in stpmic1_bo_mask_reset_unpg()
803 cfg->mrst_mask); in stpmic1_bo_mask_reset_unpg()
848 int stpmic1_lp_cfg(const char *name, struct stpmic1_lp_cfg *cfg) in stpmic1_lp_cfg() argument
855 cfg->ctrl_reg = regul->control_reg; in stpmic1_lp_cfg()
856 cfg->lp_reg = regul->low_power_reg; in stpmic1_lp_cfg()
861 int stpmic1_lp_load_unpg(struct stpmic1_lp_cfg *cfg) in stpmic1_lp_load_unpg() argument
866 assert(cfg->lp_reg); in stpmic1_lp_load_unpg()
868 status = stpmic1_register_read(cfg->ctrl_reg, &val); in stpmic1_lp_load_unpg()
870 status = stpmic1_register_write(cfg->lp_reg, val); in stpmic1_lp_load_unpg()
886 int stpmic1_lp_on_off_unpg(struct stpmic1_lp_cfg *cfg, int enable) in stpmic1_lp_on_off_unpg() argument
888 assert(cfg->lp_reg && (enable == 0 || enable == 1)); in stpmic1_lp_on_off_unpg()
890 return stpmic1_register_update(cfg->lp_reg, enable, in stpmic1_lp_on_off_unpg()
905 int stpmic1_lp_mode_unpg(struct stpmic1_lp_cfg *cfg, unsigned int mode) in stpmic1_lp_mode_unpg() argument
907 assert(cfg->lp_reg && (mode == 0 || mode == 1)); in stpmic1_lp_mode_unpg()
908 return stpmic1_register_update(cfg->lp_reg, in stpmic1_lp_mode_unpg()
931 struct stpmic1_lp_cfg *cfg) in stpmic1_lp_voltage_cfg() argument
942 cfg->lp_reg == get_regulator_data(name)->low_power_reg); in stpmic1_lp_voltage_cfg()
944 cfg->value = voltage_index << 2; in stpmic1_lp_voltage_cfg()
945 cfg->mask = mask; in stpmic1_lp_voltage_cfg()
950 int stpmic1_lp_voltage_unpg(struct stpmic1_lp_cfg *cfg) in stpmic1_lp_voltage_unpg() argument
952 assert(cfg->lp_reg); in stpmic1_lp_voltage_unpg()
954 return stpmic1_register_update(cfg->lp_reg, cfg->value, cfg->mask); in stpmic1_lp_voltage_unpg()