abb               147 drivers/regulator/ti-abb-regulator.c static inline bool ti_abb_check_txdone(const struct ti_abb *abb)
abb               149 drivers/regulator/ti-abb-regulator.c 	return !!(readl(abb->int_base) & abb->txdone_mask);
abb               156 drivers/regulator/ti-abb-regulator.c static inline void ti_abb_clear_txdone(const struct ti_abb *abb)
abb               158 drivers/regulator/ti-abb-regulator.c 	writel(abb->txdone_mask, abb->int_base);
abb               168 drivers/regulator/ti-abb-regulator.c static int ti_abb_wait_txdone(struct device *dev, struct ti_abb *abb)
abb               173 drivers/regulator/ti-abb-regulator.c 	while (timeout++ <= abb->settling_time) {
abb               174 drivers/regulator/ti-abb-regulator.c 		status = ti_abb_check_txdone(abb);
abb               182 drivers/regulator/ti-abb-regulator.c 			     __func__, timeout, readl(abb->int_base));
abb               193 drivers/regulator/ti-abb-regulator.c static int ti_abb_clear_all_txdone(struct device *dev, const struct ti_abb *abb)
abb               198 drivers/regulator/ti-abb-regulator.c 	while (timeout++ <= abb->settling_time) {
abb               199 drivers/regulator/ti-abb-regulator.c 		ti_abb_clear_txdone(abb);
abb               201 drivers/regulator/ti-abb-regulator.c 		status = ti_abb_check_txdone(abb);
abb               209 drivers/regulator/ti-abb-regulator.c 			     __func__, timeout, readl(abb->int_base));
abb               219 drivers/regulator/ti-abb-regulator.c static void ti_abb_program_ldovbb(struct device *dev, const struct ti_abb *abb,
abb               224 drivers/regulator/ti-abb-regulator.c 	val = readl(abb->ldo_base);
abb               226 drivers/regulator/ti-abb-regulator.c 	val &= ~(abb->ldovbb_override_mask | abb->ldovbb_vset_mask);
abb               231 drivers/regulator/ti-abb-regulator.c 		val |= abb->ldovbb_override_mask;
abb               232 drivers/regulator/ti-abb-regulator.c 		val |= info->vset << __ffs(abb->ldovbb_vset_mask);
abb               236 drivers/regulator/ti-abb-regulator.c 	writel(val, abb->ldo_base);
abb               247 drivers/regulator/ti-abb-regulator.c static int ti_abb_set_opp(struct regulator_dev *rdev, struct ti_abb *abb,
abb               250 drivers/regulator/ti-abb-regulator.c 	const struct ti_abb_reg *regs = abb->regs;
abb               254 drivers/regulator/ti-abb-regulator.c 	ret = ti_abb_clear_all_txdone(dev, abb);
abb               258 drivers/regulator/ti-abb-regulator.c 	ti_abb_rmw(regs->fbb_sel_mask | regs->rbb_sel_mask, 0, abb->setup_reg);
abb               262 drivers/regulator/ti-abb-regulator.c 		ti_abb_rmw(regs->rbb_sel_mask, 1, abb->setup_reg);
abb               265 drivers/regulator/ti-abb-regulator.c 		ti_abb_rmw(regs->fbb_sel_mask, 1, abb->setup_reg);
abb               270 drivers/regulator/ti-abb-regulator.c 	ti_abb_rmw(regs->opp_sel_mask, info->opp_sel, abb->control_reg);
abb               277 drivers/regulator/ti-abb-regulator.c 	if (abb->ldo_base && info->opp_sel != TI_ABB_NOMINAL_OPP)
abb               278 drivers/regulator/ti-abb-regulator.c 		ti_abb_program_ldovbb(dev, abb, info);
abb               281 drivers/regulator/ti-abb-regulator.c 	ti_abb_rmw(regs->opp_change_mask, 1, abb->control_reg);
abb               284 drivers/regulator/ti-abb-regulator.c 	ret = ti_abb_wait_txdone(dev, abb);
abb               288 drivers/regulator/ti-abb-regulator.c 	ret = ti_abb_clear_all_txdone(dev, abb);
abb               297 drivers/regulator/ti-abb-regulator.c 	if (abb->ldo_base && info->opp_sel == TI_ABB_NOMINAL_OPP)
abb               298 drivers/regulator/ti-abb-regulator.c 		ti_abb_program_ldovbb(dev, abb, info);
abb               315 drivers/regulator/ti-abb-regulator.c 	struct ti_abb *abb = rdev_get_drvdata(rdev);
abb               320 drivers/regulator/ti-abb-regulator.c 	if (!abb) {
abb               326 drivers/regulator/ti-abb-regulator.c 	if (!desc->n_voltages || !abb->info) {
abb               340 drivers/regulator/ti-abb-regulator.c 	if (sel == abb->current_info_idx) {
abb               346 drivers/regulator/ti-abb-regulator.c 	info = &abb->info[sel];
abb               347 drivers/regulator/ti-abb-regulator.c 	oinfo = &abb->info[abb->current_info_idx];
abb               350 drivers/regulator/ti-abb-regulator.c 			sel, abb->current_info_idx);
abb               354 drivers/regulator/ti-abb-regulator.c 	ret = ti_abb_set_opp(rdev, abb, info);
abb               358 drivers/regulator/ti-abb-regulator.c 		abb->current_info_idx = sel;
abb               376 drivers/regulator/ti-abb-regulator.c 	struct ti_abb *abb = rdev_get_drvdata(rdev);
abb               379 drivers/regulator/ti-abb-regulator.c 	if (!abb) {
abb               385 drivers/regulator/ti-abb-regulator.c 	if (!desc->n_voltages || !abb->info) {
abb               392 drivers/regulator/ti-abb-regulator.c 	if (abb->current_info_idx >= (int)desc->n_voltages) {
abb               394 drivers/regulator/ti-abb-regulator.c 			__func__, abb->current_info_idx, desc->n_voltages);
abb               398 drivers/regulator/ti-abb-regulator.c 	return abb->current_info_idx;
abb               408 drivers/regulator/ti-abb-regulator.c static int ti_abb_init_timings(struct device *dev, struct ti_abb *abb)
abb               412 drivers/regulator/ti-abb-regulator.c 	const struct ti_abb_reg *regs = abb->regs;
abb               417 drivers/regulator/ti-abb-regulator.c 	ret = of_property_read_u32(dev->of_node, pname, &abb->settling_time);
abb               424 drivers/regulator/ti-abb-regulator.c 	if (!abb->settling_time) {
abb               441 drivers/regulator/ti-abb-regulator.c 	abb->clk = devm_clk_get(dev, NULL);
abb               442 drivers/regulator/ti-abb-regulator.c 	if (IS_ERR(abb->clk)) {
abb               443 drivers/regulator/ti-abb-regulator.c 		ret = PTR_ERR(abb->clk);
abb               472 drivers/regulator/ti-abb-regulator.c 	clk_rate = DIV_ROUND_CLOSEST(clk_get_rate(abb->clk), 1000000);
abb               478 drivers/regulator/ti-abb-regulator.c 	sr2_wt_cnt_val = DIV_ROUND_CLOSEST(abb->settling_time * 10, cycle_rate);
abb               481 drivers/regulator/ti-abb-regulator.c 		clk_get_rate(abb->clk), sr2_wt_cnt_val);
abb               483 drivers/regulator/ti-abb-regulator.c 	ti_abb_rmw(regs->sr2_wtcnt_value_mask, sr2_wt_cnt_val, abb->setup_reg);
abb               496 drivers/regulator/ti-abb-regulator.c static int ti_abb_init_table(struct device *dev, struct ti_abb *abb,
abb               529 drivers/regulator/ti-abb-regulator.c 	abb->info = info;
abb               536 drivers/regulator/ti-abb-regulator.c 	abb->rdesc.n_voltages = num_entries;
abb               537 drivers/regulator/ti-abb-regulator.c 	abb->rdesc.volt_table = volt_table;
abb               539 drivers/regulator/ti-abb-regulator.c 	abb->current_info_idx = -EINVAL;
abb               570 drivers/regulator/ti-abb-regulator.c 		if (!abb->efuse_base) {
abb               578 drivers/regulator/ti-abb-regulator.c 		efuse_val = readl(abb->efuse_base + efuse_offset);
abb               593 drivers/regulator/ti-abb-regulator.c 		if (!abb->ldo_base) {
abb               691 drivers/regulator/ti-abb-regulator.c 	struct ti_abb *abb;
abb               711 drivers/regulator/ti-abb-regulator.c 	abb = devm_kzalloc(dev, sizeof(struct ti_abb), GFP_KERNEL);
abb               712 drivers/regulator/ti-abb-regulator.c 	if (!abb)
abb               714 drivers/regulator/ti-abb-regulator.c 	abb->regs = match->data;
abb               717 drivers/regulator/ti-abb-regulator.c 	if (abb->regs->setup_off || abb->regs->control_off) {
abb               720 drivers/regulator/ti-abb-regulator.c 		abb->base = devm_ioremap_resource(dev, res);
abb               721 drivers/regulator/ti-abb-regulator.c 		if (IS_ERR(abb->base))
abb               722 drivers/regulator/ti-abb-regulator.c 			return PTR_ERR(abb->base);
abb               724 drivers/regulator/ti-abb-regulator.c 		abb->setup_reg = abb->base + abb->regs->setup_off;
abb               725 drivers/regulator/ti-abb-regulator.c 		abb->control_reg = abb->base + abb->regs->control_off;
abb               730 drivers/regulator/ti-abb-regulator.c 		abb->control_reg = devm_ioremap_resource(dev, res);
abb               731 drivers/regulator/ti-abb-regulator.c 		if (IS_ERR(abb->control_reg))
abb               732 drivers/regulator/ti-abb-regulator.c 			return PTR_ERR(abb->control_reg);
abb               736 drivers/regulator/ti-abb-regulator.c 		abb->setup_reg = devm_ioremap_resource(dev, res);
abb               737 drivers/regulator/ti-abb-regulator.c 		if (IS_ERR(abb->setup_reg))
abb               738 drivers/regulator/ti-abb-regulator.c 			return PTR_ERR(abb->setup_reg);
abb               751 drivers/regulator/ti-abb-regulator.c 	abb->int_base = devm_ioremap_nocache(dev, res->start,
abb               753 drivers/regulator/ti-abb-regulator.c 	if (!abb->int_base) {
abb               771 drivers/regulator/ti-abb-regulator.c 	abb->efuse_base = devm_ioremap_nocache(dev, res->start,
abb               773 drivers/regulator/ti-abb-regulator.c 	if (!abb->efuse_base) {
abb               785 drivers/regulator/ti-abb-regulator.c 	abb->ldo_base = devm_ioremap_resource(dev, res);
abb               786 drivers/regulator/ti-abb-regulator.c 	if (IS_ERR(abb->ldo_base))
abb               787 drivers/regulator/ti-abb-regulator.c 		return PTR_ERR(abb->ldo_base);
abb               793 drivers/regulator/ti-abb-regulator.c 				 &abb->ldovbb_override_mask);
abb               798 drivers/regulator/ti-abb-regulator.c 	if (!abb->ldovbb_override_mask) {
abb               806 drivers/regulator/ti-abb-regulator.c 				 &abb->ldovbb_vset_mask);
abb               811 drivers/regulator/ti-abb-regulator.c 	if (!abb->ldovbb_vset_mask) {
abb               820 drivers/regulator/ti-abb-regulator.c 				 &abb->txdone_mask);
abb               825 drivers/regulator/ti-abb-regulator.c 	if (!abb->txdone_mask) {
abb               831 drivers/regulator/ti-abb-regulator.c 					      &abb->rdesc);
abb               839 drivers/regulator/ti-abb-regulator.c 	ret = ti_abb_init_table(dev, abb, initdata);
abb               844 drivers/regulator/ti-abb-regulator.c 	ret = ti_abb_init_timings(dev, abb);
abb               848 drivers/regulator/ti-abb-regulator.c 	desc = &abb->rdesc;
abb               861 drivers/regulator/ti-abb-regulator.c 	config.driver_data = abb;
abb               874 drivers/regulator/ti-abb-regulator.c 	ti_abb_rmw(abb->regs->sr2_en_mask, 1, abb->setup_reg);