Merge remote-tracking branch 'regulator/topic/linear' into regulator-next
authorMark Brown <broonie@linaro.org>
Thu, 24 Oct 2013 10:11:37 +0000 (11:11 +0100)
committerMark Brown <broonie@linaro.org>
Thu, 24 Oct 2013 10:11:37 +0000 (11:11 +0100)
1  2 
drivers/regulator/as3711-regulator.c
drivers/regulator/da903x.c
drivers/regulator/tps65217-regulator.c
drivers/regulator/tps65912-regulator.c
drivers/regulator/wm831x-ldo.c
drivers/regulator/wm8350-regulator.c
drivers/regulator/wm8400-regulator.c
include/linux/regulator/driver.h

index fb27e6c8887c53227245651814423b4d4cf8d547,f8524f988bdc810365468f5a65f290d89015baa4..c77a58478cca6b11ffd2c5a69990eddda1900230
@@@ -117,26 -117,19 +117,19 @@@ static struct regulator_ops as3711_dldo
  };
  
  static const struct regulator_linear_range as3711_sd_ranges[] = {
-       { .min_uV = 612500, .max_uV = 1400000,
-         .min_sel = 0x1, .max_sel = 0x40, .uV_step = 12500 },
-       { .min_uV = 1425000, .max_uV = 2600000,
-         .min_sel = 0x41, .max_sel = 0x70, .uV_step = 25000 },
-       { .min_uV = 2650000, .max_uV = 3350000,
-         .min_sel = 0x71, .max_sel = 0x7f, .uV_step = 50000 },
+       REGULATOR_LINEAR_RANGE(612500, 0x1, 0x40, 12500),
+       REGULATOR_LINEAR_RANGE(1425000, 0x41, 0x70, 25000),
+       REGULATOR_LINEAR_RANGE(2650000, 0x71, 0x7f, 50000),
  };
  
  static const struct regulator_linear_range as3711_aldo_ranges[] = {
-       { .min_uV = 1200000, .max_uV = 1950000,
-         .min_sel = 0, .max_sel = 0xf, .uV_step = 50000 },
-       { .min_uV = 1800000, .max_uV = 3300000,
-         .min_sel = 0x10, .max_sel = 0x1f, .uV_step = 100000 },
+       REGULATOR_LINEAR_RANGE(1200000, 0, 0xf, 50000),
+       REGULATOR_LINEAR_RANGE(1800000, 0x10, 0x1f, 100000),
  };
  
  static const struct regulator_linear_range as3711_dldo_ranges[] = {
-       { .min_uV = 900000, .max_uV = 1700000,
-         .min_sel = 0, .max_sel = 0x10, .uV_step = 50000 },
-       { .min_uV = 1750000, .max_uV = 3300000,
-         .min_sel = 0x20, .max_sel = 0x3f, .uV_step = 50000 },
+       REGULATOR_LINEAR_RANGE(900000, 0, 0x10, 50000),
+       REGULATOR_LINEAR_RANGE(1750000, 0x20, 0x3f, 50000),
  };
  
  #define AS3711_REG(_id, _en_reg, _en_bit, _vmask, _vshift, _min_uV, _max_uV, _sfx)    \
@@@ -273,16 -266,33 +266,16 @@@ static int as3711_regulator_probe(struc
                config.regmap = as3711->regmap;
                config.of_node = of_node[id];
  
 -              rdev = regulator_register(&ri->desc, &config);
 +              rdev = devm_regulator_register(&pdev->dev, &ri->desc, &config);
                if (IS_ERR(rdev)) {
                        dev_err(&pdev->dev, "Failed to register regulator %s\n",
                                ri->desc.name);
 -                      ret = PTR_ERR(rdev);
 -                      goto eregreg;
 +                      return PTR_ERR(rdev);
                }
                reg->rdev = rdev;
        }
        platform_set_drvdata(pdev, regs);
        return 0;
 -
 -eregreg:
 -      while (--id >= 0)
 -              regulator_unregister(regs[id].rdev);
 -
 -      return ret;
 -}
 -
 -static int as3711_regulator_remove(struct platform_device *pdev)
 -{
 -      struct as3711_regulator *regs = platform_get_drvdata(pdev);
 -      int id;
 -
 -      for (id = 0; id < AS3711_REGULATOR_NUM; ++id)
 -              regulator_unregister(regs[id].rdev);
 -      return 0;
  }
  
  static struct platform_driver as3711_regulator_driver = {
                .owner  = THIS_MODULE,
        },
        .probe          = as3711_regulator_probe,
 -      .remove         = as3711_regulator_remove,
  };
  
  static int __init as3711_regulator_init(void)
