]> Git Repo - linux.git/commitdiff
Merge tag 'regulator-v3.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <[email protected]>
Mon, 29 Dec 2014 21:24:38 +0000 (13:24 -0800)
committerLinus Torvalds <[email protected]>
Mon, 29 Dec 2014 21:24:38 +0000 (13:24 -0800)
Pull one regulator fix from Mark Brown:
 "One fix here, a fix for the voltage mapping on one of the s2mps11
  regulators which broke systems using it including apparently the
  Gear 2 smartwatches"

* tag 'regulator-v3.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
  regulator: s2mps11: Fix dw_mmc failure on Gear 2

1  2 
drivers/regulator/s2mps11.c

index c1444c3d84c2823a8b4eaed28e9bf5036290ce26,697be114e21a893f7b01e8fe56ff7dde081a11b4..2809ae0d6bcd9848bd15cbc8d4d45e69df1601a3
@@@ -30,7 -30,6 +30,7 @@@
  #include <linux/of_gpio.h>
  #include <linux/mfd/samsung/core.h>
  #include <linux/mfd/samsung/s2mps11.h>
 +#include <linux/mfd/samsung/s2mps13.h>
  #include <linux/mfd/samsung/s2mps14.h>
  #include <linux/mfd/samsung/s2mpu02.h>
  
@@@ -46,10 -45,10 +46,10 @@@ struct s2mps11_info 
        enum sec_device_type dev_type;
  
        /*
 -       * One bit for each S2MPS14/S2MPU02 regulator whether the suspend mode
 -       * was enabled.
 +       * One bit for each S2MPS13/S2MPS14/S2MPU02 regulator whether
 +       * the suspend mode was enabled.
         */
 -      unsigned long long s2mps14_suspend_state:35;
 +      unsigned long long s2mps14_suspend_state:50;
  
        /* Array of size rdev_num with GPIO-s for external sleep control */
        int *ext_control_gpio;
