Lines Matching +full:bd71837 +full:- +full:pmic

1 // SPDX-License-Identifier: GPL-2.0
5 #include <linux/mfd/rohm-generic.h>
21 if (ret != -EINVAL) in set_dvs_level()
35 return -EINVAL; in set_dvs_level()
37 for (i = 0; i < desc->n_voltages; i++) { in set_dvs_level()
38 /* NOTE to next hacker - Does not support pickable ranges */ in set_dvs_level()
39 if (desc->linear_range_selectors_bitfield) in set_dvs_level()
40 return -EINVAL; in set_dvs_level()
41 if (desc->n_linear_ranges) in set_dvs_level()
48 i <<= ffs(desc->vsel_mask) - 1; in set_dvs_level()
57 if (i == desc->n_voltages) in set_dvs_level()
70 unsigned int reg, mask, omask, oreg = desc->enable_reg; in rohm_regulator_set_dvs_levels()
76 if (dvs->level_map & bit) { in rohm_regulator_set_dvs_levels()
79 prop = "rohm,dvs-run-voltage"; in rohm_regulator_set_dvs_levels()
80 reg = dvs->run_reg; in rohm_regulator_set_dvs_levels()
81 mask = dvs->run_mask; in rohm_regulator_set_dvs_levels()
82 omask = dvs->run_on_mask; in rohm_regulator_set_dvs_levels()
85 prop = "rohm,dvs-idle-voltage"; in rohm_regulator_set_dvs_levels()
86 reg = dvs->idle_reg; in rohm_regulator_set_dvs_levels()
87 mask = dvs->idle_mask; in rohm_regulator_set_dvs_levels()
88 omask = dvs->idle_on_mask; in rohm_regulator_set_dvs_levels()
91 prop = "rohm,dvs-suspend-voltage"; in rohm_regulator_set_dvs_levels()
92 reg = dvs->suspend_reg; in rohm_regulator_set_dvs_levels()
93 mask = dvs->suspend_mask; in rohm_regulator_set_dvs_levels()
94 omask = dvs->suspend_on_mask; in rohm_regulator_set_dvs_levels()
97 prop = "rohm,dvs-lpsr-voltage"; in rohm_regulator_set_dvs_levels()
98 reg = dvs->lpsr_reg; in rohm_regulator_set_dvs_levels()
99 mask = dvs->lpsr_mask; in rohm_regulator_set_dvs_levels()
100 omask = dvs->lpsr_on_mask; in rohm_regulator_set_dvs_levels()
103 prop = "rohm,dvs-snvs-voltage"; in rohm_regulator_set_dvs_levels()
104 reg = dvs->snvs_reg; in rohm_regulator_set_dvs_levels()
105 mask = dvs->snvs_mask; in rohm_regulator_set_dvs_levels()
106 omask = dvs->snvs_on_mask; in rohm_regulator_set_dvs_levels()
109 return -EINVAL; in rohm_regulator_set_dvs_levels()
120 * Few ROHM PMIC ICs have constrains on voltage changing:
121 * BD71837 - only buck 1-4 voltages can be changed when they are enabled.
123 * BD96801 - LDO voltage levels can be changed when LDOs are disabled.
128 if (rdev->desc->ops->is_enabled(rdev)) in rohm_regulator_set_voltage_sel_restricted()
129 return -EBUSY; in rohm_regulator_set_voltage_sel_restricted()
137 MODULE_DESCRIPTION("Generic helpers for ROHM PMIC regulator drivers");