index c61d96e9d9255ef3b533492d0c376b3b249fc746,6d1b799ad86bf10b4575e4cb3d9974f9d8341e98..b431ae357fcd310e062bcb3fdb0ffd864b2f0603
@@@ -253,10 -253,8 +253,8 @@@ static int da9034_set_dvc_voltage_sel(s
  }
  
  static const struct regulator_linear_range da9034_ldo12_ranges[] = {
-       { .min_uV = 1700000, .max_uV = 2050000, .min_sel =  0, .max_sel = 7,
-         .uV_step =  50000 },
-       { .min_uV = 2700000, .max_uV = 3050000, .min_sel =  8, .max_sel = 15,
-         .uV_step =  50000 },
+       REGULATOR_LINEAR_RANGE(1700000, 0, 7, 50000),
+       REGULATOR_LINEAR_RANGE(2700000, 8, 15, 50000),
  };
  
  static struct regulator_ops da903x_regulator_ldo_ops = {
@@@ -463,7 -461,7 +461,7 @@@ static int da903x_regulator_probe(struc
        config.init_data = dev_get_platdata(&pdev->dev);
        config.driver_data = ri;
  
 -      rdev = regulator_register(&ri->desc, &config);
 +      rdev = devm_regulator_register(&pdev->dev, &ri->desc, &config);
        if (IS_ERR(rdev)) {
                dev_err(&pdev->dev, "failed to register regulator %s\n",
                                ri->desc.name);
        return 0;
  }
  
 -static int da903x_regulator_remove(struct platform_device *pdev)
 -{
 -      struct regulator_dev *rdev = platform_get_drvdata(pdev);
 -
 -      regulator_unregister(rdev);
 -      return 0;
 -}
 -
  static struct platform_driver da903x_regulator_driver = {
        .driver = {
                .name   = "da903x-regulator",
                .owner  = THIS_MODULE,
        },
        .probe          = da903x_regulator_probe,
 -      .remove         = da903x_regulator_remove,
  };
  
  static int __init da903x_regulator_init(void)
index 8860379fd6be465059e200845cf27d23c469001c,bbc7277fa0977702cb306fbf33ad1d2bb85d1640..9ea1bf26bd137b4b4e33dcede0c6c1551ff6d79c
@@@ -52,25 -52,17 +52,17 @@@ static const unsigned int LDO1_VSEL_tab
  };
  
  static const struct regulator_linear_range tps65217_uv1_ranges[] = {
-       { .min_uV = 900000, .max_uV = 1500000, .min_sel =  0, .max_sel = 24,
-         .uV_step = 25000 },
-       { .min_uV = 1550000, .max_uV = 1800000, .min_sel = 25, .max_sel = 30,
-         .uV_step = 50000 },
-       { .min_uV = 1850000, .max_uV = 2900000, .min_sel = 31, .max_sel = 52,
-         .uV_step = 50000 },
-       { .min_uV = 3000000, .max_uV = 3200000, .min_sel = 53, .max_sel = 55,
-         .uV_step = 100000 },
-       { .min_uV = 3300000, .max_uV = 3300000, .min_sel = 56, .max_sel = 62,
-         .uV_step = 0 },
+       REGULATOR_LINEAR_RANGE(900000, 0, 24, 25000),
+       REGULATOR_LINEAR_RANGE(1550000, 25, 30, 50000),
+       REGULATOR_LINEAR_RANGE(1850000, 31, 52, 50000),
+       REGULATOR_LINEAR_RANGE(3000000, 53, 55, 100000),
+       REGULATOR_LINEAR_RANGE(3300000, 56, 62, 0),
  };
  
  static const struct regulator_linear_range tps65217_uv2_ranges[] = {
-       { .min_uV = 1500000, .max_uV = 1900000, .min_sel =  0, .max_sel = 8,
-         .uV_step = 50000 },
-       { .min_uV = 2000000, .max_uV = 2400000, .min_sel = 9, .max_sel = 13,
-         .uV_step = 100000 },
-       { .min_uV = 2450000, .max_uV = 3300000, .min_sel = 14, .max_sel = 31,
-         .uV_step = 50000 },
+       REGULATOR_LINEAR_RANGE(1500000, 0, 8, 50000),
+       REGULATOR_LINEAR_RANGE(2000000, 9, 13, 100000),
+       REGULATOR_LINEAR_RANGE(2450000, 14, 31, 50000),
  };
  
  static int tps65217_pmic_enable(struct regulator_dev *dev)
@@@ -233,7 -225,7 +225,7 @@@ static int tps65217_regulator_probe(str
        struct regulator_init_data *reg_data;
        struct regulator_dev *rdev;
        struct regulator_config config = { };
 -      int i, ret;
 +      int i;
  
        if (tps->dev->of_node)
                pdata = tps65217_parse_dt(pdev);
                if (tps->dev->of_node)
                        config.of_node = pdata->of_node[i];
  
 -              rdev = regulator_register(&regulators[i], &config);
 +              rdev = devm_regulator_register(&pdev->dev, &regulators[i],
 +                                             &config);
                if (IS_ERR(rdev)) {
                        dev_err(tps->dev, "failed to register %s regulator\n",
                                pdev->name);
 -                      ret = PTR_ERR(rdev);
 -                      goto err_unregister_regulator;
 +                      return PTR_ERR(rdev);
                }
  
                /* Save regulator for cleanup */
                tps->rdev[i] = rdev;
        }
        return 0;
 -
 -err_unregister_regulator:
 -      while (--i >= 0)
 -              regulator_unregister(tps->rdev[i]);
 -
 -      return ret;
 -}
 -
 -static int tps65217_regulator_remove(struct platform_device *pdev)
 -{
 -      struct tps65217 *tps = platform_get_drvdata(pdev);
 -      unsigned int i;
 -
 -      for (i = 0; i < TPS65217_NUM_REGULATOR; i++)
 -              regulator_unregister(tps->rdev[i]);
 -
 -      return 0;
  }
  
  static struct platform_driver tps65217_regulator_driver = {
                .name = "tps65217-pmic",
        },
        .probe = tps65217_regulator_probe,
 -      .remove = tps65217_regulator_remove,
  };
  
  static int __init tps65217_regulator_init(void)