@@@ -370,101 -369,12 +370,101 @@@ static const struct regulator_desc s2mp
        regulator_desc_s2mps11_buck6_10(10, MIN_750_MV, STEP_12_5_MV),
  };
  
 +static struct regulator_ops s2mps14_reg_ops;
 +
 +#define regulator_desc_s2mps13_ldo(num, min, step, min_sel) { \
 +      .name           = "LDO"#num,                            \
 +      .id             = S2MPS13_LDO##num,                     \
 +      .ops            = &s2mps14_reg_ops,                     \
 +      .type           = REGULATOR_VOLTAGE,                    \
 +      .owner          = THIS_MODULE,                          \
 +      .min_uV         = min,                                  \
 +      .uV_step        = step,                                 \
 +      .linear_min_sel = min_sel,                              \
 +      .n_voltages     = S2MPS14_LDO_N_VOLTAGES,               \
 +      .vsel_reg       = S2MPS13_REG_L1CTRL + num - 1,         \
 +      .vsel_mask      = S2MPS14_LDO_VSEL_MASK,                \
 +      .enable_reg     = S2MPS13_REG_L1CTRL + num - 1,         \
 +      .enable_mask    = S2MPS14_ENABLE_MASK                   \
 +}
 +
 +#define regulator_desc_s2mps13_buck(num, min, step, min_sel) {        \
 +      .name           = "BUCK"#num,                           \
 +      .id             = S2MPS13_BUCK##num,                    \
 +      .ops            = &s2mps14_reg_ops,                     \
 +      .type           = REGULATOR_VOLTAGE,                    \
 +      .owner          = THIS_MODULE,                          \
 +      .min_uV         = min,                                  \
 +      .uV_step        = step,                                 \
 +      .linear_min_sel = min_sel,                              \
 +      .n_voltages     = S2MPS14_BUCK_N_VOLTAGES,              \
 +      .ramp_delay     = S2MPS13_BUCK_RAMP_DELAY,              \
 +      .vsel_reg       = S2MPS13_REG_B1OUT + (num - 1) * 2,    \
 +      .vsel_mask      = S2MPS14_BUCK_VSEL_MASK,               \
 +      .enable_reg     = S2MPS13_REG_B1CTRL + (num - 1) * 2,   \
 +      .enable_mask    = S2MPS14_ENABLE_MASK                   \
 +}
 +
 +static const struct regulator_desc s2mps13_regulators[] = {
 +      regulator_desc_s2mps13_ldo(1,  MIN_800_MV,  STEP_12_5_MV, 0x00),
 +      regulator_desc_s2mps13_ldo(2,  MIN_1400_MV, STEP_50_MV,   0x0C),
 +      regulator_desc_s2mps13_ldo(3,  MIN_1000_MV, STEP_25_MV,   0x08),
 +      regulator_desc_s2mps13_ldo(4,  MIN_800_MV,  STEP_12_5_MV, 0x00),
 +      regulator_desc_s2mps13_ldo(5,  MIN_800_MV,  STEP_12_5_MV, 0x00),
 +      regulator_desc_s2mps13_ldo(6,  MIN_800_MV,  STEP_12_5_MV, 0x00),
 +      regulator_desc_s2mps13_ldo(7,  MIN_1000_MV, STEP_25_MV,   0x08),
 +      regulator_desc_s2mps13_ldo(8,  MIN_1000_MV, STEP_25_MV,   0x08),
 +      regulator_desc_s2mps13_ldo(9,  MIN_1000_MV, STEP_25_MV,   0x08),
 +      regulator_desc_s2mps13_ldo(10, MIN_1400_MV, STEP_50_MV,   0x0C),
 +      regulator_desc_s2mps13_ldo(11, MIN_800_MV,  STEP_25_MV,   0x10),
 +      regulator_desc_s2mps13_ldo(12, MIN_800_MV,  STEP_25_MV,   0x10),
 +      regulator_desc_s2mps13_ldo(13, MIN_800_MV,  STEP_25_MV,   0x10),
 +      regulator_desc_s2mps13_ldo(14, MIN_800_MV,  STEP_12_5_MV, 0x00),
 +      regulator_desc_s2mps13_ldo(15, MIN_800_MV,  STEP_12_5_MV, 0x00),
 +      regulator_desc_s2mps13_ldo(16, MIN_1400_MV, STEP_50_MV,   0x0C),
 +      regulator_desc_s2mps13_ldo(17, MIN_1400_MV, STEP_50_MV,   0x0C),
 +      regulator_desc_s2mps13_ldo(18, MIN_1000_MV, STEP_25_MV,   0x08),
 +      regulator_desc_s2mps13_ldo(19, MIN_1000_MV, STEP_25_MV,   0x08),
 +      regulator_desc_s2mps13_ldo(20, MIN_1400_MV, STEP_50_MV,   0x0C),
 +      regulator_desc_s2mps13_ldo(21, MIN_1000_MV, STEP_25_MV,   0x08),
 +      regulator_desc_s2mps13_ldo(22, MIN_1000_MV, STEP_25_MV,   0x08),
 +      regulator_desc_s2mps13_ldo(23, MIN_800_MV,  STEP_12_5_MV, 0x00),
 +      regulator_desc_s2mps13_ldo(24, MIN_800_MV,  STEP_12_5_MV, 0x00),
 +      regulator_desc_s2mps13_ldo(25, MIN_1400_MV, STEP_50_MV,   0x0C),
 +      regulator_desc_s2mps13_ldo(26, MIN_1400_MV, STEP_50_MV,   0x0C),
 +      regulator_desc_s2mps13_ldo(27, MIN_1400_MV, STEP_50_MV,   0x0C),
 +      regulator_desc_s2mps13_ldo(28, MIN_1000_MV, STEP_25_MV,   0x08),
 +      regulator_desc_s2mps13_ldo(29, MIN_1400_MV, STEP_50_MV,   0x0C),
 +      regulator_desc_s2mps13_ldo(30, MIN_1400_MV, STEP_50_MV,   0x0C),
 +      regulator_desc_s2mps13_ldo(31, MIN_1000_MV, STEP_25_MV,   0x08),
 +      regulator_desc_s2mps13_ldo(32, MIN_1000_MV, STEP_25_MV,   0x08),
 +      regulator_desc_s2mps13_ldo(33, MIN_1400_MV, STEP_50_MV,   0x0C),
 +      regulator_desc_s2mps13_ldo(34, MIN_1000_MV, STEP_25_MV,   0x08),
 +      regulator_desc_s2mps13_ldo(35, MIN_1400_MV, STEP_50_MV,   0x0C),
 +      regulator_desc_s2mps13_ldo(36, MIN_800_MV,  STEP_12_5_MV, 0x00),
 +      regulator_desc_s2mps13_ldo(37, MIN_1000_MV, STEP_25_MV,   0x08),
 +      regulator_desc_s2mps13_ldo(38, MIN_1400_MV, STEP_50_MV,   0x0C),
 +      regulator_desc_s2mps13_ldo(39, MIN_1000_MV, STEP_25_MV,   0x08),
 +      regulator_desc_s2mps13_ldo(40, MIN_1400_MV, STEP_50_MV,   0x0C),
 +      regulator_desc_s2mps13_buck(1,  MIN_500_MV,  STEP_6_25_MV, 0x10),
 +      regulator_desc_s2mps13_buck(2,  MIN_500_MV,  STEP_6_25_MV, 0x10),
 +      regulator_desc_s2mps13_buck(3,  MIN_500_MV,  STEP_6_25_MV, 0x10),
 +      regulator_desc_s2mps13_buck(4,  MIN_500_MV,  STEP_6_25_MV, 0x10),
 +      regulator_desc_s2mps13_buck(5,  MIN_500_MV,  STEP_6_25_MV, 0x10),
 +      regulator_desc_s2mps13_buck(6,  MIN_500_MV,  STEP_6_25_MV, 0x10),
 +      regulator_desc_s2mps13_buck(7,  MIN_500_MV,  STEP_6_25_MV, 0x10),
 +      regulator_desc_s2mps13_buck(8,  MIN_1000_MV, STEP_12_5_MV, 0x20),
 +      regulator_desc_s2mps13_buck(9,  MIN_1000_MV, STEP_12_5_MV, 0x20),
 +      regulator_desc_s2mps13_buck(10, MIN_500_MV,  STEP_6_25_MV, 0x10),
 +};
 +
  static int s2mps14_regulator_enable(struct regulator_dev *rdev)
  {
        struct s2mps11_info *s2mps11 = rdev_get_drvdata(rdev);
        unsigned int val;
  
        switch (s2mps11->dev_type) {
 +      case S2MPS13X:
        case S2MPS14X:
                if (s2mps11->s2mps14_suspend_state & (1 << rdev_get_id(rdev)))
                        val = S2MPS14_ENABLE_SUSPEND;
@@@ -496,7 -406,6 +496,7 @@@ static int s2mps14_regulator_set_suspen
  
        /* Below LDO should be always on or does not support suspend mode. */
        switch (s2mps11->dev_type) {
 +      case S2MPS13X:
        case S2MPS14X:
                switch (rdev_id) {
                case S2MPS14_LDO3:
@@@ -570,7 -479,7 +570,7 @@@ static struct regulator_ops s2mps14_reg
        .enable_mask    = S2MPS14_ENABLE_MASK           \
  }
  
- #define regulator_desc_s2mps14_buck(num, min, step) {         \
+ #define regulator_desc_s2mps14_buck(num, min, step, min_sel) {        \
        .name           = "BUCK"#num,                           \
        .id             = S2MPS14_BUCK##num,                    \
        .ops            = &s2mps14_reg_ops,                     \
        .min_uV         = min,                                  \
        .uV_step        = step,                                 \
        .n_voltages     = S2MPS14_BUCK_N_VOLTAGES,              \
-       .linear_min_sel = S2MPS14_BUCK1235_START_SEL,           \
+       .linear_min_sel = min_sel,                              \
        .ramp_delay     = S2MPS14_BUCK_RAMP_DELAY,              \
        .vsel_reg       = S2MPS14_REG_B1CTRL2 + (num - 1) * 2,  \
        .vsel_mask      = S2MPS14_BUCK_VSEL_MASK,               \
@@@ -613,11 -522,16 +613,16 @@@ static const struct regulator_desc s2mp
        regulator_desc_s2mps14_ldo(23, MIN_800_MV, STEP_25_MV),
        regulator_desc_s2mps14_ldo(24, MIN_1800_MV, STEP_25_MV),
        regulator_desc_s2mps14_ldo(25, MIN_1800_MV, STEP_25_MV),
-       regulator_desc_s2mps14_buck(1, MIN_600_MV, STEP_6_25_MV),
-       regulator_desc_s2mps14_buck(2, MIN_600_MV, STEP_6_25_MV),
-       regulator_desc_s2mps14_buck(3, MIN_600_MV, STEP_6_25_MV),
-       regulator_desc_s2mps14_buck(4, MIN_1400_MV, STEP_12_5_MV),
-       regulator_desc_s2mps14_buck(5, MIN_600_MV, STEP_6_25_MV),
+       regulator_desc_s2mps14_buck(1, MIN_600_MV, STEP_6_25_MV,
+                                   S2MPS14_BUCK1235_START_SEL),
+       regulator_desc_s2mps14_buck(2, MIN_600_MV, STEP_6_25_MV,
+                                   S2MPS14_BUCK1235_START_SEL),
+       regulator_desc_s2mps14_buck(3, MIN_600_MV, STEP_6_25_MV,
+                                   S2MPS14_BUCK1235_START_SEL),
+       regulator_desc_s2mps14_buck(4, MIN_1400_MV, STEP_12_5_MV,
+                                   S2MPS14_BUCK4_START_SEL),
+       regulator_desc_s2mps14_buck(5, MIN_600_MV, STEP_6_25_MV,
+                                   S2MPS14_BUCK1235_START_SEL),
  };
  
  static int s2mps14_pmic_enable_ext_control(struct s2mps11_info *s2mps11,
@@@ -922,10 -836,6 +927,10 @@@ static int s2mps11_pmic_probe(struct pl
                s2mps11->rdev_num = ARRAY_SIZE(s2mps11_regulators);
                regulators = s2mps11_regulators;
                break;
 +      case S2MPS13X:
 +              s2mps11->rdev_num = ARRAY_SIZE(s2mps13_regulators);
 +              regulators = s2mps13_regulators;
 +              break;
        case S2MPS14X:
                s2mps11->rdev_num = ARRAY_SIZE(s2mps14_regulators);
                regulators = s2mps14_regulators;
                return -EINVAL;
        };
  
 -      s2mps11->ext_control_gpio = devm_kzalloc(&pdev->dev,
 +      s2mps11->ext_control_gpio = devm_kmalloc(&pdev->dev,
                        sizeof(*s2mps11->ext_control_gpio) * s2mps11->rdev_num,
                        GFP_KERNEL);
        if (!s2mps11->ext_control_gpio)
@@@ -981,7 -891,6 +986,7 @@@ common_reg
        config.regmap = iodev->regmap_pmic;
        config.driver_data = s2mps11;
        config.ena_gpio_flags = GPIOF_OUT_INIT_HIGH;
 +      config.ena_gpio_initialized = true;
        for (i = 0; i < s2mps11->rdev_num; i++) {
                struct regulator_dev *regulator;
  
@@@ -1023,7 -932,6 +1028,7 @@@ out
  
  static const struct platform_device_id s2mps11_pmic_id[] = {
        { "s2mps11-pmic", S2MPS11X},
 +      { "s2mps13-pmic", S2MPS13X},
        { "s2mps14-pmic", S2MPS14X},
        { "s2mpu02-pmic", S2MPU02},
        { },
@@@ -1033,6 -941,7 +1038,6 @@@ MODULE_DEVICE_TABLE(platform, s2mps11_p
  static struct platform_driver s2mps11_pmic_driver = {
        .driver = {
                .name = "s2mps11-pmic",
 -              .owner = THIS_MODULE,
        },
        .probe = s2mps11_pmic_probe,
        .id_table = s2mps11_pmic_id,
This page took 0.068085 seconds and 4 git commands to generate.