]> Git Repo - linux.git/commitdiff
Merge remote-tracking branches 'regulator/topic/drivers', 'regulator/topic/enable...
authorMark Brown <[email protected]>
Tue, 30 Sep 2014 12:50:27 +0000 (13:50 +0100)
committerMark Brown <[email protected]>
Tue, 30 Sep 2014 12:50:27 +0000 (13:50 +0100)
1  2  3  4  5  6 
drivers/regulator/Kconfig
drivers/regulator/Makefile
drivers/regulator/core.c
include/linux/regulator/driver.h

index 1344aa83b438eeca1e3fd9c4515fbe870b2887c4,72fb9500f4101bcbaa36d1b2f5b9ede0fc84d9cc,2dc8289e5dba772be498e084505c72d89491b3fb,2dc8289e5dba772be498e084505c72d89491b3fb,e6b98ed4c12fc9f34971474754d5a350d343cf01,e0ee40054c8db0ee1e17af4bb662cefdca618739..40eab775047e41cb0bdf962752ce891fef5740e0
@@@@@@@ -199,14 -199,13 -199,13 -199,13 -199,13 -199,13 +199,14 @@@@@@@ config REGULATOR_DA921
          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
@@@@@@@ -241,6 -240,6 -240,6 -240,6 -240,16 -240,23 +241,23 @@@@@@@ config REGULATOR_GPI
          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
@@@@@@@ -450,6 -449,25 -449,6 -449,6 -459,6 -466,6 +467,25 @@@@@@@ config REGULATOR_PFUZE10
          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
@@@@@@@ -484,11 -502,16 -483,11 -483,11 -493,11 -500,11 +520,16 @@@@@@@ config REGULATOR_S5M876
         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"
index aa4a6aa7b55827b4dab12789e40b97c5443ee8a0,a4d81ec024eac144f765dfd643b7456a60450f18,aa4a6aa7b55827b4dab12789e40b97c5443ee8a0,aa4a6aa7b55827b4dab12789e40b97c5443ee8a0,5513e2c141b11bff477c45fa7ce0d551970b9043,e12fee8c943ba7ab5c397a713aac2d7018d04e88..662834856c3769908f7e360258e47b78682a328e
@@@@@@@ -32,7 -32,7 -32,7 -32,7 -32,8 -32,9 +32,9 @@@@@@@ obj-$(CONFIG_REGULATOR_DBX500_PRCMU) +
      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
@@@@@@@ -55,8 -55,10 -55,8 -55,8 -56,8 -57,8 +57,10 @@@@@@@ obj-$(CONFIG_REGULATOR_MAX77693) += max
      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
@@@@@@@ -65,7 -67,7 -65,7 -65,7 -66,7 -67,7 +69,7 @@@@@@@ obj-$(CONFIG_REGULATOR_RC5T583)  += rc5
      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
diff --combined drivers/regulator/core.c
index a3c3785901f55b72c52db9ad4a2db3c4313dfaf2,a3c3785901f55b72c52db9ad4a2db3c4313dfaf2,7bce7158d7e6267c166c0b7b02ef787db4cd7bbc,a3c3785901f55b72c52db9ad4a2db3c4313dfaf2,1e976b6320a27978ba7a72fbfe1be060f92109ae,75aa49085763602c1b1b19ed55fb23a2d00ecd4f..44b4045b98d802b9aad993628c43c39d5e88614b
@@@@@@@ -839,7 -839,7 -839,7 -839,7 -839,7 -839,7 +839,7 @@@@@@@ static void print_constraints(struct re
      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)
@@@@@@@ -982,7 -982,7 -982,7 -982,7 -982,7 -982,7 +982,7 @@@@@@@ static int set_machine_constraints(stru
        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),
@@@@@@@ -1759,6 -1759,6 -1759,45 -1759,6 -1759,45 -1759,45 +1759,45 @@@@@@@ static int regulator_ena_gpio_ctrl(stru
        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));
      
@@@@@@@ -1919,6 -1919,6 -1950,12 -1919,6 -1950,12 -1950,12 +1950,12 @@@@@@@ static int _regulator_do_disable(struc
                        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;
@@@@@@@ -2208,9 -2208,9 -2245,9 -2208,9 -2245,9 -2245,9 +2245,9 @@@@@@@ EXPORT_SYMBOL_GPL(regulator_count_volta
       */
      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;
@@@@@@@ -2270,8 -2270,8 -2307,8 -2270,8 -2307,8 -2307,8 +2307,8 @@@@@@@ int regulator_get_hardware_vsel_registe
                                         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;
@@@@@@@ -2297,8 -2297,8 -2334,8 -2297,8 -2334,8 -2334,8 +2334,8 @@@@@@@ EXPORT_SYMBOL_GPL(regulator_get_hardwar
      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;
@@@@@@@ -2572,8 -2572,8 -2609,8 -2572,8 -2609,8 -2609,8 +2609,8 @@@@@@@ EXPORT_SYMBOL_GPL(regulator_set_voltage
      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;
@@@@@@@ -3336,9 -3336,9 -3373,9 -3336,9 -3373,9 -3373,9 +3373,9 @@@@@@@ EXPORT_SYMBOL_GPL(regulator_mode_to_sta
       */
      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) ||
@@@@@@@ -3516,12 -3516,12 -3553,12 -3516,12 -3553,12 -3553,17 +3553,17 @@@@@@@ regulator_register(const struct regulat
                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(&regulator_list_mutex);
      
        mutex_init(&rdev->mutex);
      
        /* register with sysfs */
        rdev->dev.class = &regulator_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(&regulator_no) - 1);
@@@@@@@ -3905,7 -3905,7 -3942,7 -3905,7 -3942,7 -3946,7 +3946,7 @@@@@@@ core_initcall(regulator_init)
      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;
      
index 4efa1ed8a2b0b92ebdd7160948e45b79b0e19fdf,bbe03a1924c04182be79d128854557ebb262b6e3,efe058f8f746fc5ec3fd7ba193391ee529a574a6,bbe03a1924c04182be79d128854557ebb262b6e3,efe058f8f746fc5ec3fd7ba193391ee529a574a6,18f7017deaa50f7ea72454c6385016048a05b2a4..fc0ee0ce8325e1162b95034d00721d7f6dcf3764
@@@@@@@ -203,6 -203,6 -203,6 -203,6 -203,6 -203,8 +203,8 @@@@@@@ enum regulator_type 
       *
       * @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;
      };
      
      /**
@@@@@@@ -350,6 -348,6 -351,9 -348,6 -351,9 -355,9 +357,9 @@@@@@@ struct regulator_dev 
      
        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 *
This page took 0.150766 seconds and 4 git commands to generate.