index 1ed4d049abfe0dde3ee9cbcf5596d0c4059373b1,697eab8e74d82535a4c57f1bd81e700098678e3c..9cafaa0f94555a1e8fef93b4c0171be0aaea969f
@@@ -119,12 -119,9 +119,9 @@@ struct tps65912_reg 
  };
  
  static const struct regulator_linear_range tps65912_ldo_ranges[] = {
-       { .min_uV = 800000, .max_uV = 1600000, .min_sel =  0, .max_sel = 32,
-         .uV_step = 25000 },
-       { .min_uV = 1650000, .max_uV = 3000000, .min_sel = 33, .max_sel = 60,
-         .uV_step = 50000 },
-       { .min_uV = 3100000, .max_uV = 3300000, .min_sel = 61, .max_sel = 63,
-         .uV_step = 100000 },
+       REGULATOR_LINEAR_RANGE(800000, 0, 32, 25000),
+       REGULATOR_LINEAR_RANGE(1650000, 33, 60, 50000),
+       REGULATOR_LINEAR_RANGE(3100000, 61, 63, 100000),
  };
  
  static int tps65912_get_range(struct tps65912_reg *pmic, int id)
@@@ -461,7 -458,7 +458,7 @@@ static int tps65912_probe(struct platfo
        struct regulator_dev *rdev;
        struct tps65912_reg *pmic;
        struct tps65912_board *pmic_plat_data;
 -      int i, err;
 +      int i;
  
        pmic_plat_data = dev_get_platdata(tps65912->dev);
        if (!pmic_plat_data)
                config.init_data = reg_data;
                config.driver_data = pmic;
  
 -              rdev = regulator_register(&pmic->desc[i], &config);
 +              rdev = devm_regulator_register(&pdev->dev, &pmic->desc[i],
 +                                             &config);
                if (IS_ERR(rdev)) {
                        dev_err(tps65912->dev,
                                "failed to register %s regulator\n",
                                pdev->name);
 -                      err = PTR_ERR(rdev);
 -                      goto err;
 +                      return PTR_ERR(rdev);
                }
  
                /* Save regulator for cleanup */
                pmic->rdev[i] = rdev;
        }
        return 0;
 -
 -err:
 -      while (--i >= 0)
 -              regulator_unregister(pmic->rdev[i]);
 -      return err;
 -}
 -
 -static int tps65912_remove(struct platform_device *pdev)
 -{
 -      struct tps65912_reg *tps65912_reg = platform_get_drvdata(pdev);
 -      int i;
 -
 -      for (i = 0; i < TPS65912_NUM_REGULATOR; i++)
 -              regulator_unregister(tps65912_reg->rdev[i]);
 -      return 0;
  }
  
  static struct platform_driver tps65912_driver = {
                .owner = THIS_MODULE,
        },
        .probe = tps65912_probe,
 -      .remove = tps65912_remove,
  };
  
  static int __init tps65912_init(void)
