From 6cf0bf0dfba6e1dfea061db2eef48ea2cbff68da Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Wed, 8 Oct 2014 09:57:43 +0800 Subject: [PATCH 1/5] regulator: sky81452: Remove module version The module version is unlikely to be updated, use kernel version should be enough. Signed-off-by: Axel Lin Signed-off-by: Mark Brown --- drivers/regulator/sky81452-regulator.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/regulator/sky81452-regulator.c b/drivers/regulator/sky81452-regulator.c index 97aff0ccd65f..476b80a0abca 100644 --- a/drivers/regulator/sky81452-regulator.c +++ b/drivers/regulator/sky81452-regulator.c @@ -127,4 +127,3 @@ module_platform_driver(sky81452_reg_driver); MODULE_DESCRIPTION("Skyworks SKY81452 Regulator driver"); MODULE_AUTHOR("Gyungoh Yoo "); MODULE_LICENSE("GPL"); -MODULE_VERSION("1.0"); From 70b946f9acf4e805361bd877a7e25cc05e497c52 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Fri, 24 Oct 2014 21:56:58 +0100 Subject: [PATCH 2/5] regulator: Return an error from stubbed regulator_get_exclusive() The user hasn't got a regulator and shouldn't be mislead into thinking they have one; really we should probably remove this stub entirely (and may well before the next merge window). Signed-off-by: Mark Brown --- include/linux/regulator/consumer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h index d347c805f923..c0c0a437ec75 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h @@ -282,7 +282,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 From 70b5b27c4fbe1e8b6edc29082fcb2b79ef0838b8 Mon Sep 17 00:00:00 2001 From: Gyungoh Yoo Date: Mon, 17 Nov 2014 17:33:10 +0900 Subject: [PATCH 3/5] regulator: sky81452: Modify dependent Kconfig symbol Signed-off-by: Gyungoh Yoo Signed-off-by: Mark Brown --- drivers/regulator/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig index 55d7b7b0f2e0..fe84bd461f86 100644 --- a/drivers/regulator/Kconfig +++ b/drivers/regulator/Kconfig @@ -547,7 +547,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 From 586b1514e6f66a839612bff612ce6123a84974b3 Mon Sep 17 00:00:00 2001 From: Gyungoh Yoo Date: Tue, 2 Dec 2014 17:05:28 +0900 Subject: [PATCH 4/5] regulator: sky81452: Modify Device Tree structure Signed-off-by: Gyungoh Yoo Signed-off-by: Mark Brown --- drivers/regulator/sky81452-regulator.c | 45 ++++++-------------------- 1 file changed, 9 insertions(+), 36 deletions(-) diff --git a/drivers/regulator/sky81452-regulator.c b/drivers/regulator/sky81452-regulator.c index 476b80a0abca..647860611916 100644 --- a/drivers/regulator/sky81452-regulator.c +++ b/drivers/regulator/sky81452-regulator.c @@ -5,9 +5,8 @@ * Author : Gyungoh Yoo * * 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); - - 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,4 +99,4 @@ module_platform_driver(sky81452_reg_driver); MODULE_DESCRIPTION("Skyworks SKY81452 Regulator driver"); MODULE_AUTHOR("Gyungoh Yoo "); -MODULE_LICENSE("GPL"); +MODULE_LICENSE("GPL v2"); From 8b7daad3da2b36f5fe494f5d0c5ef25b33d56b96 Mon Sep 17 00:00:00 2001 From: Gyungoh Yoo Date: Tue, 2 Dec 2014 17:05:29 +0900 Subject: [PATCH 5/5] regulator: sky81452: Modify Device Tree structure Signed-off-by: Gyungoh Yoo Signed-off-by: Mark Brown --- .../bindings/regulator/sky81452-regulator.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/regulator/sky81452-regulator.txt b/Documentation/devicetree/bindings/regulator/sky81452-regulator.txt index 882455e9b36d..f9acbc1f3c6b 100644 --- a/Documentation/devicetree/bindings/regulator/sky81452-regulator.txt +++ b/Documentation/devicetree/bindings/regulator/sky81452-regulator.txt @@ -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>; + }; };