]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge remote-tracking branches 'regulator/topic/sky81452' and 'regulator/topic/stub...
authorMark Brown <broonie@kernel.org>
Fri, 5 Dec 2014 11:14:43 +0000 (11:14 +0000)
committerMark Brown <broonie@kernel.org>
Fri, 5 Dec 2014 11:14:43 +0000 (11:14 +0000)
Documentation/devicetree/bindings/regulator/sky81452-regulator.txt
drivers/regulator/Kconfig
drivers/regulator/sky81452-regulator.c
include/linux/regulator/consumer.h

index 882455e9b36d52676a171e8988619c09048ad158..f9acbc1f3c6bdf0cebf3d21810f4ca5b284fab2b 100644 (file)
@@ -1,6 +1,7 @@
 SKY81452 voltage regulator
 
 Required properties:
+- regulator node named lout.
 - any required generic properties defined in regulator.txt
 
 Optional properties:
@@ -9,8 +10,9 @@ Optional properties:
 Example:
 
        regulator {
-               /* generic regulator properties */
-               regulator-name = "touch_en";
-               regulator-min-microvolt = <4500000>;
-               regulator-max-microvolt = <8000000>;
+               lout {
+                       regulator-name = "sky81452-lout";
+                       regulator-min-microvolt = <4500000>;
+                       regulator-max-microvolt = <8000000>;
+               };
        };
index 8558e1b21f0501c7536ff4a6801eade004debf81..5b303bfe9358604f7d2d2a7d7c904635653c29ee 100644 (file)
@@ -555,7 +555,7 @@ config REGULATOR_S5M8767
 
 config REGULATOR_SKY81452
        tristate "Skyworks Solutions SKY81452 voltage regulator"
-       depends on SKY81452
+       depends on MFD_SKY81452
        help
          This driver supports Skyworks SKY81452 voltage output regulator
          via I2C bus. SKY81452 has one voltage linear regulator can be
index 75deae706f84292e6899ac225b784ecf7ce18954..6478606119160b63740947ca02c2e3f8737028af 100644 (file)
@@ -5,9 +5,8 @@
  * Author : Gyungoh Yoo <jack.yoo@skyworksinc.com>
  *
  * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
+ * under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -52,6 +51,8 @@ static const struct regulator_linear_range sky81452_reg_ranges[] = {
 
 static const struct regulator_desc sky81452_reg = {
        .name = "LOUT",
+       .of_match = of_match_ptr("lout"),
+       .regulators_node = of_match_ptr("regulator"),
        .ops = &sky81452_reg_ops,
        .type = REGULATOR_VOLTAGE,
        .owner = THIS_MODULE,
@@ -64,30 +65,6 @@ static const struct regulator_desc sky81452_reg = {
        .enable_mask = SKY81452_LEN,
 };
 
-#ifdef CONFIG_OF
-static struct regulator_init_data *sky81452_reg_parse_dt(struct device *dev)
-{
-       struct regulator_init_data *init_data;
-       struct device_node *np;
-
-       np = of_get_child_by_name(dev->parent->of_node, "regulator");
-       if (unlikely(!np)) {
-               dev_err(dev, "regulator node not found");
-               return NULL;
-       }
-
-       init_data = of_get_regulator_init_data(dev, np, &sky81452_reg);
-
-       of_node_put(np);
-       return init_data;
-}
-#else
-static struct regulator_init_data *sky81452_reg_parse_dt(struct device *dev)
-{
-       return ERR_PTR(-EINVAL);
-}
-#endif
-
 static int sky81452_reg_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
@@ -95,20 +72,16 @@ static int sky81452_reg_probe(struct platform_device *pdev)
        struct regulator_config config = { };
        struct regulator_dev *rdev;
 
-       if (!init_data) {
-               init_data = sky81452_reg_parse_dt(dev);
-               if (IS_ERR(init_data))
-                       return PTR_ERR(init_data);
-       }
-
-       config.dev = dev;
+       config.dev = dev->parent;
        config.init_data = init_data;
        config.of_node = dev->of_node;
        config.regmap = dev_get_drvdata(dev->parent);
 
        rdev = devm_regulator_register(dev, &sky81452_reg, &config);
-       if (IS_ERR(rdev))
+       if (IS_ERR(rdev)) {
+               dev_err(dev, "failed to register. err=%ld\n", PTR_ERR(rdev));
                return PTR_ERR(rdev);
+       }
 
        platform_set_drvdata(pdev, rdev);
 
@@ -126,5 +99,4 @@ module_platform_driver(sky81452_reg_driver);
 
 MODULE_DESCRIPTION("Skyworks SKY81452 Regulator driver");
 MODULE_AUTHOR("Gyungoh Yoo <jack.yoo@skyworksinc.com>");
-MODULE_LICENSE("GPL");
-MODULE_VERSION("1.0");
+MODULE_LICENSE("GPL v2");
index 4cfaaf222304be704e5bce0eec8d5e8c6328d7f8..d17e1ff7ad019987d4c4f944dd3a6b20aa571807 100644 (file)
@@ -288,7 +288,7 @@ devm_regulator_get(struct device *dev, const char *id)
 static inline struct regulator *__must_check
 regulator_get_exclusive(struct device *dev, const char *id)
 {
-       return NULL;
+       return ERR_PTR(-ENODEV);
 }
 
 static inline struct regulator *__must_check