interface.
config REGULATOR_DA9211
----- tristate "Dialog Semiconductor DA9211/DA9212 regulator"
+++++ tristate "Dialog Semiconductor DA9211/DA9212/DA9213/DA9214 regulator"
depends on I2C
select REGMAP_I2C
help
----- Say y here to support for the Dialog Semiconductor DA9211/DA9212.
----- The DA9211/DA9212 is a multi-phase synchronous step down
----- converter 12A DC-DC Buck controlled through an I2C
+++++ Say y here to support for the Dialog Semiconductor DA9211/DA9212
+++++ /DA9213/DA9214.
+++++ The DA9211/DA9212/DA9213/DA9214 is a multi-phase synchronous
+++++ step down converter 12A or 16A DC-DC Buck controlled through an I2C
interface.
config REGULATOR_DBX500_PRCMU
and the platform has to provide a mapping of GPIO-states
to target volts/amps.
++++ config REGULATOR_HI6421
++++ tristate "HiSilicon Hi6421 PMIC voltage regulator support"
++++ depends on MFD_HI6421_PMIC && OF
++++ help
++++ This driver provides support for the voltage regulators on the
++++ HiSilicon Hi6421 PMU / Codec IC.
++++ Hi6421 is a multi-function device which, on regulator part, provides
++++ 21 general purpose LDOs, 3 dedicated LDOs, and 5 BUCKs. All
++++ of them come with support to either ECO (idle) or sleep mode.
++++
+++++ config REGULATOR_ISL9305
+++++ tristate "Intersil ISL9305 regulator"
+++++ depends on I2C
+++++ select REGMAP_I2C
+++++ help
+++++ This driver supports ISL9305 voltage regulator chip.
+++++
config REGULATOR_ISL6271A
tristate "Intersil ISL6271A Power regulator"
depends on I2C
Say y here to support the regulators found on the Freescale
PFUZE100/PFUZE200 PMIC.
+ ++++config REGULATOR_PWM
+ ++++ tristate "PWM voltage regulator"
+ ++++ depends on PWM
+ ++++ help
+ ++++ This driver supports PWM controlled voltage regulators. PWM
+ ++++ duty cycle can increase or decrease the voltage.
+ ++++
+ ++++config REGULATOR_QCOM_RPM
+ ++++ tristate "Qualcomm RPM regulator driver"
+ ++++ depends on MFD_QCOM_RPM
+ ++++ help
+ ++++ If you say yes to this option, support will be included for the
+ ++++ regulators exposed by the Resource Power Manager found in Qualcomm
+ ++++ 8660, 8960 and 8064 based devices.
+ ++++
+ ++++ Say M here if you want to include support for the regulators on the
+ ++++ Qualcomm RPM as a module. The module will be named
+ ++++ "qcom_rpm-regulator".
+ ++++
config REGULATOR_RC5T583
tristate "RICOH RC5T583 Power regulators"
depends on MFD_RC5T583
via I2C bus. S5M8767A have 9 Bucks and 28 LDOs output and
supports DVS mode with 8bits of output voltage control.
- ----config REGULATOR_ST_PWM
- ---- tristate "STMicroelectronics PWM voltage regulator"
- ---- depends on ARCH_STI
+ ++++config REGULATOR_SKY81452
+ ++++ tristate "Skyworks Solutions SKY81452 voltage regulator"
+ ++++ depends on SKY81452
help
- ---- This driver supports ST's PWM controlled voltage regulators.
+ ++++ This driver supports Skyworks SKY81452 voltage output regulator
+ ++++ via I2C bus. SKY81452 has one voltage linear regulator can be
+ ++++ programmed from 4.5V to 20V.
+ ++++
+ ++++ This driver can also be built as a module. If so, the module
+ ++++ will be called sky81452-regulator.
config REGULATOR_TI_ABB
tristate "TI Adaptive Body Bias on-chip LDO"
obj-$(CONFIG_REGULATOR_DB8500_PRCMU) += db8500-prcmu.o
obj-$(CONFIG_REGULATOR_FAN53555) += fan53555.o
obj-$(CONFIG_REGULATOR_GPIO) += gpio-regulator.o
++++ obj-$(CONFIG_REGULATOR_HI6421) += hi6421-regulator.o
obj-$(CONFIG_REGULATOR_ISL6271A) += isl6271a-regulator.o
+++++ obj-$(CONFIG_REGULATOR_ISL9305) += isl9305.o
obj-$(CONFIG_REGULATOR_LP3971) += lp3971.o
obj-$(CONFIG_REGULATOR_LP3972) += lp3972.o
obj-$(CONFIG_REGULATOR_LP872X) += lp872x.o
obj-$(CONFIG_REGULATOR_MC13783) += mc13783-regulator.o
obj-$(CONFIG_REGULATOR_MC13892) += mc13892-regulator.o
obj-$(CONFIG_REGULATOR_MC13XXX_CORE) += mc13xxx-regulator-core.o
+ ++++obj-$(CONFIG_REGULATOR_QCOM_RPM) += qcom_rpm-regulator.o
obj-$(CONFIG_REGULATOR_PALMAS) += palmas-regulator.o
obj-$(CONFIG_REGULATOR_PFUZE100) += pfuze100-regulator.o
+ ++++obj-$(CONFIG_REGULATOR_PWM) += pwm-regulator.o
obj-$(CONFIG_REGULATOR_TPS51632) += tps51632-regulator.o
obj-$(CONFIG_REGULATOR_PBIAS) += pbias-regulator.o
obj-$(CONFIG_REGULATOR_PCAP) += pcap-regulator.o
obj-$(CONFIG_REGULATOR_S2MPA01) += s2mpa01.o
obj-$(CONFIG_REGULATOR_S2MPS11) += s2mps11.o
obj-$(CONFIG_REGULATOR_S5M8767) += s5m8767.o
- ----obj-$(CONFIG_REGULATOR_ST_PWM) += st-pwm.o
+ ++++obj-$(CONFIG_REGULATOR_SKY81452) += sky81452-regulator.o
obj-$(CONFIG_REGULATOR_STW481X_VMMC) += stw481x-vmmc.o
obj-$(CONFIG_REGULATOR_TI_ABB) += ti-abb-regulator.o
obj-$(CONFIG_REGULATOR_TPS6105X) += tps6105x-regulator.o
static int machine_constraints_voltage(struct regulator_dev *rdev,
struct regulation_constraints *constraints)
{
-- - struct regulator_ops *ops = rdev->desc->ops;
++ + const struct regulator_ops *ops = rdev->desc->ops;
int ret;
/* do we need to apply the constraint voltage */
static int machine_constraints_current(struct regulator_dev *rdev,
struct regulation_constraints *constraints)
{
-- - struct regulator_ops *ops = rdev->desc->ops;
++ + const struct regulator_ops *ops = rdev->desc->ops;
int ret;
if (!constraints->min_uA && !constraints->max_uA)
const struct regulation_constraints *constraints)
{
int ret = 0;
-- - struct regulator_ops *ops = rdev->desc->ops;
++ + const struct regulator_ops *ops = rdev->desc->ops;
if (constraints)
rdev->constraints = kmemdup(constraints, sizeof(*constraints),
return 0;
}
++ + /**
++ + * _regulator_enable_delay - a delay helper function
++ + * @delay: time to delay in microseconds
++ + *
++ + * Delay for the requested amount of time as per the guidelines in:
++ + *
++ + * Documentation/timers/timers-howto.txt
++ + *
++ + * The assumption here is that regulators will never be enabled in
++ + * atomic context and therefore sleeping functions can be used.
++ + */
++ + static void _regulator_enable_delay(unsigned int delay)
++ + {
++ + unsigned int ms = delay / 1000;
++ + unsigned int us = delay % 1000;
++ +
++ + if (ms > 0) {
++ + /*
++ + * For small enough values, handle super-millisecond
++ + * delays in the usleep_range() call below.
++ + */
++ + if (ms < 20)
++ + us += ms * 1000;
++ + else
++ + msleep(ms);
++ + }
++ +
++ + /*
++ + * Give the scheduler some room to coalesce with any other
++ + * wakeup sources. For delays shorter than 10 us, don't even
++ + * bother setting up high-resolution timers and just busy-
++ + * loop.
++ + */
++ + if (us >= 10)
++ + usleep_range(us, us + 100);
++ + else
++ + udelay(us);
++ + }
++ +
static int _regulator_do_enable(struct regulator_dev *rdev)
{
int ret, delay;
trace_regulator_enable(rdev_get_name(rdev));
++ + if (rdev->desc->off_on_delay) {
++ + /* if needed, keep a distance of off_on_delay from last time
++ + * this regulator was disabled.
++ + */
++ + unsigned long start_jiffy = jiffies;
++ + unsigned long intended, max_delay, remaining;
++ +
++ + max_delay = usecs_to_jiffies(rdev->desc->off_on_delay);
++ + intended = rdev->last_off_jiffy + max_delay;
++ +
++ + if (time_before(start_jiffy, intended)) {
++ + /* calc remaining jiffies to deal with one-time
++ + * timer wrapping.
++ + * in case of multiple timer wrapping, either it can be
++ + * detected by out-of-range remaining, or it cannot be
++ + * detected and we gets a panelty of
++ + * _regulator_enable_delay().
++ + */
++ + remaining = intended - start_jiffy;
++ + if (remaining <= max_delay)
++ + _regulator_enable_delay(
++ + jiffies_to_usecs(remaining));
++ + }
++ + }
++ +
if (rdev->ena_pin) {
ret = regulator_ena_gpio_ctrl(rdev, true);
if (ret < 0)
* together. */
trace_regulator_enable_delay(rdev_get_name(rdev));
-- - /*
-- - * Delay for the requested amount of time as per the guidelines in:
-- - *
-- - * Documentation/timers/timers-howto.txt
-- - *
-- - * The assumption here is that regulators will never be enabled in
-- - * atomic context and therefore sleeping functions can be used.
-- - */
-- - if (delay) {
-- - unsigned int ms = delay / 1000;
-- - unsigned int us = delay % 1000;
-- -
-- - if (ms > 0) {
-- - /*
-- - * For small enough values, handle super-millisecond
-- - * delays in the usleep_range() call below.
-- - */
-- - if (ms < 20)
-- - us += ms * 1000;
-- - else
-- - msleep(ms);
-- - }
-- -
-- - /*
-- - * Give the scheduler some room to coalesce with any other
-- - * wakeup sources. For delays shorter than 10 us, don't even
-- - * bother setting up high-resolution timers and just busy-
-- - * loop.
-- - */
-- - if (us >= 10)
-- - usleep_range(us, us + 100);
-- - else
-- - udelay(us);
-- - }
++ + _regulator_enable_delay(delay);
trace_regulator_enable_complete(rdev_get_name(rdev));
return ret;
}
++ + /* cares about last_off_jiffy only if off_on_delay is required by
++ + * device.
++ + */
++ + if (rdev->desc->off_on_delay)
++ + rdev->last_off_jiffy = jiffies;
++ +
trace_regulator_disable_complete(rdev_get_name(rdev));
return 0;
*/
int regulator_list_voltage(struct regulator *regulator, unsigned selector)
{
-- - struct regulator_dev *rdev = regulator->rdev;
-- - struct regulator_ops *ops = rdev->desc->ops;
-- - int ret;
++ + struct regulator_dev *rdev = regulator->rdev;
++ + const struct regulator_ops *ops = rdev->desc->ops;
++ + int ret;
if (rdev->desc->fixed_uV && rdev->desc->n_voltages == 1 && !selector)
return rdev->desc->fixed_uV;
unsigned *vsel_reg,
unsigned *vsel_mask)
{
-- --- struct regulator_dev *rdev = regulator->rdev;
-- --- struct regulator_ops *ops = rdev->desc->ops;
++ +++ struct regulator_dev *rdev = regulator->rdev;
++ +++ const struct regulator_ops *ops = rdev->desc->ops;
if (ops->set_voltage_sel != regulator_set_voltage_sel_regmap)
return -EOPNOTSUPP;
int regulator_list_hardware_vsel(struct regulator *regulator,
unsigned selector)
{
-- --- struct regulator_dev *rdev = regulator->rdev;
-- --- struct regulator_ops *ops = rdev->desc->ops;
++ +++ struct regulator_dev *rdev = regulator->rdev;
++ +++ const struct regulator_ops *ops = rdev->desc->ops;
if (selector >= rdev->desc->n_voltages)
return -EINVAL;
int regulator_set_voltage_time(struct regulator *regulator,
int old_uV, int new_uV)
{
-- - struct regulator_dev *rdev = regulator->rdev;
-- - struct regulator_ops *ops = rdev->desc->ops;
++ + struct regulator_dev *rdev = regulator->rdev;
++ + const struct regulator_ops *ops = rdev->desc->ops;
int old_sel = -1;
int new_sel = -1;
int voltage;
*/
static int add_regulator_attributes(struct regulator_dev *rdev)
{
-- - struct device *dev = &rdev->dev;
-- - struct regulator_ops *ops = rdev->desc->ops;
-- - int status = 0;
++ + struct device *dev = &rdev->dev;
++ + const struct regulator_ops *ops = rdev->desc->ops;
++ + int status = 0;
/* some attributes need specific methods to be displayed */
if ((ops->get_voltage && ops->get_voltage(rdev) >= 0) ||
return ERR_PTR(-EINVAL);
}
----- init_data = config->init_data;
-----
rdev = kzalloc(sizeof(struct regulator_dev), GFP_KERNEL);
if (rdev == NULL)
return ERR_PTR(-ENOMEM);
+++++ init_data = regulator_of_get_init_data(dev, regulator_desc,
+++++ &rdev->dev.of_node);
+++++ if (!init_data) {
+++++ init_data = config->init_data;
+++++ rdev->dev.of_node = of_node_get(config->of_node);
+++++ }
+++++
mutex_lock(®ulator_list_mutex);
mutex_init(&rdev->mutex);
/* register with sysfs */
rdev->dev.class = ®ulator_class;
----- rdev->dev.of_node = of_node_get(config->of_node);
rdev->dev.parent = dev;
dev_set_name(&rdev->dev, "regulator.%d",
atomic_inc_return(®ulator_no) - 1);
static int __init regulator_init_complete(void)
{
struct regulator_dev *rdev;
-- - struct regulator_ops *ops;
++ + const struct regulator_ops *ops;
struct regulation_constraints *c;
int enabled, ret;
*
* @name: Identifying name for the regulator.
* @supply_name: Identifying the regulator supply
+++++ * @of_match: Name used to identify regulator in DT.
+++++ * @regulators_node: Name of node containing regulator definitions in DT.
* @id: Numerical identifier for the regulator.
* @ops: Regulator operations table.
* @irq: Interrupt number for the regulator.
* @linear_min_sel: Minimal selector for starting linear mapping
* @fixed_uV: Fixed voltage of rails.
* @ramp_delay: Time to settle down after voltage change (unit: uV/us)
+++++ * @linear_ranges: A constant table of possible voltage ranges.
+++++ * @n_linear_ranges: Number of entries in the @linear_ranges table.
* @volt_table: Voltage mapping table (if table based mapping)
*
* @vsel_reg: Register for selector when using regulator_regmap_X_voltage_
* @bypass_val_off: Disabling value for control when using regmap set_bypass
*
* @enable_time: Time taken for initial enable of regulator (in uS).
++ + * @off_on_delay: guard time (in uS), before re-enabling a regulator
*/
struct regulator_desc {
const char *name;
const char *supply_name;
+++++ const char *of_match;
+++++ const char *regulators_node;
int id;
bool continuous_voltage_range;
unsigned n_voltages;
-- - struct regulator_ops *ops;
++ + const struct regulator_ops *ops;
int irq;
enum regulator_type type;
struct module *owner;
unsigned int bypass_val_off;
unsigned int enable_time;
++ +
++ + unsigned int off_on_delay;
};
/**
struct regulator_enable_gpio *ena_pin;
unsigned int ena_gpio_state:1;
++ +
++ + /* time when this regulator was disabled last time */
++ + unsigned long last_off_jiffy;
};
struct regulator_dev *