#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/mfd/rohm-bd718x7.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/machine.h>
#include <linux/regulator/of_regulator.h>
static int bd718xx_buck1234_set_ramp_delay(struct regulator_dev *rdev,
unsigned int ramp_value = BUCK_RAMPRATE_10P00MV;
dev_dbg(&rdev->dev, "Buck[%d] Set Ramp = %d\n", id + 1,
ramp_value = BUCK_RAMPRATE_1P25MV;
ramp_value = BUCK_RAMPRATE_2P50MV;
ramp_value = BUCK_RAMPRATE_5P00MV;
ramp_value = BUCK_RAMPRATE_10P00MV;
ramp_value = BUCK_RAMPRATE_10P00MV;
"%s: ramp_delay: %d not supported, setting 10000mV//us\n",
rdev->desc->name, ramp_delay);
return regmap_update_bits(rdev->regmap, BD718XX_REG_BUCK1_CTRL + id,
BUCK_RAMPRATE_MASK, ramp_value << 6);
static int bd718xx_set_voltage_sel_restricted(struct regulator_dev *rdev,
if (regulator_is_enabled_regmap(rdev))
return regulator_set_voltage_sel_regmap(rdev, sel);
static int bd718xx_set_voltage_sel_pickable_restricted(
struct regulator_dev *rdev, unsigned int sel)
if (regulator_is_enabled_regmap(rdev))
return regulator_set_voltage_sel_pickable_regmap(rdev, sel);
static const struct regulator_ops bd718xx_pickable_range_ldo_ops = {
.enable = regulator_enable_regmap,
.disable = regulator_disable_regmap,
.is_enabled = regulator_is_enabled_regmap,
.list_voltage = regulator_list_voltage_pickable_linear_range,
.set_voltage_sel = bd718xx_set_voltage_sel_pickable_restricted,
.get_voltage_sel = regulator_get_voltage_sel_pickable_regmap,
static const struct regulator_ops bd718xx_pickable_range_buck_ops = {
.enable = regulator_enable_regmap,