index 482ebe8f47aaeb1f0ca0cfbf071251743935b1e5,9111b651c3534e7e5fe9a0ad35f953432f481611..46d6700467b57007fbb277283207cfbbc4456fc0
@@@ -63,10 -63,8 +63,8 @@@ static irqreturn_t wm831x_ldo_uv_irq(in
   */
  
  static const struct regulator_linear_range wm831x_gp_ldo_ranges[] = {
-       { .min_uV =  900000, .max_uV = 1600000, .min_sel =  0, .max_sel = 14,
-         .uV_step =  50000 },
-       { .min_uV = 1700000, .max_uV = 3300000, .min_sel = 15, .max_sel = 31,
-         .uV_step = 100000 },
+       REGULATOR_LINEAR_RANGE(900000, 0, 14, 50000),
+       REGULATOR_LINEAR_RANGE(1700000, 15, 31, 100000),
  };
  
  static int wm831x_gp_ldo_set_suspend_voltage(struct regulator_dev *rdev,
@@@ -279,8 -277,7 +277,8 @@@ static int wm831x_gp_ldo_probe(struct p
        config.driver_data = ldo;
        config.regmap = wm831x->regmap;
  
 -      ldo->regulator = regulator_register(&ldo->desc, &config);
 +      ldo->regulator = devm_regulator_register(&pdev->dev, &ldo->desc,
 +                                               &config);
        if (IS_ERR(ldo->regulator)) {
                ret = PTR_ERR(ldo->regulator);
                dev_err(wm831x->dev, "Failed to register LDO%d: %d\n",
        }
  
        irq = wm831x_irq(wm831x, platform_get_irq_byname(pdev, "UV"));
 -      ret = request_threaded_irq(irq, NULL, wm831x_ldo_uv_irq,
 -                                 IRQF_TRIGGER_RISING, ldo->name,
 -                                 ldo);
 +      ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
 +                                      wm831x_ldo_uv_irq,
 +                                      IRQF_TRIGGER_RISING, ldo->name,
 +                                      ldo);
        if (ret != 0) {
                dev_err(&pdev->dev, "Failed to request UV IRQ %d: %d\n",
                        irq, ret);
 -              goto err_regulator;
 +              goto err;
        }
  
        platform_set_drvdata(pdev, ldo);
  
        return 0;
  
 -err_regulator:
 -      regulator_unregister(ldo->regulator);
  err:
        return ret;
  }
  
 -static int wm831x_gp_ldo_remove(struct platform_device *pdev)
 -{
 -      struct wm831x_ldo *ldo = platform_get_drvdata(pdev);
 -
 -      free_irq(wm831x_irq(ldo->wm831x,
 -                          platform_get_irq_byname(pdev, "UV")), ldo);
 -      regulator_unregister(ldo->regulator);
 -
 -      return 0;
 -}
 -
  static struct platform_driver wm831x_gp_ldo_driver = {
        .probe = wm831x_gp_ldo_probe,
 -      .remove = wm831x_gp_ldo_remove,
        .driver         = {
                .name   = "wm831x-ldo",
                .owner  = THIS_MODULE,
   */
  
  static const struct regulator_linear_range wm831x_aldo_ranges[] = {
-       { .min_uV = 1000000, .max_uV = 1600000, .min_sel =  0, .max_sel = 12,
-         .uV_step =  50000 },
-       { .min_uV = 1700000, .max_uV = 3500000, .min_sel = 13, .max_sel = 31,
-         .uV_step = 100000 },
+       REGULATOR_LINEAR_RANGE(1000000, 0, 12, 50000),
+       REGULATOR_LINEAR_RANGE(1700000, 13, 31, 100000),
  };
  
  static int wm831x_aldo_set_suspend_voltage(struct regulator_dev *rdev,
@@@ -493,8 -501,7 +489,8 @@@ static int wm831x_aldo_probe(struct pla
        config.driver_data = ldo;
        config.regmap = wm831x->regmap;
  
 -      ldo->regulator = regulator_register(&ldo->desc, &config);
 +      ldo->regulator = devm_regulator_register(&pdev->dev, &ldo->desc,
 +                                               &config);
        if (IS_ERR(ldo->regulator)) {
                ret = PTR_ERR(ldo->regulator);
                dev_err(wm831x->dev, "Failed to register LDO%d: %d\n",
        }
  
        irq = wm831x_irq(wm831x, platform_get_irq_byname(pdev, "UV"));
 -      ret = request_threaded_irq(irq, NULL, wm831x_ldo_uv_irq,
 -                                 IRQF_TRIGGER_RISING, ldo->name, ldo);
 +      ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
 +                                      wm831x_ldo_uv_irq,
 +                                      IRQF_TRIGGER_RISING, ldo->name, ldo);
        if (ret != 0) {
                dev_err(&pdev->dev, "Failed to request UV IRQ %d: %d\n",
                        irq, ret);
 -              goto err_regulator;
 +              goto err;
        }
  
        platform_set_drvdata(pdev, ldo);
  
        return 0;
  
 -err_regulator:
 -      regulator_unregister(ldo->regulator);
  err:
        return ret;
  }
  
 -static int wm831x_aldo_remove(struct platform_device *pdev)
 -{
 -      struct wm831x_ldo *ldo = platform_get_drvdata(pdev);
 -
 -      free_irq(wm831x_irq(ldo->wm831x, platform_get_irq_byname(pdev, "UV")),
 -               ldo);
 -      regulator_unregister(ldo->regulator);
 -
 -      return 0;
 -}
 -
  static struct platform_driver wm831x_aldo_driver = {
        .probe = wm831x_aldo_probe,
 -      .remove = wm831x_aldo_remove,
        .driver         = {
                .name   = "wm831x-aldo",
                .owner  = THIS_MODULE,
@@@ -639,8 -659,7 +635,8 @@@ static int wm831x_alive_ldo_probe(struc
        config.driver_data = ldo;
        config.regmap = wm831x->regmap;
  
 -      ldo->regulator = regulator_register(&ldo->desc, &config);
 +      ldo->regulator = devm_regulator_register(&pdev->dev, &ldo->desc,
 +                                               &config);
        if (IS_ERR(ldo->regulator)) {
                ret = PTR_ERR(ldo->regulator);
                dev_err(wm831x->dev, "Failed to register LDO%d: %d\n",
@@@ -656,8 -675,18 +652,8 @@@ err
        return ret;
  }
  
 -static int wm831x_alive_ldo_remove(struct platform_device *pdev)
 -{
 -      struct wm831x_ldo *ldo = platform_get_drvdata(pdev);
 -
 -      regulator_unregister(ldo->regulator);
 -
 -      return 0;
 -}
 -
  static struct platform_driver wm831x_alive_ldo_driver = {
        .probe = wm831x_alive_ldo_probe,
 -      .remove = wm831x_alive_ldo_remove,
        .driver         = {
                .name   = "wm831x-alive-ldo",
                .owner  = THIS_MODULE,
index 017e8695ca71e2be945a36bd8685f2671a339e27,3827539f3ad7c5e4168b8eb129d724d8ba4ff489..de7b9c73e3fa09f3b14db1c5d8949ca99a37c352
@@@ -543,10 -543,8 +543,8 @@@ static int wm8350_dcdc_set_suspend_mode
  }
  
  static const struct regulator_linear_range wm8350_ldo_ranges[] = {
-       { .min_uV =  900000, .max_uV = 1650000, .min_sel =  0, .max_sel = 15,
-         .uV_step =  50000 },
-       { .min_uV = 1800000, .max_uV = 3300000, .min_sel = 16, .max_sel = 31,
-         .uV_step = 100000 },
+       REGULATOR_LINEAR_RANGE(900000, 0, 15, 50000),
+       REGULATOR_LINEAR_RANGE(1800000, 16, 31, 100000),
  };
  
  static int wm8350_ldo_set_suspend_voltage(struct regulator_dev *rdev, int uV)
@@@ -1206,8 -1204,7 +1204,8 @@@ static int wm8350_regulator_probe(struc
        config.regmap = wm8350->regmap;
  
        /* register regulator */
 -      rdev = regulator_register(&wm8350_reg[pdev->id], &config);
 +      rdev = devm_regulator_register(&pdev->dev, &wm8350_reg[pdev->id],
 +                                     &config);
        if (IS_ERR(rdev)) {
                dev_err(&pdev->dev, "failed to register %s\n",
                        wm8350_reg[pdev->id].name);
        ret = wm8350_register_irq(wm8350, wm8350_reg[pdev->id].irq,
                                  pmic_uv_handler, 0, "UV", rdev);
        if (ret < 0) {
 -              regulator_unregister(rdev);
                dev_err(&pdev->dev, "failed to register regulator %s IRQ\n",
                        wm8350_reg[pdev->id].name);
                return ret;
@@@ -1233,6 -1231,8 +1231,6 @@@ static int wm8350_regulator_remove(stru
  
        wm8350_free_irq(wm8350, wm8350_reg[pdev->id].irq, rdev);
  
 -      regulator_unregister(rdev);
 -
        return 0;
  }
  
index 870b52f709bcf411244adeb77ef241049cdf117c,8eedba2953f9d229501965cfd1481176aedfb703..82d82900085199f738d1555059d396315da6520a
  #include <linux/mfd/wm8400-private.h>
  
  static const struct regulator_linear_range wm8400_ldo_ranges[] = {
-       { .min_uV =  900000, .max_uV = 1600000, .min_sel = 0, .max_sel = 14,
-         .uV_step =  50000 },
-       { .min_uV = 1700000, .max_uV = 3300000, .min_sel = 15, .max_sel = 31,
-         .uV_step = 100000 },
+       REGULATOR_LINEAR_RANGE(900000, 0, 14, 50000),
+       REGULATOR_LINEAR_RANGE(1700000, 15, 31, 100000),
  };
  
  static struct regulator_ops wm8400_ldo_ops = {
@@@ -219,8 -217,7 +217,8 @@@ static int wm8400_regulator_probe(struc
        config.driver_data = wm8400;
        config.regmap = wm8400->regmap;
  
 -      rdev = regulator_register(&regulators[pdev->id], &config);
 +      rdev = devm_regulator_register(&pdev->dev, &regulators[pdev->id],
 +                                     &config);
        if (IS_ERR(rdev))
                return PTR_ERR(rdev);
  
        return 0;
  }
  
 -static int wm8400_regulator_remove(struct platform_device *pdev)
 -{
 -      struct regulator_dev *rdev = platform_get_drvdata(pdev);
 -
 -      regulator_unregister(rdev);
 -
 -      return 0;
 -}
 -
  static struct platform_driver wm8400_regulator_driver = {
        .driver = {
                .name = "wm8400-regulator",
        },
        .probe = wm8400_regulator_probe,
 -      .remove = wm8400_regulator_remove,
  };
  
  /**
index c8b492c6b6a8a2693abbc5ae37c0befe92e61af3,edb11b716dd3bd1d1374fee7f86983b2b8de13c4..9370e65348a40ba5a92620fbfe4cfed4305a3963
@@@ -46,19 -46,26 +46,26 @@@ enum regulator_status 
   * regulator_list_linear_range().
   *
   * @min_uV:  Lowest voltage in range
-  * @max_uV:  Highest voltage in range
   * @min_sel: Lowest selector for range
   * @max_sel: Highest selector for range
   * @uV_step: Step size
   */
  struct regulator_linear_range {
        unsigned int min_uV;
-       unsigned int max_uV;
        unsigned int min_sel;
        unsigned int max_sel;
        unsigned int uV_step;
  };
  
+ /* Initialize struct regulator_linear_range */
+ #define REGULATOR_LINEAR_RANGE(_min_uV, _min_sel, _max_sel, _step_uV) \
+ {                                                                     \
+       .min_uV         = _min_uV,                                      \
+       .min_sel        = _min_sel,                                     \
+       .max_sel        = _max_sel,                                     \
+       .uV_step        = _step_uV,                                     \
+ }
  /**
   * struct regulator_ops - regulator operations.
   *
@@@ -209,7 -216,6 +216,7 @@@ enum regulator_type 
   * @min_uV: Voltage given by the lowest selector (if linear mapping)
   * @uV_step: Voltage increase with each selector (if linear mapping)
   * @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)
   * @volt_table: Voltage mapping table (if table based mapping)
   *
@@@ -242,7 -248,6 +249,7 @@@ struct regulator_desc 
        unsigned int min_uV;
        unsigned int uV_step;
        unsigned int linear_min_sel;
 +      int fixed_uV;
        unsigned int ramp_delay;
  
        const struct regulator_linear_range *linear_ranges;
@@@ -338,12 -343,7 +345,12 @@@ struct regulator_dev 
  struct regulator_dev *
  regulator_register(const struct regulator_desc *regulator_desc,
                   const struct regulator_config *config);
 +struct regulator_dev *
 +devm_regulator_register(struct device *dev,
 +                      const struct regulator_desc *regulator_desc,
 +                      const struct regulator_config *config);
  void regulator_unregister(struct regulator_dev *rdev);
 +void devm_regulator_unregister(struct device *dev, struct regulator_dev *rdev);
  
  int regulator_notifier_call_chain(struct regulator_dev *rdev,
                                  unsigned long event, void *data);
This page took 0.037652 seconds and 5 git commands to generate.