return CMD_RET_FAILURE;
}
- ret = regulator_set_value(dev, value);
+ if (!force)
+ ret = regulator_set_value(dev, value);
+ else
+ ret = regulator_set_value_force(dev, value);
if (ret) {
printf("Regulator: %s - can't set the Voltage!\n",
uc_pdata->name);
return ops->set_value(dev, uV);
}
+/*
+ * To be called with at most caution as there is no check
+ * before setting the actual voltage value.
+ */
+int regulator_set_value_force(struct udevice *dev, int uV)
+{
+ const struct dm_regulator_ops *ops = dev_get_driver_ops(dev);
+
+ if (!ops || !ops->set_value)
+ return -ENOSYS;
+
+ return ops->set_value(dev, uV);
+}
+
int regulator_get_current(struct udevice *dev)
{
const struct dm_regulator_ops *ops = dev_get_driver_ops(dev);
*/
int regulator_set_value(struct udevice *dev, int uV);
+/**
+ * regulator_set_value_force: set the microvoltage value of a given regulator
+ * without any min-,max condition check
+ *
+ * @dev - pointer to the regulator device
+ * @uV - the output value to set [micro Volts]
+ * @return - 0 on success or -errno val if fails
+ */
+int regulator_set_value_force(struct udevice *dev, int uV);
+
/**
* regulator_get_current: get microampere value of a given regulator
*